Defi LEnding and Borrowing

 

Instructors:           Andreas Park & Zissis Poulos
 

 

categories of finance

What do banks/financial institutions do?

disclaimer: an incomplete list

Bitcoin, 

stablecoins, etc.

"higher layer"

lending
 

payments processing

financial
advice

trading
services

funding
services

prop trading to manage risks

too early, but projects are underway

as it turns out, these items are often directly related

what could defi do?

Five key problems in finance

Defi vs Legacy finance

interoperability

inefficiency

centralized control

limited access

opacity

interchange (=VISA) fees, settlement times, microtransactions, physical infrastructure

between-institution or transfers, reconciliation process, international remittances, various securities custody and trading systems

information for users, health of deposit taker, what-happens-behind-the-scenes, counterparty risk

local monopolies/switching costs, central banking, deposit concentration, control vs. competition

1.7B unbanked in the world, 24M in the US, many services or products not available based on location etc, lack of SME support, inability to collateralize

Source: Wendy Rotenberg's Payments lecture

payments pieces

simplified view

CDS

ACSS

LVTS

Cheques
 

Debit at POS
 

e-transfer
 

Credit Card/
open loop

ATMs
 

Wire
 

Interac
 

Credit
Card

deposit based retail

Interac standard

credit card network

SWIFT

CSN

Settlement

Clearing process

Underlying network

Type of payment

Financial market infrastructure purpose

Securities Trading

why blockchain?

a common resource

e-transfer
 

Wire
 

deposit based retail

CDS

Securities Trading

derivatives
swaps

property registry

interoperability

inefficiency

centralized control

limited access

opacity

siloed legacy system

is interoperable by design

reduces frictions and separates service from "commodity" 

decentralized control and common operation

fewer barriers\(\to\) broad access 

is/can be highly transparent

common infrastructure system

categories and assessment for defi

Our focus

interoperability

inefficiency

centralized control

limited access

opacity

  • What do the projects do?
     
  • How do these projects improve on legacy limitations?

payments
 

lending
 

trading
services

funding
services

prop trading  
manage risks

Prerequistes

Key Components for Defi

unified money/unit of account

on-chain ability to exchange arbitrary value

(last class)

unified unit of account: dai

Money

Idea:

  • create fiat money on chain
  • mechanism
    • a collateralized loan with ETH in escrow
    • DAO-managed monetary policy (=creation or destruction of tokens)

Sidebar: what is a DAO?

  • DAO=decentralized autonomous organization
  • \(\to\) entity without management
  • governance decided by token holders essentially by vote
  • We'll devote a 0.5 class to DAO governance

user perspective

Maker DAO

4 ETH
(1 ETH = $375)
(Oct 15, 2020)
\(\approx\) $1,500

\(\vdots\)

1,500 DAI
(1 DAI = $1)

formally: this smart contract is a collateralized debt position (CDP)

user perspective

Maker DAO

fractional collateral \(\to\) collateralization factor \(=\) 150%

\begin{array}{rcl} &&\textsf{maximal amount of DAI in \$}\\\\ &=&\frac{\textsf{\$ equivalent of ETH in escrow}}{\textsf{collateralization factor}}\\\\ &=&\frac{1,500}{150\%}=\$1,000 \end{array}

total collateral = $1,500

maximum loan = $1000

overcollateralization = $500

actual loan (example) = $500

buffer = $500

user perspective: what happens if the price of ETH rises?

Maker DAO

ETH \(\nearrow\) $500

value of ETH collateral = $2,000

maximum loan = $2,000/150%=$1,333

total collateral = $2,000

maximum loan = $1,333

overcollateralization = $667

actual loan (example) = $500

buffer = $500

overcollateralization = $667

new loan capacity= $333

user perspective: what happens if the price of ETH falls?

Maker DAO

ETH \(\searrow\) $187.5

value of ETH collateral = $750

maximum loan = $750/150%=$500

total collateral = $750

maximum loan = $500

overcollateralization = $250

actual loan (example) = $500

buffer = $0

for reference: former value of collateral

user perspective: what happens if the price falls & max loan is exceeded?

Maker DAO

ETH \(\searrow\) $150

value of ETH collateral = $600

maximum loan = $600/150%=$400

total collateral = $600

maximum loan = $400

required overcollateralization = $200

actual loan (example) = $500

buffer = -$100

for reference: former value of collateral

\(\Rightarrow\) liquidation possible by "keeper"

sell 3.33 ETH=$500=500 DAI

repay $500=500 DAI loan

retain incentive

return  remainding ETH to vault owner

Maintaining the Peg: monetary policy

Maker DAO

  • How works:
    • 1 USDC=1.01 DAI
      • use USDC to mint new DAI
        • supply (DAI) \(\nearrow\)
        • price (DAI) \(\searrow\)
    • 1 USDC=0.99 DAI
      • Swap Dai for USDC (more below)
      • demand (DAI) \(\nearrow\)
      • price (DAI) \(\nearrow\)

\(\Rightarrow\) all relies on behavioral assumptions

\(\Rightarrow\) But: there are also real incentives & mechanisms

Maintaining the Peg: monetary policy

Maker DAO

  1. stability fee
     
  2. DAI savings rate (DSR)
     
  3. debt ceiling

borrowers of DAI need to pay interest \(\to\) stability fee

  • if too much minting (=too much DAI) then
  • \(\to\) interest \(\nearrow\) \(\to\) cost of DAI \(\nearrow\)
  • \(\to\) minting \(\searrow\) \(\to\) supply DAI \(\searrow\)

DSR paid on "locked" DAI

  • DAI deposited to specific contract (demand \(\nearrow\))
  • funded by stability fees
  • \(\to\) SF>DSR

total amount of debt (or DAI) outstanding is limited

