HashKey: Analysis of the development trend and bottlenecks of decentralized exchanges from Uniswap

Written by: Qian Baijun, at HashKey Capital Research

Reviewer: Zou Chuanwei, Chief Economist of Wanxiang Blockchain, PlatON

This article studies the growth of Decentralized Exchange (DEX) from the recent development of Uniswap. The conclusion is that since the recent DeFi project launched liquidity mining, the locked funds of decentralized exchanges have increased significantly. Decentralized exchanges are an important infrastructure in the DeFi ecosystem, and the influx of funds has also promoted the liquidity and depth of capital pools of decentralized exchanges. The algorithmic decentralized exchange has an automatic market maker mechanism and a good user experience, gradually replacing the market share of the order-based decentralized exchange. However, there are still many problems with decentralized exchanges. In the future, how decentralized exchanges overcome security concerns and liquidity issues will be the key to their continued growth.

Thanks to the recent growth and explosion of DeFi, the monthly trading volume of decentralized exchanges in August 2020 reached 11 billion U.S. dollars, which is nearly five times more than the total transaction volume of 2.4 billion U.S. dollars in 2019. Decentralized trading has all the advantages of permissionless, non-custodial, and most of them do not require registration and KYC review. In the past, decentralized exchanges were far inferior to centralized exchanges in terms of user experience and depth of funds, but the recent boom in liquid mining and DeFi has caused a huge influx of funds, making the amount of funds locked by decentralized exchanges never reach 1% of funds on centralized exchanges have grown to 2% today, and future growth is expected.

This article is divided into three parts: The first part analyzes the status quo and mechanism of decentralized exchanges. The second part studies the Uniswap mechanism and iteration. The third part discusses the future growth and bottlenecks of decentralized exchanges.

The status quo and mechanism of decentralized exchanges

Mechanism of decentralized exchange

The difference between decentralized exchanges and centralized exchanges is mainly reflected in the two dimensions of technology and governance. From a technical perspective, the decentralized exchange is a DApp built on the blockchain, through smart contracts, two modules of asset management and trading are realized. From the perspective of governance, a decentralized exchange is an open, community-driven, decentralized organization with highly distributed rights and obligations.

There are currently two types of decentralized transactions: the first is an order-based exchange, which uses a bidding model to complete transactions. The second is an algorithmic exchange, an exchange based on a liquidity pool, which completes transactions through an automatic market maker (AMM).

Order-based decentralized exchange

In order-type decentralized exchanges, one trader’s buy order and another trader’s sell order need to be matched to complete a transaction. All pending orders are stored in the order book in the blockchain. (Order Book) on. The core concept of order trading is similar to a centralized exchange. The difference is that the centralized exchange adopts a centralized matching mechanism, which has strong liquidity and investors do not need to bear too much slippage. Order-based exchanges allow traders to submit two types of orders, namely limit orders and market orders. The user submits a market order to purchase cryptocurrency at the best price. The transaction is completed by matching the buying and selling orders of both parties. The limit order is a trader who sets a specified price to buy a certain amount of tokens.

Order-based exchanges include exchanges such as EthFinex, IDEX, and EtherDelta. The most representative one is IDEX. The user experience of an order-based decentralized exchange is similar to that of a centralized exchange. The method of logging in to the exchange is replaced by logging in to the wallet, and the transaction is completed when the limit order is issued. The advantage of an order-based decentralized exchange is that it is directly traded through the wallet, which has high transparency and security. However, since the entire transaction process is on the chain, the transaction speed is slow and the confirmation time is longer, and the user experience is difficult to compare with the centralized exchange . The depth of the order transaction funds is not enough, the transaction cost is high, and the transaction may fail due to some congestion on the chain, gas fees, etc. The advantage of order-based decentralized exchanges is that market makers on order-based exchanges can precisely control the price points at which they want to buy and sell tokens. This means high capital efficiency, but it also requires exchanges to actively participate in and monitor the supply of liquidity.

Algorithmic decentralized exchange

