← Protocols
Idle Finance
01Description

Yield aggregator with Perpetual Yield Tranches (PYTs): each `IdleCDO` splits a yield strategy into a Senior (AA) tranche and a Junior (BB) tranche, where BB absorbs first-loss in exchange for boosted yield. PYTs are ERC-4626.

02Best for
  • 01auto-compounded DeFi yield
  • 02risk-tranched lending (AA / BB)
  • 03senior fixed-ish yield exposure
  • 04junior leveraged yield exposure
  • 05RWA / Clearpool / Morpho-strategy wrappers
03Install
  • pnpm add viem
  • git clone https://github.com/Idle-Labs/idle-tranches
04Environment variables
VariableScopeDescription
NEXT_PUBLIC_IDLE_CDO_ADDRESSClientAddress of the target `IdleCDO` (one per strategy/asset, e.g. Idle Morpho USDC PYT).
05Prompt snippet
Integrate Idle Perpetual Yield Tranches. The user-facing contract is `IdleCDO` — one per strategy + underlying asset. Read AA/BB tranche tokens via `cdo.AATranche()` / `cdo.BBTranche()` (both ERC-20 + ERC-4626). Deposit: `cdo.depositAA(amount)` (Senior, lower yield, first-loss protected) or `cdo.depositBB(amount)` (Junior, higher yield, absorbs losses) — both return tranche tokens. Withdraw: `cdo.withdrawAA(trancheTokens)` / `cdo.withdrawBB(trancheTokens)` returns underlying. Optionally stake the tranche tokens in `cdo.AAStaking()` / `cdo.BBStaking()` for IDLE / partner rewards. Read APYs and trancheAPRSplit via `cdo.getApr(tranche)` and `cdo.trancheAPRSplitRatio()`. Underlying strategies expose: `cdo.strategy()`, `cdo.strategyToken()`, `cdo.token()`. List of deployed PYTs: docs.idle.finance/developers/yield-tranches/deployed-contracts.
06Gotchas
  • BB (Junior) absorbs losses first — if the underlying strategy (e.g. a lending market or RWA pool) takes a loss, BB tranche NAV drops to zero before AA is touched. Junior is NOT a free yield boost.
  • AA tranche only stays protected while BB has positive value — once BB is fully eaten, AA starts taking losses too. Track `cdo.virtualBalance(BB)` and the protection ratio.
  • Each PYT is tied to ONE underlying yield source (e.g. Morpho, Clearpool, Instadapp Lite) — that source's exploit / depeg / market shutdown directly hits the CDO; do not assume Idle adds a separate safety layer.
  • Withdrawals can revert if the strategy is illiquid (e.g. RWA strategy with unsettled redemptions). Some PYTs use `requestWithdraw` + claim flow — check `cdo.allowAAWithdraw()` / `cdo.allowBBWithdraw()` first.
  • Tranche APR depends on `trancheAPRSplitRatio` AND the AA:BB deposit ratio — if the pool is heavily AA, BB APR explodes (and vice versa); APYs shown on the frontend are point-in-time.
  • Some markets have been deprecated / paused (post-Euler 2023, post-Curve 2023); always check `cdo.paused()` and Idle's release-notes for shutdowns before integrating an old CDO address.
  • IDLE / partner reward emissions are claimed via the Staking contracts, not auto-compounded into the tranche — a user who never stakes leaves rewards on the table.
07Alternatives