Sidebar: how is this decided?
\(\to\) special "governance" token MKR

Value locked Oct 27, 2021

Maker DAO

Source: daistats.com (Oct 27, 2021)

The March 12, 2020 "BlAck Thursday" Drama

Maker DAO

  • some crypto prices dropped more than 50%
  • cascading liquidations in leveraging platforms
  • network congestion: some liquidations done at near-zero prices
  • collateral shortfall in DAI
  • MakerDAO sold new DAO tokens to collect collateral
  • odd: DAI became riskier but high demand for DAI to trigger liquidations!

PEG stability module (PSM)

Maker DAO

The Problem:

  • in extreme bull/bear runs, the peg may no longer work
  • example: March 2020
    • ETH dropped significantly and suddenly
    • a rush occurred to (a) get out of ETH into save assets and (b) to collect DAI to get keeper fee
    • upward pressure on price of DAI

The Solution:

  • Peg stability module
  •  swap a given collateral type directly for DAI at a fixed rate (no minting/borrowing)
  • like regular vault type with a zero stability fee and a liquidation ratio of 100%
  • accessed through a user-facing smart contract containing the relevant swap functions (no ownership, just straight swap)

Note: In May 2021, ETH prices dropped again by >30% but no drama in DAI

categories and assessment for defi

assessment of makerdao

Interest rates influenced by the FED, access to loan products controlled by regulation and institutional policies

MakerDAO platform is openly controlled by the MKR holders.

Difficulty of obtaining loans for large majority of population

Open ability to take out DAI liquidity against an overcollateralized position in any supported ERC20 token. Access to a competitive USD denominated return in DSR.

Costs of time and money to acquire a loan

Instant liquidity with minimal transaction costs.

Can't seamlessly use the same USD across many platforms

Issuance of DAI, a permissionless USD-tracking stablecoin backed by cryptocurrency. DAI can be used in any smart contract or DeFi application.

interoperability

inefficiency

centralized control

limited access

opacity

Unclear collateralization of lending institutions.

Transparent collateralization ratios of vaults visible to entire ecosystem

legacy finance

MakerDAO

The frontier: DAI loans for real-world assets

Maker DAO

categories and assessment for defi

Our focus

interoperability

inefficiency

centralized control

limited access

opacity

payments
 

/lending
 

  • Lightening Network
  • xDai
  • Makerdao
  • Compound
  • Aave

How does compound finance work?

Lending

Fundamentally, what does a bank do?

  • size intermediation
  • term intermediation
  • risk intermediation

And how is this done?

  • pooling deposits
  • issuing loans based on deposits
  • loan rates based on collateral or credit rating

on blockchain

  • short-term loans
  • pseudo-anonymous

collateral

compound Finance

  • Collateral ratio \(\in[0,90]\)
  • =0 \(\to\) not usable
  • =90 \(\to\) stablecoin
  • post 100 DAI 
  • factor 90
  • \(\to\) for each $1 borrow, deposit $100/90=$1.11
  • can borrow up to $90
  • post 1 ETH=$300 
  • factor 60
  • \(\to\) for each $1 borrowed, deposit $100/60=$1.67
  • can borrow up to $180

Example 1

Example 2

Example 3

  • post 1 ETH=$300 and 100 DAI \(\to\) $400
  • factor 60 and 90
  • \(\to\) for each $1 borrowed, deposit
    $100/(.75\(\cdot\)60+.25\(\cdot\) 90)=$1.48
  • can borrow up to $270

borrowing and lending rates compounded per block

how are the rates determined? - a function

compound Finance

100%

fraction of supplied that's been borrowed

base rate

borrow rate

\textsf{borrow rate}=\textsf{base rate}+\textsf{slope coefficient}\times\textsf{\% borrowed}
\textsf{supply rate}=\textsf{borrow rate}\times\textsf{\% (borrowed}-\textsf{reserve)}

compound Finance

  • Compound escrows tokens
  • must account for % ownership
  • \(\to\) tokenized user share
  • \(\to\) use the c-token
    • cDAI
    • cETH
  • minted/burned based on funds added/removed from underlying
  • seamless movement of these shares (reduced transactions costs!)
  • ability to use the ctokens in other protocols

Tracking ownership - How do you reclaim a deposit?

Tracking ownership - Example

compound Finance

In Compound

translated

new deposit

1,000 DAI

100 cDAI

500 DAI

add 50 new cDAI

Tracking ownership - Example

compound Finance

In Compound

translated

new deposit

1,000 DAI

150 cDAI

500 DAI

1 year later: 10% interest on compound

150 DAI

(same cDAI, ownership shares don't change, just each cDAI is worth more)

(accrues per block per deposit)

Differences to Compound

Aave

  • Aave is the second-largest lending protocol to date
  • has many features that are similar to Compound
  • offers more assets
  • offers flash loans (rate ~7bs)

common theme in DeFi: jumping between dApps

  • Assume 
    • 1 ETH = 200 DAI
    • supplied 100 ETH in Compound
    • borrowed 10,000 DAI to lever up and purchase an additional 50 ETH
    • \(\to\) also supplied to Compound
    • Borrow interest rate in DAI
      • Compound: 15%
      • Aave: 5%.
  • ​Can you refinance your borrowing?

dapp-linking

Defi is like real "high" finance

Source: Harvey, Ramachandran, and Santoro (2020)

2021

@financeUTM

andreas.park@rotman.utoronto.ca

slides.com/ap248

sites.google.com/site/parkandreas/

youtube.com/user/andreaspark2812/

Copy of Topic 6: DeFi Lending

By zpoulos

Copy of Topic 6: DeFi Lending

This slide deck provides an overview of DeFi protocols. It draws insights from Harvey, Ramachandran, and Santoro (2020) "DeFi and the Future of Finance"

  • 607