Add vesting APY as reward APY to selected IPOR Fusion vaults#2670
Add vesting APY as reward APY to selected IPOR Fusion vaults#2670rav-ipor wants to merge 2 commits into
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 extends the Fusion-by-IPOR yield adapter with on-chain vesting reward APY computation. It adds a helper function to calculate annualized APY from vesting contract data, integrates vesting APY into the pool output for allowed vaults, and expands reward token metadata to include underlying tokens. ChangesVesting Reward APY Addition
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 fusion-by-ipor adapter exports pools: Test Suites: 1 passed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/fusion-by-ipor/index.js`:
- Around line 64-67: The allowlist addresses in VESTING_APY_VAULTS contain
mixed-case Base addresses, but the matching code compares a lowercased pool
address (e.g., pool.address or poolAddressLower), so those entries never match;
fix by normalizing addresses to the same case—either convert all
VESTING_APY_VAULTS entries to lowercase during initialization or map the list
into a lowercased set before lookup, and ensure the matching logic (where
pool.address is lowercased on lines ~176-177) uses that lowercased set to
determine vesting APY.
- Around line 51-55: The APY calculation using apy_18 currently does
integer-divide SECONDS_IN_YEAR by vestingTime which can truncate to zero when
vestingTime > SECONDS_IN_YEAR—reorder the math to multiply first (e.g.,
(lastUpdateBalance * ONE_ETHER * SECONDS_IN_YEAR) / (totalAssets * vestingTime)
* 100n or equivalent) so you preserve precision before integer division;
additionally ensure address matching uses a consistent case by normalizing
VESTING_APY_VAULTS entries to lowercase (or stop lowercasing pool.pool) so the
allowlist lookup involving VESTING_APY_VAULTS and pool.pool matches correctly.
🪄 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: 13e8639d-2492-4c2d-a93c-f1efc4d9e662
📒 Files selected for processing (1)
src/adaptors/fusion-by-ipor/index.js
|
The fusion-by-ipor adapter exports pools: Test Suites: 1 passed, 1 total |
Summary by CodeRabbit