Blockchain and Decentralized Finance:
A 2024 Primer for ESADE

 

Presenter:           Andreas Park
 

 

Agenda

  1. Background:
    • Vocabulary & Evolution
    • What's DeFi and what's different to TradFi?
    • Explain some key DeFi applications
    • What do we know about tokens?
    • Stablecoins & CBDC
       
  2. Getting your hands dirty!

Full Disclosure: What do I stand?

  1. Blockchain is rife with scams, frauds, con-men, and criminals of all kinds. We need to worry whether the tool can be used for crime at scale.
     
  2. Blockchain is a great opportunity and technological marvel that can and will improve financial services eventually.
     
  3. Many regulators and policy makers act in bad faith and absolutely moronically.
     
  4. The tech is still very early and there is very little use value, for two reasons. First, regulatory uncertainty and open threats. Second, lack of network effects.

Some Technological Innovations throughout History

technological innovation removes barriers:

  • what can be done
  • how much can be done
  • by whom it can be done

many innovations move power to do things from selected few to the masses

tech disrupts a group of people who built a living around a technological restriction and they disrupt government power exerted via these groups

Financial Infrastructure

Financial Institutions provide

  • services around money & financial contracts
  • access to the financial infrastructure

= a commodity

payments network

Stock Exchange

Clearing House

custodian

custodian

 beneficiary ownership record

seller

buyer

Broker

Broker

What our financial infrastructure looks like: an example

What our financial infrastructure looks like

payments

stocks, bonds, and options

swaps, CDS, MBS, CDOs

insurance contracts

What would the most efficient financial infrastructure look like?

payments

stocks, bonds, and options

swaps, CDS, MBS, CDOs

insurance contracts

\(\Rightarrow\) a single common resource

  • easy value management
  • straightforward transfers & ownership accounting
  • new types of contracts and usage of assets
  • \(\ldots\)

 = a single database & computer for the world that anyone can send function calls to

What is a Blockchain?

What is a Cryptocurrency?

Why blockchain and what is DeFi?

What is a blockchain?

A blockchain is a

  • general purpose
  • open access
  • value management
  • infrastructure
  • that is communally run

What is a blockchain?

A blockchain is a

  • general purpose
  • open access
  • value management
  • infrastructure
  • that is communally run
  • provision of financial service functionality
  • without the necessary involvement of a traditional financial intermediary

What is a decentralized finance?

Addresses, Accounts, Wallets, and Public/Private Keys

Smart contract accounts

  • controlled by code
  • decentralized applications
  • tokens

Externally owned accounts

controlled by private keys

private
key

public
key

seed phrase

public
address

wallet = software to keep and use private keys

What is a smart contract?

  • not really "smart" - a set of commands
  • blockchain guarantees execution of commands
  • arbitrary database operations
  • escrow
  • auction
  • trading
  • voting
  • fungible and non-fungible token
  • token-minting
  • conditional transfers

Examples for smart contracts

  1. Self-custody of assets
  2. Access to financial infrastructure
  3. Value management layer = common resource
  4. Platform approach to commerce

What makes blockchain-based finance different from TradFi?

Decentralized Trading

Application: decentralized trading with automated market makers

Decentralized trading using automated market makers (AMM)

AMM pricing is mechanical:

  • determined by the amounts of deposits 
  • most common:
    • constant product
    • #USDC \(\times\) #ETH = const

No effect on the marginal price

  • Most common form of AMM liquidity rule is Constant Product Pricing
    \[L(a,c)=a\cdot c~\Rightarrow~a\cdot c= (a-q)\cdot (c+\Delta c).\]
  • Total cost of trading \(q\) \[\Delta c=\frac{cq}{a-q}.\]
  • Price per unit \[p(q)=\frac{c}{a-q}.\]

