Add Ethereum TVL support for ForgeYields + update Logo#18593
Add Ethereum TVL support for ForgeYields + update Logo#185930xSacha wants to merge 2 commits intoDefiLlama:mainfrom
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)
📝 WalkthroughWalkthroughThe Forgeyields adapter adds Ethereum TVL support and renames Starknet internals: Changes
Sequence DiagramsequenceDiagram
participant Client as ethereumTvl(api)
participant API as api
participant Registry as Strategy Registry
participant Eth as Ethereum Chain
participant Addr as ADDRESSES.ethereum
Client->>Registry: loadStrategies()
Registry-->>Client: strategies (with token_gateway)
Client->>API: extract token_gateway addresses
Client->>API: multiCall totalAssets(gateway[]) on totalAssetsProviderEthereum
API->>Eth: batch totalAssets calls
Eth-->>API: amounts[]
API-->>Client: results[]
Client->>Addr: map gateway -> underlying token (WETH fallback for ETH)
Addr-->>Client: token addresses
Client->>Client: accumulate balances into api
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@projects/forgeyields/index.js`:
- Around line 82-85: The loop in gateways.forEach silently falls back to
ADDRESSES.ethereum.WETH for any unknown symbol, causing misattribution of TVL;
change the lookup in the gateways.forEach callback (where underlying is derived
and api.add is called) to explicitly handle "ETH" by mapping it to
ADDRESSES.ethereum.WETH, but for any other missing symbol do not default to WETH
— instead log a warning or skip adding that entry (or throw) so unknown tokens
from ADDRESSES.ethereum are not counted as WETH; update the underlying
resolution and the api.add invocation accordingly to only call api.add when a
valid ADDRESSES.ethereum[token] exists.
🪄 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: d07464fb-d59b-4242-85c5-06fb6b4c92ff
📒 Files selected for processing (1)
projects/forgeyields/index.js
|
The adapter at projects/forgeyields exports TVL: |
Summary
Add Ethereum chain TVL tracking to the ForgeYields adapter. The adapter already
tracked Starknet TVL, this adds Ethereum using the same pattern: calling
totalAssets(tokenGateway)on the on-chain provider contract(
0x5d77Ef1B3e419ceca9e48be33B6600F997993DD6).Update Logo to: https://pink-implicit-dormouse-609.mypinata.cloud/ipfs/bafkreieanos4qgkmfolfx4qv5bjqrlgzqwxk2haeuazhcsna3vgbegeuw4
Changes
ethereumTvlfunction that fetches Ethereum token gateways from theForgeYields API and queries
totalAssetsfor eachtotalAssetsProvider→totalAssetsProviderStarknet/totalAssetsProviderEthereum)ethereum.tvlalongside existingstarknet.tvlTest
node test.js projects/forgeyields/index.js
--- ethereum ---
USDC 10.77 k
WBTC 1.03
WETH 0.71
Total: 10.77 k
--- starknet ---
USDC 1.19 M
ETH 554.28 k
WBTC 229.40 k
Total: 1.98 M
total 1.99 M
Summary by CodeRabbit