Skip to content

add arcadia OP lending pools#2839

Open
j-vp wants to merge 2 commits into
DefiLlama:masterfrom
arcadia-finance:master
Open

add arcadia OP lending pools#2839
j-vp wants to merge 2 commits into
DefiLlama:masterfrom
arcadia-finance:master

Conversation

@j-vp

@j-vp j-vp commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This PR add the Optimism Mainnet lending pools of Arcadia to the yield server, and refactors the file to reduce duplications.

Summary by CodeRabbit

  • New Features
    • Added multichain support for Arcadia pools, including Base and Optimism.
    • Expanded APY reporting to include supply, borrowing, liquidity, TVL, and borrowing APY across all configured pools.
    • Improved loan-to-value (LTV) and collateral factor calculations using the full set of supported assets per pool.
    • Updated pool identifiers and URLs for non-base deployments for clearer chain-specific reporting.

@coderabbitai

coderabbitai Bot commented Jul 22, 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: Pro

Run ID: d68a644e-0657-4cd4-8d92-6b6ac4e3cd66

📥 Commits

Reviewing files that changed from the base of the PR and between b383f45 and ff20fcc.

📒 Files selected for processing (1)
  • src/adaptors/arcadia-v2/index.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/adaptors/arcadia-v2/index.js

📝 Walkthrough

Walkthrough

Arcadia V2 replaces hardcoded Base-only pool handling with configuration-driven support for Base and Optimism, generic collateral-factor queries, and multichain APY calculations using pool-specific decimals and chain-aware identifiers.

Changes

Arcadia V2 multichain support

Layer / File(s) Summary
Pool configuration and collateral factors
src/adaptors/arcadia-v2/index.js
Defines chain-specific pool metadata for Base and Optimism, and calculates maximum collateral factors for arbitrary configured assets through getRiskFactors multicalls.
Multichain APY aggregation
src/adaptors/arcadia-v2/index.js
Iterates configured chains and pools, fetches pool metrics and prices, applies per-pool decimal scaling, computes APY/TVL/LTV values, and formats chain-specific pool identifiers and URLs.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant getApy
  participant config
  participant PriceAPI
  participant PoolContracts
  participant sdkApiAbi

  getApy->>config: Read chain and pool metadata
  getApy->>PriceAPI: Fetch dynamic price keys
  getApy->>PoolContracts: Read totalAssets, totalLiquidity, interestRate
  getApy->>sdkApiAbi: multiCall getRiskFactors for pool assets
  sdkApiAbi-->>getApy: Return collateral factors
  getApy-->>getApy: Compute APY, TVL, supply, borrow, and LTV
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: adding Arcadia lending pools on Optimism.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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

Copy link
Copy Markdown

The arcadia-v2 adapter exports pools:

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

