Cover Image for MakerDAO Transactions Illustrated

MakerDAO Transactions Illustrated

Coinpath

The MakerDAO protocol is implemented as smart contracts:

Sai Tub: which accepts wrapped Ether ( WETH ) as the collateral for DAI debt.

Sai Tap: for DAI debt liquidation clearance ( DAI <-> PETH exchange of bad debts )

The MakerDAO protocol is described here. We took the text description from this source, but illustrated it by the real example of transactions, using the graphical presentation from bloxy.info web site. Every illustration is accompanied by the link to the transaction it shows. You can investigate this particular transaction by clicking the link, or investigate even further, by finding similar transactions on the contract.

We believe this material will help to better understand MakerDAO protocol and use it in all possible variety of ways.

Also Read: MakerDAO Tokens Explained: DAI, WETH, PETH, SIN, MKR

Methods Overview

All protocol methods can be categorized in categories, working with different entities:

MakerDAO Smart Contract methods

MakerDAO Smart Contract methods

They describes what in general you can do with MakerDAO system:

  1. Deposit / withdraw your Ether ( PETH Pool )
  2. Control your CDP’s ( Collateral positions ) and get a loan (in DAI) from them. This effectively controls the total supply of DAI.
  3. Liquidate debts in DAI/PETH

Join Collateral Pool

Join the collateral pool by depositing ETH in exchange for PETH (pooled ether).

  • The amount should be specified in units of PETH.
  • ETH will be debited from the caller at the join price (ask)

Join Collateral Pool

source

Exit Collateral Pool

Withdraw collateral by returning PETH to the vault in exchange for the proportional amount of ETH.

  • The amount should be specified in units of ETH.
  • PETH will be debited from the caller at the exit price (bid)

Will return more or less ETH tokens for each PETH than at join depending whether the system made a profit or loss over the lifetime of the collateral deposited to the pool.

Exit Collateral Pool

source

Open CDP

Create an empty CDP and set the caller to be the owner.

Money-flow graph of an open call, a single edge from the caller to the SaiTub contract

source

Give CDP

Transfer a CDP to a different owner. (changes lad)

Money-flow graph of a give call transferring CDP ownership from one address to another via SaiTub

source

Lock CDP

Add PETH collateral (increases ink).

Money-flow graph of a lock call sending 269 PETH into SaiTub, which pulls from the Pooled Ether token

source

More complicated case, with ETH initially converted:

Money-flow graph of a proxy call wrapping 3 Ether into WETH, joining it as PETH and locking 2.8815 PETH into SaiTub

source

Free CDP

Remove PETH collateral (decreases ink).

Money-flow graph of a free call releasing 10 PETH from SaiTub back to the caller, with SaiVox and Medianizer read for the price

source

More complicated case, with the conversion back to ETH

Money-flow graph of an exit and withdraw, converting 4.8026 PETH back into 5 Ether through SaiTub and WETH

source

Draw DAI

Issue a specified amount of Dai (increases art, rum)

Money-flow graph of a draw call minting DAI against a CDP, with SaiTub reading SaiVox and the Medianizer

source

More complicated, with intermediary smart contract sending DAI to the guy

Money-flow graph of a SaiProxyCreateAndExecute call drawing 3,000 DAI, fanning out to SaiTub, SaiVox, the Medianizer and the DAI and WETH tokens

source

Wipe DAI

Repay some portion of outstanding Dai debt (decreases art, rum).

MakerDAO: Wipe DAI

source

More complicated case, where DAI exchanged to pay MKR fee. DEX exchange Oasis used for this:

Money-flow graph of a wipe repaying 79.4 DAI plus 0.1478 MKR in fees, buying the MKR through the Oasis Matching Market

source

Shut CDP

Close a CDP. Clear all debt, unlock all collateral and delete the record.

Collateral will be used to pay any outstanding debt at market rate. Remaining collateral will be returned to the pool.

MakerDAO: Shut CDP

source

More complicated case, using Oasis to exchange DAI to MKR:

Money-flow graph of a DSProxy unwinding a position, returning 201.45 DAI and 10.66 Ether to the owner

source

Even more complicated, with Uniswap involved:

Money-flow graph of a transaction routing 470 DAI through the Uniswap DAI pool and 5.38 Ether back to the caller

source

Bite CDP

Liquidate a vunerable CDP (zeros art, decreases ink).

Unsafe CDPs need to be liquidated. When a cup is not safe, anyone can perform bite(cup), which takes on all CDP debt and confiscates sufficient collateral to cover this, plus a buffer.

This returns the CDP to a safe state (possibly with zero collateral).

There are other possible implementations of bite, e.g. only taking sufficient collateral to just transition the CDP to safe, but the described implementation is chosen for simplicity.

MakerDAO : Bite CDP

source

More complicated case

Money-flow graph of a bite liquidation, burning 500 DAI and 500 SIN through SaiTap while SaiTub moves 3.2726 PETH

source

Boom Debt

Buy dai when the system is in surplus.

Can be thought of as buy and burn. Given a net Dai balance, sell the Dai in return for PETH, which is burned.

MakerDAO Boom Debt

source

Bust

Sell dai when the system is in deficit.

bust is really two functions in one: collateral sell off (aka flip), and inflate and sell (aka flop). When fog is non zero it is sold in return for Dai, which is used to cancel out the bad debt, woe. If fog is zero but the tap has a net Sin balance, then PETH is minted and sold in return for Dai, up to the point that the net Sin balance is zero.

bust

source

Vox Target Price

The vox provides the Dai target price, given in terms of the reference unit, by par. For example, par == 2 with USD as the reference unit implies a target price of 2 USD per Sai.

The target price can vary in time, at a rate given by way, which is the multiplicative rate of change per second.

In Dai 1.0 the sensitivity, how, is set to zero. Adjustments to the target price are made by adjusting the rate of change, way, directly with coax. In future iterations, how may be non-zero and way adjustments will then follow automatically via the feedback mechanism. The vox component is subject to ongoing economic modelling research.

MarkerDAO: Dai stablecoin

source

Cumbersome Complexity

To show an example of a REAL transaction, take a look at this:

Cumbersome Complexity

source

Apart from MakerDAO contracts, 3 DEX involved: Oasis, Uniswap and Kyber Network. This transaction orchestrated by smart contract SaverProxy.

What it does is withdraws Eth collateral, swaps Eth -> Dai with Kyber, and pays back the debt in Dai

Further Research

Bloxy.info Dashboard for MakerDAO shows interesting dynamics of the methods usage over time:

 Dashboard for MakerDAO

Bloxy.info Dashboard for MakerDAO

As different methods are used by traders for purpose, these dynamics may tell many stories about the important events and behavior in the MakerDAO ecosystem.

Subscribe to our newsletter

Subscribe and never miss any updates related to our APIs, new developments & latest news etc. Our newsletter is sent once a week on Monday.