Architecture

Developers > Yield Tranches > Architecture

The main contract used by users is called IdleCDO which allows depositing the underlying and mint tranche tokens (ERC-20), either AA or BB, and redeeming principal and interest from it.

YTs are also ERC-4626 compliant! Deployed wrappers can be found here.

The IdleCDO contract pools users' funds together and uses IIdleCDOStrategy as a proxy for interacting with the underlying DeFi protocol to deposit funds and collect interest and rewards.

Governance tokens collected as rewards are not redistributed to users directly in the IdleCDO contract but rather sold to the market (harvest method) and the underlying reinvested in the downstream lending provider where possible.

Codebase and contracts

The codebase and a general overview of the architecture can be found at https://github.com/Idle-Labs/idle-tranches.

These are the core contracts used:

IdleCDO.sol

A contract that holds all the user pooled assets (both underlying, e.g. DAI, and interest-bearing tokens, e.g. idleDAI) and is an entry point for the user to mint tranche tokens and burn them to redeem principal and interest.

When users deposit into the CDO they will:

  • update the global accounting of the system (i.e. split accrued rewards)

  • mint their chosen tranche tokens.

Funds won't get put in lending right away.

The harvest method will be called periodically to put new deposits in lending, get fees and update the accounting.

During the harvest call, some predefined rewards will be sold into the market (via Uniswap) and released linearly over x (currently set a 1500) blocks, to increase the value of all tranche holders. On redeem, users will burn their tranche tokens and get underlying using a checkpointed price (set at last harvest to avoid potential theft of interest, updated when dumping governance tokens to increase the tranche price).

IdleCDOTranche.sol

ERC-20 representing a specific (either AA or BB) tranche token. Only IdleCDO contract can mint and burn tranche tokens.

On top of these, all the strategies (IIdleCDOStrategy) currently used can be found here https://github.com/Idle-Labs/idle-tranches/tree/master/contracts/strategies.

Last updated