Nb of pools: 5
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬──────────────┬──────────────┬─────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┬───────────────┬────────┬─────────────────────────┬──────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────┐
│ (index) │ pool                                                  │ chain        │ project      │ symbol  │ tvlUsd             │ apyBase            │ totalSupplyUsd     │ totalBorrowUsd     │ apyBaseBorrow │ ltv    │ poolMeta                │ underlyingTokens                                 │ url                                                                            │
├─────────┼───────────────────────────────────────────────────────┼──────────────┼──────────────┼─────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┼───────────────┼────────┼─────────────────────────┼──────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────┤
│ 0       │ '0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1'          │ 'Base'       │ 'arcadia-v2' │ 'USDC'  │ 330026.017234663   │ 8.583733769961684  │ 1763464.1978021713 │ 1433438.1805675083 │ 10.56         │ 0.9325 │ 'Arcadia V2 USDC Pool'  │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' ] │ 'https://arcadia.finance/pool/8453/0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1' │
│ 1       │ '0xa37E9b4369dc20940009030BfbC2088F09645e3B'          │ 'Base'       │ 'arcadia-v2' │ 'cbBTC' │ 312782.0026362958  │ 0.2551931895289713 │ 341862.3140722463  │ 29080.311435950487 │ 3             │ 0.9225 │ 'Arcadia V2 cbBTC Pool' │ [ '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf' ] │ 'https://arcadia.finance/pool/8453/0xa37E9b4369dc20940009030BfbC2088F09645e3B' │
│ 2       │ '0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2'          │ 'Base'       │ 'arcadia-v2' │ 'wETH'  │ 155295.55747624315 │ 2.703112719984658  │ 282622.1419535832  │ 127326.5844773401  │ 6             │ 0.9325 │ 'Arcadia V2 WETH Pool'  │ [ '0x4200000000000000000000000000000000000006' ] │ 'https://arcadia.finance/pool/8453/0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2' │
│ 3       │ '0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2-optimism' │ 'OP Mainnet' │ 'arcadia-v2' │ 'wETH'  │ 15443.08096693059  │ 14.800026502372718 │ 107604.55277601785 │ 92161.47180908725  │ 17.28         │ 0.9325 │ 'Arcadia V2 WETH Pool'  │ [ '0x4200000000000000000000000000000000000006' ] │ 'https://arcadia.finance/pool/10/0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2'   │
│ 4       │ '0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1-optimism' │ 'OP Mainnet' │ 'arcadia-v2' │ 'USDC'  │ 8955.382926728853  │ 12.65331967521082  │ 54524.29737713457  │ 45568.914450405726 │ 15.14         │ 0.9325 │ 'Arcadia V2 USDC Pool'  │ [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85' ] │ 'https://arcadia.finance/pool/10/0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1'   │
└─────────┴───────────────────────────────────────────────────────┴──────────────┴──────────────┴─────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴───────────────┴────────┴─────────────────────────┴──────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/adaptors/arcadia-v2/index.js (1)

100-135: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Optional: parallelize the per-pool RPC calls.

Each pool issues four sequential awaited calls (totalAssets, totalLiquidity, interestRate, then getMaxCollFactor), and pools/chains are processed serially. Across all configured pools this is a lot of sequential round-trips. Wrapping the independent calls in Promise.all (and optionally mapping pools concurrently) would noticeably cut wall-clock time.

🤖 Prompt for 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.

In `@src/adaptors/arcadia-v2/index.js` around lines 100 - 135, Parallelize the
independent per-pool RPC requests in the pool-processing flow: group the
totalAssets, totalLiquidity, interestRate, and getMaxCollFactor calls into a
Promise.all-based operation, then use the returned values for the existing
calculations. Preserve each call’s target, ABI, chain, and arguments; optionally
apply the same concurrency pattern when iterating across configured pools.
🤖 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/arcadia-v2/index.js`:
- Line 122: Update the price lookup in getApy to safely handle a missing
coinPrices['coins'] entry for the `${chain}:${pool.underlying}` key. Skip the
affected pool when no price is available, while preserving normal APY processing
for pools with valid prices.

---

Nitpick comments:
In `@src/adaptors/arcadia-v2/index.js`:
- Around line 100-135: Parallelize the independent per-pool RPC requests in the
pool-processing flow: group the totalAssets, totalLiquidity, interestRate, and
getMaxCollFactor calls into a Promise.all-based operation, then use the returned
values for the existing calculations. Preserve each call’s target, ABI, chain,
and arguments; optionally apply the same concurrency pattern when iterating
across configured pools.
🪄 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: bc0d1663-254f-44c6-92e4-02e65070370e

📥 Commits

Reviewing files that changed from the base of the PR and between 83ee686 and b383f45.

📒 Files selected for processing (1)
  • src/adaptors/arcadia-v2/index.js

Comment thread src/adaptors/arcadia-v2/index.js Outdated
@github-actions

Copy link
Copy Markdown

The arcadia-v2 adapter exports pools:

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

Nb of pools: 5
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬──────────────┬──────────────┬─────────┬────────────────────┬────────────────────┬────────────────────┬────────────────────┬───────────────┬────────┬─────────────────────────┬──────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────┐
│ (index) │ pool                                                  │ chain        │ project      │ symbol  │ tvlUsd             │ apyBase            │ totalSupplyUsd     │ totalBorrowUsd     │ apyBaseBorrow │ ltv    │ poolMeta                │ underlyingTokens                                 │ url                                                                            │
├─────────┼───────────────────────────────────────────────────────┼──────────────┼──────────────┼─────────┼────────────────────┼────────────────────┼────────────────────┼────────────────────┼───────────────┼────────┼─────────────────────────┼──────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────┤
│ 0       │ '0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1'          │ 'Base'       │ 'arcadia-v2' │ 'USDC'  │ 330000.7734220821  │ 8.58373593465093   │ 1763331.2412234046 │ 1433330.4678013222 │ 10.56         │ 0.9325 │ 'Arcadia V2 USDC Pool'  │ [ '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' ] │ 'https://arcadia.finance/pool/8453/0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1' │
│ 1       │ '0xa37E9b4369dc20940009030BfbC2088F09645e3B'          │ 'Base'       │ 'arcadia-v2' │ 'cbBTC' │ 312676.03399584576 │ 0.2551932795768693 │ 341746.5044106763  │ 29070.470414830506 │ 3             │ 0.9225 │ 'Arcadia V2 cbBTC Pool' │ [ '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf' ] │ 'https://arcadia.finance/pool/8453/0xa37E9b4369dc20940009030BfbC2088F09645e3B' │
│ 2       │ '0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2'          │ 'Base'       │ 'arcadia-v2' │ 'wETH'  │ 155229.44090925463 │ 2.703113915554199  │ 282501.918962144   │ 127272.47805288936 │ 6             │ 0.9325 │ 'Arcadia V2 WETH Pool'  │ [ '0x4200000000000000000000000000000000000006' ] │ 'https://arcadia.finance/pool/8453/0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2' │
│ 3       │ '0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2-optimism' │ 'OP Mainnet' │ 'arcadia-v2' │ 'wETH'  │ 15392.825052023745 │ 14.8000312046157   │ 107254.58215201144 │ 91861.75709998769  │ 17.28         │ 0.9325 │ 'Arcadia V2 WETH Pool'  │ [ '0x4200000000000000000000000000000000000006' ] │ 'https://arcadia.finance/pool/10/0x803ea69c7e87D1d6C86adeB40CB636cC0E6B98E2'   │
│ 4       │ '0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1-optimism' │ 'OP Mainnet' │ 'arcadia-v2' │ 'USDC'  │ 8954.697678545752  │ 12.653323763085297 │ 54520.2149120119   │ 45565.51723346615  │ 15.14         │ 0.9325 │ 'Arcadia V2 USDC Pool'  │ [ '0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85' ] │ 'https://arcadia.finance/pool/10/0x3ec4a293Fb906DD2Cd440c20dECB250DeF141dF1'   │
└─────────┴───────────────────────────────────────────────────────┴──────────────┴──────────────┴─────────┴────────────────────┴────────────────────┴────────────────────┴────────────────────┴───────────────┴────────┴─────────────────────────┴──────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

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