FEI/DAI PSM issues and solution

As you can see below, since the RageQuit (it seems), the price of FEI is below its peg. It is only 20-40bps below, not the end of the world, but not acceptable for a tier-1 stablecoin (FRAX and MIM are far better on that front, always within 10bps deviation over the last month).

It is also expected to decrease the fees from 50bps to 25bps. This would be welcome, but in the current shape, this will lead to an arbitrage opportunity that will burn Tribe Treasury.

Here is for instance Chainlink prices on December 28th, you can see that there is a 42bps drop in price. This allows getting more DAI per FEI.

This doesn’t seem to be a Chainlink issue as it reports a price coherent with coinmarketcap. This fluctuation represents secondary markets imbalance and not the price of DAI. As an argument, the price of USDC is way more stable (by one order of magnitude) and, during the whole period, the MakerDAO USDC PSM allowed to convert DAI <-> USDC with no fees.

Since the implementation, this issue was protected by the 50bps fees. Nevertheless, with 25bps it would have made FEI redemption provide more than 1 DAI/FEI.

It is thanks to this “issue” that the price of FEI is not lower as flashbots exploited the DAI price “issue” to arbitrage. Obviously, nothing prevents the issue to be above the 50bps fees in the future.

Moreover, there is evidence that some FEI users are using the PSM interface when it is not giving the best price (which is most of the time).

I would suggest the following actions:

  • Decreases the PSM fees to 25bps
  • Reduce the allowed range for the DAI price from 0.9975 to 1.0025. This would remove any issue as fees will always be greater than any accepted deviation. Most of the time, Chainlink DAI price is within this range.
  • Remove the mint/redeem interface or integrate Uniswap pools on it. This would avoid providing bad prices to our customers.

The result would lead to a 30bps max peg deviation on DAI/FEI Uni v3 LP and 35bps on USDC/FEI Uni v3 LP (but lower in reality due to the Chainlink price fluctuation). It is in line with the Gelato LP range so maximizing their capital utilization.

Alternatively, we could use lower fees on the PSM to get a better peg, but I think this should be a second step if no issue is seen.

1 Like

hi

thanks for looking at this

the fei-dai psm started at 50 basis points only to verify that it was working properly

yes this should happen sooner rather than later

the fei-dai psm already uses a chainlink oracle to compute the amount of dai given/received instead of trading them 1:1. I think this should take care of a lot of the problem youre referencing

additionally there will always be a problem of people frontrunning whatever latency there is in the chainlink oracle updates, but the fei-dai psm will suffer significantly less from this issue than the eth-based redemption mechanism that it has replaced. this is because dai is stable and so the oracle updates are typically much smaller and thus present a smaller opportunity for frontrunning. this is also not a problem that can be solved by limiting the trading range based on DAI price, because doing so also depends on the chainlink oracle. finally it’s important to mention out that the fei-dai psm is ratelimited which limits the blast radius of an errant chainlink oracle

I dont know if I fully grasp the point youre making so lmk if these factors do not address it

I agree that if would be nice for the UI to be expanded here. in a perfect world maybe showing the fei price on all the major dex pools. I think it’s fine to leave it mostly as is if it showed a table above or to the side with the fei price on all these other pools so that people realize they have options. providing an interface to trade on all of these other pools might be out of scope though

Are you saying that we should introduce lower and upper bounds on the DAI/FEI exchange rate? This could guard against a faulty oracle leading to bad trades for the protocol. On the other hand, this could be detrimental if DAI actually goes outside the range.

1 Like

Thanks for your answer

Actually, the use of the Chainlink Oracle is the issue.

You can check this transaction : Ethereum Transaction Hash (Txhash) Details | Etherscan . The DAI price used was 0.9991 after the 50bps fees. With 25bps fees it would have been 1 DAI = 1.0016 FEI.

The actual Chainlink Oracle price was DAI = $1.0041, there is no evidence on that on-chain using USDC as reference. DAI was always $1 +/- trading fees (1 or 5bps). Chainlink is probably giving a good price overall (CeFi), but not on Ethereum DeFi.

With less than 41bps fees (what we expect to have) it would have been a loss for Fei Protocol. I agree, it’s not big, but it’s a useless loss that will be exploited over time. WIth 25bps fees, it would have been a 40k loss on December 28th (and an additional similar amount on non-earned fees).

Here are the details, you can see that it happened twice on December 28th.

The solution I propose is assuming we keep the same smart contract. To @fei.saver point, I think it would still work >95% of the time (as usually Chainlink price is within the narrow range, and the flashbots are never sleeping anyway). There are better ways to enable it to work all the time and provide more revenue for the protocol (and still protecting if there is an actual oracle or DAI issue), but I’m not sure it is worth the time to make a new contract.

It seems that all the good trades on the PSM are made by flashbots and all the bad by humans.

2 Likes