Sitemap
Zengo Wallet

A blog about the Zengo Wallet, security, and cryptography

Dai another day

--

On the week of March 12th 2020, the Dai token had experienced a major crisis, to the point that some feared it might not survive. Today, we explore the reasons for this crisis and its aftermath.

What is Dai

In a world of highly volatile crypto currencies, having a low volatility (“stable”) currency is a desired goal for many use-cases, such as payments and remittances. While most stable currencies achieve that feature by backing each token with a fiat currency (most known is Tether’s USDT), MakerDAO and the Dai token are a decentralized system to achieve stability with game-theory algorithmics. The MakerDao protocol provides incentives for its users to always keep Dai’s value at one USD. When the price goes above one USD, there are incentives to sell Dai and vice versa.

Dai is generated when a user locks some Eth in a “vault”, implemented with an Ethereum smart contract, as a collateral. Vault owners must keep the value of the locked Eth at a minimum of 150% of the generated Dai. To make sure the system always stays overcollateralized, there is a strong incentive for vault owners to uphold this ratio when prices change, either by adding more Eth or repaying the borrowed Dai when getting close to the threshold.

MakerDAO liquidation system

Liquidation is a common practice in DeFi systems involving collaterals. When vault owners fail to maintain the desired collateral to debt ratio by themselves, others must do it to keep the system stable.

For example, in Compound, liquidators compete over who is going to issue the liquidation order first. The fastest liquidator wins and receives a fixed reward for the liquidation.

ZenGo’s white paper on Compound’s liquidation.

In contrast, MakerDAO applies a different method. Once a vault becomes eligible for liquidation, actors known as Keepers, compete in auctions, bidding increasing prices of Dai for the collateral. The winning bid is used to repay the outstanding debt. The collateral is paid to the winning keeper, with the leftovers repaid to the vault owner.

March 12th “Black Thursday” events

In case Eth prices fall dramatically, many vault holders can suddenly find themselves at risk of liquidation, without the means to keep up their collateralization ratio. That is exactly what happened last week.

On March 12th, Eth saw a drop in price of nearly 30% in a span of a few hours.This instantly made many vaults eligible for liquidation, as the Eth collateral value dropped, causing the collateral to debt ratio to go below the liquidation threshold.

Ethereum Price on March 12th (Source: kitco.com)

The sharp fall created a perfect storm:

  1. Many liquidation opportunities were created in a short period of time, creating many lucrative liquidation opportunities on one hand, but generating a liquidity problem for Dai. Since all bids must be paid in Dai, keepers were not able to obtain enough Dai to participate in all the liquidation auctions.
  2. The sudden fall in price created network congestion across the Ethereum blockchain and brought a spike in Ethereum’s Gas prices. This made it difficult for keepers to broadcast their bids and successfully compete in auctions.
Ethereum Gas Prices in Gwei (Source: ycharts.com)

As a result, many honest keepers were not able to participate in auctions, giving room for others to take advantage of the situation. And indeed some parties were able to send bids of 0 Dai to successfully win Dai liquidation auctions and receive Eth for free!

0 Dai were paid for 50 Eth( Source: defiexplore)

Some of this losses were absorbed by vault owners, receiving 0 Eth of their collateral back after liquidation, and about $4M were translated into MakerDAO system debt.

The MakerDAO went from a $500K surplus to a 4M$ debt that needs to be filled.

0 DAI liquidations happend A LOT
Multiple “free” liquidations (source: defiexplore )

This also caused a spike in Dai price, as many vault owners were seeking to close their position and retrieve their collateral. Dai prices were as high as $1.1, 11% off its target.

Mitigation

The MakerDAO community has acknowledged the problem as is taking measures to stabilize the system.

Some steps have already been taken. To fix the debt problem, an auction will be held, where MKR tokens are minted and sold to the public. Income from this sell will be used to cover the system debt.

To make sure this does not happen again, suggestions include increasing the auction to allow keepers to overcome network congestion.

In addition, USDC was added as an optional source of collateral to allow keepers easier access to Dai liquidity in similar circumstances.

What happens next?

If everything goes according to plan, the system should stabilize, Dai prices should return to peg, and the MKR auction should cover the system debt.

If this fails to happen, the MakerDAO community can choose to trigger an Emergency Shutdown. In an event of Emergency Shutdown, the protocol for creating Dai will freeze, and Dai will become pegged to the price of Eth at the point the shutdown was triggered. Dai will then become a volatile asset.

All locked Eth will be available for recovery by both vault owners and Dai holders. Each should be able to receive their proportional value. Since the system is currently in debt, all Dai holders will practically get a haircut on their holdings, upon recovery of their owed Eth. This is an extreme solution and a new territory. This solution has never been tested in the wild before and could be an extreme stress test of the Dai ecosystem.

Closing remarks

Although unfortunate, the protocol and its governance mechanisms were able to eventually save the Dai token under extreme conditions. System debt and the auction to close this debt were covered in the MakerDAO white paper are valid courses of action for exactly these situations.

on the matter

MakerDAO’s liquidation system proved to be problematic. The system already uses price oracles to determine when a vault is eligible for liquidation, but these price oracles are not used during the liquidation auction itself. As it often happens complexity is the enemy of security and the complex auction process proved to be more prone to attacks, compared to a more simple model such as Compound’s, in which the liquidation rewards and penalties are well known in advance.

For now, it seems the price of Dai has been getting closer to the target $1 peg, but no one can tell how the new measures will affect the system, and whether the market turmoil will return to cause more havoc.

--

--

Zengo Wallet
Zengo Wallet

Published in Zengo Wallet

A blog about the Zengo Wallet, security, and cryptography

Alex Manuskin
Alex Manuskin

Written by Alex Manuskin

Open source | Blockchain | Making cool things work

No responses yet