Skip to content

fix: add more pools to Yuzu Money#2320

Merged
0xkr3p merged 3 commits intoDefiLlama:masterfrom
tangten:master
Feb 1, 2026
Merged

fix: add more pools to Yuzu Money#2320
0xkr3p merged 3 commits intoDefiLlama:masterfrom
tangten:master

Conversation

@tangten
Copy link
Contributor

@tangten tangten commented Jan 30, 2026

Summary by CodeRabbit

  • New Features

    • Added multi-chain pool support across Plasma, Ethereum, and Monad networks
    • Unified token metadata and chain-aware pricing for improved underlying-asset resolution
    • Pool listings now show per-chain TVL and 7-day APY with standardized fields and URLs
  • Refactor

    • Consolidated supply/TVL/APY computations to aggregate metrics across tokens and chains in a data-driven way

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Refactors the Yuzu Money adaptor to support multiple chains (plasma, ethereum, monad) via centralized multi-chain/token metadata and helpers; adds chain-aware price, supply, TVL, redemption price, APY calculations, and multi-chain pool generation while preserving the public apy API.

Changes

Cohort / File(s) Summary
Multi-chain Yuzu Money Adaptor Refactor
src/adaptors/yuzu-money/index.js
Replaced single-chain constants with multi-chain configs (CHAINS, UNIT, yuzuConfig, TOKEN_META). Added chain-aware helpers: price fetch, getTotalSupply(chain, token), getRedemptionPrice(chain,...), calculateTvlByToken(tokenKey), calculateApy(chain, token,...), and fetchPoolsForToken(tokenKey, unit). Reworked apy() to aggregate pools across tokens/chains (fields: pool, chain, project, symbol, tvlUsd, apyBase, underlyingTokens, url). Added PLASMA_USDT_ADDRESS and USDT_UNIT handling.

Sequence Diagram(s)

sequenceDiagram
    participant Adapter as Yuzu Adaptor
    participant RPC as Blockchain RPCs (plasma / ethereum / monad)
    participant PriceAPI as External Price API
    participant Aggregator as Pools Aggregator

    Adapter->>RPC: getTotalSupply(chain, token)
    RPC-->>Adapter: totalSupply
    Adapter->>RPC: getRedemptionPrice(chain, blockNumber, token, underlyingUnit)
    RPC-->>Adapter: redemptionPriceData
    Adapter->>PriceAPI: fetch price for chain+token address
    PriceAPI-->>Adapter: tokenPrice
    Adapter->>Aggregator: calculateTvlByToken & calculateApy
    Aggregator-->>Adapter: pool objects per chain/token
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested reviewers

  • 0xkr3p

Poem

🐰 I hopped through chains both near and far,

Plasma, Ethereum, Monad — a guiding star.
Prices pulled, supplies tallied in tune,
Pools stitched together under a multi-chain moon.
A happy rabbit hops — refactor done, hooray! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix: add more pools to Yuzu Money' accurately reflects the main objective: expanding the Yuzu Money adapter to support multiple chains and tokens, enabling export of 6 pools across Plasma, Monad, and Ethereum.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@llamatester
Copy link

The yuzu-money adapter exports pools:

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

Nb of pools: 6
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬────────────┬──────────────┬──────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬───────────────────────────────────────┐
│ (index) │ pool                                                  │ chain      │ project      │ symbol   │ tvlUsd             │ apyBase            │ underlyingTokens                                 │ url                                   │
├─────────┼───────────────────────────────────────────────────────┼────────────┼──────────────┼──────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────┤
│ 0       │ '0xc8a8df9b210243c55d31c73090f06787ad0a1bf6-plasma'   │ 'Plasma'   │ 'yuzu-money' │ 'syzUSD' │ 38897187.558340855 │ 10.409877297509773 │ [ '0x6695c0f8706c5ace3bdf8995073179cca47926dc' ] │ 'https://app.yuzu.money/yzusd-syzusd' │
│ 1       │ '0x484be0540ad49f351eaa04eeb35df0f937d4e73f-monad'    │ 'Monad'    │ 'yuzu-money' │ 'syzUSD' │ 12361721.885037499 │ 10.409877297509773 │ [ '0x6695c0f8706c5ace3bdf8995073179cca47926dc' ] │ 'https://app.yuzu.money/yzusd-syzusd' │
│ 2       │ '0x6dff69eb720986e98bb3e8b26cb9e02ec1a35d12-ethereum' │ 'Ethereum' │ 'yuzu-money' │ 'syzUSD' │ 9358007.452851819  │ 10.409877297509773 │ [ '0x6695c0f8706c5ace3bdf8995073179cca47926dc' ] │ 'https://app.yuzu.money/yzusd-syzusd' │
│ 3       │ '0xebfc8c2fe73c431ef2a371aea9132110aab50dca-plasma'   │ 'Plasma'   │ 'yuzu-money' │ 'yzPP'   │ 2627895.797590021  │ 70.39630562211184  │ [ '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb' ] │ 'https://app.yuzu.money/yzpp'         │
│ 4       │ '0xb37476cb1f6111cc682b107b747b8652f90b0984-monad'    │ 'Monad'    │ 'yuzu-money' │ 'yzPP'   │ 17.777940368521932 │ 70.39630562211184  │ [ '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb' ] │ 'https://app.yuzu.money/yzpp'         │
│ 5       │ '0xb2429ba2cfa6387c9a336da127d34480c069f851-ethereum' │ 'Ethereum' │ 'yuzu-money' │ 'yzPP'   │ 1.0574289940723545 │ 70.39630562211184  │ [ '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb' ] │ 'https://app.yuzu.money/yzpp'         │
└─────────┴───────────────────────────────────────────────────────┴────────────┴──────────────┴──────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴───────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

