Skip to content

Add Ethereum TVL support for ForgeYields + update Logo#18593

Open
0xSacha wants to merge 2 commits intoDefiLlama:mainfrom
ForgeYields:main
Open

Add Ethereum TVL support for ForgeYields + update Logo#18593
0xSacha wants to merge 2 commits intoDefiLlama:mainfrom
ForgeYields:main

Conversation

@0xSacha
Copy link
Copy Markdown
Contributor

@0xSacha 0xSacha commented Mar 31, 2026

Summary

Changes

  • Added ethereumTvl function that fetches Ethereum token gateways from the
    ForgeYields API and queries totalAssets for each
  • Renamed variables for clarity (totalAssetsProvider
    totalAssetsProviderStarknet / totalAssetsProviderEthereum)
  • Exported ethereum.tvl alongside existing starknet.tvl

Test

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

  • New Features
    • Added Ethereum network support to TVL tracking capabilities.
    • Platform now provides total value locked metrics for both Ethereum and Starknet networks.
    • Improved asset mapping for Ethereum deposits (ensures ETH balances are represented consistently).

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1d752222-85b3-41c7-88f6-caa046e793f5

📥 Commits

Reviewing files that changed from the base of the PR and between 5d9cea6 and 9b16faf.

📒 Files selected for processing (1)
  • projects/forgeyields/index.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • projects/forgeyields/index.js

📝 Walkthrough

Walkthrough

The Forgeyields adapter adds Ethereum TVL support and renames Starknet internals: totalAssetsABIstarknetTotalAssetsABI, totalAssetsProvidertotalAssetsProviderStarknet, and tvlstarknetTvl. A new ethereumTvl reads strategies, multi-calls totalAssets on Ethereum gateways, maps tokens, and aggregates balances.

Changes

Cohort / File(s) Summary
ForgeYields adapter
projects/forgeyields/index.js
Renamed Starknet ABI/provider and tvl to starknetTvl. Added ethereumTvl(api) that loads strategies, extracts token_gateway addresses for ethereum domain, batch-queries totalAssets via totalAssetsProviderEthereum using api.multiCall, maps results to underlying tokens (substituting WETH for ETH), and accumulates balances. Export updated to include ethereum.tvl and starknet.tvl.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nibble bytes and hop through chains,

Starknet hops and Ethereum reigns,
Gateways counted, multicalls play,
Balances gathered, bright as day,
ForgeYields hums — a rabbit's hooray! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: adding Ethereum TVL support to ForgeYields and updating the logo.
Description check ✅ Passed The description provides a clear summary, lists specific changes, and includes test results demonstrating the implementation works correctly.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between e2884a6 and 5d9cea6.

📒 Files selected for processing (1)
  • projects/forgeyields/index.js

@llamabutler
Copy link
Copy Markdown

The adapter at projects/forgeyields exports TVL:

starknet                  1.98 M
ethereum                  10.77 k

total                    1.99 M 

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.

2 participants