fusion-by-ipor: switch to Fusion API v2 and simplify adapter add Flare and remove TAC chains - #2967
fusion-by-ipor: switch to Fusion API v2 and simplify adapter add Flare and remove TAC chains#2967rav-ipor wants to merge 11 commits into
Conversation
Vault data now comes from https://api.ipor.io/v2/fusion/vaults, which already exposes the full APY breakdown. This lets the adapter drop all on-chain and third-party lookups: - apyBase = apy + underlyingAssetApy + rewardsApy from the API - apyReward = vestingApy from the API (replaces the on-chain RewardsClaimManager vesting calculation and the VESTING_APY_VAULTS allowlist) - remove the Merkl reward step: rewardsApy from the API already includes those campaigns, so adding them again double counted remove the ipor-abi addresses.json allowlist; all vaults returned by the API on supported chains are listed - replace the hardcoded chainId map with a list of chain names resolved through @defillama/sdk providers.json - dedupe vaults by address (the API can return the same vault twice) and treat missing/null numeric fields as 0 - format with prettier (2-space indent) The v2 payload is ~230 KB uncompressed vs ~59 MB for v1, so memory usage is much lower.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe ChangesFusion by IPOR adaptor
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The adapter now retrieves smaller v2 vault payloads, filters to public vaults, and maps API-provided metrics without an established correctness or runtime issue. Sequence Diagram(s)sequenceDiagram
participant FusionAPI
participant apy
participant buildPool
apy->>FusionAPI: request vault data
FusionAPI-->>apy: return vault records
apy->>apy: filter public vaults and deduplicate addresses
apy->>buildPool: pass selected vaults
buildPool-->>apy: return mapped pool records
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 fusion-by-ipor adapter exports pools: Test Suites: 1 passed, 1 total |
|
The fusion-by-ipor adapter exports pools: Test Suites: 1 passed, 1 total |
|
Could the pool page keep the per-pool url and append the referral query string from referralUrl instead of replacing the whole link? On our side the If this is something adapters are expected to handle themselves (e.g. by including the referral parameter in url), please let me know and we will update the |
Changes:
Vault data now comes from
https://api.ipor.io/v2/fusion/vaults, which already exposes the full APY breakdown. This lets the adapter drop all on-chain and third-party lookups:apyBase = apy + underlyingAssetApy + rewardsApyfrom the APIapyReward = vestingApyfrom the API (replaces the on-chainRewardsClaimManagervesting calculation and theVESTING_APY_VAULTSallowlist)Merklreward step:rewardsApyfrom the API already includes those campaigns, so adding them again double counted remove the ipor-abi addresses.json allowlist; all vaults returned by the API on supported chains are listed@defillama/sdk providers.jsonThe v2 payload is ~230 KB uncompressed vs ~59 MB for v1, so memory usage is much lower.
Summary by CodeRabbit
New Features
Removed