What is DAI, and how does it work?

As long as huge price fluctuations plague the ecosystem, cryptocurrency could never be globally adopted as a currency for everyday real life transactions.

Sharon Manrique
Feb 7, 2019 · 9 min read

This is a brief overview of how MakerDAO and Dai works. There are many intricacies to the system, but I believe these are the main mechanisms in place if one wants a brief overview of how Maker gives Dai its stablecoin properties.

Even though cryptocurrency has progressed significantly since its inception, a few crucial problems are blocking its adoption as a real-world currency. One problem being: price fluctuations of a single coin can drastically change in a day, let alone an hour. Could you imagine having USD or CAD fluctuate hundreds, maybe thousands of dollars in an hour while you are trying to pay rent or buy groceries? You could go from having the appropriate amount of USD for rent of $1200, then suddenly it is now worth $900 dollars.

Image for post
Image for post
The swings of the market

Cryptocurrency saw a significant boost in popularity during the bull run of 2017. This caused a lot of hype and fear-of-missing-out to sweep across investors, creating a domino effect of other investors buying in as the price of many cryptocurrencies skyrocketed— which only helped boost prices even higher. However, what goes up must come down. The market started falling rapidly during the early months of 2018 as investors became weary of the current valuations of cryptocurrencies, and most of them weren’t exactly sure what they were getting themselves into. There is a small percentage of investors who buy into cryptocurrency due to its technological fundamentals, but it is not enough to change the current trend of pure-hype investment. Imagine if investing in cryptocurrency could guarantee steady returns, offered minimal risk of losing your initial investment, and helped make history by supporting a technology that you believed could make a difference in the world. And for those who enjoy riding the highs and lows of the cryptocurrency market, you could still participate in high-risk, high-reward endeavours while your initial investment was safe.

The Collateralized Debt Position (CDP) is a financial cryptocurrency concept that has been in development since 2014 by the MakerDAO project, which offers a possible solution to the high volatility that cryptocurrency faces today through the stablecoin known as Dai. A stablecoin is a cryptocurrency that is pegged to another stable asset. Pegging is the practice of fixing the exchange rate of one currency to the value of another currency. In this case, the Dai stablecoin is pegged to the US dollar. Having a stablecoin opens up many new financial possibilities for this burgeoning sector that were not possible before due to volatility. Not only does Dai offer stabilization, but is also offers transparency and decentralization, since it is built on top of the Ethereum network.

Image for post
Image for post
This is why it’s called a stablecoin and not an unstablecoin

Now, back to CDPs. There are many mechanisms in place that ensure that Dai stays relative to the US dollar. Maker offers a smart contract platform on the Ethereum blockchain that backs and stabilizes Dai through a series of dynamic feedback systems called CDPs, which also help to facilitate an efficient decentralized margin trading platform. With a CDP, a user deposits an asset into a smart contract as collateral for a loan. Once the CDP holds the assets deposited by a user, the user can then generate the equivalent USD value in Dai that they wish to borrow. Users can then do anything they want with Dai, just like any other cryptocurrency. They can trade Dai, use it for payments, or even use it as a personal savings account — there are no restrictions to using Dai, it can be use the same way you would use any other cryptocurrency.

Image for post
Image for post

Since Dai is pegged to the US dollar, you will always only owe back what you initially borrowed in addition to interest. For example, let’s say you deposit 2 ETH (at moment of writing, ETH is worth $105 USD) into a CDP and borrow 100 Dai: You would have to pay 100 Dai back plus accumulated interest, and you get back your full 2 ETH. Currently, there are other systems you can use to borrow other non-stable coins, but with the current market volatility, you could end up owing twice as much as your initial investment. Let’s say you deposited 10 AssetCoins, and then generated 100 NonStableCoin(NSC) to be borrowed at their current market price of $2 USD. If the price of NSC has dropped to $1 USD when you go back to repay the loan, you would now owe 200 NSC plus accumulated interest. As you can see, this is a great benefit for any investor: what you owe will always be clear and certain.

Image for post
Image for post

In another example, let’s say you want to invest in the very high-risk AmazingICO(AICO) but you do not want to send in your ETH and potentially lose it all. You could deposit 10 ETH into a CDP (at time of writing, that is $1050 USD), generate the equivalent in Dai, and then send that 1050 Dai to the AICO. Let’s say AICO crashes and you want to cut your losses, so you sell AICO back into Dai, but now you only have $800 worth of Dai. Good news though! You still have your 10 ETH safe in a CDP. In order to retrieve your ETH, you would have to find a way to recuperate the $250 USD to pay off your loan plus interest, but you’re happy that you didn’t lose ETH since while you were waiting for your ICO to increase in value, the price of ETH has been skyrocketing, so now your 10 ETH is now worth $2100! That was enough to offset your losses in AICO.

Image for post
Image for post

Imagine if instead of setting up a CDP, you actually sent in ETH to AICO, you could have lost 2 ETH, which would have meant losing $420. Setting up a CDP and using Dai as your method of investment can be the difference between either doubling your loses or doubling your profits. Of course, there will always be risk with investments, so you must be diligent in your research and strategies.

