Intro to MakerDAO: Stablecoin (Blockgeeks Part 2)
Welcome to the second part of our Guide on MakerDAO!
Intro to MakerDAO: Stablecoin (Blockgeeks Part 2)
In the Part 1 we explained to you:
- What Stablecoins are and why they are important?
- The different kinds of pegs.
- The obstacles that stablecoins face.
In this guide, we are going to talk about MakerDAO. However, before we do that, we need to take a look at Tether.
Well, firstly, it happens to be the most widely used stablecoin in the world, and it also happens to be extremely controversial. We feel that this will help provide a helpful contrast for MakerDAO.
So, let’s get into Tether!
What is Tether?
Tether (USDT) is a stablecoin that is Fiat collateralized.
Fiat collateralized stablecoins are the most straightforward way to create a stable currency. A certain amount of fiat currency is deposited as a collateral and coins are issued 1:1 against this fiat money.
Although this method is simple and robust, it requires a central party (custodian) which guarantees the issuance and redeemability of the stablecoin. Regular audits are needed to ensure that the stablecoin is indeed fully collateralized.
According to their website,
“Tether converts cash into digital currency, to anchor or “tether” the value of the coin to the price of national currencies like the US dollar, the Euro, and the Yen.”
Basically, each and every USDT is backed by an equivalent number of US dollars, meaning 1 USDT = 1 USD. (or EUR Yen etc.)
Being a stablecoin, the main purpose of Tether is to provide stability in the cryptomarket. It is an extremely simple way to get liquidity for crypto only exchanges like Bitfinex and Binance. The interesting part is that you can move your holdings in these exchanges to Tether. This will keep you safe from the usual temperamental crypto mood swings.
However, that’s not the only advantage.
Most exchanges like Binance and Bitfinex provide trading pairs with USDT. This pretty much allows you to buy crypto straight with your fiat currency. This complete negates the volatility you’d have faced if you used something like Bitcoin and Ether as the base currency.
However, turns out that not everything is rosy with Tether.
The Problems with Tether
There are many issues with Tether:
The people who run Tether are the same people who run Bitfinex. Since it is pegged to the US dollar, which is a centralized asset, there are concerns that it gives a lot of power to the Bitfinex team, which in turn centralizes the asset.
#2 Is the Peg Real?
A huge concern is the lack of transparency shown in the matter by Bitfinex/Tether. Think about this for a minute: The circulating supply for Tether is right now at 2,207,140,814 USDT, which means that it is pegged to 2,207,140,814 USD. $2.2 billion is a lot of money and people don’t believe that Bitfinex/Tether has that much money.
Plus, Bitfinex/Tether has explicitly stated that they are not going to revealing their bank details adding further fuel to the speculation.
Image Credit: Hackernoon
#3 BTC Price Manipulation?
One of the biggest problems of Tether is that they have been accused of “artificially propping” the value of bitcoin. This report closely studied the bitcoin prices for a set period of time and shows some pretty damning results:
- Firstly, they found out that the 50% of BTC total rise took place within 2 hours after a new delivery of Tethers.
- The report asserts that it is likely that Tether is being used to manipulate Bitcoin prices.
- 80% of Bitcoin’s current value might be derived from Tether-based price manipulation.
As can be seen, Tether has a lot of problems, which is why everyone wants a stablecoin which can be as easily accessible as Tether without having any of its flaws.
What is MakerDAO?
MakerDAO is the company behind the Dai stablecoin. Dai is valued at 1 USD, pretty much like Tether and, quite like Tether, it is unmineable as well.
However, that’s where the comparison ends. Dai is a crypto-collateralized as opposed to Tether. There are many things that one needs to go through to get their heads wrapped around how Dai works. However, before that, let’s meet the team!
The MakerDAO Team
MakerDAO is lead by Rune Christensen, its CEO and founder. He studied International Business from the Copenhagen Business School. Former Amazon software engineer Andy Milenius is the CTO of the company.
The team seems to be extremely committed towards the project and they have a healthy and thriving community as well.
A Tale of Two Tokens
Before we get into how Dai works, we need to know about the tokens. The Maker Platform has two coins: Makercoin (MKR) and Dai (DAI).
- Makercoin(MKR): This token is not a stablecoin. Its main purpose is to govern the Maker Platform.
- Dai (DAI): The stablecoin that is suitable for payments, savings, or collateral.
We will get into the details more in future sections.
Interacting with the MakerDAO Platform
So, now we get to the fun part. How do you actually get your hands on Dai? Now, remember, as we said before, Dai is a Crypto-Collateralized asset, meaning that you will need to leverage some of your crypto (Ethereum for now) and lock it up as collateral.
When you interact with the MakerDAO system, you lock up your Ether in a “collateralized debt position” or CDP for short. CDP is a “smart contract”, and the entire system works because of it. So, it makes sense to take a little detour and understand what a smart contract is and how it works before we continue any further.
What is a Smart Contract?
Smart contracts are how things get done in the Ethereum ecosystem. When someone wants to get a particular task done in Ethereum they initiate a smart contract with one or more people. Smart contracts are a series of instructions, written using the programming language “solidity”, which work on the basis of the IFTTT logic aka the IF-THIS-THEN-THAT logic. Basically, if the first set of instructions are done then execute the next function and after that the next and keep on repeating until you reach the end of the contract.
The best way to understand that is by imagining a vending machine. Each and every step that you take acts like a trigger for the next step to execute itself. It is kinda like the domino effect. So, let’s examine the steps that you will take while interacting with the vending machine:
Step 1: You give the vending machine some money.
Step 2: You punch in the button corresponding to the item that you want.
Step 3: The item comes out and you collect it.
Now look at all those steps and think about it. Will any of the steps work if the previous one wasn’t executed? Each and every one of those steps is directly related to the previous step. There is one more factor to think about, and it is an integral part of smart contracts. You see, in your entire interaction with the vending machine, you (the requestor) were solely working with the machine (the provider). There were absolutely no third parties involved.
So, now how would this transaction have looked like if it happened in the Ethereum network? Suppose you just bought something from a vending machine in the Ethereum network, how will the steps look like then?
Step 1: You give the vending machine some money and this gets recorded by all the nodes in the Ethereum network and the transaction gets updated in the ledger.
Step 2: You punch in the button corresponding to the item that you want and record of that gets updated in the Ethereum network and ledger.
Step 3: The item comes out and you collect it and this gets recorded by all the nodes and the ledger.
Every transaction that you go through the smart contracts will get recorded and updated by the network. What this does is that it keeps everyone involved with the contract accountable for their actions. It takes away human malice by making every action taken visible to the entire network
Tl;dr: Smart contracts are automated contracts. They are self-executing with specific instructions written on its code which get executed when certain conditions are made.
Ok, now let’s back to Dai.
Generating Dai via CDP
Users lock up their Ether in CDPs in the form of Pooled Ether (PETH). The CDP then generates Dai for the users while calculating interest on the pooled ether over time. This interest is known as “Stability Fee”. If a user wants to withdraw their ETH from the CDP then they will have to payback the equivalent amount of Dai.
Note: At first, Pooled Ether (PETH) will be the only collateral type accepted on Maker. After the Maker Platform is upgraded to support multiple collateral types, PETH will be removed and replaced by ETH alongside the other new collateral types.
Now remember what we said in the first part when it came to crypto collateralized stablecoins.
The peg used is a cryptocurrency and we all know that cryptocurrencies are unstable, unlike fiat currency (comparatively), so how does this system work?
The answer to that question is “over-collateralization.” So, if you want $100 worth of stablecoins then you will need to deposit $200 worth of ether. It is not a straightforward 1:1 ratio.
This is true with CDPs as well; they are always over-collateralized. We will see a working example of this later on.
Interacting with CDP
Interacting with CDP is a four step process. The content of the steps is taken straight from the Dai Whitepaper.
#1 Creating the CDP and Depositing Collateral
The CDP user first sends a transaction to Maker to create the CDP, and then sends another transaction to fund it with the amount and type of collateral that will be used to generate Dai. At this point the CDP is considered collateralized.
#2 Generating Dai from the Collateralized CDP
The CDP user then sends a transaction to retrieve the amount of Dai they want from the CDP, and in return the CDP accrues an equivalent amount of debt, locking them out of access to the collateral until the outstanding debt is paid.
#3 Paying down the debt and Stability Fee
When the user wants to retrieve their collateral, they have to pay down the debt in the CDP, plus the Stability fee that continuously accrue on the debt over time. The Stability Fee can only be paid in MKR. Once the user sends the requisite Dai and MKR to the CDP, paying down the debt and Stability Fee, the CDP becomes debt free.
#4 Withdrawing collateral and closing the CDP
With the Debt and Stability Fee paid down, the CDP user can freely retrieve all or some of their collateral back to their wallet by sending a transaction to Maker.
Risk Parameters for CDPs
CDPs have multiple Risk Parameters that enforces how they can be used. Let’s go through some of them.
- Debt Ceiling: Debt Ceiling is the maximum amount of debt that can be created by a single type of CDP. Once the ceiling has been reached by a CDP, it becomes impossible to create more unless existing CDPs are closed.
- Liquidation Ratio: Liquidation Ratio is simply the ration between collateral and debt, at which the CDP becomes vulnerable to Liquidation. Low Liquidation Ratio means low volatility and vice-versa.
- Stability Fee: Once a CDP is made, a stability fee is accrued over time. It is an annual percentage yield and needs to be paid by the CDP user. This can only be paid by MKR and the MKR is immediately burnt after it has been paid off.
- Penalty Ratio: If the liquidation mechanism is not efficient enough, the Penalty Ratio comes into play. It is used to determine the max amount of Dai raised from a Liquidation Auction. (More on this auction in the following section).
Let’s See an example of how this works:
The example and the diagrams have been taken from Gregory DiPrisco’s Medium article.
Let’s assume that Ether is worth $100. As mentioned before, CDP is always over-collateralized to make up for the crypto peg’s volatility. For this example, let’s assume that the collateralization ratio is 150%, meaning for $100 worth of ether you will get 66 Dai.
So, the ether that you have put up as collateral stays locked until you pay back the 66 Dai. When you pay back the Dai, the Dai tokens get burnt.
The following flow diagram shows you how this process takes place.
Image Credit: Medium.
How does the Price Remain Stable?
Now, there are two things that can happen which may fluctuate the value of 1 DAI away from $1. Those two are:
- The value of Ether goes down.
- Dai trades for more or less than target price.
Let’s look at both these cases.
#1 Value of Ether Goes Down
If the value of Ether goes down, then it is worth less than the Dai that it supposed to be backed by it. This would obviously make Dai lose its value which would collapse the stablecoin system.
In the event of such a scenario, Maker liquidates the CDPs by auctioning off the ether locked up inside it before it becomes less than the amount of Dai getting backed by it.
In simpler terms, if the CDP indicates that the value of Ether has gone below a certain threshold, say 125%, then the CDP is liquidated and the ether is auctioned off for Dai until there is enough Dai to pay back the initial value that was obtained from that CDP.
The following flow diagram shows how it works:
Image Credit: Medium.
#2 Dai Trades for > or < Target Price
The value of Dai goes >$1 when there is more demand for Dai and not enough supply. Conversely, its value goes <$1 when there is not enough demand and too much supply.
“Supply and Demand” is basic economics 101. More the demand and lesser the supply more will be the price of the product. The supply-demand graph looks sorta like this:
The sweet spot where both the curves intersect is the equilibrium
In situations like these Maker combats by utilizing Target Rate Feedback Mechanism. So then, how does Target Rate Feedback Mechanism (TRFM) work?
TRFM is a mechanism which adjusts the Target Rate in order to cause market forces to maintain the stability of the Dai price. During periods of severe instability, the TRFM kicks in. When that happens, the fixed peg of Dai breaks but it still maintains the same denomination.
The Target Rate determines the change of the Target price over time, in other words, during normal times when TRFM is not engaged, the target rate is fixed at 0%.
However, when TRFM is engaged, the Target Rate can determine the Target Price over time to either:
- Make it appealing enough to make users hold Dai.
- Make the users want to borrow more Dai.
Upon TRFM activation, the Target Rate and Target Price, according to the Dai whitepaper,
“change dynamically to balance the supply and demand of Dai by automatically adjusting user incentives for generating and holding Dai. The feedback mechanism pushes the market price of Dai towards the variable Target Price, dampening its volatility and providing real-time liquidity during demand shocks. “
So, let’s see what happens when market price of Dai is below and above the Target Price.
#1 When Dai < Target Price
When Dai below the target price the following happens:
- The Target Rate increases.
- This causes the Target Price to increase at a higher rate.
- This causes Dai generation via CDP to become more expensive.
- The increased target rate causes an increase in Dai demand.
- The combination of reduced supply and increased demand causes a rise in Dai’s prices pushing it towards the Target Price.
#2 When Dai > Target Price
In this case, the mechanism works in reverse.
- The Target Rate decreases.
- The Target Price decreases.
- Dai generation via CDP becomes cheap.
- Decreased rate causes decrease in Dai demand.
- The increased supply and reduced demand pushes the value down towards Target Price.
As the white paper puts it, “This mechanism is a negative feedback loop: Deviation away from the Target Price in one direction increases the force in the opposite direction.”
So, what determines the magnitude of this Target Rate change? The parameter that determines this is called the “Sensitivity Parameter”.
MKR holders set the Sensitivity Parameter when the market is normal, however, during times of crisis, the Target Price and Target Rate are determined by market dynamics.
Red Alert! The Global Settlement
If all else fails, the last resort is Global Settlement. It basically shuts down and unwinds the MakerDAO platform while making sure that all Dai holders and CDP users receive the net value of assets that they are entitled to.
The process is decentralized and only MKR holders can initiate it to make sure that this method is not exploited and only used during an extreme emergency. Examples of such emergencies are: long term market irrationality, hacking, system upgrades etc.
The Global Settlement follows three steps, according to the Dai whitepaper:
Step 1: Global Settlement is activated
If enough actors who have been designated as global settlers by Maker Governance believe that the system is subject to a serious attack, or if a global settlement is scheduled as part of a technical upgrade, they can active the Global Settlement function. This stops CDP creation and manipulation and freezes the Price Feed at a fixed value that is then used to process proportional claims for all users.
Step 2: Global Settlement claims are processed
After Global Settlement has been activated, a period of time is needed to allow keepers to process the proportional claims of all Dai and CDP holders based on the fixed feed value. After this processing is done, all Dai holders and CDP holders will be able to claim a fixed amount of ETH with their Dai and CDPs.
Step 3: Dai and CDP holders claim the collateral with their Dai and CDPs.
Each Dai and CDP holder can call a claim function on the Maker Platform to exchange their Dai and CDPs directly for a fixed amount of ETH that corresponds to the calculated value of their assets, based on the target price of Dai.
E.g. If the Dai Target Price is 1 U.S. Dollar, The ETH/USD Price is 200 and a user holds 1000 Dai when Global Settlement is activated, after the processing period they will be able to claim exactly 5 ETH from the Maker Platform. There is no time limit for when the final claim can be made.
We have heard a lot of MKR holders and MKR voters till now. Before we go any further let’s acquaint ourselves with the second token used in the Maker ecosystem, the MKR.
What is MKR?
MKR, in stark contrast to Dai, is not a stablecoin. It has a volatile price because of its role in the MakerDAO platform and its unique supply mechanics. There is a total supply of 1 billion MKR tokens in the platform. MKR can be used as both a utility token and a governance token.
MKR as a Utility Token
MKR is needed to pay the stability fees that are accrued on the CDPs that have been used to generate Dai. These fees can only be paid by MKR and as soon as the payment is done, the MKR paid is burnt completely removing it from supply.
What does that imply?
It implies that if the adoption and demand for Dai and CDPs increase, the demand for MKR will increase as well (because they will be required to pay the fees). Plus, since MKR is burnt the moment it is used, it decreases the overall supply of MKR as well.
MKR as a Governance Token
MKR holders can also vote in the Maker platform via the MKR tokens. One of the issues that they vote on is “Risk Management” which is crucial to the success of the platform. The voting is done on specific risk parameters for each collateral asset and CDP type. The risk parameters for CDP has already been discussed above.
The voting process for the governance is done through continuous approval voting. In simple terms, any MKR holder can vote for any number of proposals with the MKR that they they hold. They can also submit a new proposal or cast or withdraw their vote any time they want. The proposal with the maximum votes from MKR holders becomes the top proposal and can be activated to implemented any changes in the MakerDAO platform.
In an ideal case scenario, where the MKR holders are all highly competent, the CDPs will always remain over-collateralized.
However, to make the system trustless, there needs to be a contingency for worst case scenarios. It may be possible that parts of the collateral portfolio become under-collateralized.
When that happens, the MKR tokens trigger an “automatic recapitalization” through forced MKR dilution. What does that mean?
This means that the MakerDAO system automatically creates new MKR tokens and sells them on the market. This serves two purposes:
- Firstly, it brings in some much needed liquidity.
- Secondly, it punishes the MKR holders and voters for bad governance.
So, as we have mentioned before, the main focus of MKR governance is on Risk Management. Let’s look into it.
Risk Management of the MakerDAO Platform
MKR holders can vote on the following risk management factors:
- They can create a new CDP with a unique set of risk parameters.
- Modify the risk parameters of some existing CDP.
- Change the sensitivity of the Target Rate Feedback Mechanism (TRFM).
- Modify the Target Rate accordingly.
- Choose a set of trusted oracle nodes. We will get into what oracles are in the following section.
- Modify the price feed sensitivity.
- Choose the set of global settlers for global settlement.
External Actors in the MakerDAO Ecosystem
While MakerDAO is mostly based on a smart contract infrastructure, there are some external players in the ecosystem. Namely:
- Global Settlers.
Keepers are independent actors who are incentivized by profit opportunities to contribute to decentralized systems. They have two purposes:
- They participate in the Debt Auctions and Collateral Auctions when CDPs are liquidated.
- Keepers also profit from Dai trading.
Oracles perform a critical function in the Maker ecosystem. Real-time information about the market prices of assets to be used as collateral in CDPs is needed because it lets the platform know when to trigger liquidations.
Plus, the MakerDAO Platform needs info about the market price of Dai and its deviation from the Target Price in order to adjust the Target Rate IF TRFM needs to be triggered.
In order to take care of this, the MKR voters choose a set of trusted oracle to feed them real time information.
Global Settlement is the last line of defense that MakerDAO has. Global Settlers are actors chosen by the MKR voters who have the authority to trigger Global Settlement in crisis situations. Aside from this, they have no other purpose to serve in the ecosystem.
Risks with the MakerDAO Platform
No platform is perfect, and Maker also has some issue. Some of them are fairly obvious:
- Malicious Hacking Attempt: Since it is a smart contract platform, it will always be open to potential hacks.
- Complexity: As you may have guessed by now. The Maker platform is not really straightforward. New users may get overwhelmed and move on to something like Tether which is pretty straightforward to use even though it has numerous flaws.
- Irrational Market Actions: If the market acts irrationally for a long period of time then it can destroy the Maker system.
- Team Failure: While the Maker team is extremely good and has earned a lot of respect. You can never ever count out human error.
- Black Swan Event: The most interesting and grandiose (in a bad way) thing that can happen to Dai is a black swan event. Dai, right now at least, is pegged to Ethereum. If Ethereum goes through a severe crash and completely fails then it will obviously affect Dai as well.
In the first part of our guide, we have made it pretty clear as to why Stablecoins are required. There are many projects out there that seems to be giving an admirable solution, however, Dai seems to be most promising of the lot. MakerDAO is a brilliant team and its system is congruent with the spirit of decentralization. Let’s see how they develop further in the future. A well-crafted stablecoin could be the one thing that pushes cryptocurrency into mainstream adoption.