Although there is no universal solution to the problems of impermanent loss and slippage faced by the AMM structure, there is still much room for improvement in the design of the DEXs ecosystem.
Recommended reading: ” Selected Good Articles from Chain News丨Understand the popular DeFi track “Automated Market Maker AMM” “
Original Title: “The Status and Future of Automated Market Makers (AMM)”
Written by: Huobi DeFi Labs
When reconstructing a new financial world on a blockchain-based distributed system (such as Ethereum), it must be recognized that the blockchain world has completely different dynamic properties compared to the off-chain world.
Most notably, the chain is not continuously timed, but blocks are used to quantify the passage of time. But because it is limited by the block size, this in turn leads to latency problems and limitations in computing power. Because of these structural differences, the designers of distributed finance should have completely different ideas from those of the centralized world. For example, due to the cost and technical infrastructure of the blockchain, market makers do not have much advantage in market-making on DEX based on the on-chain order book.
In traditional markets, an order book is usually used to record transactions between buyers and sellers of a financial instrument. Since the development of the financial market, technological advancements have made the order book extremely efficient, and even high-frequency transactions through ultra-high-speed optical fiber data centers have become a reality. The natural best price discovery process always occurs in the off-chain world (order book).
On the other hand, due to the impact of blockchain delays and computational costs, the order book running on the chain is at a slight disadvantage. Based on some ideas of Nick Johnson, Vitalik (2016) proposed a simple method of on-chain market makers, now called automatic market makers (AMMs). These ideas have developed today’s decentralized exchanges (DEXs) based on AMMs, and such AMMs dominate the current DeFi ecosystem.
Transaction volume and market share of different types of DEX, source: DeBank, Huobi DeFi Labs
According to data from DeFi data service provider DeBank, of the 30 DEXs it tracks, only 8 are based on the order structure. At the same time, in comparison, more than 75% of the transaction volume comes from the top 3 DEXs based on AMM, namely Uniswap V2, Curve, and 1inch.
Historical trading volume of DEXs, source: DeBank, Huobi DeFi Labs
The sudden rise of DeFi in the middle of the year has brought huge development opportunities to DEXs, and AMM-based DEXs have lower entry barriers for liquidity providers, better availability, and liquidity compared to order book type DEXs. Better and most popular.
The increase in the overall transaction volume of AMM-based DEXs in June 2020 indicates that DEXs of the AMMs type have become a basic demand in the DeFi ecosystem. However, there are still various problems in the world of AMM-based DEXs. For example, when providing liquidity on AMM type DEXs, compared with the order book market-making structure, its capital utilization rate is relatively low. In addition, the most criticized issue of AMM type DEXs is the problem of impermanence-due to the fluctuation of the target trading pair, the temporary capital loss experienced by the liquidity provider.
Although there is currently no one-size-fits-all solution to the problems faced by the AMM structure, there is still much room for improvement in the design of the DEXs ecosystem.
Auto Market Maker (AMM) Existing Issues
Existing AMM-type decentralized exchanges (AMM), such as Uniswap (constant product market maker), Balancer (constant average market maker) and Curve (mixed constant function market maker) all use constant function market makers (CFMM) model. CFMM (constant function market makers) is determined by transaction function and liquidity. “Constant function” means that if the liquidity of the asset is changed in each transaction, it is necessary to ensure that the product of the liquidity of the asset remains unchanged (that is, equal to a constant).
Although these DEXs have some similar theoretical characteristics and have achieved greater success, the current AMMs design still has some problems. Current problems include but are not limited to potential impermanent losses, large slippage and low capital utilization.
By injecting assets into the AMMs liquidity pool, the overall return of the liquidity provider usually consists of two parts, plus an optional incentive part. They are: impermanent losses, transaction fees and incentive gains.
Market making in any type of financial market will be accompanied by certain risks. These risks are often reflected by the difference between the transaction price and the asking price in the order book, which we usually call the spread. In the AMM type of DEX, these risks are reflected as potential impermanent losses, which may result in a significant reduction in the overall income of liquidity market makers.
There are various solutions on the market to reduce or eliminate impermanence losses. Such as the launch of options, or Bancor V2 that uses dynamic weighting to adjust the price of tokens. However, no solution really solves this problem. In addition, many industry participants are moving further and further towards a doomed road. To truly solve the problem of impermanent loss, we must first systematically understand and quantify the financial parameters on the chain.
Impermanent loss (difficult to hedge)
The impermanence loss refers to the difference between the gains obtained when liquidity providers simply hold assets and the gains when they are injected into the AMM pool. This difference exists because of the volatility of trading pairs. Suppose there is a liquidity pool composed of x assets and y assets. If the price changes from P to P’, the market value of the fund pool becomes
And the value of the portfolio becomes
We obtain the impermanence loss correlation function (Divergence_loss) as follows:
Source of impermanence loss function: Huobi DeFi Labs
As can be seen from the above figure, no matter the direction of price changes, it will lead to impermanence losses. But if the price can return to the initial value, the loss is temporary.
Slippage
From a trader’s perspective, slippage refers to the difference between the final price of the transaction and the actual market price.
The greater the liquidity of the fund pool, the lower the slippage. The design of the market-making mechanism makes it easier for larger liquidity pools to benefit from economies of scale.
The larger the liquidity pool, the lower the slippage, and the easier it is to attract greater trading volume.
Diagram of the relationship between liquidity and daily trading volume (horizontal axis: liquidity, vertical axis daily trading volume), source: Uniswap V2, Huobi DeFi Labs
Fund utilization
According to data from DeFi Pulse, the value of encrypted assets locked in the DEX agreement has exceeded US$4.42 billion, which accounts for about 1/3 of the TVL of the DeFi market. Considering that a large amount of funds are locked in DEX, one of the most pressing questions at the moment seems to be: Are these assets being used well, do they contribute more value to the ecology or are they just being left unused?
Capital utilization is an important component of the financial market. Low capital utilization means that the investment portfolio structure is poor, and idle assets are not being used well to obtain income. The relationship between liquidity and transaction volume can be expressed by capital utilization.
Capital Utilization Ratio = Trading Volume (24h) /Tota Value Locked
This article extracts and studies the liquidity and transaction data of the top 100 trading pairs in Uniswap V2 on October 28, 2020, to reflect the current status of fund utilization in the DeFi ecosystem.
The analysis results show that the capital efficiency of Uniswap’s liquidity pool is low, with only 23% of assets used for trading on average. Only 5 of the top 100 trading pairs have a fund utilization greater than 100%, including OCEAN/ETH, ETH/HEX2T, NAMI/ETH, ETH/CRV and KORE/ETH. 88% of the 100 trading pairs have a trading capital utilization rate of less than 40%, while 56% of the trading pairs have a capital utilization rate of less than 10%.
Fund utilization rate of Uniswap V2 top 100 trading pairs, source: Uniswap V2, Huobi DeFi Labs, data as of October 28, 2020 (excluding 5 trading pairs with capital efficiency> 1)
Decentralized transactions using different AMM mechanisms have completely different capital utilization rates, so there may be a large amount of funds locked in the agreement, but the capital utilization rate is not high. The following is an analysis of the capital utilization of the three agreements described in this article.
Fund utilization of different decentralized exchanges (Nov. 10, 2020)
The results show that CoFiX currently has a capital utilization rate far exceeding the other two agreements. We also calculated the historical capital utilization of these three agreements; it can be seen that Uniswap’s capital utilization has continued to decline with the cooling of DeFi since the beginning of autumn, DODO has remained at about 20%, and the capital utilization of CoFiX has been online. After rising continuously.
Sources of historical capital utilization of different decentralized exchanges: Uniswap, DODO, CoFiX
Last asset
AMM provides a very simple way for market makers to divert early projects, no longer need to worry about the cumbersome process of going online and the relatively high cost. Market makers in centralized exchanges need a complex market-making algorithm to distribute a large number of assets on different exchanges to provide liquidity. Unlike the traditional order book structure, market participants trade with a certain asset pool in the liquidity pool instead of trading with a specific counterparty, and there is no need for customized market-making algorithms. Automated market making lowers the threshold for DEX drainage, so long-tail assets flock in, and they can easily guide early liquidity for price discovery.
As of October 26, 2020, there are 18,440 and 3,747 trading pairs on Uniswap V2 and V1 respectively. Huobi Global Exchange has about 800 trading pairs, and Binance has about 1,100 trading pairs.
Number of trading pairs (October 26, 2020), source: Dune Analytics, Huobi, Binance
Comparison of Uniswap V2, Huobi and Binance trading pairs and tokens, source: Dune Analytics, Huobi Global Data as of October 26, 2020
The low overlap rate of different assets on different platforms shows that each exchange can meet the differentiated needs of users. On October 26, 2020, Uniswap V2 had 656 trading pairs (ETH-based trading pairs) with daily trading volume greater than 0. Among them, 51 trading pairs (ETH-based trading pairs) have been listed on Huobi. In terms of currencies, Uniswap V2 and Huobi Global both listed 74 assets.
As of October 26, 2020, from the large difference in the number of trading pairs on the three platforms and the low repetition rate of trading pairs, it can be seen that compared with centralized exchanges, decentralized exchanges such as Uniswap can satisfy The differentiated needs of multiple users.
AMM-type decentralized exchanges are expanding the entire trading ecosystem to accommodate multiple trading pairs, including crypto assets with low liquidity and low trading volume.
Stability of transaction price
Time series of stable trends
The impermanence loss function described above shows how price changes affect the value of assets held by liquidity providers. At the same time, it shows that the favorable condition for the liquidity provider is that the exchange rate of its participating liquidity pool assets x and y is maintained at a stable level (such as USDT/USDC) or oscillates back and forth.
However, the results of this article found that most transactions have a memory of time series, that is, they have a stable upward or downward trend, which is extremely disadvantageous for liquidity providers. The following are three typical time series. Transactions with mean reversion characteristics are beneficial to liquidity providers, while time series with upward and downward trends have obvious impermanence losses because their prices are difficult to return to their original positions.
Three different time series, source: Huobi Global exchange
Hurst index estimation
Transaction pair price time series (a group of data point sequences arranged in the order of time) can be divided into different categories, such as mean regression process 1, geometric random walk 2, trend series 3 (trend stable series). At present, most trading pairs of Huobi Global Exchange are trend stable sequences.
This article explores the trend characteristics of the time series of trading pairs through statistical analysis of the price data of trading pairs. The test method adopts the Hurst index 4 estimation proposed by HEHurst (1951).
The Hurst index can measure the long-term memory of a time series5, and can measure how the fluctuation range of a time series changes over time.
Source of H values corresponding to three different time series: Eduardo Gallego 2020 (github.com/3dvg)
- In the traditional financial field, mean reversion assumes that as time moves, the price of a stock moves toward its mean value.
- Random walk, also called random walk, is a mathematical statistical model. Random walking, etc. refers to the inability to predict future development steps and directions based on past performance.
- If a price series continues to close, it will either rise or fall (averaged within a specified period), indicating a trend.
- Hurst, HE (1951). Long-term storage capacity of reservoirs. Transactions of the American Society of Civil Engineers, 116, 770-799.
- Memorability means that the current (or past) value of the time series affects the future value of the time series far beyond what can be achieved by random disturbances.
The value of the Hurst index is distributed between 0 and 1. According to the size of H, a time series can be divided into three categories.
a) 0<H<0.5 represents an anti-persistent sequence, which has the characteristic of “mean recovery”, that is, the value of the sequence will return to its average value over time. The closer H is to 0, the more obvious the characteristic of “mean recovery”.
b) H=0.5 represents a random sequence, which has no correlation.
c) 1> H> 0.5 means that the time series has long memory, which means that the direction of the next value is more likely to be the same as the current value. The larger the Hurst index, the stronger the trend. For time series with rising or falling trend characteristics, the Hurst index will be between 0.5 and 1.
data analysis
The historical price data of trading pairs is taken from Huobi Global Exchange, including 4 different time spans for each trading pair: 30 minutes, 60 minutes, 4 hours and 1 day.
This paper uses the following formula to produce the Hurst index result.
Where R is the variation range of the observation point, S is the standard deviation, c is a constant, n is the number of samples, and H is the Hurst exponent. After importing historical price data, 2864 Hurst index results can be finally obtained, and the result distribution is shown in the figure below.
Distribution of Hurst index results in different time spans, source: Huobi DeFi Labs, uobi Global Exchange
The Hurst index result distribution chart above shows several characteristics of Huobi Global Exchange trading pairs:
- ~9.7% of trading pairs Hurst index result is greater than 1. Since the H value calculated by the R/S method under normal circumstances should not be greater than 1, this article uses another method to calculate the Hurst index, DFA, to calculate the H value of these trading pairs time series, and get the same result. The results greater than 1 can be explained by the following two: Due to the relatively recent online date of the trading pair, the data sample size is small and there is a large amount of noise; secondly, these trading pairs are non-stationary in the time series.
- ~80.8% has a trend (0.5<H<=1). These transactions have an upward or downward trend in time series. Since most trading pairs (x/y) have an upward or downward trend, that is, the exchange rate of x and y assets is not a long-term mean recovery, so it is not suitable to be used as a liquidity pool to form assets.
- There is no random walk sequence.
- ~9.4% has mean recovery characteristics. This kind of time series usually quickly changes the direction of the trend, returning to the mean value over time. Trading pairs with mean recovery characteristics are what AMM liquidity providers most hope to provide. However, at present, less than 10% of trading pairs are suitable as liquidity pools to form a property.
- Hurst index values greater than 1 mostly occur in data samples with a period of 1 day.
Hurst index statistical results of different time span data samples, source: Huobi DeFi Labs, Huobi Global Exchange
In this paper, the H value results of four different time spans are drawn into different frequency distribution histograms. In the figure, the x-axis represents the bending range of H, and the y-axis is the number of H values falling within the modified range. The results show that the longer the time span, the wider the shape of the frequency distribution.
Except for the time series with a time span of one day, the H value results of the time series with a span of 30 minutes, 60 minutes and 4 hours are all concentrated between 0.5 and 0.6, indicating that most time series have a trend. From the perspective of the liquidity provider’s perspective, since the strength of the “mean recovery” increases as the H value approaches 0, the trading pairs (x/y) of different time spans on the exchange obviously do not have the mean recovery characteristic.
Source of frequency distribution of Hurst index values in different time spans: Huobi DeFi Labs, Huobi Global Exchange
All in all, 80% of trading pairs from Huobi Global Exchange have trend characteristics. This shows that the ratio of 80% of transactions to x/y, that is, the transaction price, will deviate significantly. The providers that provide liquidity for these trading pairs face potential The huge impermanence loss.
Liquidity provider income analysis
Profits are crucial to liquidity providers, and analyzing this process helps liquidity providers make decisions about when to provide liquidity for which agreement.
Uniswap is a leading non-oracle price feed AMM, while DODO and CoFiX use Chainlink and NEST respectively as external oracle price feed sources. Therefore, these three agreements will be discussed in this chapter. We analyze the income (including compensation, impermanent loss and handling fee) of the ETH/USD(T/S) fund pool or unilateral fund pool of these three agreements, and supplemented by stress testing.
Uniswap liquidity provider income analysis (ETH/USDT fund pool, Nov. 10, 2020), source: Uniswap V2, Huobi DeFi Labs
For those who inject liquidity into the Uniswap ETH/USDT fund pool on November 10, 2020, if the price of UNI fluctuates within 20%, the expected annualized return on investment is 12.5%-19.0% (not considering The appreciation or depreciation of ETH itself). Since liquidity providers cannot predict the price trend of ETH, they cannot lock in a fixed rate of return.
Analysis of DODO Liquidity Provider Income (Unilateral Injection of ETH/USDC Fund Pool, Nov. 10, 2020), Source: DODO, Huobi DeFi Labs
DODO’s ETH/USDC fund pool allows unilateral liquidity injection. The above table shows that the liquidity injection of the two assets in the DODO ETH/USDC fund pool will obtain completely different benefits. Depending on the price of the DODO token, USDC liquidity providers can obtain an annualized return of 5.8%-12.3%; at the same time, ETH liquidity providers can receive an annualized return of 3.0% -4.4%, if ETH depreciates by 20% , Its actual annualized rate of return will be -17.0%.
DODO tries to reduce the loss of impermanence by introducing Chainlink oracles, but its income is uneven (or uncalculated), and it may also face the problem of oracles. Regarding the issue of oracle, please refer to our previous report “Price oracle-an indispensable infrastructure”.
CoFiX liquidity provider income analysis (ETH/USDT fund pool unilateral injection, Oct. 21, 2020) Source: CoFiX, Huobi DeFi Labs
CoFiX also allows unilateral liquidity injection into the fund pool, and its fund pool assets must have a certain density of quotations in the NEST oracle. Due to the poor liquidity of the COFI token itself in the secondary market, its exact rate of return on investment cannot be calculated. We estimate that when it goes live (October 21, 2020), the annualized return rate of the ETH/USDT fund pool will be approximately 60.2%.
Unlike the other two protocols, as mentioned above, CoFiX’s market-making risk can be hedged on a centralized exchange (the CoFiX team provides a hedging script). Therefore, CoFiX can attract a large amount of funds (such as institutions, etc.) into DeFi The world is making market.
Comparison of the annualized returns of liquidity providers of different decentralized exchanges (Nov. 10, 2020) Source: CoFiX, DODO, Uniswap, Huobi DeFi Labs
The total lock-up volume of different decentralized exchanges, source: Dune Analytics, Huobi Global, Binance Date: Nov. 10, 2020
Uniswap is one of the first decentralized exchanges to adopt the AMM mechanism, and the total lock-up amount of its fund pool has reached more than 100 times that of DODO and CoFiX. However, with the launch of CoFiX, Uniswap is no longer the best choice to provide liquidity due to impermanence.
The above figure shows that both DODO and CoFiX can obtain positive returns for liquidity providers (please note that market making in CoFiX requires hedging settings), but when the price of UNI falls by 12.45% or more, Uniswap’s liquidity provider will No positive income can be obtained.
On the other hand, DODO and COFI tokens have not yet been launched on any large centralized exchanges, which means that their liquidity is relatively poor, so it is difficult to quickly realize the token rewards for liquid mining.
Outlook, Computable Finance–DeFi 2.0
DeFi, as the name suggests, combines the distributed nature of blockchain technology with traditional finance to create a next-generation financial service experience. Based on blockchain technology, DeFi realizes the mainstay of finance in a fair, open, and distributed manner.
Although there have been some notable innovations in the past two years, such as AMMs and oracles, the research and development of risk in the DeFi field is extremely limited. But one of the most important elements that constitute the foundation of finance is risk management. Black Thursday is a stress test for the DeFi financial system. It has sounded a timely wake-up call for industry participants. There are many different systemic risks in the DeFi field. These risks may crash the entire industry, but they still It is impossible to accurately calculate the risk in the current DeFi field.
As we continue to build DeFi Lego and introduce various components of traditional finance into the new ecosystem, the composability of DeFi will exponentially expand the risk. When the market collapses, these unquantified risks may collapse the DeFi ecosystem.
We hope to see that the next generation of DeFi can bring computable components to the ecosystem, so that various financial parameters can be quantified, and market efficiency can be improved. Computable financial parameters will only bring net positive benefits to the ecosystem, and at the same time promote our thinking and understanding of risks in the DeFi field.
Therefore, the next iteration of DeFi should be the transition to Computable Finance (CoFi), in which every financial parameter can be quantified to help market participants form wise decisions. Computable risk will become a game changer for DeFi in the future.
Computable finance (or CoFi), as the next iteration, laid the foundation for DeFi 2.0.