The deposited assets inside a CDP can only be retrieved once the user has paid back the same amount of Dai that they initially borrowed. However, generating the initial CDP to borrow Dai also accrues interest, so the user must pay back the Dai they borrowed plus generated interest to retrieve their assets. Active CDPs must always hold a higher collateral value than the value of debt the user has. Otherwise, CDPs that hold less value in collateral than they do in debt might be at risk to be liquidated and sold off.

Dai initially launched with support for only one collateral, which was Pooled Ether, also known as PETH. In order for users to obtain PETH to use as collateral for a CDP, they first had to deposit their ETH into a smart contract that pools ETH, which then gave them the equivalent amount in PETH. The purpose of using Pooled ETH was so that if the market for ETH crashed, the CDP would be able to retain a higher value of collateral than debt. If ETH crashed, the debt in a CDP would be worth more than the collateral held. Maker would then have the ability to recapitalize the market by automatically decreasing the supply of PETH, which would increase demand and, in turn, increase the price of Dai. This then increases the value of the collateral in a CDP and decreases the overall value of debt.

Maker is able to make Dai a Stablecoin due to its Target Rate Feedback Mechanism (TRFM). The TRFM is an automatic mechanism that the Dai Stablecoin System employs in order to maintain stability. The Target Price of 1 Dai is $1 USD, so the Target Rate determines the needed change of price of Dai over time in order to reach the Target Price during a market swing. However, when the TRFM engages, the fixed peg ratio of 1 DAI to $1 USD breaks, but it is required in order to get the price of Dai back to where it needs to be. For example, if the Target Price of Dai is below $1 USD, the TRFM increases so that it can push the price of Dai back up. This causes the price of Dai to increase, which then causes the generation of Dai through CDPs to become more expensive.

Simultaneously, this also causes users who hold Dai to gain profit, leading to an increase in demand for Dai. The combination of increased demand for the coin causes a reduced supply of Dai in the market, as users lower the supply of Dai as they borrow it through CDPs and buy from the market, they cause the price of Dai to be pushed back up to its Target Price.

Image for post
Image for post

The TRFM and Target Rate are determined by market supply and demand dynamics. However, Maker voters can also set the Sensitivity Parameter of the TRFM. The Sensitivity Parameter determines how mild or severe the response of the Target Rate Feedback Mechanism should be when the Target Price of Dai has deviated from where it should be. For example, if the Sensitivity Parameter is defined as “10% in 15 minutes” by Maker voters, then the Target Rate cannot change the price of the market by more than 10% within a span of 15 minutes. This means that the maximum hourly change in price of Dai that the TRFM can make is 40% from where Dai was at the beginning of the hour. This restriction ensures that there is enough time to trigger a global settlement in the event that an attacker gains control over a majority of the oracles. The Sensitivity Parameter is set by Maker Voters so that if the Oracles were ever hacked, Maker Voters would be able could set the Sensitivity Parameter as low as possible to limit the speed of which the price of Dai could change, which would give the network enough time to trigger a global settlement.

The Maker Platform requires real-time information to be fed into the system in order for the autonomous procedure to work properly. This ensures that collaterals in CDPs are worth more than the debt accrued in them; if not, TRFM kick’s in to level the price of Dai. Maker always wants the collateralized assets to be worth more than the debt incurred by users. The protocol can liquidate CDPs if the collateralized assets within them are deemed to be “risky.” In this case, liquidating them would ensure that the CDP can cut its losses. The Maker Platform also requires oracles to relay real-time information to the system about market price in order to adjust the Target Rate when TRFM is engaged.

Image for post
Image for post

A Global Settlement is a last resort process to guarantee the Target Price to the holders of Dai. When a Global Settlement is triggered, it shuts down the system. This means that holders of Dai and CDP users receive the net value of assets that they are entitled to. The process is fully decentralized and Maker voters govern the access to it in the case of an emergency.

Oracles and Global Settlers are known as Key External Actors that help keep Dai’s price stable. They are external actors since they do not live within the protocol but, rather, live around it to help keep Dai safe. Another type of Key External Actor are Keepers. Keepers are usually automated and independent actors who are incentivized by profitable opportunities to contribute to decentralized systems. Keepers can also make profit trading Dai; when the market price of Dai is higher than Target Price, keepers sell to increase supply and decrease demand, which lowers the price of Dai back to its Target Price. Keepers also buy Dai when the price is below $1 USD to lower supply, which increases demand for the coin, in turn helping push Dai’s price back up to where it needs to be.

As any company would, Maker strives to ensure that the operation of this system is as secure as possible, but there are always potential risks. However, Maker is consistently developing new ways to benefit the community and perfect its stablecoin system. Maker addresses a crucial problem in today’s Ethereum ecosystem: The price of cryptocurrency is too volatile to be today’s everyday currency.


Big thanks to Luker @MyCrypto for helping me edit. :D


The Official MyCrypto Blog

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store