Maker and Dai — The Banana Paper

Michael Bogan
Jun 21, 2018 · 15 min read
https://makerdao.com/

This article is one in a series of my 🍌Banana Papers— blockchain whitepapers re-written in an easy to digest (like bananas!) manner. My goal is to help readers quickly understand and evaluate complex blockchain ideas with minimal pain.

Today we’ll take a look at Maker—one of the most prominent (and complicated) stablecoin projects in the ecosystem. Maker has great backing from Polychain Capital, Andreesson Horowitz, and others.

(Note: this is a rather long Banana Paper, which sort of goes against the principles of what I’m trying to do. But there are several pieces of important background information that are key to understanding Maker, so I spend a little time explaining these, namely stablecoins and margin trading. If you already understand these concepts, you can safely skip those sections.)


Maker and Dai — The Easy Explanation

Maker is a smart contract platform that generates, manages, and stabilizes Dai — a cryptocurrency stablecoin.

The Maker platform — through a financial instrument known as a CDP (Collateralized Debt Position) — allows users to borrow Dai against their crypto assets, effectively creating a decentralized margin-trading platform.


Maker and Dai — Detailed Overview

What are Stablecoins?

In order to understand Maker and Dai, you first need to understand stablecoins.

In your life, financial transactions are probably completed using fiat (legal currency backed by a government). Maybe you buy food with dollars or pay rent with euros. There are many reasons you can use your fiat for these purposes, such as fungibility (one unit of your money is exchangeable for any other similar unit), liquidity (others will accept your money), and limited supply. One of the most important reasons you can use your fiat is that it has a relatively stable value.

You wouldn’t want to spend your day creating widgets, only to be paid in a currency that drops half its value next week. You wouldn’t want to open a mortgage in a currency that becomes worthless by the time your first payment is due. Uncertainty in the future value of a currency makes that currency nearly impossible to use for normal transactions.

Many people feel that this lack of stability is one of the major blocks to mainstream adoption of cryptocurrency . Cryptocurrencies tend to have the opposite of stability — they have very high volatility. You may believe your favorite coin is going “to the moon” — but in reality, you don’t know what drastic changes in value will happen next month, next week, or even tomorrow. If there is to be mainstream adoption of cryptocurrencies, many believe there must be a currency — a stablecoin — that remains decentralized, but maintains a consistent value over time.

Maker is a smart contract platform that creates and manages such a stablecoin called Dai.

Maker and Dai

Dai is a cryptocurrency stablecoin that, initially at least, is stabilized by being pegged 1-to-1 to the US dollar, meaning the value of 1 Dai is created and exchanged at the same rate as 1 US dollar.

The Maker platform behind Dai has several functions. The Maker platform:

  1. Creates Dai
  2. Allows users to borrow Dai against crypto assets
  3. Attempts to stabilize the Maker platform and value of Dai
  4. Provides a token — MKR — for managing risk on the Maker platform

We’ll look at each of these in detail.


Creating and Borrowing Dai

Dai isn’t mined like Bitcoin. Instead Dai is dynamically created through loans over a smart contract. In the simplest flow, a user sends some type of collateral (in the form of a crypto asset) to the contract, and the contract returns to the user newly created Dai. The contract stores the collateral until the Dai is returned.

Here’s how a typical scenario might work (we’ll keep the values in dollars for simplicity). Note that you must deposit more collateral than the value of the Dai you get in return. In the below scenario, for example, Bob needs to send $150 worth of ETH to get $100 worth of Dai — a 150% deposit.

  1. Bob sends $150 worth of ETH into the smart contract as collateral.
  2. The smart contract returns $100 worth of Dai to Bob.

Bob can now do whatever he wants with the Dai, for however long he chooses. When he is finished with the Dai, the reverse flow happens:

  1. Bob returns $100 worth of Dai to the smart contract.
  2. The smart contract releases the collateral ETH back to Bob.

The smart contract above is referred in the Maker platform as a Collateralized Debt Position (CDP).

Collateralized Debt Position

The smart contract is slightly more complicated than presented above. For example, Bob doesn’t pay back just the $100 in Dai. He must pay back slightly more — perhaps $100 in Dai plus an additional $1 — because the system charges a time-based Stability Fee to the CDP. You can think of this Stability Fee as an interest rate on Dai.

So why would Bob want to open a CDP and get Dai? There are several reasons. Here are a couple:

  • In a simple use case, since Dai is stable in value, Bob can perform basic banking activities, such as loan the Dai and earn interest.
  • In a more complicated use case, Bob can use the Dai to margin trade ETH.

Let’s explore that second case, as it’s a major section of the Maker whitepaper.

(If you already understand margin trading, feel free to skip this next section and start again at Margin Trading with CDPs)

What is Margin Trading?

Traditional margin trading is a financial tool that increases the magnitude of your gains — and losses — by allowing you to borrow money to purchase an asset (such as stocks).

For example, if you have $2000, margin trading allows you to borrow an additional $2000 against your original $2000, and purchase a total of $4000 in a stock. In margin trading, you are borrowing money to increase your exposure — or, gains and losses. You margin trade because it gives you leverage — a magnitude increase of your gains and losses.

To margin trade, you:

  1. Deposit money into a margin account with your brokerage.
  2. Borrow up to 50% of the price of the stock you want to purchase. So if a stock is $100 per share, you could pay $50, and borrow the other $50 to purchase the share. The percentage you borrow is called the initial margin and is set by your brokerage firm.
  3. The stock you buy becomes collateral against your loan.
  4. You pay interest on your loan
  5. You must maintain a minimum amount (usually 25%) of collateral to the value of the stock. This percentage you must keep is called the maintenance margin. So if the maintenance margin is 25%, and your stock is worth $100, you must have at least $25 (25% of $100) of your own money in the stock.
  6. You cannot margin trade for some types of stocks, for instance IPOs and penny stocks.

Here is an example:

  1. Bob believes that the stock BgTme is going to rise sharply in the next week. He wants to take full advantage of this rise.
  2. Bob deposits $10,000 into a margin account.
  3. Bob can now buy up to $20,000 of BgTme. He uses $10,000 of his own money, and $10,000 borrowed from his margin account.
  4. Over the next week, BgTme rises 50% in price.
  5. Bob has gained $5,000 on his own money, and an additional $5,000 on the borrowed money, doubling the gains he would have made with just his own money.
  6. Bob closes his margin account, pays back his $10,000 loan, and exits $10,000 ahead.

(There are interest and other fees involved here, but we’ll skip them for simplicity)

Of course, the opposite could also happen:

  1. Bob believes that the stock BgTme is going to rise sharply in the next week. He wants to take full advantage of the rise.
  2. Bob deposits $10,000 into a margin account.
  3. Bob can now buy up to $20,000 of BgTme. He uses $10,000 of his own money, and $10,000 borrowed from his margin account.
  4. Over the next week, BgTme falls 50% in price.
  5. Bob has lost $5,000 on his own money, and an additional $5,000 on the borrowed money, doubling the loses he would have made with just his own money. In fact, because he still has to pay back the $10,000 loan, he has effectively lost all of his money.
  6. Bob closes his margin account, pays back his $10,000 loan, and exits with nothing. Without the margin, he would have lost only half his money ($5,000). But because he used a margin account, he doubled his exposure, and lost everything.

In fact, in the extreme case of this second example, if the value of the stock falls too low, and Bob no longer has the required maintenance margin in his account, the brokerage will issue a “margin call” which, depending on the rules of the account, either allows Bob to deposit more money to cover the needed margins, or simply closes his account and sells his collateral.

And worst of all, in this extreme case, Bob could end up owing money even after the margin call. If the value falls more than 50% — let’s say it falls 75% — Bob ends up losing not only his original $10,000, but still owes an additional $5,000 (plus the miscellaneous interest and commission fees).

Margin trading can be very lucrative — but can also cause heavy losses.

Margin Trading with CDPs

Margin trading with cryptocurrencies is a key feature of the Maker platform.

Margin Trading with CDPs
  1. Bob believes the price of ETH is going to rise sharply over the next week. He wants to take full advantage of this rise.
  2. Bob deposits $10,000 worth of ETH into a CDP and receives back $5,000 worth of Dai.
  3. Bob now uses the $5,000 worth of Dai to purchase even more ETH. He now holds $15,000 worth of ETH.
  4. Over the next week, ETH rises 50% in price.
  5. Bob gained $5,000 on his original ETH, and an additional $2,500 on his Dai-purchased ETH, increasing the gains he would have made with just his original ETH by 25%.
  6. Bob sells his $5,000 in ETH bought in step 3 back for Dai, returns the Dai to the smart contract to close out the CDP, and receives his original collateral ETH back.
  7. Bob ends with a handsome $7,500 profit.

(There is a charge here similar to interest rate — the stability fee — which we ignore for simplicity)

But, just like with margin trading, the opposite can happen. If the price of ETH drops, Bob’s losses will be magnified. And again, just like with margin trading, if the value of ETH drops too low, and the value of Bob’s deposited ETH nears a value that no longer covers the cost of the Dai he has borrowed (Maker calls this value the liquidation ratio), the Maker platform will issue a margin call — in Maker’s case, they call this liquidating the CDP — and auction off the collateral to keep the system solvent.

One difference, however, of CDPs over margin trading — no matter how far the value of your collateral drops, you can never end up owing more money than you deposited. In margin trading you can end up owing large sums of money. But in CDPs, Maker caps your losses at the total value of your collateral. If the value of the collateral falls below the value of the borrowed Dai, the Maker platform and its governance covers that loss without charging you.

Note: Only ETH (actually, a variance called Pooled Ether, or PETH) is allowed as collateral in CDPs at the current time, though the whitepaper says more collateral types will be allowed in the near future.


OK, we’re back to the functions of the Maker platform. We covered the first two functions: creating Dai and allowing users to borrow against crypto assets. We also covered in detail CDPs and Margin Trading. Now, let’s cover the last two functions of the Maker platform: stabilizing Dai/Maker, and Governance.


Stabilize Dai and the Maker Platform

The Maker platform enables stability in three ways:

  1. The collateral auctions mentioned in the above CDP section(debt auctions)
  2. The TRFM (Target Rate Feedback Mechanism) attached to Dai
  3. Global Settlement

Debt Auctions

Note: For now, Maker has implemented a temporary mechanism for liquidating CDPs — the Maker platform itself acquires the CDP and sells the collateral, creating or burning more PETH as necessary to cover any losses or gains in the sale. Long term, when multiple types of collateral are accepted by Maker, they plan to implement a series of debt auctions, as outlined below.

Maker’s version of a margin call is the debt auction. Every CDP collateral type has a Liquidation Ratio. This liquidation ratio is used to decide when a CDP is at risk of defaulting, and when it should be margin called — or in the Maker world, liquidated.

For example, consider this CDP.

  • Bob opens a CDP with $150 in ETH and receives $100. His current collateral-to-debt ratio is 150% — he holds 150% of the value of his Dai in ETH.
  • The liquidation ratio of ETH is 105%
  • If the ETH in the CDP drops in value from $150 to $104, the collateral-to-debt ratio will become 104%, which is below the required 105%, so the CDP will be liquidated.

When a CDP drops below its liquidation ratio, Keepers (actors in the system that keep the system solvent) have the job of auctioning off the CDP. They immediately perform the following actions:

  1. First, the platform must raise enough Dai to pay back the CDP so that it can obtain and sell the collateral. To obtain this Dai, the platform creates, and then auctions off, new MKR tokens (MKR tokens are the systems governance token — see the below section about the MKR token).
  2. The platform uses the raised Dai from step 1 to close the CDP and obtain the collateral. The platform then liquidates and auctions the collateral, using the proceeds to buy back an equal amount of MKR as was created in step 1. This controls dilution of the MKR token. The platform auctions off just enough of the collateral to buy back the MKR.
  3. The platform also charges a liquidation penalty. So step 2 actually auctions off slightly more collateral than necessary to buy back the MKR. This extra amount pays the liquidation penalty.
  4. If there is any leftover collateral, it is returned to the original holder of the CDP.
  5. Steps 1 and 2 above happen in parallel.

Let’s walk through an example flow, and see how this works in action.

  1. Bob opens a CDP using $150 of ETH. In return he receives $100 in Dai.
  2. The Liquidation Ratio of ETH has been set to 110%. Currently, as seen in step 1, the collateral-to-debt ratio for Bob’s CDP is 150%.
  3. The value of ETH drops suddenly, and now the $150 of ETH is only worth $105. This is not good. If the value of the collateral continues to fall and ends up below the value of the Dai loaned out, the CDP turns “upside-down” and has a negative value.
  4. The platform sees that the CDP has a below-threshold ratio of collateral to debt, and it immediately performs the two auctions. First, the platform needs to raise enough Dai to buy out the CDP. For this example CDP, it must create and auction enough MKR to raise $100 in Dai. Assuming the current market value of MKR is $50, the platform creates and auctions off 2 new MKR tokens, and in return now has $100 in Dai. And second, the platform pays the Dai to the CDP to obtain the $105 in ETH collateral.
  5. Now the platform needs to auction off just enough of the ETH collateral to buy back the MKR created in the first auction — PLUS a liquidation penalty. In our example, the platform needs to raise $101 in Dai — $100 to buy back the 2 new MKR tokens, and a $1 liquidation penalty. Since the ETH held in the CDP is now worth $105, the platform auctions off $101 of ETH for $101 in Dai, then buys back $101 in MKR tokens.
  6. Since there is now $4 of ETH left in the CDP, this extra is returned to the original CDP holder.
  7. Finally, the MKR that was bought in step (d) is burned (or erased permanently so that it no longer exists). This is an important step, as will be explained below.

