Skip to content

fusion-by-ipor: switch to Fusion API v2 and simplify adapter add Flare and remove TAC chains - #2967

Open
rav-ipor wants to merge 11 commits into
DefiLlama:masterfrom
IPOR-Labs:master
Open

fusion-by-ipor: switch to Fusion API v2 and simplify adapter add Flare and remove TAC chains#2967
rav-ipor wants to merge 11 commits into
DefiLlama:masterfrom
IPOR-Labs:master

Conversation

@rav-ipor

@rav-ipor rav-ipor commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Changes:

  • fusion-by-ipor: switch to Fusion API v2 and simplify adapter
  • add Flare chain
  • remove TAC chain

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.

Summary by CodeRabbit

  • New Features

    • Added support for Fusion vaults on the Flare network.
    • Improved APY reporting by combining base yield data and displaying vesting rewards separately.
    • Public vault listings now include only vaults accepting deposits and avoid duplicate entries.
  • Removed

    • Removed support for the TAC network.
    • Removed on-chain reward lookup and public-vault allowlist dependencies.

rav-ipor and others added 10 commits May 12, 2026 12:53
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.
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: f5763542-4f34-485b-aa34-87e6bee2e02c

📥 Commits

Reviewing files that changed from the base of the PR and between ebb7ddb and f6c54b9.

📒 Files selected for processing (1)
  • src/adaptors/fusion-by-ipor/index.js

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The fusion-by-ipor adaptor now uses API vault data, provider-derived chain IDs, public-deposit filtering, deduplication, and API-provided APY fields. It removes on-chain, GitHub, and Merkl reward integrations.

Changes

Fusion by IPOR adaptor

Layer / File(s) Summary
Chain mapping and pool metrics
src/adaptors/fusion-by-ipor/index.js
The adaptor derives chain IDs from providers.json. It maps TVL and combined base APY fields from API data, and uses vestingApy for reward APY.
API vault selection
src/adaptors/fusion-by-ipor/index.js
The adaptor keeps supported vaults with publicDepositOpened === true, deduplicates addresses, and removes GitHub, on-chain, and Merkl enrichment.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to f6c54

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: migrating the adapter to Fusion API v2, simplifying retrieval, adding Flare, and removing TAC.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

The fusion-by-ipor adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 2611 passed, 2611 total
Snapshots: 0 total
Time: 0.655 s
Ran all test suites.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

The fusion-by-ipor adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 1007 passed, 1007 total
Snapshots: 0 total
Time: 0.44 s
Ran all test suites.

