MIP36: Peg Stability - Compound Governance Dai Leverage
Preamble
MIP#: 36
Title: Peg Stability - Compound Governance Dai Leverage
Author(s): Alexis
Contributors: None
Type: Technical
Status: Conception
Date Proposed: 2021-01-09
Date Ratified: <yyyy-mm-dd>
Dependencies: Join Dai-farming, Join Dai-lendler
Replaces: n/a
License: AGPL3+
References
- The proposed implementation is part of the dss-psm-cme - Peg Stability Compound Mixed Exposure - project.
Sentence Summary
This proposal defines a Peg stabilizer actionable only by governance,
which uses flash minting technique with MIP35c2: Dai farming vault or MIP32c2: Dai lending vault
to leverage our position on cDai.
Paragraph Summary
By governance vote, or by executing order, we can call one of the methods define in this MIP. These methods will leverage/deleverage our position on one of the Compound Dai Vault.
For that we use flash minting technique on Dai, then we convert Dai to cDai using either the farming or the lending Vault which will increase our position, then we return the Dai.
Both vaults are already defined previously (MIP32, MIP35).
Here is the last part of the - Peg Stability Compound Mixed Exposure - project.
Component Summary
MIP36c1: The Peg Stabilizer Compound Dai Leverage
MIP36c2: The Joins
MIP36c3: Proposed Code
MIP36c4: Test cases Lists existing test cases
MIP36c5: Security considerations Comments on the security implications
MIP36c6: Licensing States the license under which the proposal and code are distributed.
Motivation
Currently, the usdc token inside the PSM is inefficient and needs to be diversified.
All previous MIPs ( MIP29, MIP32, MIP35)
are mint to control the peg under or over a certain level, for example the current PSM levels the dai at 1.001 or 0.999 on the other side.
But none of them can actually move the price, this stabilizer allows the governance to push down or up the price.
I believe this tool is needed for example in case the price stays stuck on one side and in any case it gives more power to the governance.
The governance can move the market price by sending supply to the market via cDai
or by removing supply.
Specification
MIP36c1: The Peg Stabilizer Compound Dai Leverag
The contract has 4 methods only accessible by governance :
leverageLendingVault(uint256 amount)
leverageLendingLeverageVault(uint256 amount)
deleverageLendingVault(uint256 amount)
deleverageLendingLeverageVault(uint256 amount)
leverageLendingVault()
flash mint the amount of dai pass as parameter. Increase its position on cDai using the Compound Lending Vault and return the Dai flash minted.
leverageLendingLeverageVault()
flash mint the amount of dai pass as parameter. Increase its position on cDai using the Compound Farming Vault and return the Dai flash minted.
deleverageLendingVault()
flash mint the amount of dai pass as parameter. Use the Dai to pay back its debt using the Compound Lending Vault, decrease its position and return the Dai flash minted.
deleverageLendingLeverageVault()
flash mint the amount of dai pass as parameter. Use the Dai to pay back its debt using the Compound Lending Vault, decrease its position and return the Dai flash minted.
MIP36c2: The Joins
We reuse both join defined with MIP32 and MIP35.
MIP36c3: Proposed code
The code : dds-psm-cme
MIP36c4: Test cases
Unit tests:
MIP36c5: Security considerations
Compound technical risk
Errors or security vulnerabilities in the Compound system could result in the underlying USDC deposits to be lost or stolen.
Implementation technical risk
In addition to the technical risk inherent to Compound, the adapter implementation itself is non-trivial and could increase the attack/error surface.
Due to the design of multi-collateral DAI, worst-case losses should be limited to the collateral deposited in the adapter, and the debt ceiling should be set with this in mind.
There is security consideration about the code itself, compound tokens.
In this implementation as we use leverage on compound, the c-token can be sized.
By using leverage on compound we also expose ourself to a lost of the assert which is currently compensated by COMP token.
Another risk: uniswap interaction, but limited to the extra bonus.