The second type of decentralized exchange is an algorithmic decentralized exchange based on liquidity pools, represented by Uniswap, Balancer and Bancor. The background of the emergence of algorithmic decentralized exchanges is that decentralized exchanges often face the problem of insufficient liquidity at the beginning of their launch, while algorithmic decentralized exchanges use algorithms to provide transaction liquidity. The core concept of the algorithmic decentralized exchange is that the price of an asset will only change when a transaction occurs, and it is less subject to external manipulation, and the mechanism is very different from the order matching model.

The market maker in the order matching mode is responsible for providing quotations on the exchange. If there is no trading activity, the exchange will lose liquidity. In order to earn income, market makers buy and sell assets from their accounts. Their trading activities create liquidity for other parties and reduce the slippage of large-scale transactions.

Algorithmic decentralized exchanges use Automated Market Makers to imitate the quotation behavior of market makers. Common market maker algorithms are algorithms derived from constant product market makers and their functions. The constant product market maker is adopted by Bancor and Uniswap, and its mechanism is as follows:

Assume that the constant product market maker has injected 100 A tokens and 1,000 B tokens into this liquidity pool. Uniswap multiplies these two quantities (100 x 1,000 = 100,000) and sets a trading goal: regardless of the trading volume, the trading pair will always maintain a trading pair product number of 100,000. The constant product market maker is established based on the function x*y=z. Where x and y are the number of tokens in the liquidity pool, and z is the product. If you want to keep z constant, x and y can only move in opposite directions. This function determines the price range of two tokens based on the liquidity of each token. If the supply of A tokens by a trader increases, then the supply of B tokens must decrease, and vice versa, in order to keep the product z constant. If the function is drawn, it is found that this is a hyperbola, in which liquidity always exists, but the price will get higher and higher, and approach infinity at both ends.

However, this resulted in insufficient transaction depth in the automatic market maker model. Since y=z/x, when z does not change, the larger the value of x, the smaller the value of y. This means that when the user puts more tokens A into the transaction contract, the smaller the number of tokens B exchanged, the higher the transaction price. Therefore, it is difficult for users to conduct large transactions on algorithm-based decentralized exchanges such as Uniswap, otherwise they will have to pay high prices.

kwxiucz9wqdzu2idheading

Trading pair price under constant product function

With the development of liquidity based on the AMM model, hybrid constant function market makers have also emerged, which combine multiple functions and parameters to achieve specific goals. Such as adjusting the risk exposure of liquidity providers, or reducing the price slippage of transactions. For example, Curve’s AMM combines constant product and constant average market-making algorithms to provide liquidity in the fund pool, thereby reducing slippage.

However, algorithmic exchanges still have some problems to be solved. First, impermanent loss (Impermanent Loss). The most important risk faced by liquidity providers is impermanence loss, that is, over time, there is a difference in value between the liquidity providers depositing tokens in the liquidity pool and holding tokens in their wallets. As long as the market price of the tokens in the liquidity pool deviates from either side, impermanent losses will occur. Since the exchange rate of the token market price cannot be automatically adjusted within the liquidity pool, arbitrageurs are required to buy low-priced assets or sell high-priced assets. When the external market of a token changes, arbitrageurs can buy or sell any token that is currently relatively discounted in the liquidity pool. In this process, the profits drawn by arbitrageurs come from the pockets of liquidity providers, which will lead to impermanent losses.

nvuj47n6mfc5ahi2heading

The impermanence of the ETH/DAI liquidity pool due to currency price fluctuations

Second, multi-token risk exposure. Algorithmic decentralized exchanges usually require liquidity providers to deposit two different tokens in order to provide equal liquidity for both parties of the transaction. The quality of ERC20 tokens on decentralized exchanges is uneven, which means that liquidity providers will be forced to assume dual-token risks and cannot maintain long-term exposure to a single token.

Third, the capital utilization rate is low. In order to achieve low slippage, the liquidity pool of the algorithm-based decentralized exchange needs to reserve a large amount of liquidity. Since liquidity providers cannot determine the price point of liquidity, and prices are passively balanced by arbitrageurs, the liquidity utilization rate of most algorithmic decentralized exchanges is maintained at a very low level.

Current status of decentralized exchanges

