Comment on page
Developers > Yield Tranches > Architecture
The main contract used by users is called
IdleCDOwhich allows depositing the underlying and mint tranche tokens (ERC-20), either AA or BB, and redeeming principal and interest from it.
The IdleCDO contract pools users' funds together and uses
IIdleCDOStrategyas 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 (
harvestmethod) and the underlying reinvested in the downstream lending provider where possible.
These are the core contracts used:
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.
harvestmethod 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).