Copy link

@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: 2

🤖 Fix all issues with AI agents
In `@src/adaptors/yuzu-money/index.js`:
- Around line 75-81: getUsdPrice currently returns undefined on missing API data
and lets network errors bubble up; wrap the axios call in a try/catch inside
getUsdPrice, validate that data.coins[priceKey]?.price is a finite number, and
on failure either return a safe numeric fallback (e.g., 0) or throw a
descriptive error that includes chain and token.address so callers can handle
it; also consider logging the axios error before rethrowing or returning the
fallback to aid debugging.
- Around line 119-126: The plasma TVL computation can become negative due to
timing mismatches between supply fetches; update the return calculation that
uses plasmaSupply, monadSupply, ethereumSupply and tokenPrice (the block using
getUsdPrice('plasma', yuzuConfig.plasma[tokenKey]) and computing plasma:
(plasmaSupply - monadSupply - ethereumSupply) * tokenPrice) to clamp the plasma
component to a non-negative value (e.g., compute netPlasma = Math.max(0,
plasmaSupply - monadSupply - ethereumSupply) and use netPlasma * tokenPrice) so
plasma TVL never goes below zero.
🧹 Nitpick comments (1)
src/adaptors/yuzu-money/index.js (1)

61-73: Unused chain parameter in getUnderlyingTokens for syzUSD.

The chain parameter on line 66 is accepted but never used—it always returns the plasma yzUSD address. If this is intentional (canonical underlying always on plasma), consider removing the parameter for consistency with yzPP, or add a comment clarifying the design choice.

