Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion

Decentralized Exchanges

Alfred Lehar Christine A. Parlour Calgary Berkeley

2021 RiskLab/BoF/ESRB Conference on Systemic Risk Analytics June 2021 Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Introduction

ˆ Most modern exchanges are operated as a variant of an open electronic limit order book.

ˆ It is viewed as an most efficient way of providing liquidity.

ˆ Key assumption are perfectly competitive market makers, obtaining zero profit

ˆ Investments into high frequency trading, co-location

ˆ Liquidity traders try to carve out a competitive niche and extract rents

ˆ We examine a new form of liquidity provision - liquidity pools Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Main finding

ˆ Liquidity pools can dominate limit order markets when ˆ There are many uninformed traders ˆ Prices do not move by much ˆ Incentives to invest in high frequency trading are strong ˆ Liquidity pools ˆ track limit order market prices ˆ can have lower price impact ˆ have lower variation in price impact Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion The Uniswap system

ˆ Uniswap is a large, swap facility.

ˆ Part of the new “Decentralized Finance” or DeFi

ˆ Daily Trading Volume is over 3 billion USD.

ˆ Posted Liquidity is over 7.5 billion USD

ˆ Uniswap comprises tens of thousands of liquidity pools.

ˆ Anyone can be a liquidity provider

ˆ Trading: send token A to the pool, receive token B Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Setup and Players

ˆ Asset

ˆ current value p0 ˆ With probability α innovation: p0 + σ or p0 − σ ˆ Traders ˆ Liquidity trader: trades for exogenous motive quantity q: arrives when there is no innovation ˆ Arbitrageur: Learns about innovation and trades on it ˆ Liquidity providers: unaware which type of trader they face Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Limit order market

ˆ Competitive liquidity providers ˆ gain from selling to liquidity trader ˆ lose from trading with arbitrageur post innovation ˆ break even on average ˆ narrower spread ˆ Liquidity providers can invest in a technology that gives them a chance for a market niche where they have market power ˆ High frequency trading ˆ Learn if an institutional trader is placing a large order ˆ Learning information faster than others ˆ Monopolist liquidity provider ˆ charges high spread ˆ either p0 + σ or p0 − σ ˆ Technology is wasteful and costly (cost a) Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Uniswap – Liquidity Provision A Pool with Ether “E” and a token “T”

ˆ Suppose that there is a pool with E and T

ˆ The exchange rate is E/T

ˆ Liquidity demanders pay a fixed, proportional fee.

ˆ Price impact: Trading will move the price in a deterministic fashion

ˆ The exchange rate is determined by a “bonding curve.”

ˆ This mechanically relates Eth to the Token, so that

(E + ∆E )(T + ∆T ) = k

ˆ An infinitesimal small trader pays E/T Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion UniSwap-Price Impact

Eth

E0 E1

T0 T1 Token

Figure: A bonding curve Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Framework - Uniswap markets

ˆ Liquidity providers earn a fee τ per trade ˆ Liquidity trader - no change in ‘true price’

ˆ Pushes price from p0 = E0/T0 to E1/T1 ˆ An arbitrageur arrives and pushes price back from E1/T1 to E0/T0 ˆ No change in value for liquidity providers except collecting 2 x fee ˆ Arbitrageur - change in ‘true price’

ˆ Liquidity pool quotes price p0 ˆ assume true price is p0 ± σ ˆ Price is stale ˆ arbitrageur will take advantage of mispricing ˆ pool gets picked off ˆ Liquidity providers lose out Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Types of Transactions

ˆ List of all UniSwap V1 and V2 liquidity pools from factory contract transactions.

ˆ 36,958 individual liquidity pools, consisting of 3,937 V1 pools and 33,021 V2 pools.

ˆ We have 47,204,920 transactions on Uniswap from its inception on November 2, 2018 until May 20, 2021.

ˆ 1,084,581 liquidity injections

ˆ 582,063 withdrawals of liquidity

