MIP29 - Peg Stability Module

Haha I figured as a technical MIP I would keep it technical. It will do exactly what was described in the pre-mip discussion. You can trade between dai and usdc/tusd/etc at 1:1 for a fee provided there is liquidity. You can picture it like the sai-dai bridge but with fees.

2 Likes

In the present market 1 DAI = 1.01 USDC.
Maker has approved the collateral type USDC-PSM as per MIP29.
Bob the whale has 1 million USDC and heads to Oasis.app.
Bob puts 1 million USDC into USDC-PSM and gets 1 million DAI as per MIP29. Bob happy as it is the cheapest DAI in the market.

is this a correct ELI5 version?

Pretty much except you probably don’t want the fees at exactly 0%, so Bob will get some fraction of 1 million Dai.

So let’s say Bob gets 1 million DAI minus 2x gas fees as we want the spread real tight. Is this approximately correct? Still a lot better than 1.01 spread currently.

The fees are a percent of the transaction amount and don’t have anything to do with gas. They can be whatever we want. If they are 1% then it will be roughly the same as the current stablecoin vaults but with no stability fee.

…story of Bob the whale continues…

Bob takes his DAI, does his thing and then wants his USDC back. He takes 1 million DAI (minus some fees) and starts looking around.
Bob could go to Oasis, but why? If the market peg is not 1:1 there is a better deal elsewhere.
Bob uses some other market, maybe Curve. Bob gets 1010000 USDC (minus fees) as the peg is still 1 DAI = 1.01 USD.
Bob heads over to Oasis again. Rinse and repeat.

edit: is this ELI5 still correct?

The ELI5 is more like:

You want DAI?, I give it to you for 1.01 USDC.
You want USDC? I give it to you for 1.00 DAI if I still have some USDC left from step above.

Parameters can change, but let’s start with the current state.

3 Likes

@Planet_X and all interested: it might be interesting (surely it was for me, @hexonaut kindly pointed it to me) to read the pre-MIP thread: here.

What we can do now is discuss (energetically!) on how:

  1. Properly reward @hexonaut for the code/community contribution. This is extremely important and should be rewarded as such.
  2. Approve some spending of the surplus to pay for third parties (Trail of bits, bounties, etc) to verify the code. We want this as quickly as possible. But at the time we need ultra-safe code. We will have to pay good money to have both of these things.
  3. While the verification (and perhaps code optimisations) are performed, we need to discuss a roadmap to how launch this PSM (for USDC first): What ceiling and what fixed-fees do we want?

This is very exciting. Thanks again @hexonaut.

6 Likes

This is not how I read this MIP. Goal is 1:1 trading, adjusted by fees.
If the fees are indeed 1% this means MIP29 can not help the peg inside the 0.99-1.01 range.
Am I correct?

Edit: outside corrected to inside

1 Like

If the fees both ways are set to 1% it will enforce a hard limit of 0.99-1.01 provided there is debt ceiling room or usdc available because it’s free money otherwise. There are a number of other benefits outlined in the pre-mip though.

1 Like

Does this contract have a enable/disable switch? We definitely want to disable it when the DAI savings rate (DSR) is greater than zero, yes? Maybe it should have a switch for each direction so we can set it to drain DAI liquidity in preparation to increase the DSR above zero.

Hm, can the switch be locked to the condition DSR!=0?

1 Like

It’s a parameter, I used tin at 1% and tout at 0%. I find this solution strictly superior to USDC-A so I don’t want to give the impression that we need to narrow the peg band more that what is currently done.

It can, but it’s not mandatory.

3 Likes

It has all the same controls as a regular vault type. We can turn off minting dai by setting the dc to 0. We cannot turn it off the other way though and we should let it drain first before turning on the dsr (same with usdc-a, etc).

3 Likes

Looks good
Thanks.

That is important :

1 Like

MIP14 allows you to do this, but you need to know specifically where you are sending the DAI. In terms of actually engaging auditors, you’d probably want to approach them and secure an agreement for work provided that DAI is paid upfront.

In terms of using it for bounties, this is currently possible, again, you just need a recipient address.

I’d largely agree with some of the others and say that the first step should be replicating the current stable-coin vault types in terms of fees. The ceiling should probably start low to limit risk.

2 Likes

Thanks LFW. Yesterday in MakerDAO’s chat, @hexonaut said:

So let’s wait a few days to see how this thing evolves. Ideally, the Smart contract team can give us indications on the necessity or not of 3rd party audits and stuff like that.

2 Likes

Awesome work - so glad to see progress on this

Some basic questions.