Essentially, the platform found a CDP that was at risk of being worth less than the Dai that had been loaned out. These CDPs threaten the stability of the Maker platform. So the platform acts to eliminate this risk by auctioning off the CDP — removing it from Maker.

If the platform acts fast enough, the risk of the CDP is removed while the collateral still has value, and the auction even earns a slight gain as a liquidation penalty is paid by the holder of the CDP. When the MKR is burned in step (e), the supply of existing MKR decreases. A lower supply of MKR means a higher per-token price. In this way, correct management of the platform (through risk settings) by holders of MKR should increase the value of MKR tokens.

On the flip side — if the platform does not act fast enough, or if the liquidation ratio is set too low, the collateral will fall below the value of the loaned Dai. There won’t be enough Dai raised in the auction to buy back all the created MKR, which will cause a net increase of the amount of MKR in existence. A higher supply of MKR causes the value of MKR to decrease. In this way, poor management of the platform by the holders of MKR should cause the value of MKR to drop.

In summary: When the Maker platform discovers a CDP whose collateral value may soon drop below the value of the Dai created by that CDP, it acts quickly to auction off the CDP and remove it from the Maker platform. If the platform acts quickly enough, the holders of MKR are rewarded. If the platform is slow or inefficient, the holders of MKR are penalized.

Target Rate Feedback Mechanism

Another way Maker enforces stability is when the US dollar becomes unstable, the platform triggers the Target Rate Feedback Mechanism — an automatic function that removes the Dai peg to the US Dollar. Through the TRFM, Maker attempts to keep the value of Dai stable through market forces and a Target Price. The further from the Target Price Dai moves on the markets, the harder the platform pushes and pulls the creation cost of Dai in a newly opened CDP, working to bring the value of Dai back to the Target Price.

It’s a pretty complicated process, as illustrated below:

Target Rate Feedback Mechanism

Global Settlement

Global Settlement is the last way Maker enforces stability, and is used a last resort in the case of an extreme market emergency, such as hacking or security breaches of the Maker platform, or long-term market irrationality. Global Settlement is triggered by MKR holders (see below), and effectively “unwinds” the Maker platform, freezes prices, liquidates all assets, and returns them to their owners.


And finally, the last function of the Maker platform is providing a native governance token, MKR.

The MKR Token

The MKR token is the governance token of the Maker platform. MKR holders are responsible for the stability and integrity of the system, and they enforce those values by voting on, and setting, the risk parameters of the platform.

Here are some example parameters that holders of the MKR token can vote on:

  • Types of collateral accepted in CDPs
  • Collateral-to-debt percentages for each type of collateral
  • Stability fee paid when a user closes a CDP
  • Governance questions
  • And more

Theoretically, if MKR holders do a good job governing the platform, the value of MKR goes up. If they do a poor job, the value of MKR goes down.


That was a long way to understanding Maker and Dai — but there are a lot of concepts in the platform. There are a few items we didn’t cover, such as Oracles (how Maker knows the market price for collateral), Keepers, and security. If you are interested in these, I suggest moving to the white paper.

Resources

The Maker whitepaper

The Maker website

Disclaimer — I’m long on MKR.


How about giving some claps?

If you enjoyed this article, feel free to clap many times or share with a friend. This lets me know my work is helping, and encourages me to write more.

Also — if you’d like to see more of these 🍌Banana Papers, comment below and let me know which blockchain projects you are interested in, and would like to understand a little better.


Michael Bogan is a tech enthusiast with 25 years of technical architecture, founding startups, product launches, and more. I write about blockchain, startups, and family.

Subscribe to my mailing list so you never miss a post!

Follow me on Medium.

Follow me on Instagram.

Follow me on Twitter.

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Michael Bogan

Written by

25 years of startups, launching products, and software architecture. Based in Indiana.

Coinmonks

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

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