Add Covenant (Monad) Yield Coin pools#2681
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a complete Covenant protocol adaptor to DefiLlama's yield-server for the Monad chain. It includes contract ABI definitions, market discovery and data fetching utilities, APY and TVL computation logic, and a formatted pool export function. ChangesCovenant Adaptor for Monad Chain
Sequence DiagramsequenceDiagram
participant Adaptor as apy() orchestrator
participant Chain as Monad Chain
participant Covenant as Covenant Contract
participant DataProvider as Data Provider
participant LlamaAPI as DefiLlama API
Adaptor->>Covenant: listMarketIds() fetch CreateMarket events
Covenant-->>Adaptor: marketIds[]
Adaptor->>DataProvider: getMarketsDetails(marketIds)
DataProvider->>Chain: query market state & params
Chain-->>DataProvider: MarketDetails[]
DataProvider-->>Adaptor: market data
Adaptor->>LlamaAPI: fetchMonUsdPrice()
LlamaAPI-->>Adaptor: monUsdPrice
Adaptor->>Adaptor: filter active markets
Adaptor->>Adaptor: computeYieldCoinApy(marketData)
Adaptor->>Adaptor: zTokenSupplyValueInQuote(marketData)
Adaptor->>Adaptor: compute tvlUsd
Adaptor-->>Adaptor: return pool[] with metrics
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
The covenant adapter exports pools: Test Suites: 1 passed, 1 total |
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.
|
The covenant adapter exports pools: Test Suites: 1 passed, 1 total |
|
The covenant adapter exports pools: Test Suites: 1 passed, 1 total |
|
The covenant adapter exports pools: Test Suites: 1 passed, 1 total |
| @@ -0,0 +1,64 @@ | |||
| [ | |||
There was a problem hiding this comment.
file is not used, pls remove
| @@ -0,0 +1,139 @@ | |||
| const sdk = require('@defillama/sdk'); | |||
| const superagent = require('superagent'); | |||
There was a problem hiding this comment.
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), |
| 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})`, |
There was a problem hiding this comment.
reduce the pool meta the text is very long
| } | ||
|
|
||
| module.exports = { | ||
| timetravel: false, |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
use defilllama pricing helper in utils
0xkr3p
left a comment
There was a problem hiding this comment.
hi @amorphousguy, thanks for the pr - a few comments to resolve before we can merge
Adds yield-server pools for Covenant on Monad. One pool per market for
the Yield Coin (zToken):
(EVMBlockchainAdapter.ts debtTokenAPYCalc), pulled from a single
DataProvider.getMarketsDetails call on Monad mainnet
converted to USD via the quote anchor (USDC = $1, MON via CoinGecko)
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