Draft CIP-4 Achive higher yield across 4 lending protocol (Compound, AaveV1, AaveV2, DyDx) with Idle finance

Proposal title

Achive higher yield across 4 lending protocol (Compound, AaveV1, AaveV2, DyDx) with Idle finance

Motivation

Today, Layer2.finance user earn yield by depositing token to single strategy(e.g. Compound, AaveV2, Curve3Pool strategy). As mentioned in CIP-3 by frankzhu, it is hassle for Layer2.finance user to manually redistribute balance to another strategy with higher yield.

So I propose a strategy to automate rebalance across 4 lending protocol (Compound, AaveV1, AaveV2, DyDx) for optimize interest rate profitability and get the higher yield by integrating Idle finace to layer2.finance. In addition, Layer2.finance strategy does not support AaveV1 and DyDx now. So Layer2.finance user can get an opportunity of eaning yield by lending to AaveV1 and DyDx.

Currently, Idle finance support two different allocation strategies:

  • Best-Yield: this strategy combines multiple money markets to automatically provide the highest interest rates, beating the best traditional offerings across interest-bearing tokens and DeFi protocols.

  • Risk-adjusted: this strategy automatically changes the asset allocation in order to find the optimal mix between risk scores and yield.

I propose layer2.finance support two allocation strategies for user can choose best interest rate or best risk/yield allocation.

Specification

  • aggregateCommit
    Deposit supply token(e.g. DAI, USDT) into Idle Lending Pool and mint iToken(e.g. idleDAI, idleUSDC) correspoing to deposit token amount.
  • aggregateUncommit
    1. Withdraw underlying token(e.g. DAI, USDT) from Idle Lending Pool by redeeming iToken(e.g. idleDAI, idleUSDC).
    2. Transfer withdrawn token to rollup chain contract.
  • harvest
    1. Claim IDLE (Idle finance governance token) which distributed by liquidity mining.
    2. Swap IDLE token for supply token (e.g. DAI, USDT) via sushiswap.
    3. Deposit obtained token by swap into idle Lending Pool and mint iToken correspoding to deposit token amount.
  • Support this proposal to add new Idle finance strategy
  • Do not support this proposal to add new Idle finance strategy

0 voters

Reference

[1] Idle finance developer docs (https://developers.idle.finance/)

3 Likes

Great!wonderful! now,the apy is too low, need more stradgy.

6 Likes

Thank you Taki for continuing your contribution in our governance forum. I think this is a great addition. Could you please elaborate on the risk involved in this strategy?

5 Likes

Hi Mo.
I guess composability(l2.finance <-> Idle finance) lisk level is the same as l2.finance <-> Aave because interface is almost same. I investigate the details risk of Idle finance.
I asses the various factors risk of Idle finance in reference to Consensys’s “DeFi Score: Assessing Risk in Permissionless Lending Protocols”[1].

Smart Contract Risk

Code Security
I asses code security by looking at the following six factors.

  1. Time on Mainnet: Normalized time since the protocol first launched on mainnet:
    The date of the first smart contract (Idle DAIv1) deployed is Aug-15-2019 10:46:12 AM +UTC.
    The date of smart contract (Idle DAIv4) which will integrate into l2.finace
    deployed is Aug-04-2020 09:11:23 PM +UTC.
  2. No Critical Vulnerabilities: No vulnerabilities have been exploited:
    As far as I searched, Idle finance has never been hacked due to smart
    contract vulnerabilities.
  3. Four Engineer Weeks 4 or more engineer weeks have been dedicated to auditing the protocol:
    Github commits by idle finance team is active but it is developed by
    three developers.
    4. Public Audit: Has the audit report been made public:
    Idle finace publishes quant stamp audit reports.[2] [3]
    5. Recent Audit: Has there been an audit in the last 12 months or have no
    code changes been made:
    Idle Protocol was audited in December 10th 2020 and Idle
    Governance Protocol was audited in November 26th 2020.
    6. Bounty Program: Does the development team offers a public bug bounty
    program?
    Yes, Idle finance team offers a public bounty program.

Financial Risk

Liquidity Risk
In the case of high utilization (high borrowed funds/supplied funds ratio), when many lenders withdraw at the same time, a certain amount of them might have to wait until some of the borrowers have to wait until some of the borrowers have paid back their outstanding loans.[4]
Idle finance is yield lending protocol across Compound, AAVE, dydx. Liquidity risk of Idle finance depends on these protocols. Best Yield allocation strategy allcates without considering this risk. Risk adjusted allocation strategy allocates to take into consideration Defi score(including liquidity risk score). The Defi score for each lending protocol is this(DeFi Score Compare | Codefi Data).

Centralization & Intermediary Risk

① Protocol Administration
Admin privileges are controlled by Idle governance and timelock contract.
Governance help mitigate centralized lisk by distributing control to community . Timelocks help mitigate risk by allowing protocol users to exit their positions before a change can take place.
This management approach is the best(level 4) as defined by Defi Score.
② Oracles
Idle finance use only centralized self-operated oracles. This oracle usage is most risky as defined by Defi Score.
Idle finance team mention about centralized self-operated oracles and oracle usage as follows.
“Price oracle for IDLE/WETH value will be set by multisig rather than on-chain. Direct on-chain oracles are unreliable, and vulnerable to manipulation, this change reduces the surface area of attack. The only use for the oracle would be to configure the initial weights of the pool in anycase.” [5]
Idle finance is operated without oracle price feed so I guess that oracle risk is low.

[1] DeFi Score: Assesing Risk in Permissionless Lending Protocols (defi-score/whitepaper.md at master · ConsenSys/defi-score · GitHub)
[2] Idle Protocol Audit Report (https://certificate.quantstamp.com/full/idle-finance)
[3] Idle Governance Audit Report (https://certificate.quantstamp.com/full/idle-goverance)
[4] Yield Aggregators in DeFi (Yield Aggregators in DeFi. This article summarizes the paper ‘SoK… | by Simon Cousaert | UCL CBT | Jun, 2021 | Medium)
[5] Smart Treasury - Progress Update ([Update] - Smart Treasury - Progress Update - 📋 Proposals - Idle)

2 Likes

Thank you for the detailed breakdown. I think this is reasonable risk level to be accepted into the protocol. Any PR we should look at?

2 Likes

Yes, please look at this PR (Add Idle finance strategy by thashimoto1998 · Pull Request #99 · celer-network/layer2-finance-contracts · GitHub).

2 Likes