Nexera-FiAdapters & DeFi ProtocolsIdle

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:

  • IdleToken contract instances → (Best Yield)
  • IdleCDO contract instances → (Yield Tranches)

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.


graph LR; style Nexera_Fi fill:#8453ed style Idle fill:#4397f7; style Best_Yield fill:#4fdb87; style Yield_Tranches fill:#f5d75f; subgraph Nexera_Fi A[<b> IdleAdapter </b>] end subgraph Idle subgraph Best_Yield B["<b>...</b>"] C["<b>IdleToken Instance</b>"] D["<b>...</b>"] end subgraph Yield_Tranches E["<b>...</b>"] F["<b>IdleCDO Instance</b>"] G["<b>...</b>"] end end A --> |<b>mintIdleToken</b>: <i>Mint Idle LP tokens representing deposit positions</i>| Best_Yield A --> |<b>redeemIdleToken</b>: <i>Redeem underlying assets by burning Idle LP tokens</i>| Best_Yield A --> |<b>redeemInterestBearingTokens</b>: <i>Redeem interest-bearing tokens<br/> and unlent underlying by burning Idle LP tokens </i>| Best_Yield A --> |<b>depositAARef</b>: <i>Deposit underlying and mint AA tranche tokens</i>| Yield_Tranches A --> |<b>depositBBRef</b>: <i>Deposit underlying and mint BB tranche tokens</i>| Yield_Tranches A --> |<b>withdrawAA</b>: <i>Redeem underlying principal and interests<br/> by burning AA tranche tokens</i>| Yield_Tranches A --> |<b>withdrawBB</b>: <i>Redeem underlying principal and interests<br/> by burning BB tranche tokens</i>| Yield_Tranches

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:

  1. mintIdleToken
  2. redeemIdleToken
  3. redeemInterestBearingTokens

Methods

mintIdleToken

Mint idleTokens (ERC-20 Idle LP tokens representing shares), given an underlying asset _amount.

function mintIdleToken(uint256 _amount, bool _skipWholeRebalance, address _referral)
    external
    returns (uint256 mintedTokens);

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.

function redeemIdleToken(uint256 _amount) external returns (uint256 redeemedTokens);

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.
function redeemInterestBearingTokens(uint256 _amount) external;

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:

  1. depositAARef
  2. depositBBRef
  3. withdrawAA
  4. withdrawBB

Methods

depositAARef

Mint AA (Senior) tranche tokens (ERC-20) by depositing _amount of underlying asset. Returns the minted amount of AA tranche tokens.

function depositAARef(uint256 _amount, address _referral) external returns (uint256);

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.

function depositBBRef(uint256 _amount, address _referral) external returns (uint256);

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.

function withdrawAA(uint256 _amount) external returns (uint256);

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.

function withdrawBB(uint256 _amount) external returns (uint256);

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.

On this page