-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from makerdao/dev
Add Splitter + FlapperMom => SplitterMom + DAI => USDS
- Loading branch information
Showing
28 changed files
with
1,731 additions
and
788 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,45 @@ | ||
# Dss Flappers | ||
|
||
Implementations of MakerDao surplus auctions, triggered on `vow.flap`. The current featured Flapper is `FlapperUniV2`. | ||
Implementations of MakerDAO surplus auctions, triggered on `vow.flap`. | ||
|
||
### FlapperUniV2 | ||
### Splitter | ||
|
||
Exposes a `kick` operation to be triggered periodically. Its logic withdraws `DAI` from the `vow` and buys `gem` tokens on Uniswap v2. The acquired tokens, along with a proportional amount of additional `DAI` withdrawn from the `vow`, are deposited back into the liquidity pool. Finally, the minted LP tokens are sent to a predefined `receiver` address. | ||
Exposes a `kick` operation to be triggered periodically. Its logic withdraws `USDS` from the `vow` and splits it in two parts. The first part (`burn`) is sent to the underlying `flapper` contract to be processed by the burn engine. The second part (`WAD - burn`) is distributed as reward to a `farm` contract. The `kick` cadence is determined by the `hop` value. | ||
|
||
Configurable Parameters: | ||
* `burn` - The percentage of the `vow.bump` to be moved to the underlying `flapper`. For example, a value of 0.70 \* `WAD` corresponds to funneling 70% of the `USDS` to the burn engine. | ||
* `hop` - Minimum seconds interval between kicks. | ||
* `flapper` - The underlying burner strategy (e.g. the address of `FlapperUniV2SwapOnly`). | ||
* `farm` - The staking rewards contract receiving the rewards. | ||
|
||
### FlapperUniV2 | ||
|
||
Exposes an `exec` operation to be triggered periodically by the `Splitter` (at a cadence determined by `Splitter.hop()`). Its logic withdraws `USDS` from the `Splitter` and buys `gem` tokens on Uniswap v2. The acquired tokens, along with a proportional amount of `USDS` (saved from the initial withdraw) are deposited back into the liquidity pool. Finally, the minted LP tokens are sent to a predefined `receiver` address. | ||
|
||
Configurable Parameters: | ||
* `pip` - A reference price oracle, used for bounding the exchange rate of the swap. | ||
* `want` - Relative multiplier of the reference price to insist on in the swap. For example, a value of 0.98 * `WAD` allows for a 2% worse price than the reference. | ||
|
||
#### Notes: | ||
#### Note: | ||
|
||
* As a `kick` operation also withdraws `DAI` for depositing in the pool (and not only for swapping), it can in practice reduce the Surplus Buffer to below `vow.bump`. | ||
|
||
* Although the Flapper interface is conformant with the Emergency Shutdown procedure and will stop operating when it is triggered, LP tokens already sent to the receiver do not have special redeeming handling. Therefore, in case the Pause Proxy is the receiver and governance does not control it, the LP tokens can be lost or seized by a governance attack. | ||
* Although the Flapper interface is conformant with the Emergency Shutdown procedure and will stop operating when it is triggered, LP tokens already sent to the `receiver` do not have special redeeming handling. Therefore, in case the Pause Proxy is the `receiver` and governance does not control it, the LP tokens can be lost or seized by a governance attack. | ||
|
||
### FlapperUniV2SwapOnly | ||
|
||
Exposes a `kick` operation to be triggered periodically. Its logic withdraws `DAI` from the `vow` and buys `gem` tokens on Uniswap v2. The acquired tokens are sent to a predefined `receiver` address. | ||
Exposes an `exec` operation to be triggered periodically by the `Splitter` (at a cadence determined by `Splitter.hop()`). Its logic withdraws `USDS` from the `Splitter` and buys `gem` tokens on Uniswap v2. The acquired tokens are sent to a predefined `receiver` address. | ||
|
||
Configurable Parameters: | ||
* `hop` - Minimum seconds interval between kicks. | ||
* `pip` - A reference price oracle, used for bounding the exchange rate of the swap. | ||
* `want` - Relative multiplier of the reference price to insist on in the swap. For example, a value of 0.98 * `WAD` allows for a 2% worse price than the reference. | ||
|
||
### FlapperMom | ||
### SplitterMom | ||
|
||
This contract allows bypassing the governance delay when disabling the Flapper in an emergency. | ||
This contract allows bypassing the governance delay when disabling the Splitter in an emergency. | ||
|
||
### OracleWrapper | ||
|
||
Allows for scaling down an oracle price by a certain value. This can be useful when the `gem` is a redenominated version of an existing token, which already has a reliable oracle. | ||
|
||
### General Note: | ||
|
||
* Availability and accounting of the withdrawn `DAI` is the responsibility of the `vow`. At the time of a `kick`, the `vow` is expected to hold at least the swapped amount (`vow.bump`) over the configured flapping threshold (`vow.hump`). | ||
* Availability and accounting of the withdrawn `USDS` is the responsibility of the `vow`. At the time of a `kick`, the `vow` is expected to hold at least the drawn amount (`vow.bump`) over the configured flapping threshold (`vow.hump`). |
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule dss-test
updated
8 files
+1 −1 | lib/forge-std | |
+101 −2 | src/DssTest.sol | |
+93 −34 | src/ScriptTools.sol | |
+2 −2 | src/domains/Domain.sol | |
+2 −17 | src/domains/OptimismDomain.sol | |
+51 −0 | src/tests/FileUnitTest.t.sol | |
+30 −12 | src/tests/ScriptToolsTest.t.sol | |
+1 −1 | test.sh |
Oops, something went wrong.