add arcadia OP lending pools#2839
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughArcadia 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. ChangesArcadia V2 multichain support
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
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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
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. Comment |
|
The arcadia-v2 adapter exports pools: Test Suites: 1 passed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/adaptors/arcadia-v2/index.js (1)
100-135: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winOptional: parallelize the per-pool RPC calls.
Each pool issues four sequential
awaited calls (totalAssets,totalLiquidity,interestRate, thengetMaxCollFactor), and pools/chains are processed serially. Across all configured pools this is a lot of sequential round-trips. Wrapping the independent calls inPromise.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
📒 Files selected for processing (1)
src/adaptors/arcadia-v2/index.js
|
The arcadia-v2 adapter exports pools: Test Suites: 1 passed, 1 total |
This PR add the Optimism Mainnet lending pools of Arcadia to the yield server, and refactors the file to reduce duplications.
Summary by CodeRabbit