Decentralized Finance

by David Stancel, MSc.

Money in DeFi is:

- Algorithmic

- Transparent

- Censorship resistant

- Permissionless

- Composable 


Example: Uniswap


MakerDAO is a decentralized credit platform on Ethereum that supports Dai, a stablecoin whose value is pegged to USD. Anyone can use Maker to open a Vault, lock in collateral such as ETH , and generate Dai as debt against that collateral. Dai debt incurs a stability fee (i.e., continuously accruing interest), which is paid upon repayment of borrowed Dai.


Holders of Maker’s other token (MKR) govern the system by voting on, e.g., risk parameters such as the stability fee level. MKR holders also act as the last line of defense in case of a black swan event. If the system-wide collateral value falls too low too fast, MKR is minted and sold on the open market to raise more collateral, diluting MKR holders.

Example: MakerDao


  • Dai is simply a loan against Ethereum. Anyone can create Dai — all that’s needed is ETH and the technical know-how to use a decentralized app
  • Most users — 99.999+% — will never need to create Dai, nor understand how it’s created.
  • Dai is always worth $1 USD each
  • It can be freely traded like any other ERC20 token
  • Anyone with an Ethereum wallet can own, accept, and transfer it
  • It can be exchanged without any middleman
  • No individual person or company has control over it
  • No government or authority can shut it down

Dai - How

  • First, ETH is turned into “wrapped ETH” (WETH), which is simply an ERC20 wrapping around ETH. This “tokenizes” ETH so it can be used like any other ERC20 token
  • Next, WETH is turned into “pooled ETH” (PETH), which means it joins a large pool of Ethereum that is the collateral for all Dai created
  • Once you have PETH, you can create a “collateralized debt position” (CDP), which locks up your PETH and allows you to draw Dai against your collateral (PETH).
  • As you draw out Dai, the ratio of debt in the CDP increases. There is a debt limit that sets a maximum amount of Dai you can draw against your CDP.
  • Once you have Dai, you can spend or trade it freely like any other ERC20 token

Dai - Why

  • You need a loan, and have an asset (ETH) to use as collateral for your loan
  • You believe ETH is going up in value. You can use your CDP to buy ETH on margin — you lock up your ETH in a CDP, draw Dai against it, use the Dai to buy more ETH on an exchange, and then use that ETH to further increase the size of your CDP.
    --> without any third-party or centralized authority
  • The demand for Dai drives the price above $1 USD. When this occurs, you can create Dai then immediately sell it on an exchange for greater than $1 USD. This is essentially free money, and is one of the mechanisms the Maker system uses to keep Dai pegged to $1 USD. Dai being worth over $1 USD encourages more Dai to be created.

Dai - Peg Mechanism

  • If Dai < $1 USD, CDP owners can pay down their debt at a cheaper price!
  • fe. CDP with $1000 in ETH --> draw out 500 Dai to close the position --> pay back 500 Dai (paying debt destroys Dai).
  • If Dai < $1 USD, then buy cheaper DAI (fe 0.99 USD) --> pay off debt with a 1% discount == free money — $500 loan (500 Dai) --> 500 Dai for $495 (0.99 * 500 = 495, a 1% discount)
  • --> demand for Dai increases its price, until it approaches $1 USD.
  • If Dai stays below $1, CDP owners continue to pay down debt and remove Dai from the system.
  • --> When Dai goes above $1 USD, Dai is created to feed the demand. It is this push and pull, creation and destruction, supply and demand which ensures that Dai always matches the $1 USD peg.

Dai - Taking Loan

1. Deposit ETH to Metamask
2. Wrap ETH --> WETH (via
3.Exchange it for PETH (pool eth), used for collateral
4. Create CDP (the loan)
5. Lock your PETH collateral
6. Mint new DAI (max. 60% of collateral)
7. Exchange DAI for ETH at Oasis DEX
8. Send ETH to any exchange and get EUR, BTC etc.

Dai - Repaying the Loan

1. Get some ETH
2. Exchange it for DAI (which you owe) and MKR (for governance fee) on Oasis DEX
3. Return DAI to the smart contract and pay the fee in MKR
4. You cancel CDP smart contract
5. Unlock your PETH
6. Exchange PETH for WETH
7. Unwrap WETH --> ETH
8. You have your ETH back


Aave is an open-source non-custodial protocol on Ethereum for decentralized lending and borrowing.

Users can borrow against most supplied assets; the collateralization ratio and liquidation threshold depend on the asset. Interest rates adjust algorithmically based on supply and demand, but Aave lets borrowers opt in to and out of (at any time) a stable rate that changes less often. The protocol keeps a liquidity reserve to ensure withdrawal at any time.

Example: Aave

Title Text

Title Text

Title Text

Title Text

Thank you!

Book, Newsletter & Resources:


Easy way to invest in crypto:

Decentralized Finance

By David Stancel

Decentralized Finance

Capgemini Seminar

  • 151
Loading comments...

More from David Stancel