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

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

Loading

The explosion of the DeFi concept in 2020 has caused the rapid growth of algorithm-based decentralized exchanges such as Uniswap, but security and liquidity issues will be the key to their continued growth.

Written by: Qian Baijun, at HashKey Capital Research
Reviewer: Zou Chuanwei, Chief Economist of Wanxiang Blockchain, PlatON

From the recent development Uniswap to study the growth of decentralized Exchange (DEX) is. The conclusion is that since the project started recently DeFi liquidity mining, decentralized exchange of locking a substantial increase in funding. To the center of the exchange as an important ecological DeFi in infrastructure funds also contributed to the influx of liquidity and capital to the center of the pool depth exchanges. The algorithmic decentralized exchange market maker has an automatic mechanism and a good user experience, gradually replacing the order type to the center of the exchange’s market share. However, there are still many Exchange to the center of the problem, the next to the center of the exchange how to overcome security concerns and the liquidity problem will be the key to its continued growth.

Thanks to the recent growth of the outbreak of DeFi, monthly trading volume in August 2020 to the center of the exchange reached $ 11 billion, compared with $ 2.4 billion in the whole of 2019, total trading volume, will be nearly five times more. 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 paper is divided into three parts: The first part analyzes the status quo and mechanisms to the center of the exchange. The second part studies Uniswap mechanism and iteration. The third part discusses future growth and the bottleneck to the center of the exchange.

The status quo and mechanism of decentralized exchanges

Mechanism of decentralized exchange

Exchange difference to the center and the center of exchanges, mainly in technical and governance two dimensions. From the perspective of technology, the decentralized exchange is a DApp built on the blockchain , which implements two modules of asset management and trading through smart contracts. From the point of view of governance dimensions, decentralized exchange is an open, community-driven, rights and obligations of highly distributed decentralized organization.

Currently all transactions to the center of two types: the first type is the order exchange, using an auction model to complete the transaction. The second is the exchange algorithm type, based on exchange liquidity pool, to complete the transaction through automated market makers (AMM).

Order-based decentralized exchange

Orders to the center of the exchange type, you need to match a trader’s buy order and sell order another trader, respectively, to complete a transaction, the sale of all pending orders are stored in the block chain in the order book (Order Book) on. The core concept of trading orders of similar centers of exchange, the difference lies in the center of the center of the match to take the exchange mechanism, strong liquidity, investors need not take excessive 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 is IDEX, an order similar type to the center of user experience with centralized Exchange Exchange Exchange login way to log into the purse, while limit orders issued transaction also completed transaction. The advantage of the order-type decentralized exchange is that it is directly traded through the wallet, which has high transparency and security. However, because 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 that capital-efficient, but also requires the active participation of exchange and monitoring of liquidity supply.

Algorithmic decentralized exchange

The second type of decentralized exchange is an algorithmic decentralized exchange based on liquidity pools, represented by Uniswap , Balancer and Bancor . Algorithmic Exchange born to the center of the background that decentralized start at the beginning of the exchange often face shortage of liquidity problems, while the exchange algorithm type to the center of the depth of the transaction to provide liquidity by way algorithm. The core concept of algorithmic decentralized exchange that the price of the asset only when the transaction occurred change will occur, less subject to external manipulation mechanism and order matching pattern is very different.

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 to the transaction, reducing slippage big deal.

Algorithmic decentralized exchange market maker is to use automatic (Automated Market Makers) to mimic the behavior of market makers quote. 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 . Wherein x and y are the number of tokens in the pool of mobility, 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 a user puts more tokens A into the transaction contract, the smaller the number of tokens B exchanged, the higher the transaction price. Thus, the user is difficult to conduct large transactions on Uniswap algorithms type to the center of exchange, or they will have to pay a very high price.

HashKey: Analyze the development trend and bottlenecks of decentralized exchanges from UniswapTrading 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 binding constant of the AMM and constant product average market making algorithms to provide liquidity pools, 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 internal flow cell can automatically adjust the token price of the exchange rate, thus requiring arbitrage by buying underpriced assets or selling assets of high prices. 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 extracted arbitrage profits from the pocket of the liquidity providers, which leads to uncertain loss.