Nb of pools: 166
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬────────────┬──────────────────┬─────────┬────────────────────┬───────────────────┬────────────────────┬──────────────────────────────────────────────────┬──────────────────────────────────────────────────┬─────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────┐
│ (index) │ pool                                         │ chain      │ project          │ symbol  │ tvlUsd             │ apyBase           │ apyReward          │ underlyingTokens                                 │ rewardTokens                                     │ poolMeta                        │ url                                                                              │
├─────────┼──────────────────────────────────────────────┼────────────┼──────────────────┼─────────┼────────────────────┼───────────────────┼────────────────────┼──────────────────────────────────────────────────┼──────────────────────────────────────────────────┼─────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ 0       │ '0xb9e806e8f2d94c015ffefa90cd24ecce18f1663c' │ 'ethereum' │ 'fusion-by-ipor' │ 'WETH'  │ 9077152.249687854  │ 4.099471994329097 │ 2.5410310007791077 │ [ '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ] │ [ '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ] │ 'rETH Liquity LP Carry'         │ 'https://app.ipor.io/fusion/ethereum/0xb9e806e8f2d94c015ffefa90cd24ecce18f1663c' │
│ 1       │ '0x17d0f109ee895bad0b68aa104aa72bd0b003ad8e' │ 'base'     │ 'fusion-by-ipor' │ 'WETH'  │ 8227251.922948726  │ 3.65913043859023  │ 0                  │ [ '0x4200000000000000000000000000000000000006' ] │                                                  │ 'Base ETH Lending Optimizer'    │ 'https://app.ipor.io/fusion/base/0x17d0f109ee895bad0b68aa104aa72bd0b003ad8e'     │
│ 2       │ '0xb8a451107a9f87fde481d4d686247d6e43ed715e' │ 'ethereum' │ 'fusion-by-ipor' │ 'stETH' │ 6657811.181345148  │ 3.333869454488892 │ 0                  │ [ '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' ] │                                                  │ 'Fusion stETH looping Ethereum' │ 'https://app.ipor.io/fusion/ethereum/0xb8a451107a9f87fde481d4d686247d6e43ed715e' │
│ 3       │ '0xe883426b4fc84a7f5cc86415cabbef43e73a4cc8' │ 'base'     │ 'fusion-by-ipor' │ 'cbETH' │ 5897233.225471395  │ 5.097615821472631 │ 0                  │ [ '0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22' ] │                                                  │ 'TAU cbETH Dynamic Looping'     │ 'https://app.ipor.io/fusion/base/0xe883426b4fc84a7f5cc86415cabbef43e73a4cc8'     │
│ 4       │ '0x7872893e528fe2c0829e405960db5b742112aa97' │ 'base'     │ 'fusion-by-ipor' │ 'WETH'  │ 5479668.496526794  │ 4.072273974052441 │ 0                  │ [ '0x4200000000000000000000000000000000000006' ] │                                                  │ 'Harvest WETH vault Base'       │ 'https://app.ipor.io/fusion/base/0x7872893e528fe2c0829e405960db5b742112aa97'     │
│ 5       │ '0x5900c3b72458f12967dc1bef35b92d271f5cdbc1' │ 'base'     │ 'fusion-by-ipor' │ 'WETH'  │ 4253519.5115302885 │ 3.80866493684     │ 0                  │ [ '0x4200000000000000000000000000000000000006' ] │                                                  │ 'Base cbETH Loooper'            │ 'https://app.ipor.io/fusion/base/0x5900c3b72458f12967dc1bef35b92d271f5cdbc1'     │
│ 6       │ '0xb0f56bb0bf13ee05fef8cd2d8df5ffdfcac7a74f' │ 'ethereum' │ 'fusion-by-ipor' │ 'USDC'  │ 1271056.183068303  │ 8.179493229589925 │ 0                  │ [ '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' ] │                                                  │ 'TAU InfiniFi Pointsmax'        │ 'https://app.ipor.io/fusion/ethereum/0xb0f56bb0bf13ee05fef8cd2d8df5ffdfcac7a74f' │
│ 7       │ '0x0d877dc7c8fa3ad980dfdb18b48ec9f8768359c4' │ 'base'     │ 'fusion-by-ipor' │ 'USDC'  │ 1239611.3498757666 │ 6.958952903496625 │ 0                  │ [ '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' ] │                                                  │ 'Harvest USDC vault Base'       │ 'https://app.ipor.io/fusion/base/0x0d877dc7c8fa3ad980dfdb18b48ec9f8768359c4'     │
│ 8       │ '0xd46a3c2d958d0a2cb098d48c48dc19fe3a710f37' │ 'base'     │ 'fusion-by-ipor' │ 'USDC'  │ 1214233.7663605635 │ 4.979977120437783 │ 0                  │ [ '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' ] │                                                  │ 'Base USDC Lending Optimizer'   │ 'https://app.ipor.io/fusion/base/0xd46a3c2d958d0a2cb098d48c48dc19fe3a710f37'     │
│ 9       │ '0xf8f226da66244f89e70c5b5d1a5c5b0d505eb1d8' │ 'ethereum' │ 'fusion-by-ipor' │ 'USDC'  │ 809925.3947464196  │ 5.935373966279971 │ 0                  │ [ '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' ] │                                                  │ 'Bitcoin Dollar USDC'           │ 'https://app.ipor.io/fusion/ethereum/0xf8f226da66244f89e70c5b5d1a5c5b0d505eb1d8' │
└─────────┴──────────────────────────────────────────────┴────────────┴──────────────────┴─────────┴────────────────────┴───────────────────┴────────────────────┴──────────────────────────────────────────────────┴──────────────────────────────────────────────────┴─────────────────────────────────┴──────────────────────────────────────────────────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@rav-ipor
rav-ipor marked this pull request as ready for review September 3, 2026 19:40
@rav-ipor

rav-ipor commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Could the pool page keep the per-pool url and append the referral query string from referralUrl instead of replacing the whole link?
For example:

pool url:      https://app.ipor.io/fusion/ethereum/0xb8a451107a9f87fde481d4d686247d6e43ed715e                                              
referralUrl:   https://app.ipor.io/fusion?f=D0V4X4doim7oC8cTQZzAZXBOkbwaf                                                              
resulting:     https://app.ipor.io/fusion/ethereum/0xb8a451107a9f87fde481d4d686247d6e43ed715e?f=D0V4X4doim7oC8cTQZzAZXBOkbwaf              

On our side the Fusion by IPOR app captures the f parameter on any route, so the referral keeps working and the user lands directly on the vault they clicked. The fallback to referralUrl alone makes sense only when a pool has no url.

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 fusion-by-ipor adapter accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant