What the hell is this?
Good question. In this post I present the specification for an on-chain market maker with useful properties to MKR holders. It is similar to uniswap in some ways, and distinct in others. This is only a specification and description of how such a contract could work. I have done no development work (nor do I really plan to, I don’t have the expertise.)
Why should I care?
Another great question. The mechanism I’m proposing has the following properties.
+ A uniswap-like contract that only deals in stablecoins, open for any liquidity provider to earn fees without the risk of large ‘impermanent’ losses due to severe price movements.
+ Provides an approximate on-chain answer to the question ‘what do market makers inventories look like?’
+ Allows MKR holders to react to changing Dai supply/demand balance before it affects the peg.
+ Provides an new source of income for MakerDAO.
+ Incentivizes MKR holders to keep the price within a ‘Target Range’ as opposed to accepting larger oscillations above and below $1.
- Unlike uniswap, it cannot guarantee to always have liquidity.
Target Range - The maximum range at which Dai should trade versus other stablecoins.
Variable Price Liquidity Percentage - The share of liquidity that is available for trades within the target range.
Liquidity Reward - Equivalent to uniswap’s fee, this goes to providers of liquidity.
Stability Reward - When trading inside the bounds of the target range this is used to burn MKR. At the bounds of the target range, this reward goes to providers of liquidity.
What are the differences from Uniswap?
This system is similar in many ways to uniswap. For those that don’t know how uniswap works, I suggest reading up on that before diving into this. Unless specified, assume parity with uniswap.
First the easy-to-understand ones
- Dai is the base currency.
- It will only trade Dai versus other stablecoins.
And now the more complicated…
The algorithm within the target range
The algorithm in this contract would work differently from uniswaps ‘constant product’ system. Let’s assume that the Target Range is 1%, this means that we allow Dai to trade against USDC at between 0.99 and 1.01.
The price varies from 1:1 when the inventories are exactly equal, to 1:0.99 or 1:1.01 when the Variable Price Liquidity Percentage (VPLP) has been depleted. Within the target range, the price is set proportionally based on the amount of VPLP that has been used. Allow me to illustrate with some examples:
Say the VPLP is set at 20%, and we start with 1000 Dai and 1000 USDC within the liquidity pool (and that we’re ignoring the affect of trading fees.)
At 800 Dai, and 1200 USDC, the price of Dai is 1.010 USDC.
At 900 Dai, and 1100 USDC, the price of Dai is 1.005 USDC.
At 1000 Dai, and 1000 USDC, the price of Dai is 1.000 USDC.
At 1100 Dai and 900 USDC, the price of Dai is 0.995 USDC.
At 1200 Dai and 800 USDC, the price of Dai is 0.990 USDC.
Outside the target range
So what happens to the liquidity after we reach the edge of the target range? Answer: We stop changing the price.
In this contract the price is always within the bounds of the Target Range. After the Variable Liquidity Percentage is depleted, the price stops changing, remaining at 0.99 or 1.01 in our example above.
At this point, trades are still permitted at this price until the inventory for one token is completely depleted.
The effect of enforcing the Target Range is to provide a ‘buffer’ of Dai available at a certain price. Provided the contract holds significant liquidity, this buffer will hold the Dai price within the Target Range across the whole market by providing an arbitrage opportunity for traders. But only until the liquidity is entirely depleted.
MKR Token Holders have until the liquidity is depleted to adjust the Stability Fee or the DSR to fix the macro-scale supply/demand imbalance. Not only that, but the size of the contract inventory, and the speed at which the inventory is being depleted provides valuable information as to the magnitude of the required changes in the DCS parameters.
While the VLPL is depleted, the Stability Reward is re-directed to the liquidity providers. This helps to incentivize MKR Holders to maintain the macro-scale supply/demand balance within the Target Range and rewards liquidity providers to make up for the fact that they could be making more money by trading outside the Target Range in another market.
A few notes
- The more liquidity this contract contains, the more effective it is at stabilising the Dai price within the Target Range.
- We would need to make sure that the fee is competitive with uniswap from the perspective of liquidity providers. That said, this contract has an advantage over uniswap in that more liquidity is available for trade at a specific price point because we are not using the constant-product model.
- The higher the VLPL, the less each trade changes the price of Dai within the target range, however this comes at the cost of having a smaller ‘buffer’ once the VLPL is depleted.
- Setting of the Target Range and VLPL parameters can be done as part of MKR governance. An MVP version of this contract could allow a mutlisig to set these values. The Stability Reward should not be modifiable by MKR governance, it should be a fixed percentage of the Liquidity Reward and should change proportionally to the Liquidity reward.
Feedback is very welcome, it’s quite possible I’ve missed some terrible incentive misalignment. Going forward I think a system like this would be beneficial to stabilize the Dai price, but I lack the expertise to create it myself. If anyone with that expertise thinks likewise I’d love to discuss it further.
I also have no idea in which forum category this fits. I’ve put it in Governance just because.