Since July, the daily trading volume of decentralized exchanges has increased by 510%. Uniswap V2’s trading volume accounted for 43.9% of the total decentralized exchanges. In July, Uniswap V2’s daily trading volume increased by 116 million US dollars, an increase of 835%. As of September 8, the average daily trading volume of decentralized exchanges exceeded US$400 million, and Uniswap V2 accounted for 66.9% of the total daily trading volume of decentralized exchanges. The top five decentralized exchanges accounted for the largest share of the entire market. 92%.

io7vs6f247piuzlxheading

Percentage of average daily trading volume of decentralized exchanges in 2020

What we can find is that the substantial growth of decentralized exchanges in the past two months is mainly concentrated in algorithmic decentralized exchanges, and the market share of decentralized exchanges is gradually occupied by algorithmic decentralized exchanges. The main reason is that DeFi is not compatible with order-based decentralized exchanges. The DeFi field is still in its early stages, and the number of users is insufficient, and there is no guarantee that more traders will participate in the market. Due to the lack of liquidity and large transaction volume on the DeFi platform, its price is more susceptible to fluctuations. Such price fluctuations will be amplified in order-based decentralized exchanges, resulting in high transaction slippage and low transaction efficiency. Therefore, tokens with large price fluctuations are not easily accepted by order-based decentralized exchanges.

Algorithmic decentralized exchanges are completely suitable for DeFi tokens. They use algorithmic operations to pool the liquidity of market makers and traders. The algorithm completes transactions on the platform by setting parameters. Each automatic market maker exchange stores the buyer’s and seller’s funds in an off-chain liquidity pool. DeFi users have a better user experience, high transaction efficiency and a low decline in the case of small transactions.

In addition, we can see from the figure below that users are not sticky. In 2018, the decentralized exchange market just emerged. IDEX’s average daily active users were much higher than other platforms, and it monopolized the entire market. In 2019, the number of daily active users on each platform decreased compared with 2018. 0x, Kyber and Uniswap entered the market to compete, and the number of daily active users of IDEX declined the most.

By 2020, with the explosion of the DeFi concept, the overall transaction volume of decentralized exchanges and the number of daily active users on each platform will increase significantly. The market competition has become increasingly fierce. Uniswap currently accounts for the highest proportion of daily active users, with a market share of over 1%. The number of platforms has reached 10. The rise of liquid mining has brought about a large number of user growth. Algorithmic decentralized exchanges are the beneficiaries of this wave of craze, and how to retain users has become their biggest problem in the future.

ym91uwr03aspsrjnheading

Average number of daily active users on each platform of the decentralized exchange

Uniswap’s mechanism and iteration

Uniswap V1 mechanism and features

Uniswap is a liquidity protocol running on the Ethereum blockchain, supporting trustless token swaps, which means that all transactions on the exchange are automatically executed by smart contracts, and users do not need to rely on an intermediary There is also no need to trust a third party. On the Uniswap platform, there are three roles: The first is the liquidity provider, which is risk-neutral and aims to earn traders’ fees. The second is traders, who are real buyers and sellers on the platform. The third is arbitrageurs, who make profits when the platform price deviates from the market price and passively adjust the price on the platform.

5rwbv1v8s5io92iaheading

Beginning in 2019, Uniswap has developed rapidly. By the end of the year, the total value of Uniswap’s locked-up amount was US$29.1 million. By 2020, Uniswap will develop more rapidly. In the past month, Uniswap transaction volume has increased by 10 times, and liquidity has increased by 200%. There are four reasons why Uniswap has increased significantly in both transaction volume and user numbers during this period:

  1. The implementation mechanism of Uniswap is simple. Uniswap has low design complexity. It can operate on its own as long as the smart contract and algorithm are deployed, and the startup cost is low. In addition, Uniswap users do not need to register or go through a cumbersome KYC process, and as long as they have an Ethereum wallet, they can enter the market. Due to the current serious performance limitations of Ethereum 1.0, Uniswap’s low gas fee has become a major advantage.
  2. The user experience is good. Uniswap’s constant product market-making algorithm provides unlimited price range quotations and low slippage in small transactions. Moreover, it is very easy to provide liquidity in Uniswap, and the source of liquidity supply is simple.
  3. Tokens on the Uniswap platform can be listed without permission, meeting the demand for long-tail tokens.
  4. During the rise of Uniswap, the infrastructure of DeFi has been very rich. Now there are various derivatives such as loans, leverage, options, insurance, etc. These infrastructures have attracted a large amount of capital to enter and provide sufficient liquidity for the ecology.