HashKey: Analyze the development trend and bottlenecks of decentralized exchanges from UniswapThe 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, with the intention of providing equal liquidity for both parties of the transaction. ERC20 tokens on the quality of the exchange center away uneven, which means that the liquidity providers will be forced to bear a double risk token, can not maintain the long-term risk of exposure to a single currency generation.

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. And because the liquidity provider can not determine the liquidity of price points, price passively by arbitrageurs to balance, so most of the liquidity utilization of algorithmic decentralized exchange remained at very low levels.

Current status of decentralized exchanges

Since July decentralized Stock Exchange daily trading volume grew 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%.

HashKey: Analyze the development trend and bottlenecks of decentralized exchanges from UniswapPercentage of average daily trading volume of decentralized exchanges in 2020

We can see that the substantial growth of the past two months to the center of the exchange focused on the exchange algorithm type to the center, away the center of the exchange’s market share has gradually been occupied algorithmic decentralized exchange. The main reason is DeFi and Order to the center of the exchange are not compatible. 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 in the figure below is not strong user stickiness. 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.

HashKey: Analyze the development trend and bottlenecks of decentralized exchanges from UniswapAverage 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 Uniswap platform, there are three roles: the first is the liquidity provider, the risk-neutral, aims to earn a commission trader. The second is the traders, they are genuine buyers and sellers in the platform. Third, arbitrageurs, they make a trading profit in the platform and the market prices deviation, and passive adjustment of the price on the platform.

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

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’s 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. Simple Uniswap enforcement mechanisms. 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 without permission can be listed on the Uniswap platform to meet the needs of 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 does not support currency currency trading, that is, if the trader you want to be converted into tokens A token B, ETH must buy tokens for A, then B then ETH buy tokens . 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 can be expected to reduce by half the volume of transactions, as well as saving Gas costs of the transaction. 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 trading (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 at any stage of this process fails, all state changes will be revoked, the relevant token back to the corresponding Uniswap flow cell, the transaction is 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, the price oracle 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 set a cumulative price variable in intelligence contract, the variable is the time to present the transaction price weighted. 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 using the time-weighted average price is the result of ex-post correction can not be accurately render the market price for the mainstream transaction currency terms, Uniswap can not control pricing, need 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 U.S. dollars. The amount of lock-up on the chain also exceeded US$1.3 billion, surpassing MakerDao to become the second largest DeFi protocol , and causing Uniswap to lose more than 70% of its liquidity. SushiSwap protocol can be understood as Uniswap plus flowability 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 get 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, SushiSwap liquidity mining mechanism can not raise general willingness to provide participants with 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. Total SushiSwap tokens issued no upper limit, and currently number 5.5 million every day on behalf of coins mining, even to the second stage, tokens, or will the number of 550,000 per day to dig out. 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

Exchange will naturally be affected by network effects, as traders want to trade at the best platform for mobility. 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 the regulation, the traditional center of exchange gradually move closer to regulatory compliance, the use of real names or KYC and other regulatory mechanisms, in conjunction with third-party security company’s support (such as AML system), can effectively prevent criminal money laundering or encryption . Decentralized exchanges are always difficult to supervise, which is mainly reflected in two levels:

  1. The first is the user, Uniswap or some decentralized Exchange was unable to master the basic identity of the user does not need to be KYC review, which means that 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 project, most of the decentralized exchange, although not as charged on currency exchange fees as centralized, but also caused the quality of the project on decentralized exchange platform mixed, and such items on Uniswap does not require review that is able to trade on the platform, the platform easily withstand greater legal risk. 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 exchange on Uniswap algorithms make improvements to try to resolve the problem of large transactions slippage and impermanence high losses. For example, low-slip model Bancor V2 by Chainlink oracle and cooperation can be established volatility of assets, in addition to transaction price is determined by arbitrageurs, but also can provide price updates from the oracle, effectively avoid liquidity providers Impermanence loss.

In summary, the current Uniswap V2 can play the largest transactions to effect: First, the large number of traders long tail, and frequent small transactions. Second, low volatility market transactions. Third, the liquidity pool for trading have sufficient scale.

Although decentralized exchanges are currently growing rapidly, 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 than that. 2%. Next to the center of the exchange how to overcome security concerns and liquidity problems will be the key to the center of the exchange continues to grow.

Source link: mp.weixin.qq.com