Skip to content

Add Covenant (Monad) Yield Coin pools - #2681

Open
amorphousguy wants to merge 8 commits into
DefiLlama:masterfrom
amorphousguy:add-covenant-yields
Open

Add Covenant (Monad) Yield Coin pools#2681
amorphousguy wants to merge 8 commits into
DefiLlama:masterfrom
amorphousguy:add-covenant-yields

Conversation

@amorphousguy

@amorphousguy amorphousguy commented May 15, 2026

Copy link
Copy Markdown

Adds yield-server pools for Covenant on Monad. One pool per market for
the Yield Coin (zToken):

  • APY uses the instantaneous formula from covenant-interface
    (EVMBlockchainAdapter.ts debtTokenAPYCalc), pulled from a single
    DataProvider.getMarketsDetails call on Monad mainnet
  • Pool tvlUsd = zToken.totalSupply × tokenPrices.zTokenPrice / 1e36,
    converted to USD via the quote anchor (USDC = $1, MON via CoinGecko)
  • 14 active markets, APYs ranging ~0.6%–52%
  • No npm dependency additions; no lockfile changes

TVL adapter (already merged in DefiLlama-Adapters#19272):
https://defillama.com/protocol/covenant

Methodology rationale + source-of-truth ABIs:
https://github.com/covenant-labs/covenant-defillama

Summary by CodeRabbit

Release Notes

  • New Features
    • Added support for Covenant markets on the Monad chain.
    • Covenant pools are now available for analysis in the app.
    • Added APY calculations and USD TVL metrics for supported Covenant pools.
    • Added market details, token information, and pool status data for improved visibility.

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a Covenant adaptor for Monad. It defines contract ABIs, discovers markets through Envio, loads market data, calculates APY and TVL, filters unsupported markets, and exports formatted pool records.

Changes

Covenant Adaptor for Monad Chain

Layer / File(s) Summary
Contract ABI Definitions
src/adaptors/covenant/covenant.json, src/adaptors/covenant/dataProvider.json
Defines Covenant market events, state queries, data provider queries, nested MarketDetails structures, and the SafeCastOverflowedUintDowncast error.
Adaptor Implementation and Export
src/adaptors/covenant/index.js
Configures Monad addresses and ABIs, discovers market IDs through Envio, retrieves market details and MON/USD pricing, calculates Yield Coin APY and zToken-based USD TVL, filters invalid markets, builds pool records, and exports the adaptor with timetravel disabled.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Adaptor as apy()
  participant Envio as Envio GraphQL indexer
  participant DataProvider as Covenant data provider
  participant PriceAPI as DefiLlama price endpoint
  Adaptor->>Envio: query Monad market IDs
  Envio-->>Adaptor: marketIds
  Adaptor->>DataProvider: getMarketsDetails(covenantLiquid, marketIds)
  DataProvider-->>Adaptor: MarketDetails[]
  Adaptor->>PriceAPI: request MON/USD price when required
  PriceAPI-->>Adaptor: MON/USD price or no price
  Adaptor->>Adaptor: calculate APY and zToken TVL
  Adaptor-->>Adaptor: return filtered pool records
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Covenant Yield Coin pools on Monad.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

The covenant adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 88 passed, 88 total
Snapshots: 0 total
Time: 0.227 s
Ran all test suites.

Nb of pools: 14
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────┬─────────┬────────────┬────────────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬────────────────────────────┬─────────────────────────────┐
│ (index) │ pool                                               │ chain   │ project    │ symbol             │ tvlUsd             │ apyBase            │ underlyingTokens                                 │ url                        │ poolMeta                    │
├─────────┼────────────────────────────────────────────────────┼─────────┼────────────┼────────────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼────────────────────────────┼─────────────────────────────┤
│ 0       │ '0x02e092532583bd48e47cceb44c2b2f1913727498-monad' │ 'Monad' │ 'covenant' │ 'USD.B.AHYPER'     │ 8854.922944640019  │ 8.044418427865253  │ [ '0x7cd231120a60f500887444a9baf5e1bd753a5e59' ] │ 'https://covenant.finance' │ 'aHYPER/USD Yield Coin'     │
│ 1       │ '0x4ecee86813246f052266f4d8baa414e83c41ca35-monad' │ 'Monad' │ 'covenant' │ 'MON.B.SHMON'      │ 6344.791191218074  │ 18.988891393466044 │ [ '0x1b68626dca36c7fe922fd2d55e4f631d962de19c' ] │ 'https://covenant.finance' │ 'shMON/MON Yield Coin'      │
│ 2       │ '0x7baba501946144a2c4cd953eff9f83a800c553e5-monad' │ 'Monad' │ 'covenant' │ 'USD.B.NACCUSDC'   │ 5174.898197703234  │ 8.283140268444544  │ [ '0x58ba69b289de313e66a13b7d1f822fc98b970554' ] │ 'https://covenant.finance' │ 'naccUSDC/USD Yield Coin'   │
│ 3       │ '0xf5b54dc84a52634d1f50284388708ac3d828e827-monad' │ 'Monad' │ 'covenant' │ 'USD.B.EARNAUSD'   │ 4558.405857342104  │ 6.441277800987022  │ [ '0x103222f020e98bba0ad9809a011fdf8e6f067496' ] │ 'https://covenant.finance' │ 'earnAUSD/USD Yield Coin'   │
│ 4       │ '0xb60812eb6d15d395ea3c41b989fcb4c08a30d63a-monad' │ 'Monad' │ 'covenant' │ 'MON.B.SMON'       │ 2335.7663604398117 │ 13.494861341041897 │ [ '0xa3227c5969757783154c60bf0bc1944180ed81b9' ] │ 'https://covenant.finance' │ 'sMON/MON Yield Coin'       │
│ 5       │ '0xbc19ac589c66e3661b8dce5caa29838279bd733a-monad' │ 'Monad' │ 'covenant' │ 'MON.B.GMON'       │ 1102.2448818691305 │ 11.451720190350256 │ [ '0x8498312a6b3cbd158bf0c93abdcf29e6e4f55081' ] │ 'https://covenant.finance' │ 'gMON/MON Yield Coin'       │
│ 6       │ '0x1f537ce577c91fab77ef3d803e7125faaa38f906-monad' │ 'Monad' │ 'covenant' │ 'USD.B.SHMON'      │ 832.9709103160513  │ 6.483862484222569  │ [ '0x1b68626dca36c7fe922fd2d55e4f631d962de19c' ] │ 'https://covenant.finance' │ 'shMON/USD Yield Coin'      │
│ 7       │ '0xb73957dbb96d9dfd3bc1e818001df66cab8ccbc5-monad' │ 'Monad' │ 'covenant' │ 'USD.B.HYPERUSDCD' │ 177.1052985684743  │ 5.740550626985641  │ [ '0x78999cc96d2ba0341588c60ccb0e91c6c33cf371' ] │ 'https://covenant.finance' │ 'hyperUSDCa/USD Yield Coin' │
│ 8       │ '0xdff181c68dae5f848ba7f8b20566d0e88f1e1404-monad' │ 'Monad' │ 'covenant' │ 'USD.B.BBQUSDC'    │ 96.35083133480614  │ 0.6407915470110215 │ [ '0xbeeff443c3cba3e369da795002243beac311ab83' ] │ 'https://covenant.finance' │ 'bbqUSDC/USD Yield Coin'    │
│ 9       │ '0x2da0f3ecdf5e7cd829853ddbaed0b6f18a80a31a-monad' │ 'Monad' │ 'covenant' │ 'USD.B.KURU-VAULT' │ 82.59607780126464  │ 51.951076958411726 │ [ '0x4869a4c7657cef5e5496c9ce56dde4cd593e4923' ] │ 'https://covenant.finance' │ 'KURU-VAULT/USD Yield Coin' │
└─────────┴────────────────────────────────────────────────────┴─────────┴────────────┴────────────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴────────────────────────────┴─────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

Matches Synthetix-v3's convention for sUSD (underlying = USDC, not SNX)
and shmonad's use of WMON for MON-denominated yield. The Yield Coin
(zToken) is a synthetic claim denominated in the quote unit, not in
the deposited baseToken — exposing baseToken in underlyingTokens would
mislead users searching the yields page.
@github-actions

Copy link
Copy Markdown

The covenant adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 88 passed, 88 total
Snapshots: 0 total
Time: 0.258 s
Ran all test suites.

Nb of pools: 14
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────┬─────────┬────────────┬────────────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬────────────────────────────┬────────────────────────────────────────────────────┐
│ (index) │ pool                                               │ chain   │ project    │ symbol             │ tvlUsd             │ apyBase            │ underlyingTokens                                 │ url                        │ poolMeta                                           │
├─────────┼────────────────────────────────────────────────────┼─────────┼────────────┼────────────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼────────────────────────────┼────────────────────────────────────────────────────┤
│ 0       │ '0x02e092532583bd48e47cceb44c2b2f1913727498-monad' │ 'Monad' │ 'covenant' │ 'USD.B.AHYPER'     │ 8854.922944640019  │ 8.044418427865253  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://covenant.finance' │ 'aHYPER/USD Yield Coin (backed by aHYPER)'         │
│ 1       │ '0x4ecee86813246f052266f4d8baa414e83c41ca35-monad' │ 'Monad' │ 'covenant' │ 'MON.B.SHMON'      │ 6316.2933380672375 │ 19.080145799629978 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://covenant.finance' │ 'shMON/MON Yield Coin (backed by shMON)'           │
│ 2       │ '0x7baba501946144a2c4cd953eff9f83a800c553e5-monad' │ 'Monad' │ 'covenant' │ 'USD.B.NACCUSDC'   │ 5174.898197703234  │ 8.283140268444544  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://covenant.finance' │ 'naccUSDC/USD Yield Coin (backed by naccUSDC)'     │
│ 3       │ '0xf5b54dc84a52634d1f50284388708ac3d828e827-monad' │ 'Monad' │ 'covenant' │ 'USD.B.EARNAUSD'   │ 4558.405857342104  │ 6.441277800987022  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://covenant.finance' │ 'earnAUSD/USD Yield Coin (backed by earnAUSD)'     │
│ 4       │ '0xb60812eb6d15d395ea3c41b989fcb4c08a30d63a-monad' │ 'Monad' │ 'covenant' │ 'MON.B.SMON'       │ 2324.909180082257  │ 13.494861341041897 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://covenant.finance' │ 'sMON/MON Yield Coin (backed by sMON)'             │
│ 5       │ '0xbc19ac589c66e3661b8dce5caa29838279bd733a-monad' │ 'Monad' │ 'covenant' │ 'MON.B.GMON'       │ 1097.1213936284696 │ 11.451720190350256 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://covenant.finance' │ 'gMON/MON Yield Coin (backed by gMON)'             │
│ 6       │ '0x1f537ce577c91fab77ef3d803e7125faaa38f906-monad' │ 'Monad' │ 'covenant' │ 'USD.B.SHMON'      │ 834.7846197672003  │ 6.483862484222569  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://covenant.finance' │ 'shMON/USD Yield Coin (backed by shMON)'           │
│ 7       │ '0xb73957dbb96d9dfd3bc1e818001df66cab8ccbc5-monad' │ 'Monad' │ 'covenant' │ 'USD.B.HYPERUSDCD' │ 177.1052985684743  │ 5.740550626985641  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://covenant.finance' │ 'hyperUSDCa/USD Yield Coin (backed by hyperUSDCa)' │
│ 8       │ '0xdff181c68dae5f848ba7f8b20566d0e88f1e1404-monad' │ 'Monad' │ 'covenant' │ 'USD.B.BBQUSDC'    │ 96.35083133480614  │ 0.6407915470110215 │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://covenant.finance' │ 'bbqUSDC/USD Yield Coin (backed by bbqUSDC)'       │
│ 9       │ '0x2da0f3ecdf5e7cd829853ddbaed0b6f18a80a31a-monad' │ 'Monad' │ 'covenant' │ 'USD.B.KURU-VAULT' │ 82.6720186998179   │ 51.951076958411726 │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://covenant.finance' │ 'KURU-VAULT/USD Yield Coin (backed by KURU-VAULT)' │
└─────────┴────────────────────────────────────────────────────┴─────────┴────────────┴────────────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴────────────────────────────┴────────────────────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@github-actions

Copy link
Copy Markdown

The covenant adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 88 passed, 88 total
Snapshots: 0 total
Time: 0.282 s
Ran all test suites.

Nb of pools: 14
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────┬─────────┬────────────┬────────────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────┐
│ (index) │ pool                                               │ chain   │ project    │ symbol             │ tvlUsd             │ apyBase            │ underlyingTokens                                 │ url                                                                                                                  │ poolMeta                                     │
├─────────┼────────────────────────────────────────────────────┼─────────┼────────────┼────────────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────┤
│ 0       │ '0x02e092532583bd48e47cceb44c2b2f1913727498-monad' │ 'Monad' │ 'covenant' │ 'USD.B.AHYPER'     │ 8854.752631057387  │ 8.044418427865253  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xeb91150761cf353d9d9cd932d87b9e3a33649b5f?action=swap&input=base&output=yield' │ 'Fixed-rate USD yield, backed by aHYPER'     │
│ 1       │ '0x4ecee86813246f052266f4d8baa414e83c41ca35-monad' │ 'Monad' │ 'covenant' │ 'MON.B.SHMON'      │ 6279.491608831853  │ 19.080145799629978 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://app.covenant.finance/market/0xb17ed620936f4f90c53d554f4ce4cf654855bcf0?action=swap&input=base&output=yield' │ 'Fixed-rate MON yield, backed by shMON'      │
│ 2       │ '0x7baba501946144a2c4cd953eff9f83a800c553e5-monad' │ 'Monad' │ 'covenant' │ 'USD.B.NACCUSDC'   │ 5174.792067475303  │ 8.283140268444544  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xc387a0dd7c67e96b0522b40c0425274eda8ec8b2?action=swap&input=base&output=yield' │ 'Fixed-rate USD yield, backed by naccUSDC'   │
│ 3       │ '0xf5b54dc84a52634d1f50284388708ac3d828e827-monad' │ 'Monad' │ 'covenant' │ 'USD.B.EARNAUSD'   │ 4558.405857342104  │ 6.441277800987022  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xf30d107691fde017fbf47af10eea67607dfa6f13?action=swap&input=base&output=yield' │ 'Fixed-rate USD yield, backed by earnAUSD'   │
│ 4       │ '0xb60812eb6d15d395ea3c41b989fcb4c08a30d63a-monad' │ 'Monad' │ 'covenant' │ 'MON.B.SMON'       │ 2311.365132378939  │ 13.494861341041897 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://app.covenant.finance/market/0xb2c399d52b748bcababf1ffab623135bbd2aa69a?action=swap&input=base&output=yield' │ 'Fixed-rate MON yield, backed by sMON'       │
│ 5       │ '0xbc19ac589c66e3661b8dce5caa29838279bd733a-monad' │ 'Monad' │ 'covenant' │ 'MON.B.GMON'       │ 1090.6642446370067 │ 11.451720190350256 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://app.covenant.finance/market/0x544e60c94e9aa394db6b0ed7868eb29b8745cd46?action=swap&input=base&output=yield' │ 'Fixed-rate MON yield, backed by gMON'       │
│ 6       │ '0x1f537ce577c91fab77ef3d803e7125faaa38f906-monad' │ 'Monad' │ 'covenant' │ 'USD.B.SHMON'      │ 834.5192046390862  │ 6.483862484222569  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xc731f60dbdc480110e1fb135e985ee25d85c21bd?action=swap&input=base&output=yield' │ 'Fixed-rate USD yield, backed by shMON'      │
│ 7       │ '0xb73957dbb96d9dfd3bc1e818001df66cab8ccbc5-monad' │ 'Monad' │ 'covenant' │ 'USD.B.HYPERUSDCD' │ 177.1052985684743  │ 5.740550626985641  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xdae76886306e311307b0d406394555377c21a3e6?action=swap&input=base&output=yield' │ 'Fixed-rate USD yield, backed by hyperUSDCa' │
│ 8       │ '0xdff181c68dae5f848ba7f8b20566d0e88f1e1404-monad' │ 'Monad' │ 'covenant' │ 'USD.B.BBQUSDC'    │ 96.35083133480614  │ 0.6407915470110215 │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0x2bbb31f07be3bf497ada87eb9446e0eb5f937c89?action=swap&input=base&output=yield' │ 'Fixed-rate USD yield, backed by bbqUSDC'    │
│ 9       │ '0x2da0f3ecdf5e7cd829853ddbaed0b6f18a80a31a-monad' │ 'Monad' │ 'covenant' │ 'USD.B.KURU-VAULT' │ 82.66092938214095  │ 51.951076958411726 │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xe36835496ea4c0e7c0cdd0d71d0a5335c1d234e7?action=swap&input=base&output=yield' │ 'Fixed-rate USD yield, backed by KURU-VAULT' │
└─────────┴────────────────────────────────────────────────────┴─────────┴────────────┴────────────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@github-actions

Copy link
Copy Markdown

The covenant adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 88 passed, 88 total
Snapshots: 0 total
Time: 0.254 s
Ran all test suites.

Nb of pools: 14
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────┬─────────┬────────────┬────────────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────────────┐
│ (index) │ pool                                               │ chain   │ project    │ symbol             │ tvlUsd             │ apyBase            │ underlyingTokens                                 │ url                                                                                                                  │ poolMeta                                │
├─────────┼────────────────────────────────────────────────────┼─────────┼────────────┼────────────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────────────┤
│ 0       │ '0x02e092532583bd48e47cceb44c2b2f1913727498-monad' │ 'Monad' │ 'covenant' │ 'USD.B.AHYPER'     │ 8854.752631057387  │ 8.044418427865253  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xeb91150761cf353d9d9cd932d87b9e3a33649b5f?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by aHYPER)'     │
│ 1       │ '0x4ecee86813246f052266f4d8baa414e83c41ca35-monad' │ 'Monad' │ 'covenant' │ 'MON.B.SHMON'      │ 6279.490228685859  │ 19.080145799629978 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://app.covenant.finance/market/0xb17ed620936f4f90c53d554f4ce4cf654855bcf0?action=swap&input=base&output=yield' │ 'MON Yield Coin (backed by shMON)'      │
│ 2       │ '0x7baba501946144a2c4cd953eff9f83a800c553e5-monad' │ 'Monad' │ 'covenant' │ 'USD.B.NACCUSDC'   │ 5174.792067475303  │ 8.283140268444544  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xc387a0dd7c67e96b0522b40c0425274eda8ec8b2?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by naccUSDC)'   │
│ 3       │ '0xf5b54dc84a52634d1f50284388708ac3d828e827-monad' │ 'Monad' │ 'covenant' │ 'USD.B.EARNAUSD'   │ 4558.405857342104  │ 6.441277800987022  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xf30d107691fde017fbf47af10eea67607dfa6f13?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by earnAUSD)'   │
│ 4       │ '0xb60812eb6d15d395ea3c41b989fcb4c08a30d63a-monad' │ 'Monad' │ 'covenant' │ 'MON.B.SMON'       │ 2311.365132378939  │ 13.494861341041897 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://app.covenant.finance/market/0xb2c399d52b748bcababf1ffab623135bbd2aa69a?action=swap&input=base&output=yield' │ 'MON Yield Coin (backed by sMON)'       │
│ 5       │ '0xbc19ac589c66e3661b8dce5caa29838279bd733a-monad' │ 'Monad' │ 'covenant' │ 'MON.B.GMON'       │ 1090.6642446370067 │ 11.451720190350256 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://app.covenant.finance/market/0x544e60c94e9aa394db6b0ed7868eb29b8745cd46?action=swap&input=base&output=yield' │ 'MON Yield Coin (backed by gMON)'       │
│ 6       │ '0x1f537ce577c91fab77ef3d803e7125faaa38f906-monad' │ 'Monad' │ 'covenant' │ 'USD.B.SHMON'      │ 834.1032909087528  │ 6.483862484222569  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xc731f60dbdc480110e1fb135e985ee25d85c21bd?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by shMON)'      │
│ 7       │ '0xb73957dbb96d9dfd3bc1e818001df66cab8ccbc5-monad' │ 'Monad' │ 'covenant' │ 'USD.B.HYPERUSDCD' │ 177.1052985684743  │ 5.740550626985641  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xdae76886306e311307b0d406394555377c21a3e6?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by hyperUSDCa)' │
│ 8       │ '0xdff181c68dae5f848ba7f8b20566d0e88f1e1404-monad' │ 'Monad' │ 'covenant' │ 'USD.B.BBQUSDC'    │ 96.35083133480614  │ 0.6407915470110215 │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0x2bbb31f07be3bf497ada87eb9446e0eb5f937c89?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by bbqUSDC)'    │
│ 9       │ '0x2da0f3ecdf5e7cd829853ddbaed0b6f18a80a31a-monad' │ 'Monad' │ 'covenant' │ 'USD.B.KURU-VAULT' │ 82.64353097418702  │ 51.951076958411726 │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xe36835496ea4c0e7c0cdd0d71d0a5335c1d234e7?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by KURU-VAULT)' │
└─────────┴────────────────────────────────────────────────────┴─────────┴────────────┴────────────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@@ -0,0 +1,64 @@
[

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file is not used, pls remove

@@ -0,0 +1,139 @@
const sdk = require('@defillama/sdk');
const superagent = require('superagent');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

superagent is no longer used in the repository, pls use our pricing helpers in utils instead

pool: `${d.zToken.tokenAddress.toLowerCase()}-${CHAIN}`,
chain: utils.formatChain(CHAIN),
project: PROJECT,
symbol: utils.formatSymbol(d.zToken.symbol),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove formatSymbol

apyBase,
underlyingTokens: [underlying.toLowerCase()],
url: `${APP_URL}/market/${d.marketId.toLowerCase()}?action=swap&input=base&output=yield`,
poolMeta: `${quoteSym} Yield Coin (backed by ${d.baseToken.symbol})`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reduce the pool meta the text is very long

}