Uniswap’s mechanism is quite simple and reasonable from an economic perspective: Uniswap charges traders a small fee and uses the fee as an incentive basis for liquidity providers, with a fee of 0.3%. The liquidity provider allocates transaction fees to traders according to the proportion of the number of tokens injected into the liquidity pool to the total liquidity pool.

However, in Uniswap V1, currency transactions are not supported. That is to say, if a trader wants to exchange token A into token B, he must first use token A to buy ETH, and then use ETH to buy token B . Traders need to pay two transaction fees and gas fees, which is quite unintuitive.

Uniswap V2

Uniswap carried out an iteration in March 2020, upgrading Uniswap to Uniswap V2, with three main changes. First, ERC20 is a trading pair of ERC20 tokens. Uniswap V2 no longer needs ETH as an intermediate exchange token to assist ERC20 currency transactions. It is expected that the transaction volume can be reduced by half and the gas fee of the transaction can also be saved. If there is no liquidity pool between the tokens that traders are trying to trade, they can use circuitous routes to obtain the trading pairs they want to trade more efficiently, without having to pass blocked ETH.

Second, Flash Swap. There are three steps in the lightning transaction process: One is to borrow tokens from Uniswap’s liquidity pool. The second is to use these tokens for a certain operation. The third is to repay these tokens. If any stage of this process fails, all state changes will be revoked, the relevant tokens will be returned to the corresponding Uniswap liquidity pool, and the transaction will be atomic. The main purpose of lightning trading is arbitrage trading, and traders can carry out arbitrage at low cost. While making a profit, return the value of the previously borrowed tokens to the Uniswap liquidity pool. Compared with directly using the tokens held by oneself to repay, this method consumes less gas.

Third, price prediction machine. Uniswap’s price is determined by the function curve, so it often deviates from the market price. Uniswap V2 introduces a price oracle machine to improve this problem. Before a transaction in Uniswap occurs, each transaction pair measures the market price at the beginning of each block, and the price at the beginning of each block is the transaction price of the last transaction in the previous block. If the attacker tries to manipulate the price, he needs to make multiple consecutive transactions that deviate from the market price, and no arbitrageur is involved.

In addition, Uniswap V2 sets a cumulative price variable in the smart contract, which is weighted by the time the transaction price exists. This variable represents the sum of prices per second in the entire Uniswap history of the contract. The external can use this variable to track the time-weighted historical average price in Uniswap at any time interval. In this way, market crashes and severe price fluctuations can be avoided, and the cost of attackers can be increased. However, Uniswap uses time-weighted average prices to modify the results after the fact and cannot accurately present market prices. For mainstream trading currencies, Uniswap cannot control the pricing power and needs to rely on other exchanges.

The rise of SushiSwap

According to statistics from DeBank, SushiSwap’s average daily trading volume on September 14 jumped to the second largest decentralized exchange, reaching 150 million US dollars. The amount of locked positions on the chain also exceeded 1.3 billion U.S. dollars, surpassing MakerDao to become the second largest DeFi protocol and causing Uniswap to lose more than 70% of its liquidity. SushiSwap can be understood as Uniswap agreement plus liquidity mining mechanism. Uniswap’s liquidity providers only earn transaction fees from the fund pool when they provide liquidity. Once they withdraw their funds from the fund pool, they will no longer receive the corresponding income. Moreover, impermanence losses often cut their profits.

With the development of ecology, there are more and more liquidity providers, and the income of early liquidity providers will be diluted. The liquidity provider of SushiSwap can receive additional liquidity mining rewards in the form of Sushi tokens while receiving transaction fees. And unlike Uniswap, even if the liquidity provider no longer provides its funds, the Sushi tokens it originally obtained can be converted into dividend tokens to capture the value of SushiSwap’s future growth.

