feat(napier): fix LP APY split and add volume enrichment#2445
feat(napier): fix LP APY split and add volume enrichment#24450xkr3p merged 1 commit intoDefiLlama:masterfrom
Conversation
- Fix LP apyBase: use poolApy - poolTargetRewardsApy (was poolBaseApy, swap fees only) - Fix LP apyReward: use poolTargetRewardsApy (pool-weighted, was unweighted underlyingRewardsApy) - Fix LP rewardTokens: use poolTargetRewards (pool-weighted) instead of underlyingRewards - Add volumeUsd1d to LP entries from napier-api volumeInUsd - PT entry unchanged (underlyingRewardsApy and underlyingRewards remain correct for PT)
📝 WalkthroughWalkthroughModified LP APY calculation in the Napier adaptor to compute apyBase as poolApy minus poolTargetRewardsApy, set apyReward to poolTargetRewardsApy, source rewardTokens from poolTargetRewards instead of underlyingRewards, and add volumeUsd1d metric to the LP APY object. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
|
Linear: NAP-2375 — DefiLlama Dashboard Enhancement Related PRs:
This PR: Fixes LP APY calculation to use Also adds Draft until all adapters are ready to go live together. |
|
Hi @amrrobb, Thanks for the PR, I tested the PR, the TVL / APY values are extremely low inconsistent, some even negative. Are you able to check this please? Here are the test results: |
|
Thanks for testing @0xkr3p! Fixed both issues:
Updated test output: Note: TVL is still low (< $10k threshold) on these pools as they're newly deployed. TVL will increase as liquidity is added. |
|
@0xkr3p Quick question — the adapter is merged but the "Yields" tab isn't showing on our protocol page (https://defillama.com/protocol/napier). We noticed all our pools are currently below the $10k TVL threshold. Will the Yields tab appear automatically once at least one pool crosses $10k, or is there something else needed on our end? Thanks! |
|
@0xkr3p Following up — we checked and we do have markets above the $10k TVL threshold. For example, our "cp0x LRT Conservative Vault" on Ethereum has ~$146k TVL. However, Napier still returns empty from the yields API (https://yields.llama.fi/pools) and the "Yields" tab doesn't appear on https://defillama.com/protocol/napier. Could you help check if there's an issue with the adapter not picking up these markets, or if something else is preventing them from showing? Thanks! |
Hey @amrrobb, will take a look later today, thanks for raising |
|
hey @amrrobb, the test results for the napier adapter still show a maximum of $48 TVL, this why no pools are being displayed |
Summary
Linear: NAP-2375 — DefiLlama Dashboard Enhancement
poolApy - poolTargetRewardsApyinstead ofpoolBaseApy(swap fees only → full LP APY including rehypothecation yield)poolTargetRewardsApy(pool-weighted) instead ofunderlyingRewardsApy(unweighted)poolTargetRewards(pool-weighted reward tokens for LP) instead ofunderlyingRewardsContext
poolApyis the canonical total LP APY from napier-api, composed of:poolBaseApy + poolPtImpliedApy + poolTargetUnderlyingApy + poolTargetRewardsApy + rehypo APYsThe previous adapter used
poolBaseApyforapyBase(swap fees only) andunderlyingRewardsApyforapyReward(full underlying, not pool-weighted). This misreported LP yields —apyBasewas too low andapyRewardwas unweighted by pool share.After contract modification, rehypothecation yield is now reflected in
poolApyand correctly categorized as part of LP returns, increasing the reported fee/yield statistics captured by Napier Protocol.PT entry remains unchanged —
underlyingRewardsApyandunderlyingRewardsare correct for PT.Test plan
keepFinitefilter