Liquidity providers: positional losses

  • Deposit asset & cash when the asset price is \(p\)
  • Withdraw at price \(p'\ne p\) 

 

 

Buy and hold

Provided liquidity

in the pool

  • Why?
    • adverse selection losses
    • arbitrageurs trade to rebalance the pool 
  • \(\to\) always positional loss relative to a "buy-and-hold"

Constant Liquidity (Product) AMM

  • Purchase \(q\) of asset
     
  • Deposit cash \(\Delta c (q)\) into liquidity pool, extract \(q\) of shares
     
  • Idea of pricing: liquidity before trade \(=\) after trade
    \[L(a,c)=L(a-q,c+\Delta c)\]
  • AMMs require liquidity deposits
  • Deposits:
    • \(a\) units of an asset (e.g. a stock)
    • \(c\) units of cash

The Pricing Function

  • Most common form of AMM liquidity rule is Constant Product Pricing
    \[L(a,c)=a\cdot c~\Rightarrow~a\cdot c= (a-q)\cdot (c+\Delta c).\]
  • Total cost of trading \(q\) \[\Delta c=\frac{cq}{a-q}.\]
  • Price per unit \[p(q)=\frac{c}{a-q}.\]
  • Average spread paid\[\frac{p(q)}{p(0)}-1=\frac{q}{a-q}.\]
  • liquidity provider makes asset and cash deposit
  • more deposits flatten price curve
    • may attract more volume
    • but larger "positional" dollar loss when prices move
  • larger liquidity deposits \(a\) \(\Rightarrow\) 
    • lower costs (price impact) for liquidity demanders
limit order book periodic auctions AMM
continuous
trading
price discovery with orders
risk
sharing
passive liquidity provision
price
continuity
continuous liquidity
sniping
prevented

Source of savings: 

  • better risk sharing among liquidity providers
  • better use of capital

Possible transaction cost savings when applied to equity trading: \(\approx\) 30%

Source: "Learning from DeFi: Would Automated Market Makers Improve Equity Trading?" working paper, Malinova & Park 2023

Converting Assets to Cash: MakerDAO

\(\vdots\)

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

  • create fiat money on chain with borrowing
  • a collateralized loan with ETH in escrow

The User's Perspective for a DAI Loan

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

The User's Perspective for a DAI Loan

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 if the price of ETH rises?

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 if the price of ETH falls?

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\) triggering of liquidation auction by "keeper"

sell 3.33 ETH=$500=500 DAI

repay $500=500 DAI loan

retain incentive

return  remainding ETH to vault owner

Pool-based lending principles

borrow

provide collateral

Application: Pool-based borrowing and lending

Application: Decentralized Borrowing & Lending

Interest rates

threshold/target utilization 

Collateral Condition

  • borrowers have a "health factor"
  • idea: how much risk-adjusted collateral did they provide relative to loan
  • risk adjustment is mechanical by a lending factor = how much can you borrow per dollar of collateral
  • Examples:
    • Stablecoin: borrow 90 cents per $1
    • ETH: borrow 60 cents per $1
  • Low health factor loans can be liquidated

Flash Loans

5. repay DAI

 for        loan
with health factor <1

liquidation
opportunity

1. flash-borrow DAI

2. repay loan
with DAI

3. claim
collateral ETH

4. convert ETH to DAI

Liquidity Mining: Priming the Pump

liquidity \(\nearrow\)

volume \(\nearrow\)

protocol fees \(\nearrow\)

token value \(\nearrow\)

Platform economics is tricky:

  • What's the product?
  • How do you get it started?
  • How do you get people to contribute?
  • How do you earn money?

Without intermediaries:
platform economics!

incentives for both?

A Taxonomy of Tokens

  • tokens are a re-imagination of value, ownership, use, rewards
     
  • tokens live on a single infrastructure and can interact with other tokens
     
  • tokens are immediately transferable  & immediately usable in DeFi
     
  • token can be programmed to have many features and have many different uses

  • tokens can assign ownership to "things" that could not be owned before
     
  • tokens are often important for the functioning and incentives of platforms