ˆ 45,481,500 trades of tokens.

ˆ rest complex transactions or flash swaps. Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Largest Exchanges

Token 1 Token 2 Number Volume Volume Pool size Transactions (ETH) (USD) (ETH) Panel A: Uniswap V2 Wrapped Ether WETH USD USDT 7,516.2 83,445 72,383,925 211,915 USD Coin USDC Wrapped Ether WETH 5,757.4 81,018 71,535,793 197,864 DAI Wrapped Ether WETH 3,008.9 46,683 36,897,989 162,671 Uniswap UNI Wrapped Ether WETH 2,429.9 31,156 26,624,652 53,511 Wrapped BTC WBTC Wrapped Ether WETH 957.9 29,277 23,932,848 284,151 Fei USD FEI Wrapped Ether WETH 288.6 26,780 68,605,073 374,990 yearn.finance YFI Wrapped Ether WETH 872.1 19,994 9,318,935 27,322 Tendies Token TEND Wrapped Ether WETH 144.3 16,260 24,569,585 724 SushiToken SUSHI Wrapped Ether WETH 894.5 14,860 6,750,425 77,097 Wrapped Ether WETH Truebit TRU 3,680.3 14,171 43,746,104 1,647 Panel B: Uniswap V1 Ether ETH Dai Stablecoin DAI 540.6 2,681 524,088 9,226 Ether ETH HEX HEX 219.4 1,801 378,702 22,300 Ether ETH USD Coin USDC 258.0 1,274 287,165 6,858 Ether ETH Maker MKR 118.3 1,101 217,221 11,010 Ether ETH LoopringCoin V2 LRC 20.5 983 365,065 794 Ether ETH Sai Stablecoin v1.0 SAI 166.4 770 153,078 5,030 Ether ETH Synthetix Network Token SNX 124.8 700 130,702 3,480 Ether ETH Synth sETH sETH 44.1 576 110,465 26,579 Ether ETH UniBright UBT 108.0 279 58,212 635 Ether ETH Pinakion PNK 40.7 197 59,877 1,544 Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Network of largest pools Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Volume

2,400,000,000 Uniswap V1 V2 Direct to WETH 2,200,000,000 V2 Other Tokens

2,000,000,000

1,800,000,000

1,600,000,000

1,400,000,000

1,200,000,000

1,000,000,000

800,000,000 Total Volume traded in USDVolume Total traded

600,000,000

400,000,000

200,000,000

0 May-2019 September-2019 January-2020 May-2020 September-2020 January-2021 May-2021 blockday Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Optimal poolsize - Theory

ˆ Fee revenue = Losses from quoting stale prices

ˆ Fee revenues get shared among liquidity providers

ˆ As losses increase pool shrinks to increase revenue per unit of liquidity provided

5.0 100

Poolsize 80 Poolsize 4.5

60 4.0

α 40 σ σ = 0 α = 8 = 4 = 0 . .01 3.5 1 20

2 4 6 8 10 0.2 0.4 0.6 0.8 σ α Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Optimal poolsize - Empirical

(1) (2) (3) (4) (5) Volatility -14646277.8∗∗∗ -14193779.4∗∗∗ -13976232.8∗∗∗ -15986481.5∗∗∗ (1907118.6) (1742450.0) (1615636.4) (2208943.9) Volume (USD) 0.255∗∗∗ 0.255∗∗∗ (0.0739) (0.0739) Number trades 3051.9∗∗ (1521.2) Reversals 18963.9∗∗ (9073.6) R2 0.000925 0.0498 0.0507 0.0338 0.0264 Observations 263,750 279,040 263,750 263,750 263,750

ˆ Poolsize decreasing in innovation and

ˆ increasing in uninformed trading Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Stability in liquidity provision

ˆ No short term evaporation of liquidity

ˆ Only 1.17% of sample are liquidity withdrawals