♻️ Suggested cleanup if chain is intentionally unused
 const TOKEN_META = {
   syzUSD: {
     symbol: 'syzUSD',
     url: 'https://app.yuzu.money/yzusd-syzusd',
-    getUnderlyingTokens: (chain) => [yuzuConfig['plasma'].yzUSD.address],
+    getUnderlyingTokens: () => [yuzuConfig['plasma'].yzUSD.address],
   },

@llamatester
Copy link

The yuzu-money adapter exports pools:

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

Nb of pools: 6
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬────────────┬──────────────┬──────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬───────────────────────────────────────┐
│ (index) │ pool                                                  │ chain      │ project      │ symbol   │ tvlUsd             │ apyBase            │ underlyingTokens                                 │ url                                   │
├─────────┼───────────────────────────────────────────────────────┼────────────┼──────────────┼──────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────┤
│ 0       │ '0xc8a8df9b210243c55d31c73090f06787ad0a1bf6-plasma'   │ 'Plasma'   │ 'yuzu-money' │ 'syzUSD' │ 39225505.4875368   │ 10.391619050450696 │ [ '0x6695c0f8706c5ace3bdf8995073179cca47926dc' ] │ 'https://app.yuzu.money/yzusd-syzusd' │
│ 1       │ '0x484be0540ad49f351eaa04eeb35df0f937d4e73f-monad'    │ 'Monad'    │ 'yuzu-money' │ 'syzUSD' │ 12371803.264871826 │ 10.391619050450696 │ [ '0x6695c0f8706c5ace3bdf8995073179cca47926dc' ] │ 'https://app.yuzu.money/yzusd-syzusd' │
│ 2       │ '0x6dff69eb720986e98bb3e8b26cb9e02ec1a35d12-ethereum' │ 'Ethereum' │ 'yuzu-money' │ 'syzUSD' │ 9365639.207432777  │ 10.391619050450696 │ [ '0x6695c0f8706c5ace3bdf8995073179cca47926dc' ] │ 'https://app.yuzu.money/yzusd-syzusd' │
│ 3       │ '0xebfc8c2fe73c431ef2a371aea9132110aab50dca-plasma'   │ 'Plasma'   │ 'yuzu-money' │ 'yzPP'   │ 2629365.9233153844 │ 70.44802924365871  │ [ '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb' ] │ 'https://app.yuzu.money/yzpp'         │
│ 4       │ '0xb37476cb1f6111cc682b107b747b8652f90b0984-monad'    │ 'Monad'    │ 'yuzu-money' │ 'yzPP'   │ 17.78788589509255  │ 70.44802924365871  │ [ '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb' ] │ 'https://app.yuzu.money/yzpp'         │
│ 5       │ '0xb2429ba2cfa6387c9a336da127d34480c069f851-ethereum' │ 'Ethereum' │ 'yuzu-money' │ 'yzPP'   │ 1.0580205523709585 │ 70.44802924365871  │ [ '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb' ] │ 'https://app.yuzu.money/yzpp'         │
└─────────┴───────────────────────────────────────────────────────┴────────────┴──────────────┴──────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴───────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

Copy link

@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: 2

🤖 Fix all issues with AI agents
In `@src/adaptors/yuzu-money/index.js`:
- Around line 61-72: The TOKEN_META entries (syzUSD and yzPP) currently ignore
the chain parameter in their getUnderlyingTokens functions and always return
plasma-only addresses; update getUnderlyingTokens for syzUSD and yzPP to use the
supplied chain argument (e.g., yuzuConfig[chain].yzUSD.address or a
chain-indexed PLASMA_USDT_ADDRESS map) so each chain returns the correct
underlying token address, or explicitly validate and document that the same
address is valid across chains if that is intentionally the case; locate and
change getUnderlyingTokens in the TOKEN_META object to perform a chain lookup
instead of returning a hardcoded plasma address.
- Around line 141-157: The calculateApy function can produce Infinity/NaN when
startPrice is zero or non-finite; after obtaining startPrice (from
getRedemptionPrice) add a guard that checks Number.isFinite(startPrice) and
startPrice > 0 and, if the check fails, return a safe fallback (e.g., 0 or null)
instead of proceeding to compute appreciationRatio and the power expression;
keep all other logic and use the existing constants APY_REFERENCE_PERIOD_IN_DAYS
and YEAR_IN_DAYS for the calculation.

@llamatester
Copy link

The yuzu-money adapter exports pools:

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

Nb of pools: 6
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬────────────┬──────────────┬──────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬───────────────────────────────────────┐
│ (index) │ pool                                                  │ chain      │ project      │ symbol   │ tvlUsd             │ apyBase            │ underlyingTokens                                 │ url                                   │
├─────────┼───────────────────────────────────────────────────────┼────────────┼──────────────┼──────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼───────────────────────────────────────┤
│ 0       │ '0xc8a8df9b210243c55d31c73090f06787ad0a1bf6-plasma'   │ 'Plasma'   │ 'yuzu-money' │ 'syzUSD' │ 39209790.39252817  │ 10.384112340162034 │ [ '0x6695c0f8706c5ace3bdf8995073179cca47926dc' ] │ 'https://app.yuzu.money/yzusd-syzusd' │
│ 1       │ '0x484be0540ad49f351eaa04eeb35df0f937d4e73f-monad'    │ 'Monad'    │ 'yuzu-money' │ 'syzUSD' │ 12366878.254627766 │ 10.384112340162034 │ [ '0x6695c0f8706c5ace3bdf8995073179cca47926dc' ] │ 'https://app.yuzu.money/yzusd-syzusd' │
│ 2       │ '0x6dff69eb720986e98bb3e8b26cb9e02ec1a35d12-ethereum' │ 'Ethereum' │ 'yuzu-money' │ 'syzUSD' │ 9361910.901376557  │ 10.384112340162034 │ [ '0x6695c0f8706c5ace3bdf8995073179cca47926dc' ] │ 'https://app.yuzu.money/yzusd-syzusd' │
│ 3       │ '0xebfc8c2fe73c431ef2a371aea9132110aab50dca-plasma'   │ 'Plasma'   │ 'yuzu-money' │ 'yzPP'   │ 2629960.493968097  │ 70.48006746547071  │ [ '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb' ] │ 'https://app.yuzu.money/yzpp'         │
│ 4       │ '0xb37476cb1f6111cc682b107b747b8652f90b0984-monad'    │ 'Monad'    │ 'yuzu-money' │ 'yzPP'   │ 17.791908216532573 │ 70.48006746547071  │ [ '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb' ] │ 'https://app.yuzu.money/yzpp'         │
│ 5       │ '0xb2429ba2cfa6387c9a336da127d34480c069f851-ethereum' │ 'Ethereum' │ 'yuzu-money' │ 'yzPP'   │ 1.0582597993942915 │ 70.48006746547071  │ [ '0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb' ] │ 'https://app.yuzu.money/yzpp'         │
└─────────┴───────────────────────────────────────────────────────┴────────────┴──────────────┴──────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴───────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@0xkr3p 0xkr3p merged commit 32ac0e1 into DefiLlama:master Feb 1, 2026
2 checks passed
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.

3 participants