module.exports = {
timetravel: false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add the protocolId: 7856


async function fetchMonUsdPrice() {
// Native MON, queried by chain identifier (no contract address for the gas token).
const res = await superagent.get(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use defilllama pricing helper in utils

@0xkr3p 0xkr3p left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @amorphousguy, thanks for the pr - a few comments to resolve before we can merge

The hardcoded marketId snapshot went stale whenever a market launched or
migrated. Enumerate marketIds at runtime from the hosted Envio indexer
(unauthenticated GraphQL, same endpoint the production app uses); market
state is still read on-chain via DataProvider. Fails loudly on indexer
errors rather than serving a stale market set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Error while running covenant adapter:

● Running covenant Test › Adapter exports the protocolId matching its protocol slug

    expect(received).toBe(expected) // Object.is equality

    Expected: "string"
    Received: "undefined"

  ● Running covenant Test › Adapter assigns protocolId as a string literal inside module.exports

    no `protocolId: '1234'` found inside a `module.exports = { ... }` object literal

Test Suites: 1 failed, 1 total
Tests:       2 failed, 100 passed, 102 total
Snapshots:   0 total
Time:        0.285 s
Ran all test suites.

Nb of pools: 16
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────┬─────────┬────────────┬───────────────────────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────┐
│ (index) │ pool                                               │ chain   │ project    │ symbol                        │ tvlUsd             │ apyBase            │ underlyingTokens                                 │ url                                                                                                                  │ poolMeta                                           │
├─────────┼────────────────────────────────────────────────────┼─────────┼────────────┼───────────────────────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────┤
│ 0       │ '0x8967a44ed642ac5ff324c7a9c465199f9c9e10cd-monad' │ 'Monad' │ 'covenant' │ 'USD.B.AHYPER'                │ 20556.58174845893  │ 4.995372915251672  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xbe9b86b9b2992701bb70805c5e7ced0d6129f9ab?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by aHYPER)'                │
│ 1       │ '0xce89c65326680a5c5e5317977530dcfb0a2ae67c-monad' │ 'Monad' │ 'covenant' │ 'USD.B.WNAUSD-WNUSDC-WNUSDT0' │ 5776.075572665008  │ 4.004874535651992  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0x072ec0649b821b1647ba5a1a4fa32342b1e98279?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by wnAUSD-wnUSDC-wnUSDT0)' │
│ 2       │ '0x4ecee86813246f052266f4d8baa414e83c41ca35-monad' │ 'Monad' │ 'covenant' │ 'MON.B.SHMON'                 │ 4485.324665208727  │ 19.84335989302144  │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://app.covenant.finance/market/0xb17ed620936f4f90c53d554f4ce4cf654855bcf0?action=swap&input=base&output=yield' │ 'MON Yield Coin (backed by shMON)'                 │
│ 3       │ '0xf5b54dc84a52634d1f50284388708ac3d828e827-monad' │ 'Monad' │ 'covenant' │ 'USD.B.EARNAUSD'              │ 1324.532700034349  │ 6.521971648902047  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xf30d107691fde017fbf47af10eea67607dfa6f13?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by earnAUSD)'              │
│ 4       │ '0xbc19ac589c66e3661b8dce5caa29838279bd733a-monad' │ 'Monad' │ 'covenant' │ 'MON.B.GMON'                  │ 868.9887907701581  │ 17.898249097494535 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://app.covenant.finance/market/0x544e60c94e9aa394db6b0ed7868eb29b8745cd46?action=swap&input=base&output=yield' │ 'MON Yield Coin (backed by gMON)'                  │
│ 5       │ '0xb60812eb6d15d395ea3c41b989fcb4c08a30d63a-monad' │ 'Monad' │ 'covenant' │ 'MON.B.SMON'                  │ 734.6454551641905  │ 11.961981709103874 │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://app.covenant.finance/market/0xb2c399d52b748bcababf1ffab623135bbd2aa69a?action=swap&input=base&output=yield' │ 'MON Yield Coin (backed by sMON)'                  │
│ 6       │ '0x1f537ce577c91fab77ef3d803e7125faaa38f906-monad' │ 'Monad' │ 'covenant' │ 'USD.B.SHMON'                 │ 453.06966409948956 │ 6.947106793438196  │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xc731f60dbdc480110e1fb135e985ee25d85c21bd?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by shMON)'                 │
│ 7       │ '0xb73957dbb96d9dfd3bc1e818001df66cab8ccbc5-monad' │ 'Monad' │ 'covenant' │ 'USD.B.HYPERUSDCD'            │ 178.96598379707322 │ 6.8706620778287375 │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0xdae76886306e311307b0d406394555377c21a3e6?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by hyperUSDCa)'            │
│ 8       │ '0xdff181c68dae5f848ba7f8b20566d0e88f1e1404-monad' │ 'Monad' │ 'covenant' │ 'USD.B.BBQUSDC'               │ 98.30112915142197  │ 0.7142158653691499 │ [ '0xf817257fed379853cde0fa4f97ab987181b1e5ea' ] │ 'https://app.covenant.finance/market/0x2bbb31f07be3bf497ada87eb9446e0eb5f937c89?action=swap&input=base&output=yield' │ 'USD Yield Coin (backed by bbqUSDC)'               │
│ 9       │ '0x5815a1fd745be35af048dfb6227416c07d23c8fd-monad' │ 'Monad' │ 'covenant' │ 'MON.B.APRMON'                │ 69.2087656139962   │ 12.67576270888604  │ [ '0x3bd359c1119da7da1d913d1c4d2b7c461115433a' ] │ 'https://app.covenant.finance/market/0xc0e43be9048549aa7d4c78a20ce6c50aae603875?action=swap&input=base&output=yield' │ 'MON Yield Coin (backed by aprMON)'                │
└─────────┴────────────────────────────────────────────────────┴─────────┴────────────┴───────────────────────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/adaptors/covenant/index.js`:
- Line 64: Update the superagent request in the covenant indexer flow to chain
.timeout({ response, deadline }) before awaiting it, using appropriate response
and total-request deadline values. Preserve the existing await behavior so
timeout errors continue propagating.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b87f4a8-a375-4d39-8229-5159b60018f1

📥 Commits

Reviewing files that changed from the base of the PR and between 654b713 and e5f2a29.

📒 Files selected for processing (1)
  • src/adaptors/covenant/index.js

const CHAIN_ID = 143; // Monad mainnet

async function fetchMarketIds() {
const res = await superagent.post(INDEXER_URL).send({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

ast-grep outline src/adaptors/covenant/index.js --items all
rg -n -C 3 -P '\bsuperagent\.(get|post|put|patch|delete)\s*\(|\.timeout\s*\(' src/adaptors/covenant/index.js
fd -HI -t f '^package\.json$' . -E node_modules -x rg -n -C 2 '"superagent"' {}

Repository: DefiLlama/yield-server

Length of output: 1680


🏁 Script executed:

set -euo pipefail

printf '%s\n' '--- manifests containing superagent ---'
git ls-files '*package*.json' '*lock*' |
  xargs -r rg -n -C 3 '"superagent"|superagent@' || true

printf '%s\n' '--- repository timeout usage ---'
rg -n -C 3 '\.timeout\s*\(\s*\{|\btimeout\s*:\s*[0-9]+' --glob '!node_modules/**' --glob '!dist/**' . || true

printf '%s\n' '--- fetchMarketIds implementation ---'
sed -n '60,82p' src/adaptors/covenant/index.js

printf '%s\n' '--- superagent package metadata, if vendored or installed ---'
for f in node_modules/superagent/package.json package.json; do
  if [ -f "$f" ]; then
    printf '%s\n' "--- $f"
    rg -n -C 2 '"superagent"|"version"' "$f"
  fi
done

Repository: DefiLlama/yield-server

Length of output: 19874


🏁 Script executed:

set -euo pipefail

printf '%s\n' '--- superagent 7.1.6 timeout implementation ---'
rg -n -C 8 'timeout\(|responseTimeout|deadline|_timeout' \
  node_modules/superagent/lib node_modules/superagent/index.js \
  2>/dev/null || true

printf '%s\n' '--- superagent 7.1.6 package dependency path ---'
rg -n -C 4 '"superagent":|"node_modules/superagent"|from node_modules/superagent' \
  package.json package-lock.json node_modules/superagent/package.json \
  2>/dev/null || true

printf '%s\n' '--- timeout documentation in the installed package ---'
rg -n -C 5 'response.*deadline|deadline.*response|response timeout|total time' \
  node_modules/superagent \
  2>/dev/null || true

Repository: DefiLlama/yield-server

Length of output: 50379


Set response and total deadlines for the indexer request.

Superagent 7.1.6 supports .timeout({ response, deadline }). Without these values, a stalled indexer request has no application-level deadline. The existing await propagates the timeout error.

Proposed fix
-  const res = await superagent.post(INDEXER_URL).send({
+  const res = await superagent
+    .post(INDEXER_URL)
+    .timeout({ response: 10_000, deadline: 15_000 })
+    .send({
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const res = await superagent.post(INDEXER_URL).send({
const res = await superagent
.post(INDEXER_URL)
.timeout({ response: 10_000, deadline: 15_000 })
.send({
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/adaptors/covenant/index.js` at line 64, Update the superagent request in
the covenant indexer flow to chain .timeout({ response, deadline }) before
awaiting it, using appropriate response and total-request deadline values.
Preserve the existing await behavior so timeout errors continue propagating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants