Maker DAO & DAI

What is DAI?

DAI is a collateral backed cryptocurrency that lives completely on the blockchain and does not rely on any mediator to insure its stability and peg relative to the US Dollar. DAI is backed by collateral which is locked into audited and publicly available smart contracts.

How is DAI generated?

Maker uses a series of smart contracts deployed on the mainnet to back the value of the DAI stablecoin through a system of Collateralized Debt Positions (CDPs), feedback mechanisms and trusted third parties. It allows anyone to leverage ETH holdings to generate DAI stablecoins.

Users that want to create DAI first open a CDP and then deposit ETH in the Maker CDP smart contract.

Technically it’s not ETH that is deposited, but PETH, or Pooled Ether. First of all, ETH is turned into WETH, or Wrapped Ether, which is essentially an ERC20 token that is minted 1:1 for ETH. Afterwards PETH basically acts as a share of a ‘pool of ETH’ — you deposit ETH, and get a share that you can redeem for the amount of ETH received. It’s worth noting that unlike ETH to WETH, ETH to PETH conversion rates are not 1:1. Currently 1 PETH = 1.04 ETH — the reason behind this will be made clear a bit later.

The amount of DAI that the user creates relative to the ETH it deposited is called the collateralization ratio. For example, if the collateralization ratio is 200%, and 1 ETH is worth 1000$ — when depositing 1 ETH to the collateralization contract, a user would be able to create 500 DAI. That 1 ETH is no longer in the user’s control — until the 500 DAI loan is paid back, the CDP is closed, and the DAI burned.

If the value of ETH fluctuates and the ETH value in the CDP drops enough that it gets close to the collateralization ratio — it runs the risk of entering liquidation. However, users have mechanisms at their disposal that lets them add more collateral, unless the CDP is already in liquidation. The opposite is also true — and in the case of ETH appreciation that brings the collateralization ratio even higher — users have 2 options at their disposal. They can either issue fresh DAI based on the same collateral, or withdraw part of that collateralized ETH. Users can also transfer ownership of CDPs, pay back all the debt or close their account entirely.

However, when the collateral value for a CDP drops below the collateralization ratio, and the user doesn’t lock up more ETH — that CDP gets liquidated. When this happens, it is acquired by the system, and the CDP owner receives the value of the leftover collateral minus the debt, Stability Fee and Liquidation Penalty.

The PETH collateral is then offered for sale at a discount, which can be bought using DAI, until an amount equal to the CDP debt has been removed. If any DAI is paid in excess, the excess is used to purchase PETH from the market and burn it, which positively changes the ETH to PETH ratio (hence 1 PETH = 1.04 WETH = 1.04 ETH) .

A CDPs lifecycle is defined in 6 stages (according to the purple paper)

Fig.3 — The 6 stages in a CDPs lifecycle

Some implications:

Collateral-increasing actions are allowed until Grief.

To draw is only allowed during Pride, while free is also allowed during Anger.

To give\ transfers ownership of a CDP. is allowed at any time, including during liquidation.

Each of the liquidation actions corresponds to its own stage.

Risk Management: The MKR token. MKR is an ERC-20 token which is created/destroyed in response to DAI price fluctuations in order to keep it hovering around $1 USD. Aside from being used to pay the stability fees on the system, the holders of the MKR token are responsible for voting on performing a number of risk management actions. They can add or modify existing CDP types (currently only single collateral CDPs), change the DAI savings rate (unused currently — a part of the switch to multi-collateral CDPs), choose the set of oracles that help determine accurate collateral prices (properly incentivized external actors which report prices), choose a set of emergency oracles which have the ability to trigger an Emergency Shutdown, and finally, the voters can instantly trigger Emergency shutdown themselves if enough voters deem it necessary (Emergency Shutdown is the mechanism used in case (Emergency Shutdowns can occur due to technical updates or if the system is subject to a serious attack it can be used to mitigate that).

Fig.4 — The maker community by March 12

Above is showing by March 12, how the user community around Maker Collateral Pool look like. Green nodes are all the external accounts created CDPs and deposited into the liquidity pool. Some of them communicated through proxy contracts (blue nodes) and exchanged ETH for WETH first, and then deposited WETH into Maker SaiTub, while some of them sent WETH directly towards the Maker (green nodes around it). The total WETH volume makes up the total amount of ETH once locked up in Maker, which is ~2 million ETH by then. (*2% of total ETH supply and ~89% out of 6 major defi projects*)