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.

Bob sends $150 worth of ETH into the smart contract as collateral. 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:

Bob returns $100 worth of Dai to the smart contract. 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:

Deposit money into a margin account with your brokerage. 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. The stock you buy becomes collateral against your loan. You pay interest on your loan 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. You cannot margin trade for some types of stocks, for instance IPOs and penny stocks.

Here is an example:

Bob believes that the stock BgTme is going to rise sharply in the next week. He wants to take full advantage of this rise. Bob deposits $10,000 into a margin account. 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. Over the next week, BgTme rises 50% in price. 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. 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:

Bob believes that the stock BgTme is going to rise sharply in the next week. He wants to take full advantage of the rise. Bob deposits $10,000 into a margin account. 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. Over the next week, BgTme falls 50% in price. 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. 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.