On current decentralized rebalance.

Idle smart contract allows to seamlessly yield the best available rate within different lending providers. It has a decentralized rebalance, that allows users pool to be up to date with the highest rate without relying on a centralized system.

Idle Finance
Idle DAO
Published in
4 min readSep 26, 2019

--

IdleDAI deposit cap reached!

We are thrilled to announce that we already reached our first milestone of 30'000 idleDAI minted. In this Idle alpha version, we have set a limit on the max mintable amount to mitigate a well-known possible edge case. It occurs when rebalancing funds and the value locked in our smart contract reach a level whereby it can significantly influence interest rates on lending protocols connected to Idle.

This limit allowed us to initial battle-test Idle value proposition, collect user feedback and test our assumptions for the next contract version.

Current Idle smart contract

With the current contract, users are allowed to mint idleDAI using DAI on our app. When a user mints idleDAI, our smart contract checks the current interest rates on Compound and Fulcrum. Consequently, it mints cDAI/iDAI (depending on the highest interest rate) proportionally to the DAI amount supplied. In this way, idleDAI represents a right to redeem a share of DAI locked into cDAI/iDAI.

Users can get back DAI + interest by redeeming idleDAI via our smart contract. This operation consists in burning idleDAI from the user and convert a proportional amount of the locked cDAI/iDAI back into DAI, and send this amount to user address. Every time a user mints or redeems idleDAI, the current contract rebalances the entire pool of funds (cDAI/iDAI) from a protocol to another, if needed.

With enough funds to influence interest rates, this can cause an issue: when the smart contract moves the funds from a protocol to another during a rebalance, it lowers the target protocol rate. Simultaneously, the interest rate on the previous lending protocol proportionally increases with the redeemed amount and the lending protocol available liquidity.

Let’s say, for example, that the current pool of DAI locked in Idle smart contract is composed by only cDAIs with a NAV (Net Asset Value) of 10M DAI.

The current (𝑡 = 0) interest rates are:

  • 𝐶𝑜𝑚𝑝𝑜𝑢𝑛𝑑: 15% 𝐴𝑃𝑅
  • 𝐹𝑢𝑙𝑐𝑟𝑢𝑚: 10% 𝐴𝑃𝑅

After some time (𝑡 = 1) interest rates have been changed into:

  • 𝐶𝑜𝑚𝑝𝑜𝑢𝑛𝑑: 12% 𝐴𝑃𝑅
  • 𝐹𝑢𝑙𝑐𝑟𝑢𝑚: 15% 𝐴𝑃𝑅

In t=1, Idle pool can still be in cDAI (no one has minted/redeemed/rebalanced). However, once a user triggers a rebalance, Idle smart contract moves 10M DAI from Compound to Fulcrum. As a result, Compound’ rate will get higher and Fulcrum’ rate will get lower.

After this rebalance (𝑡 = 2) interest rates could be:

  • 𝐶𝑜𝑚𝑝𝑜𝑢𝑛𝑑: 14% 𝐴𝑃𝑅
  • 𝐹𝑢𝑙𝑐𝑟𝑢𝑚: 11% 𝐴𝑃𝑅

Which is a worse scenario compared to the previous rate given by holding cDAI. This will also cause any subsequent action to trigger a new rebalance, hence causing a ping-pong effect.

Dynamic Funds Allocation algorithm

An ideal solution is to dynamically allocate funds both on Compound and Fulcrum (and other protocols in the future) in order to yield an aggregated interest rate that represents the highest available one for all funds.
This implies that funds could be allocated in 3 different ways:

  • All on Compound because it offers the best rate for all 10M DAI
  • All on Fulcrum because it offers the best rate for all 10M DAI
  • Dynamically allocated so that in the end Compound rate = Fulcrum rate

Let’s walk into an example of Dynamic Funds Allocation (DFA) algorithm.

Here’s the current (𝑡 = 0) situation:

  • 𝐶𝑜𝑚𝑝𝑜𝑢𝑛𝑑: 10% 𝐴𝑃𝑅
  • 𝐹𝑢𝑙𝑐𝑟𝑢𝑚: 15% 𝐴𝑃𝑅
  • Idle smart contract holds cDAI with NAV=10M DAI

When a rebalance process is triggered:

  1. Idle smart contract redeems cDAI in DAI from Compound (which causes the Compound rate rises to e.g. 13%)
  2. Idle smart contract computes the maximum amount to be allocated in Fulcrum such that the minimum rate given by Fulcrum is the Compound’s one. So e.g. 3M DAI causes Fulcrum rate to move from 15% to 13%. Now we have Compound rate = Fulcrum rate = 13% and 7M more DAI to invest.
  3. Then Idle smart contract calculates how to allocate the remaining 7M DAI between each protocol based on the current lending supply and borrowing demand of DAI. This amount will be split such that new rates will still be equal, so we could end up with something like this: 4M allocated on Compound (which shifts the rate to 11%), and 3M on Fulcrum (which shifts the rate to 11%).

All 10M funds are now gaining 11% APR (rates have been “arbitraged”) with 6M on Fulcrum and 4M on Compound (Idle contract holds both cDAI and iDAI).

We are currently working hard to implement this DFA on-chain algorithm in our upcoming smart contract. We will keep posting other updates on DFA and a final solution will be published once the new smart contract version will be tested and completed.

Keep yourself updated

If you want to follow our updates, you can subscribe to our mailing list: https://eepurl.com/gAGzSH.

You can also schedule a 15-minutes call if you want to share your opinion about Idle with us: https://calendly.com/idlefinance/15min.

If you have any question, please join and ask on our social channels:

We would be more than happy to answer, discuss and discover with you about Idle and its applications and use cases.

--

--

Idle Finance
Idle DAO

Earn the yield you deserve without worrying about finding the best option, whether you want to optimize returns or risks.