Behavior of Liquidity Providers in Decentralized Exchanges Arxiv:2105.13822V1 [Q-Fin.CP] 28 May 2021
Total Page:16
File Type:pdf, Size:1020Kb
Behavior of Liquidity Providers in Decentralized Exchanges Ye Wang∗ Lioba Heimbach∗ Roger Wattenhofer [email protected] [email protected] [email protected] ETH Zurich ETH Zurich ETH Zurich Zurich, Switzerland Zurich, Switzerland Zurich, Switzerland ABSTRACT well. So understanding DEXes may be important beyond just Decentralized exchanges (DEXes) have introduced an in- cryptocurrency applications. novative trading mechanism, where it is not necessary to DEXes are based on smart contracts running on a blockchain. match buy-orders and sell-orders to execute a trade. DEXes In contrast to the limit order book mechanism, traders do execute each trade individually, and the exchange rate is not need to be matched to a trading partner with opposite in- automatically determined by the ratio of assets reserved in tentions. In a DEX, trades are completed immediately when the market. Therefore, apart from trading, financial players the orders are recorded on the blockchain. can also liquidity providers, benefiting from transaction fees Uniswap is the most popular DEX. As an example, consider from trades executed in DEXes. Although liquidity providers trades between BTC and ETH. The Uniswap platform offers a are essential for the functionality of DEXes, it is not clear smart contract (liquidity pool) with locked-in funds for these how liquidity providers behave in such markets. two cryptocurrencies. When a trader wants to exchange ETH In this paper, we aim to understand how liquidity providers for BTC, the trader just needs to send their ETH to the smart react to market information and how they benefit from pro- contract. The smart contract will then immediately send the viding liquidity in DEXes. We measure the operations of appropriate amount of BTC back to the trader, while the ETH liquidity providers on Uniswap and analyze how they deter- sent by the trader will be locked in the smart contract. The mine their investment strategy based on market changes. We exchange rate is primarily determined by the ratio of BTC also reveal their returns and risks of investments in different to ETH stored in the smart contract. The BTC and ETH in trading pair categories, i.e., stable pairs, normal pairs, and the smart contract are providing the liquidity for the trades exotic pairs. Further, we investigate the movement of liquid- between BTC and ETH on Uniswap. ity between trading pools. To the best of our knowledge, this In a DEX pool, liquidity is provided by liquidity providers. is the first work that systematically studies the behavior of These liquidity providers lock their cryptocurrencies into the liquidity providers in DEXes. corresponding liquidity pools. DEXes generally charge a per- centage transaction fee for each trade executed on the plat- form. This transaction fee is shared by the liquidity providers 1 INTRODUCTION in proportion to their liquidity contributions. Therefore, with Traditionally, trading is executed on centralized exchanges the emergence of DEXes, users have new investment oppor- (CEXes), using the limit order book mechanism. With this tunities in the cryptocurrency ecosystem: they can offer their mechanism, each seller is matched with a buyer for a trade. assets in DEXes as liquidity and benefit from transaction fees. In the cryptospace, when traders for instance want to ex- Many interesting questions emerge: How many differ- change Ether (ETH) with Bitcoin (BTC) through a CEX, they ent pools are liquidity providers invested in? What are the have to transfer their ETH to the account of the centralized expected earnings from transaction fees? How do liquidity arXiv:2105.13822v1 [q-fin.CP] 28 May 2021 operator, submit their sell orders of ETH, wait for matching providers react to market forces? Do liquidity providers redis- corresponding buy orders of ETH, and then withdraw the tribute their assets? As DEXes are an emerging phenomenon incoming BTC from the market operators after the execution that might cross over to other markets beyond cryptocurren- of their orders. This is cumbersome but also risky, since the cies, it is interesting to understand the motives of liquidity funds are temporarily with the CEX. providers. Recently, there is an alternative in the form of decen- In this paper, we quantitatively measure the behavior of tralized exchanges (DEXes). Currently DEXes are popular liquidity providers. We collect data from Uniswap, the most in cryptocurrency markets, but eventually fiat currencies, popular DEX in the cryptocurrency ecosystem, to study liq- stocks or other commodities might be traded on DEXes as uidity provider contributions, returns, and strategies. First, we analyze the distribution of liquidity providers in Uniswap, ∗The first two authors have equal contribution. examining the creation of liquidity pools, the distribution Submission Ye Wang, Lioba Heimbach, and Roger Wattenhofer of liquidity, and the participation of liquidity providers in 2.1 Ethereum Blockchain and ERC20 these pools. Although Uniswap allows users to create liq- Standard uidity pools between any pair of tokens, more than 80% of Ethereum is a public blockchain platform, which supports liquidity pools include ETH, and six popular tokens domi- Turing complete smart contracts. Compared to earlier blockchain nate the market. Moreover, more than 60% liquidity is locked systems, such as Bitcoin, Ethereum provides a decentralized in the top 24 pools. Cryptocurrency holders act restrained virtual machine, the Ethereum Virtual Machine (EVM), to concerning these new investments: approximately 70% of execute smart contract code. A smart contract is a set of pro- providers reserve their liquidity in a single pool. However, grams written in high-level languages, e.g., Solidity. These these seemingly conservative liquidity providers contribute programs will be compiled into executable byte-code. After more than 50% of the liquidity in the most popular pools. the creation of the smart contract, the executable byte-code This indicates that individual providers, as opposed to pro- will be stored in an independent database of the blockchain. fessional market makers, control the liquidity of DEXes. In Any Ethereum users can invoke functions defined in a smart examining the addition and removal of liquidity day by day, contract. we find that the market change of liquidity is relatively sta- Ethereum supports three kinds of transactions: a simple ble, i.e., the correlation between the number of injections transaction, where the recipient is another address (account) and withdrawals is 0.922. to transfer the native currency, ETH; a smart contract creation To understand the behavior of liquidity providers, we transaction, without recipient is the null to create a new smart study the risks and returns they face across three different contract; a smart contract execution transaction, where the pool Uniswap categories: stable, normal and exotic. We find recipient is a smart contract address to execute a specific that while stable and normal pairs may provide attractive function of that contract. investment opportunities for liquidity providers depending When a transaction is included in a block by a miner, the on the individual risk tolerance and return expectations, the operation corresponding to the message takes effect. The exotic pools investigated are not. Those demonstrated deeply miner who creates the block modifies the state of correspond- negative returns accompanied by high risk. ing accounts based on the messages. Each step of the miner’s Liquidity providers do not frequently move their assets operation consumes a certain amount of gas, and the amount across different pools, seemingly indifferent to price changes of gas consumed in each block is capped. Users need to spec- or other market indicators. However, we observe that many ify a gas price for the operation execution when sending traders redistribute their liquidity given the opportunity to transactions. The fee paid by the initiator of a transaction earn additional benefits of liquidity mining on top of trans- to miners is determined by the amount of gas consumed action fees. This inspires to study what external factors are and the gas price (gas fee = gas price × gas consumption). influencing the behavior of liquidity providers. The miner will include a receipt of the executed transactions This paper makes the following contributions. First, we in Ethereum blocks as well, including the information on conduct a systematic investigation on the liquidity providers whether the transaction has been executed successfully, the in Uniswap to outline the participants of users in such emerg- gas fee, the identity of the transaction and the block, and ing trading activities. Second, we classify three categories of other information generated during the execution. liquidity pools and analyze the investment returns and risks Based on the support of the smart contract, users can of liquidity providers in those pools. We present the variabil- create cryptocurrency other than ETH on Ethereum. These ity of investment strategies for different types of liquidity smart contracts have to follow some standards; the most pools. Finally, we demonstrate the movement of liquidity widely used standard is the ERC20 standard, which requires around the entire DEX and suggests the significant influence an approve function and a transferFrom function. When an of external factors on liquidity providers, such as liquidity address (account) 033A calls the function approve(033A ,E), mining activities. 0 1 then the address