Update Lagoon vaults Incentives computation#2625
Conversation
Sum incentives[].apr + airdrops[].apr directly instead of deriving apyReward from (linearNetApr - linearNetAprWithoutExtraYields), which also includes native yield. DefiLlama's apyReward should represent reward incentives only, not yield intrinsic to the underlying asset.
…eld-from-reward fix(lagoon): split apyBase/apyReward and exclude native yield
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe Lagoon adapter's GraphQL query now extracts additional APR data for incentives and airdrops. The mapping logic reassigns Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 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 |
|
Error while running lagoon adapter: Test Suites: 1 failed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/adaptors/lagoon/index.js`:
- Around line 74-81: Guard against null/missing lists from vault.state.weeklyApr
by making sumApr tolerant of null: change the helper sumApr so it accepts a
possibly-null input (e.g., const sumApr = (items = []) => items.reduce(...)) or
explicitly default incentives/airdrops to [] when calling sumApr; keep the
existing apyReward logic (sumApr(incentives) + sumApr(airdrops) || null) so a
zero total still yields null. Update the symbols: sumApr, incentives, airdrops,
apyReward, and vault.state.weeklyApr accordingly.
🪄 Autofix (Beta)
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
Run ID: 7597a5a2-a27a-49e5-b8d9-4646edd87629
📒 Files selected for processing (1)
src/adaptors/lagoon/index.js
|
Error while running lagoon adapter: Test Suites: 1 failed, 1 total |
Fix/no apy vault
|
The lagoon adapter exports pools: Test Suites: 1 passed, 1 total |
0xkr3p
left a comment
There was a problem hiding this comment.
hey @GuiDupont, thanks for the PR, just a comment to resolve and pls remove package-lock.json file from PR
| apyBase: vault.state.weeklyApr.linearNetAprWithoutExtraYields, | ||
| apyBase, | ||
| apyReward, | ||
| tvlUsd: vault.state.totalAssetsUsd || 0, |
Summary by CodeRabbit