What's a crypto-token and what's special about it?

  • a blockchain is a protocol in which
    • users have direct control and responsibility over their assets
    • users can create codes at will
    • \(\rightarrow\) any user can create tokens and applications

Tokens by use

payments:

  • you use them strictly to pay for something
  • example: native cryptocurrencies


     

utility

  • you use them to access a specific service of function
  • example: filecoin


     

stablecoins

  • digital representation of fiat money
  • centralized/ decentralized
  • examples: DAI, USDC, USDT
     

governance

  • voting rights to determine parameters of a project
  • example: UNI, Compound etc

     

asset

  • representation of ownership
  • pool claims, digital items
  • example: receipts from UniSwap, Compound, NFTs

derivatives

  • tokens based on other tokens & functions
  • Example: tokensets


     

Disclaimer: this list in non-exhaustive, new ideas and concepts come up every day!

Stablecoins

pulled from Nick Carter's talk on "Will stablecoins serve or subvert U.S. interests?"

BTC, ETH

HQLA: USD, EUR

asset (gold)

fee-backed

Seigniorage

Crypto

Traditional

Algorithmic

Collateral-Backed

Taxonomy of Stablecoins

DEPOSITS

other assets

JPM coin

USDC

USDT

TUSD

DAI, FEI

What makes a Stablecoin stable?

Case 1: price(1 SC) \(>\) 1 FU \(\to\) SC expensive

collateralized stablecoin

arbitrageur

issuer

market

Case 2: price(1 SC) \(<\) 1 FU \(\to\) SC cheap

collateralized stablecoin

arbitrageur

issuer

market

every issued token has a corresponding HQLA amount

Algorithmic Stablecoin: UST on Terra

Case 2: price(1 SC) \(<\) 1 FU \(\to\) SC cheap

under-collateralized stablecoin

arbitrageur

issuer

market

  • arbitrageur purchases should raise price in market
  • BUT:
    • will is rise fast enough?
    • does the issuer have enough funds or, rather have funds for long enough?
  • for fully decentralized algo/smart contract stablecoin: there is no dollar to give!

Case 1: price(1 SC) \(>\) 1 FU \(\to\) SC cheap

arbitrageur

issuer

  • for fully decentralized algo/smart contract stablecoin: there is no dollar to give!

The Case of Luna-Terra

 exchange LUNA for newly minted UST tokens at the prevailing $ market rate

market

 LUNA market

Case 2: price(1 SC) \(<\) 1 FU \(\to\) SC cheap

arbitrageur

issuer

  • for fully decentralized algo/smart contract stablecoin: there is no dollar to give!

The Case of Luna-Terra

 exchange SC for newly minted LUNA tokens at the prevailing $ market rate

market

 LUNA market

Case 2: price(1 SC) \(<\) 1 FU \(\to\) SC cheap

DISCUSSION

  • backing/collateral is the value of the LUNA/Terra Network
    • \(\to\) must have value(Terra)\(\ge\sum\) SC
  • when you issue new LUNA tokens
    • shift value from current to new owners
    • create inflation\(\to\) price(Luna)\(\searrow\)

       

POTENTIAL PROBLEMS

  • value(Terra)\(<\sum\) SC
    • could be pre-drop SC
  • when SC<FU, LUNA token holders
    • know price(LUNA) will drop
    • \(\to\) pre-emptive selling
    • more LUNA issued
    • \(\to\) more inflation
    • \(\to\) more price drops
    • \(\to\) DEATH SPIRAL!!!
  • So far there has never been an algorithmic stablecoin that did not collapse.
     
  • Disclaimer: I am not aware of a mathematical proof that an algo stablecoin cannot work.

Stablecoin use cases

What do central bankers think about stablecoins?

BIS Survey of Central Banks:

What do central bankers think about stablecoins?