Is tin and tout in this design expected to be managed by governance or just set and left alone? I can’t imagine these are fixed values because then this part of the code would have to be redeployed on changes to tin/tout?!

Are tin and tout always expected to be above 0 and hence PEG always bracket 1-tout <= PEG <= 1+tin?

What is a scenario where this module actually causes the PEG to regulate around 1? (i.e. what are the tin and tout settings in this scenario and why is the PEG at 1 vs 1+tin and how much stablecoin liquidity is there in the PSM at this time).

Correct me if I am wrong in the understanding here.

with tin = 1% and tout=0. Lets say a user comes to the PSM and wants to swap 1010USDC for 1000 DAI. My understanding of the above code is the contract basically creates a vault and deposits 1010 USDC and mints 1010DAI. 1000 goes back to the USDC depositor and 10DAI goes into the surplus?

What happens in the above code if say for some reason USDC is trading at .985 US while DAI is trading at $1+tin for sake of illustration.

  • In the above example: What is to stop the system from minting 1000 DAI worth (1000+tin*1000)USD for 1000 USDC that is worth only $985US?
  • If there is something that stops the above, how does the price in USD of the stablecoin being converted relate to how much DAI the user gets and is this displayed in the User Interface to the PSM?

I think I disagree with the bolded part of the quote below:

I don’t see how a fixed tin and tout value causes any work other than to act as a pricing bracket at 1-tin as long as there is stablecoin liquidity in the PSM, and 1+tout as long as there is available DAI DC. As @LongForWisdom repeatedly points out without liquidity on either end here the facility ceases to regulate.

What is the backup PEG regulation if the PSM runs out of liquidity?

On the PEG downside everyone feels like stablecoin liquidity will exhaust rather rapidly and Maker has SF and DSR to cause the PEG to rise back to 1. But do we really give up our stablecoin PEG liquidity buffer at 1 PEG price or do we perhaps lower the 1-tout down to .99 and use the stablecoin liquidity in that case to act as a price stabilizer on the low side?

On the PEG highside is there going to be another facility that is available in case the PSM DC exhausts before governance can extend it?

Also on first glance there is no rate control on this. Literally someone could come and eat all of the available liqudiity in one shot (think flash loan here that costs tin% for the entire available DC), killing the PSMs ability to manage the PEG for some time (GSM delay to extend DC?!). Is the DC alone the best way to control capital flows into and out of this facility or should the rate of flow be controlled to some extent.

Looking at this proposal it really just looks like another variation of a USDC vault except fees are taken out up front. I have concerns over how the USD price of stablecoins minting DAI will be managed against the USD PEG price of DAI and what happens here if the collateral value in USD happens to drop below $1 as this will negative affect 1:1 collateral:DAI backing collateral value.

Notice during an ES these USD price oracles on collateral and DAI would be taken into account in normal vault claiming left over collateral… With the PSM the oracle price, if it is considered at all, is only at the time the exchange is made(we don’t care what the price of USDC does because we simply are not going to liquidate positions).
I think this adds an extra hazard for DAI holders in terms of collateral backing. Even at LR of 101 on USDC vaults with SF = 0 if USDC were to drop to what .99 with PEG at 1.01 or higher (for some reason) pretty much puts DAI holders in an ES short some collateral value.

The whole backing value was one of the main reasons I really wasn’t hot to go to LR of 101 on USDC-A with liquidations off mostly because one is limiting the collateral value buffer to only a 1% USD price change on the collateral (.99). If I my understanding is correct the PSM here is no longer has such a collateral USD value buffer as DAI is minted for stablecoins at 1:1 with profit immediately going into the surplus.

1 Like

These can be changed after deployment by governance.

It’s up to governance how they want to set these. It’s possible to leave one or both of them at 0% depending on the size of the debt ceiling. I’m guessing we probably won’t want to set the fees both to 0% as your bracket equation is correct as long as there is debt ceiling or liquidity available to go either way.

This is correct.

This is essentially the case where Dai is trading above $1.01 USDC (not USD). In this case free money is available, and the price will be arbitraged until it reaches $1.01 again (or the debt ceiling is reached).

Yes this would be more against short term price shocks in the other way. Definitely if we sustain a price of < $1 the PSM will clear out quickly and we need to move onto Stability Fee price regulation after that same as before. That being said, this is the case where the tout is set to ~0%. We could increase that if we want to maintain a pool of USDC for extreme price shocks in the other direction. These are all options available that need to be discussed. It’s not really my place to comment on what the fees will be. I’m just putting the code out there.

2 Likes

Note: I’ve updated the design to put the PSM on the other side of the join adapter. Will update the MIP to match shortly.

EDIT: Updated to the new design.

1 Like