Idle Protocol
Overview
Idle Finance optimizes asset allocation and yield farming for DeFi users through two core products: Best Yield and Yield Tranches. Best Yield (BY) vaults act as lending aggregators, dynamically rebalancing capital across integrated DeFi protocols to ensure users earn the highest interest rates. On the other hand, Yield Tranches (YTs) represent capital pools with market-neutral yield strategies, offering distinct Senior and Junior classes. Senior Tranches provide primary protection with a first lien, backed by Junior deposits, while Junior Tranches are designed for higher yield, compensating for elevated risk through a secondary lien or no lien in case of fund losses.
The Nexera-Fi IdleAdapter interacts with and utilizes the following two components of Idle:
In the following sections, we'll provide an overview of these contracts and their methods that Nexera-Fi IdleAdapter interacts with.
Interactions with IdleAdapter
The IdleAdapter interacts with Idle protocol by calling the methods presented in the diagram below. Each method serves a specific purpose within the Adapter, enabling strategies to seamlessly integrate liquidity provision and liquidity withdrawal in Idle.
IdleToken
IdleToken serves as the implementation contract for Best Yield vaults, operating as single-sided liquidity pools that issue ERC-20 shares (idleTokens) for each user deposit. Users can actively engage in Idle's Best Yield strategy by depositing assets or divest their position by burning shares, redeeming their underlying balance. Each instance of IdleToken consolidates pooled funds from all users for a specific asset, facilitating seamless participation in Idle's optimized yield strategy.
In the context of the Nexera-Fi IdleAdapter, these three methods come into play:
Methods
mintIdleToken
Mint idleTokens (ERC-20 Idle LP tokens representing shares), given an underlying asset _amount
.
This method is invoked by the following IdleAdapter function:
This function invokes the mintIdleToken
method on the IdleToken instance specified by the idleToken
input parameter.
It is triggered within the context of the Adapter's _deposit function when DepositOperation is configured as MINT_IDLE_TOKEN.
redeemIdleToken
Redeem underlying asset balance by burning _amount
of associated Idle LP tokens.
This method is invoked by the following IdleAdapter function:
This function invokes the redeemIdleToken
method on the IdleToken instance specified by the idleToken
input parameter.
It is triggered within the context of the Adapter's _withdraw function when WithdrawOperation is configured as REDEEM_IDLE_TOKEN.
redeemInterestBearingTokens
Redeem interest-bearing tokens and unlent underlying balance by burning _amount
of associated Idle LP tokens.
Note:
- This method can be called only in emergency situations when the BY contract is paused.
This method is invoked by the following IdleAdapter function:
This function invokes the redeemInterestBearingTokens
method on the IdleToken instance specified by the idleToken
input parameter.
It is triggered within the context of the Adapter's _withdraw function when WithdrawOperation is configured as REDEEM_INTEREST_BEARING_TOKENS.
IdleCDO
IdleCDO is the implementation contract for Yield Tranches, acting as the primary gateway for users to mint tranche tokens (ERC-20). Each IdleCDO instance is dedicated to a specific asset, encompassing both the underlying (e.g. DAI) and interest-bearing tokens (e.g. idleDAI). Through its interface users are able to mint tranche tokens, either AA (Senior) or BB (Junior) by depositing underlying assets, and subsequently redeem principal and interest by burning the respective tokens.
In the context of the Nexera-Fi IdleAdapter, these four methods come into play:
Methods
depositAARef
Mint AA (Senior) tranche tokens (ERC-20) by depositing _amount
of underlying asset.
Returns the minted amount of AA tranche tokens.
This method is invoked by the following IdleAdapter function:
This function invokes the depositAARef
method on the IdleCDO instance specified by the idleCDO
input parameter.
It is triggered within the context of the Adapter's _deposit function when DepositOperation is configured as DEPOSIT_AA_REF.
depositBBRef
Mint BB (Junior) tranche tokens (ERC-20) by depositing _amount
of underlying asset.
Returns the minted amount of BB tranche tokens.
This method is invoked by the following IdleAdapter function:
This function invokes the depositBBRef
method on the IdleCDO instance specified by the idleCDO
input parameter.
It is triggered within the context of the Adapter's _deposit function when DepositOperation is configured as DEPOSIT_BB_REF.
withdrawAA
Redeem underlying principal and interests by burning _amount
of associated AA (Senior) tranche tokens.
Returns the amount of underlying tokens redeemed.
This method is invoked by the following IdleAdapter function:
This function invokes the withdrawAA
method on the IdleCDO instance specified by the idleCDO
input parameter.
It is triggered within the context of the Adapter's _withdraw function when WithdrawOperation is configured as WITHDRAW_AA.
withdrawBB
Redeem underlying principal and interests by burning _amount
of associated BB (Junior) tranche tokens.
Returns the amount of underlying tokens redeemed.
This method is invoked by the following IdleAdapter function:
This function invokes the withdrawBB
method on the IdleCDO instance specified by the idleCDO
input parameter.
It is triggered within the context of the Adapter's _withdraw function when WithdrawOperation is configured as WITHDRAW_BB.
Please note: For detailed information about Idle protocol, consult the official Idle Finance documentation.