Stablecoin use cases

  • Domestic
    • developed world: do things you otherwise can't do
    • developing world: everything
  • stablecoins as payments compete with existing rails
  • factors for adoption are
    • price
    • convenience
    • reach/applications
    • interoperability (e.g., credit availability, acceptance)
  • International
    • move assets faster and cheaper
    • do things banks can't/won't do

 

Source: On-chain Foreign Exchange and Cross-border Payments by Austin Adams, Mary-Catherine Lader, Gordon Liao, David Puth, Xin Wan (2023) [team from UniSwap Labs]

DeFi fees:

  • fiat to crypto on ramp: 0%-1%
  • exchange fees 1-5bps
  • network fee: $0.001-5$
  • off-ramp fee: 0%-1%
  • total: from close to 0 to 2%+$5

Central Bank-Issued Digital Currencies

Evolution

Source: CBDCtracker.org

Possible CBDC architectures

Source: BIS Quarterly Review, March 2020

Technological Limitations

Challenge 1: Environment

  • Carbon footprint of Switzerland
  • Power consumption of Austria

problem solved

transactions per second T per 12 hours (business day)
Bitcoin 7 302,400
Ethereum 30 1,296,000
Algorand 2000 86,400,000
Avalanche 5000 216,000,000
US retail payments 7639 330,000,000

Challenge 2: Throughput

Solution 2: Rollups

  • rollups can add millions of transactions per day
  • gas usage \(= \frac{1}{500}\) of mainnet
  • other chains (BNB, Polygon) process several million transaction per day

Challenge 3: State Size

Source: Ycharts

Settlement Layer

a

b

c

d

e

f

g

The Role of the Settlement Layer

Solutions and Remedies

  • Flashbots protocol
  • encrypted transactions
  • FHE Protocol

Stinky Business: Hacks & Exploits

Risk is in every layer of the tech stack!

  • Network Layer
    • DDoS attacks etc.
  • Blockchain Layer
    • Sybil attacks
    • MEV
  • Smart Contract Layer
    • Malicious code
    • Bug exploits
  • Interface Layer
    • Oracle attacks
    • Malicious plug-ins
    • 2FA SIM attacks

hot wallet hack (Sept 2023)

Hacker minted WETH out of thin air on Solana's contract since signatures were not verified! Bridge attack

Hacker remotely stole validator private keys

Bridge attack

Remedies?

  • Centralized auditing (as a service)
    • Blockchain layer
    • Smart contract layer
    • OK, but audits based on past "lessons"
  • In-house testing
    • OK, but limited coverage of cases
  • Symbolic and formal verification
    • Expensive but probably the future

Why are Blockchains challenging for current regulation?

The Investment Process

issuers

investors

  • funding
  • record-keeping
  • instruments
  • custody
  • advice
  • trading

services
needed & provided

  • takes care of custody and allows self-custody
  • allows instrument creation
  • enables record-keeping
  • allows circumvention of existing institutions

A general purpose value management infrastructure:

intermediaries

separate institutions

  • asset custodians
  • broker-dealers
  • trading platforms

The blockchain reality:
new institutions
emerged that do all three

tokens are often not intended to be investments!

Who controls the Projects? Decentralized Autonomous organizations

UniSwap Lab supports development

a website app accesses the code

token holders control contact features

don't own the code

operation = decentral

control = decentral

anyone can use the baseline code

core code runs on the blockchain

tokens used as rewards

Final Thoughts

Some Final Thoughts

  • blockchain tech won't get uninvented.
     
  • young people and universities keep working on blockchain ideas
     
  • the space is still trying to figure things out, including tech and economic challenges
     
  • great progress has been made, but things will and do still go wrong
     
  • a common resource can have huge economic benefits
     
  • I'd like to see more thinking and discussion about paths to unlock the benefits

@financeUTM

andreas.park@rotman.utoronto.ca

slides.com/ap248

sites.google.com/site/parkandreas/

youtube.com/user/andreaspark2812/

Blockchain and DeFi ESADE 2024

By Andreas Park

Blockchain and DeFi ESADE 2024

  • 305