Skip to content

liquidium-cross-chain: native supply/debt, stablecoin metadata, folder rename - #3270

Merged
0xkr3p merged 2 commits into
DefiLlama:masterfrom
robin-liquidium:liquidium-fi-native-supply
Nov 27, 2026
Merged

0xkr3p merged 2 commits into
DefiLlama:masterfrom
robin-liquidium:liquidium-fi-native-supply

Conversation

@robin-liquidium

@robin-liquidium robin-liquidium commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Brief

  • What changes for users: Liquidium Cross-Chain's supply and borrow totals, utilization and APYs now match the lending canister. USDC and USDT, which users deposit straight from Ethereum, stay on ICP. Each gets an explicit poolMeta and a link to its market page.
  • Riskiest part: the folder rename and its config migration (section 4). Pool ids are unchanged, so history is kept.
  • Start reading: src/adaptors/liquidium-cross-chain/index.js, in the rayMul conversion and the fromEthereum branch.
  • Tested: npm run test --adapter=liquidium-cross-chain passes 84/84 against live canister data. Supply and debt match the protocol's own database snapshot to within the stablecoin price (USDC $1.0756M / $1.0072M, USDT $768.9k / $708.7k).

1. Scaled supply and debt converted to native amounts

The canister's total_supply_at_last_sync and total_debt_at_last_sync are scaled share totals. The adapter used them as token amounts, which understated supply and debt by the interest accrued since each deposit or borrow. Utilization, and therefore both APYs, were off too.

- supply = total_supply_at_last_sync
- debt   = total_debt_at_last_sync
+ supply = total_supply_at_last_sync ⊗ lending_index   // ray_mul, half-up like the canister
+ debt   = total_debt_at_last_sync   ⊗ borrow_index
  utilization, apyBase, apyBaseBorrow, tvlUsd, totalSupplyUsd, totalBorrowUsd ← native values

This matches the canister's own utilization_rate() and available_liquidity(). The rate model is unchanged.

Pool Supply before → after Borrow before → after Supply APY Borrow APY
USDC $1,060,054 → $1,075,427 $985,280 → $1,007,036 8.61% → 9.07% 10.30% → 10.76%
USDT $758,543 → $767,897 $692,311 → $707,779 7.54% → 8.11% 9.18% → 9.78%
BTC $1,822,451 → $1,822,547 $110,754 → $110,926 0.021% → 0.021% 0.404% → 0.404%
ETH $232,667 → $232,717 $859 → $860 ~0% → ~0% 0.123% → 0.123%
ICP $2,548,096 → $2,548,096 $85 → $85 ~0% → ~0% ~0% → ~0%

2. SOL pool

The SOL pool added in #3190 is decoded and priced correctly. It holds about $18 today, below the $1k tvlUsdDB minimum, so it doesn't reach /pools yet. No code change is needed.

3. USDC and USDT metadata

Per review, both pools stay on ICP with their ckUSDC/ckUSDT ledgers as underlyingTokens. They get:

poolMeta: 'Deposit USDC from Ethereum (held as ckUSDC on ICP)',
url: 'https://app.liquidium.fi/insights/usdc?utm_source=defillama&utm_medium=yields',

4. Folder rename

Protocol 7478's slug is now liquidium-cross-chain, so the adapter test failed on master: the folder name must match the slug. This PR renames the folder and project, and adds a config migration in the same format as #3237. If you prefer to do renames yourselves, I'll drop that part.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added Liquidium cross-chain pool listings.
    • USDC and USDT pools on Ethereum now show Ethereum deposit and ICP ck-token details, with links to Liquidium asset insights.
  • Bug Fixes
    • Supply and debt totals now account for lending and borrow indices, including when an index is zero.

…ereum, rename folder to slug

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Liquidium adaptor now applies lending and borrow indices to supply and debt values. It adds Ethereum-specific metadata and app links for ETH-chain USDC and USDT pools. A reversible migration renames existing project configuration records to liquidium-cross-chain.

Changes: Liquidium cross-chain adaptor

Layer / File(s) Summary
Ethereum pool metadata and project rename
src/adaptors/liquidium-cross-chain/index.js, migrations/1795708761247_rename-liquidium-to-liquidium-cross-chain.js
The adaptor adds Liquidium app links and Ethereum deposit and ICP ck-token metadata for ETH-chain USDC and USDT pools. It changes the emitted project ID. The migration updates matching project configuration records and can reverse that change.
Indexed supply and debt calculations
src/adaptors/liquidium-cross-chain/index.js
The adaptor adds ray multiplication and applies lending and borrow indices to supply and debt values before converting them to native units.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: shudufhadzo, 0xkr3p

Merge Risk: Minimal · up to 06068

The adaptor now reports Liquidium supply and debt with lending and borrow indices applied. It also renames the project to liquidium-cross-chain through a reversible migration. No concrete merge-blocking risk was found in the changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the adaptor's project rename, native supply and debt conversion, stablecoin metadata, and folder rename, all of which appear in the summary and objectives. It lists several changes rat…
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.
Full details: Title check

Explanation

The title names the adaptor's project rename, native supply and debt conversion, stablecoin metadata, and folder rename, all of which appear in the summary and objectives. It lists several changes rather than one main change, but each item is a real part of the changeset. The title is specific enough to identify the work.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c509d0b1-67d3-4450-82b0-d7a06968417f
Commits

Reviewing files that changed from the base of the PR and between 4dfb858 and 0606869.

Files selected for processing: 1

  • src/adaptors/liquidium-cross-chain/index.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@0xkr3p 0xkr3p 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.

hi @robin-liquidium, thanks for the changes

BTC, ETH, ICP and SOL stay on ICP as they were. If you'd rather keep the stablecoins on ICP, we can drop the chain change and keep the poolMeta and the URL.

Please keep stablecoins on ICP

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robin-liquidium robin-liquidium changed the title liquidium-cross-chain: native supply/debt, stablecoins under Ethereum, folder rename liquidium-cross-chain: native supply/debt, stablecoin metadata, folder rename Nov 27, 2026
@robin-liquidium

Copy link
Copy Markdown
Contributor Author

Thanks @0xkr3p, done: USDC and USDT stay on ICP with their ck ledgers as underlying tokens, and they keep the poolMeta and URL. Tests pass (84/84).

@0xkr3p
0xkr3p merged commit ccd3bf6 into DefiLlama:master Nov 27, 2026
3 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.

2 participants