SushiSwap can be said to be an advanced version of Uniswap. Its design mechanism has attracted liquidity providers to a large extent, but there are several risks to be aware of:

  1. In the long run, the SushiSwap liquidity mining mechanism cannot increase the willingness of ordinary participants to provide liquidity. Due to the limited amount of funds of ordinary users, the Sushi tokens obtained by ordinary liquidity providers are almost negligible compared to institutional investors and speculators with large funds.
  2. There is no upper limit on the total number of tokens issued by SushiSwap, and it is currently mined at 5.5 million tokens per day. Even in the second stage, the tokens will still be mined at 550,000 per day. Although SushiSwap is designed to repurchase at a transaction fee rate of 0.05%, SushiSwap has the possibility of inflation to lower the value of the currency, which in turn affects the willingness of liquidity providers to participate.
  3. Although SushiSwap claims that the smart contract will be audited by a technical audit company, there is no official security audit result yet, and the code security is not yet known.

Uniswap’s impact on future exchanges and its bottleneck

bottleneck

Exchanges are naturally affected by network effects, because traders want to trade on the most liquid platform. Since arbitrageurs can adjust the liquidity pool, the network effect of this liquidity also has a certain limit. Compared with traditional centralized exchanges, decentralized exchanges are more in line with the original intention of blockchain. If the problems of performance and architecture design are solved, it may win more support in the long run. But in terms of supervision, traditional centralized exchanges are gradually moving closer to regulatory compliance, using real-name systems or KYC mechanisms for supervision, combined with the support of third-party security companies (such as AML systems), which can effectively avoid money laundering or cryptocurrency crimes . Decentralized exchanges are always difficult to supervise, which is mainly reflected in two levels:

  1. The first is the user. Uniswap or some decentralized exchanges cannot grasp the user’s basic identity and do not need to conduct KYC review, which means the possibility of financial crime. Criminals can use decentralized exchanges to cover up the flow of funds, and even use new currency to launder money.
  2. The second is the project. Although most decentralized exchanges do not charge listing fees like centralized exchanges, they also cause uneven project quality on the decentralized exchange platform. For example, the projects on Uniswap are not You can trade on the platform without review, and the platform is easy to bear greater legal risks. In addition, the transaction depth of decentralized exchanges is insufficient to support large-value transactions. When large transactions occur, it is easy to cause premium transactions.

influences

Algorithmic decentralized exchanges can have far-reaching influence on future cryptocurrency transactions. In the future, whether centralized or decentralized cryptocurrency exchanges can apply this model based on some basic improvements. These improvements include the use of consortium chains or private chains, identity authentication and KYC of transaction users, and review of the use of compliant cryptocurrencies, etc. The application of Uniswap model can provide another possible choice for traditional stock exchanges, which can be mainly reflected in two parts:

  1. Since there is no need for an order matching model, the breadth of trading commodities can be greatly increased, and liquidity does not need to be provided by market makers, which can save the cost of related market makers. Since anyone can participate in providing liquidity and profit from it, the operation of the exchange is entirely based on the needs of the market.
  2. More and more decentralized exchanges are improving Uniswap’s algorithm, trying to solve the problems of high slippage and impermanent loss in large transactions. For example, Bancor V2 passed and  

All in all, Uniswap V2 is currently able to maximize its effect in the following trading situations: First, there are a large number of long-tail traders and frequent small transactions. The second is the low volatility of trading to the market. The third is that the trading pair liquidity pool has sufficient scale.

Although decentralized exchanges are growing rapidly at present, most of the trading volume is still in centralized exchanges. Binance’s average daily trading volume is close to 5 billion U.S. dollars, and Uniswap’s highest daily trading volume is no more. 2%. How decentralized exchanges overcome security concerns and liquidity issues in the future will be the key to the continued growth of decentralized exchanges.

Total
0
Shares
Leave a Reply
Related Posts

Another cryptocurrency lender suspends services

Cryptocurrency lending platform Hodlnaut has announced a freeze on withdrawals, deposits and token swaps, citing “difficult market conditions” amid a series of similar incidents. According to an official announcement, Hodlnaut has notified the Monetary Authority of Singapore (MAS) of its intention to…
Read More

Fed Chairman’s Speech Sparks Bitcoin Volatility

An interview with Federal Reserve Chairman Jerome Powell at the Economic Club of Washington sparked wild swings in the Crypto asset. During the talk, Powell pointed to the start of a deflationary process in the commodity sector and the expectation of a…
Read More