ˆ Only 1,801 events where the same address added and withdrew liquidity within 50 blocks. Median size USD 146.75 ˆ Only 18 observations where ˆ deposit and withdrawal over USD 1,000 ˆ within 5 blocks Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Liquidity provision - May 19, 2021

3,600 0.02

0.00 3,400

−0.02 sizepool of % in flow liquidity Cummulative 3,200 −0.04

3,000 −0.06

2,800 −0.08

USD/ETH price −0.10 2,600

−0.12 2,400 −0.14

2,200 −0.16

2,000 −0.18 04 PM 06 PM 08 PM 10 PM Wed 19 02 AM 04 AM 06 AM 08 AM 10 AM 12 PM 02 PM 04 PM 06 PM 08 PM 10 PM Time Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Comparison to a limit order market

ˆ Liquidity pools ˆ track limit order market prices ˆ can have lower price impact ˆ have lower variation in price impact

ˆ We collect minute interval data from , the largest crypto exchange

ˆ Identify 384 tokens that trade on both

ˆ Eliminate pairs with small trading volume and end up with 27 cross listed tokens. Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Minimal Pricing difference for pools above 700 Eth

1,000,000 40

100,000 30 Relative Pricing Error Binance - Uniswap in % Relativein -Uniswap BinanceError Pricing 10,000 20

1,000 10

100 0

Pool Size 10 -10

1 -20

0.1 -30

0.01 -40

0.001 -50 May 10 May 24 Jun 07 Jun 21 Jul 05 Jul 19 Aug 02 Aug 16 Aug 30 Sep 13 Sep 27 Oct 11 Oct 25 Nov 08 Nov 22 Time

Figure: Pricing error and pool size Pricing difference for the USDC/ETH pair when comparing Binance to Uniswap in percent of the Binance price (blue line, right axis) and pool size of the Uniswap USDC/ETH pool (orange, log-scale, left axis). Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Intraday Prices

Figure: Intraday prices for the USDC/ETH pair on October 21, 2020 The graph shows minute-by-minute prices of the USDC/ETH pair on Binance and Uniswap. Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Price Impact

Binance 0.00034 Uniswap Uniswap A 0.00032

0.00030

0.00028

0.00026

0.00024

0.00022

0.00020

0.00018

0.00016 Price Impact Price 0.00014

0.00012

0.00010

0.00008

0.00006

0.00004

0.00002

0.00000 May 24 Jun 07 Jun 21 Jul 05 Jul 19 Aug 02 Aug 16 Aug 30 Sep 13 Sep 27 Oct 11 Oct 25 Nov 08 Time

Figure: Price Impact of USDC/ETH on Uniswap (orange, green) and Binance (blue). Price impact is computed as change in price over volume (green and blue lines) as well as analytically as the price change for a marginal unit bought using the bonding curve formula (green line). Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Trading Volume

160,000 Binance Uniswap 150,000

140,000

130,000

120,000

110,000

100,000

90,000

80,000

70,000 Volume (ETH)Volume

60,000

50,000

40,000

30,000

20,000

10,000

0 May 10 May 24 Jun 07 Jun 21 Jul 05 Jul 19 Aug 02 Aug 16 Aug 30 Sep 13 Sep 27 Oct 11 Oct 25 Nov 08 Time

Figure: Trading volume of USDC/ETH on Uniswap (orange) and Binance (blue). The graph shows the trading volume excluding flash loans in ETH. Trading volume is aggregated over rolling eight hour intervals. Introduction Model Data and Stylized Facts Liquidity provision Exchange comparison Conclusion Conclusion

ˆ Presented evidence on the efficacy of a new model of liquidity provision.

ˆ Liquidity providers in limit order markets have an incentive to invest in wasteful technology to carve out a competitive advantage

ˆ In a pool, an automated market maker, adverse selection costs are mutualized, which reduced the cost to posting liquidity.

ˆ Liquidity pools can dominate limit order markets

ˆ Liquidity pools can have lower price impact and variation in price impact