Maker DAO Transactions Illustrated

Maker DAO is the protocol for supporting the stable token, DAI. This article is the description of the protocol based on the real examples of transactions, illustrated by graphs from bloxy.info web site.

Aleksey Studnev
Coinmonks
Published in
6 min readMay 8, 2019

--

Introduction

The protocol is implemented as smart contracts:

Sai Tub: https://bloxy.info/address/0x448a5065aebb8e423f0896e6c5d525c040f59af3

which accepts wrapped Ether ( WETH ) as the collateral for DAI debt, and

Sai Tap:

https://bloxy.info/address/0xbda109309f9fafa6dd6a9cb9f1df4085b27ee8ef

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

The protocol is described in https://developer.makerdao.com/dai/1/api/vox. We took the text description from this source, but illustrated it by real example of transactions, using the graphical presentation from bloxy.info web site. Every illustration is accompanied with 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 Maker DAO protocol and use it in all possible variety of ways.

Methods Overview

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

MakerDAO Smart Contract methods

They describes what in general you can do with Maker DAO 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)
https://bloxy.info/tx/0x68802029f7dd70895f1c773082f049b71d325581000d23ccbebdd4530ce444ff

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.

https://bloxy.info/tx/0xde0045b4e2386612396e3113b82f37928a980785516806f1ab4a49cb0d78cd00

Open CDP

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

https://bloxy.info/tx/0xaf9814ac29554f2e0c7ccb0ebe87c73a343f43886bb21c10da54bef35d4b0b7b

Give CDP

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

https://bloxy.info/tx/0xef45f2faaa0b908d57131e32e1af856c0b3c0f7e9a68222e05f00c9584cd58fe

Lock CDP

Add PETH collateral (increases ink).

https://bloxy.info/tx/0x8666e2871274c806b77e3b4046fa41b7a3bc02f120f0ab5f5e4f03f92c6edd39

More complicated case, with ETH initially converted:

https://bloxy.info/tx/0x7e5858980d985f62342828f2e3018d4cea3012312d991a3eecd78577df149294

Free CDP

Remove PETH collateral (decreases ink).

https://bloxy.info/tx/0x95a8e38236ba459ab0ec44bc53a4561c1626e1f08950fb92466d7ae33e4230f8

More complicated case, with the conversion back to ETH

https://bloxy.info/tx/0x714bee5d4c352acfe1edf5b8286ffbab46f54946a24e7c7edd1cacca41a8cfcf

Draw DAI

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

https://bloxy.info/tx/0xa675314e644aea0320c72f3107e6cb5c427a51885999c1e42484ddbdb46ad29b

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

https://bloxy.info/tx/0xe847cd30af2826e37170ae2c736a0d0f0adc4a7f3b0e32a20f2768440d2c3f10

Wipe DAI

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

https://bloxy.info/tx/0x6466f98209f92dc32921988c016a75b9946a9d44f58d2b5eaecf898500cdab84

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

https://bloxy.info/tx/0xc28febfa30c5233c1f0a69cc8ed0dc1c7c6dfe5809d7e18cf38bba5fb8c161c3

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.

https://bloxy.info/tx/0x41d126cf65e57585b79f5ab178188b30716e9590e540fa4530030cf18d50512d

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

https://bloxy.info/tx/0x0cfcad36a457135111f4e0cfb309bc784488d066f527d8e4ab27e87b338da8e5

Even more complicated, with Uniswap involved:

https://bloxy.info/tx/0x38eeae65901c6ff749999b83d121d35e49a025c8d57c294f19f3d029137d2841

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.

https://bloxy.info/tx/0xa569c5e31c978aa5f281a584d14ebc0fcbb41de4f69acb8629d16e6f6277f219

More complicated case

https://bloxy.info/tx/0x627ff7151575daaa93c63e5bf470e58011c71c8893807ad17e1d4a09aeaa21bd

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.

https://bloxy.info/tx/0x50f77fadf3ff0282a160cc4602081737252a906f6661469afb1f2de3ada84a2b

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.

https://bloxy.info/tx/0xc69d05644d525a8404b7c93509e8d51f6cedaeb35351368376ff5a0250cbc198

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.

https://bloxy.info/tx/0x45f816f35b28550e9eec3e876d35247ee1e75dcc6cd215d4ed9c816a31c5dfda
This article was composed from the data and by analytical tools from Bloxy.info analytical engine.

Bloxy.info web site provides a set of tools for analytics, traders, companies and crypto enthusiasts.

The tools include APIs, dashboards and search engine, all available on-site, providing accurate data, indexed directly from the blockchain live node.

Bloxy mission is to make blockchain more transparent and accessible to people and businesses.

Please, make a reference to the source of data when referencing this article.

Cumbersome Complexity

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

https://bloxy.info/tx/0xa745b2c9f7621f5a9a3a3cdcc5b321c2e61de0148d88047296a9ddcd642948c5#

Apart from Maker DAO contracts, 3 DEX involved: Oasis, Uniswap and Kyber Network. This transaction orchestrated by smart contract SaverProxy ( https://bloxy.info/address/0xc19d0f1e2b38aa283e226ca4044766a43aa7b02b ).

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:

Bloxy.info Dashboard for MakerDAO

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

Get Best Software Deals Directly In Your Inbox

--

--