header-langage
简体中文
繁體中文
English
Tiếng Việt
한국어
日本語
ภาษาไทย
Türkçe
Scan to Download the APP

In-depth comparison of underlying algorithms, liquidity distribution, and market performance between Uniswap V3, Curve V2, and DODO.

2022-12-01 13:36
Read this article in 35 Minutes
总结 AI summary
View the summary 收起
Original Title: "In-depth Comparison of Uni V3, CurveV2, DODO Market Making Algorithms - Efficiency Improvement Brought by Concentrated Liquidity"
Source: DODO Research


Introduction


In the development of DEX, the iteration of algorithms and changes in market-making forms are a major trend. From constant price and constant product market-making to various centralized liquidity algorithms, the efficiency of DEX's underlying market-making algorithms is increasing. Among the many options, DEXs that adopt centralized liquidity solutions have performed well in the market, with Uni V3, Curve V2, and DODO being among the top performers. Each of these platforms has implemented liquidity concentration in different ways, improving the capital efficiency of LPs and achieving great success in the market. This article will analyze the underlying market-making algorithms from multiple dimensions, compare the data performance of the underlying algorithms of the three trading platforms, and compare the overall market performance of the three trading platforms.


Concentrated Liquidity


Efficiency is the key to economy. - Benjamin Franklin


Constant product market-making formula: x*y=k, is considered a breakthrough innovation in the DeFi field. It has pioneered the trading form of the fund pool model to achieve on-chain transactions, but the AMM market-making curve of constant product also has unavoidable efficiency problems.


Uniswap (Uni) early versions adopted the constant product market-making formula. As can be seen from the graph, its liquidity is evenly distributed on the curve, and the theoretical fluctuation range of Token price is from 0 to infinity, while the actual price fluctuation range in the market is concentrated in a small range. Therefore, the liquidity outside the price fluctuation range does not really provide to the market, which causes efficiency loss. In this case, slippage, market depth, and impermanent loss will be negatively affected.


来源:Curve Whitepaper


Concentrated liquidity refers to changing the distribution of liquidity on the market-making curve in a certain way, concentrating liquidity in the most frequently traded range of the market, and improving the efficiency of market-making funds. Broadly speaking, any attempt to regulate the market-making curve by changing the distribution of liquidity in the fund pool can be called concentrated liquidity. Uni V3, Curve V2, and DODO are all typical DEXs with concentrated liquidity, but the obvious differences in underlying algorithms also make them different. There is not a single solution for concentrated liquidity, but the essence is to improve the efficiency of fund utilization as much as possible and meet the market demand and market-making demand for token trading.


 三种做市曲线(从左至右分别是 Uni V3,Curve V2,DODO)

Uni V3, Curve V2, DODO - Three Concentrated Liquidity Market-Making Curves


Uni V3


Range orders and leverage liquidity


Range Order proposed by Uni V3 allows users to provide liquidity in a specific price range, which concentrates the market-making funds in a specific price range, and the distribution of liquidity in the entire pool is the sum of all curves. LP provides leveraged liquidity because LP's funds only work in the selected price range. If within the range, the efficiency of market-making funds earning fees is doubled; if outside the range, the market-making funds become ineffective.


Multiple Range Order Diagram (Source: "Uniswap V3: Liquidity Providing 101" by MellowProtocol)


It can be seen that the centralized liquidity mechanism of Uni V3 provides a mechanism for leveraged liquidity, and LPs concentrate liquidity near the market price through subjective behavior. LPs will subjectively predict the range of price movement. When the market price fluctuates, LPs will actively adjust their market-making range. A large number of adjustment behaviors will lead to changes in the overall distribution of liquidity, which statistically will eventually be concentrated near the market price. Overall efficiency has been improved, but the efficiency changes between users depend on their specific order placement behavior.


 USDC / ETH 0.3% Pool 流动性分布(来源:Uniswap 官网)


Design Analysis and Pros and Cons


The design purpose of Uni V3 is to improve the efficiency of LP funds, and LPs can freely choose the range of liquidity they provide according to their own judgment to customize market making. Although this design improves the overall market making efficiency of LPs, the income of LPs is uneven, and additional decision-making costs are added. The initiative of LP market making is stronger, but to a certain extent, it contradicts the original intention of DEX's lazy market making. Most retail investors do not have the ability to predict the market, but instead face higher impermanent loss risks due to leveraged liquidity. This design has also spawned the phenomenon of JIT (Just In Time) attacks, making market making operations more complex.


Advantages


High flexibility, can customize the price range of market making and control the efficiency of funds. The distribution of market liquidity is formed subjectively by the range of limit orders placed by all LPs, which is closer to market behavior. The upper limit of fund efficiency is high.


Disadvantage


LP revenue depends on the LP's ability to judge the market, which increases the LP's decision-making costs, resulting in uneven LP revenue and the possibility of JIT attacks. Improving efficiency also increases risk, and high leverage liquidity will face higher impermanent losses.


Curve V2


Automatic Price Curve Adjustment


Curve V2 is designed by Curve for non-stable assets, and its core concept is no different from Curve's StableSwap. Let's review the StableSwap proposed by Curve.


Curve's first-generation algorithm is very simple, it is a weighted sum of constant product and constant price market-making curves. This makes the curve's curvature smaller around fixed prices and concentrates liquidity at fixed prices. In stablecoin trading, prices are concentrated around 1, and Curve achieves liquidity concentration around 1 in this way, thereby improving capital efficiency.


来源:Curve Whitepaper


Curve V2 is designed for non-stable assets and uses both constant product and constant price automated market maker (AMM) curves to calculate a new AMM curve, which is dynamically adjusted. The previous generation algorithm could only concentrate liquidity around a fixed price, while this generation algorithm dynamically adjusts the price and degree of liquidity concentration based on an internal oracle. Curve V2 defines a parameter called K, which dynamically adjusts the shape of the curve. The larger the K value, the smaller the curvature, and the closer the curve is to a constant price curve, resulting in more concentrated liquidity.


来源:Curve Whitepaper


Curve V2 will calculate the D value based on its internal oracle, which determines the anchor price, i.e. the price of liquidity concentration. The Curve V2 algorithm concentrates liquidity by blending constant product and constant price curves, continuously updating the weights of the two curves. The internal oracle determines the anchor price of liquidity concentration, and by continuously updating this price, liquidity is concentrated near the market price.


来源:Curve Whitepaper


Design Analysis and Pros and Cons


The design of Curve V2 is relatively simple, concentrating liquidity through a combination of constant product and constant price curves, with an internal oracle determining the anchor price. In this design pattern of Curve V2, changes in the internal oracle price are achieved through user trading behavior. When a large amount of trading behavior causes the price to deviate significantly, the internal oracle updates the price and the liquidity distribution changes.


Advantages


Through the original market-making curve, the slippage near the trading price is reduced to ensure market depth, and the market-making function is applicable to various Tokens. The internal oracle dynamically adjusts the anchoring price to ensure trading near the market price. The trading fee is dynamically adjusted, and the further away from the price balance point, the higher the fee, thereby providing better prices near the market price.


Disadvantage


The price adjustment of the internal oracle depends on user transaction behavior and has a certain lag, and cannot adjust the liquidity distribution in advance. The curve solution has no explicit form and needs to be solved using numerical methods (Newton's method). The calculation cost is relatively high and there is a certain degree of error.


DODO


Market Maker Quote Adjustment Curve


DODO provides liquidity through its unique PMM algorithm, which introduces a reference price. Market makers concentrate liquidity near the market price by providing independent quotes using the PMM algorithm. Unlike AMM-based market-making algorithms, the price calculation of the PMM algorithm is based on two factors: external prices and inventory. When the external price changes, the exchange rate of the Token will change directly. When users trade with the pool, the inventory changes, and the price also changes. Therefore, the Token price determined by the PMM algorithm depends on external prices and user trading behavior, allowing DODO to adjust liquidity distribution in advance and always maintain liquidity near external prices.



The specific form of the PMM algorithm is as follows, where the parameter i is the external price provided by the market maker quote, k is the parameter that controls the degree of liquidity concentration, the smaller the k, the more concentrated the liquidity, B and Q are the inventory of the Token. This formula describes the relationship between the marginal price and the changes in inventory and external price.



DODO provides flexible pool creation solutions, with parameters that can be set by users themselves, making it very flexible.


Design Analysis and Pros and Cons


From a design perspective, DODO actually references the liquidity distribution of CEX. The external price is provided by market makers' quotes, and the external price provided by the oracle is actually the market price formed by users in CEX trading. Currently, the liquidity of CEX still dominates the market, and adjusting liquidity based on external prices greatly improves market-making efficiency.


Advantages


Through the innovative PMM algorithm market-making, external prices are introduced, and liquidity is anchored near the market price, providing low slippage trading prices. It has high capital efficiency and can support larger trading volumes with the same amount of capital. The speed of liquidity distribution adjustment is fast, making DODO's liquidity quickly synchronized with the market.


Disadvantage


Dependent on external prices, there is a risk of market maker quotes deviating, and external prices represent high liquidity in the market, not internal liquidity in DODO. The k value in the anchor pool is a set value and does not have a dynamic adjustment mechanism.


Market Making Curve Comparison - Taking ETH Trading Pool as an Example


Data Processing


Comparing the trading pools of different DEXs is challenging due to the varying market-making algorithms, such as data source issues, comparative analysis problems, and how to determine a standard for comparison.


Based on this, the data analysis in this article is processed as follows:


Select the USDC/WETH 0.05% pool on Uni V3 Ethereum mainnet, the USDT/WBTC/WETH 3crypto pool on Curve Ethereum mainnet, and the USDC/WETH liquidity provider pool on DODO Polygon as samples. All three sample pools are trading pairs of WETH against stablecoins. The underlying parameters are obtained by directly querying the smart contract data, and the liquidity distribution is calculated based on the market-making curves of each trading platform. The liquidity data ranges from January 1, 2022 to August 16, 2022, with hourly intervals. The trading volume and TVL data range from June 16, 2022 to August 16, 2022. All data samples have synchronized timestamps and block heights. For the sake of visual consistency, all data visualizations have been normalized. For the total liquidity distribution, ETH prices ranging from 100 to 10000 are used. The liquidity distribution changes within the selected time span, with 2% representing the proportion of liquidity within a price range of +/- 2% of the market price, and 6% and 10% representing the same for their respective price ranges.


Flow distribution data performance - Is liquidity really concentrated?


Uni V3


For the USDC/WETH 0.05% pool of Uni V3, the overall concentration of liquidity is high and the volatility is large. It varies in different market environments, and in some cases, there may be significant deviations between the market price and the price with the highest liquidity.


Liquidity Distribution Mean


 Uni V3 USDC/WETH 0.05% Pool 流动性分布随时间变化(数据来源:Ethereum)


From the chart, it can be seen that the liquidity of the 0.05% WETH/USDC pool in Uni V3 is highly concentrated for most of the time, with liquidity within 10% accounting for an average of 40% of the total liquidity, basically achieving concentrated liquidity. Overall, over a considerable period of time, the liquidity concentration of the WETH 0.05% pool in Uni V3 has remained at a high level, achieving the design goal of V3.



According to data, when the market is highly volatile, the liquidity distribution of the pool will undergo significant changes, and the concentration of liquidity near the market price will rapidly decrease. For example, from May 6th to May 13th and from June 10th to June 19th, with the sharp decline of ETH price, the liquidity distribution of the pool was quickly adjusted, and a large number of user behaviors caused a significant decrease in the concentration of liquidity near the market price, with users adjusting their market-making range outside the market price, and liquidity within 10% decreasing to below 10%. Therefore, due to the mechanism design of Uni V3, users will anticipate the market and withdraw liquidity in advance, leading to a decrease in the concentration of liquidity during periods of sharp market fluctuations.


Uni V3 USDC/WETH 0.05% Pool 市场价格与最高流动性价格偏离情况(数据来源:Ethereum)


The above chart shows the comparison between the tick price with the highest liquidity and the market price. By observing the deviation between the range of the tick with the highest liquidity and the range of market trading prices, it can be seen that in most cases, the tick price with the highest liquidity and the market trading price are relatively close in Uni V3, but there are times when there is a significant deviation.


Curve V2


The liquidity distribution of the USDT/WBTC/WETH pool in Curve V2, also known as the 3crypto pool, is highly concentrated with low volatility. There is a certain deviation between the market price and the price with the highest liquidity, but it does not exceed 1% most of the time. User trading behavior itself will cause internal oracle price adjustments, and the dynamic simulation of Curve V2 is more complex, and there are differences between off-chain and on-chain computing environments. Therefore, this article does not consider the dynamic changes of Curve V2, and the liquidity distribution in the low price range is more referenceable.


Liquidity Distribution Mean


Curve 3crypto Pool 流动性分布随时间变化(数据来源:Ethereum)


From the chart, it can be seen that the liquidity distribution of the USDT/WBTC/WETH pool in Curve V2 has relatively small fluctuations and shows the characteristic that the larger the price range, the higher the volatility, and the liquidity is concentrated near the market price. The special volatility feature of Curve V2 is determined by its algorithm, as the curve of Curve will dynamically adjust, and the larger price range will be more affected. Similar to DODO's algorithm, when the oracle price is adjusted due to user trading behavior causing price deviation, Curve V2's internal oracle itself will also adjust. Therefore, the liquidity of the 6% and 10% price ranges does not represent the market depth in actual trading.


Curve 3crypto Pool 市场价格与最高流动性价格偏离情况(数据来源:Ethereum)


It can be seen that there is still a certain deviation between the internal oracle price of Curve and the market price, although the deviation is small, but in most cases there will be some deviation, which indicates that there is a certain time lag in the price adjustment of Curve's internal oracle. This is a characteristic of the algorithm itself. Because Curve will update the oracle price when user transactions cause the price to deviate from a critical value, there will be a certain time lag, but the degree of price deviation of Curve is small.


DODO


The liquidity distribution of the USDC/WETH pool on DODO is the most concentrated, which is because DODO market makers generally set the K value very small and update the reference price at a high frequency, thus concentrating liquidity. Due to the high quoting frequency of DODO market makers, the market price is highly anchored to the price with the highest liquidity.


Liquidity Distribution Mean


DODO USDC/WETH Pool 流动性分布随时间变化(数据来源:Polygon)


From the chart, it can be seen that the liquidity distribution of DODO's USDC/WETH pool fluctuates greatly, and the liquidity is highly concentrated near the market price. From the data, overall, DODO's market makers will set the K value to 0.01 at the lowest, thus achieving a high degree of liquidity concentration. However, market makers will quickly adjust the K value and liquidity distribution when the market is extremely volatile. Due to the PMM algorithm providing market makers with a very flexible adjustment space, the adjustment of liquidity distribution is very flexible, and overall, the degree of liquidity concentration is relatively high.


DODO USDC/WETH Pool 市场价格与最高流动性价格偏离情况(数据来源:Polygon)


Due to DODO's PMM algorithm, which provides quotes through market makers, introduces external prices, and thus maintains a high degree of anchoring between the market price of the pool and the price with the highest liquidity. At the same time, for the PMM algorithm, the price with the highest liquidity is the external price provided by the market maker. Therefore, the above figure also shows that the difference between the external price and the market price is not significant. This indicates that there will not be a situation where users trade on a large scale, causing the market price to deviate significantly from the market maker's quote. In other words, DODO's market maker price adjustment can keep up with market changes in a timely manner.


Trading Data Performance - What is the Geometric Difference in Capital Efficiency?


This article obtained trading volume and TVL data from three sample pools, using Volume/TVL as a proxy indicator of capital efficiency. This indicator measures how much trading volume can be generated per unit of TVL, reflecting the efficiency of market-making funds.


Due to the significant difference in trading volume and TVL between the three sample pools, we directly compare capital efficiency.


样本池资本效率对比(数据来源:Ethereum,Polygon)


From the performance of the sample pool, the capital efficiency of the DODO USDC/WETH pool is higher than that of the Uniswap USDC/WETH pool and the Curve 3crypto pool, which is consistent with the corresponding liquidity distribution performance. DODO's market maker pool has professional market makers providing quotes, which results in high capital efficiency. Uniswap's USDC/WETH pool is one of its top trading pools with sufficient liquidity. For assets with high liquidity such as ETH, Uni V3's design structure can also concentrate liquidity and improve capital efficiency. DODO's algorithm has better performance for value-stable assets, such as stablecoin trading pairs.


Market Performance Analysis


Through comparing the design of different algorithms using the sample pool of WETH and stablecoin trading pairs in the previous section, we will now compare the overall market performance of Uniswap, Curve, and DODO.


Trading Volume Comparison


各交易所交易量变化对比(数据来源:Coingecko)


From the perspective of trading volume, Uni V3's trading volume is definitely larger than Curve and DODO. DODO has a fast growth rate and has been leading Curve in terms of trading volume since mid-July. Due to the volatility of stablecoin market, Curve's trading volume surged in May and June.


TVL Comparison


各交易所 TVL 变化对比(数据来源:Defillamma)


The total locked value of Curve is very high, but it drops rapidly after the stablecoin market fluctuates, falling below half of its peak value. The total value locked (TVL) of Uni is relatively large, with low volatility, and it has remained stable in poor market conditions. In comparison, the TVL of DODO is lower, and stablecoins account for a high proportion.


Capital Efficiency Comparison


各交易所资本效率变化对比(数据来源:Coingecko,Defillamma)


From the chart, it can be seen that DODO has the highest overall capital efficiency, followed by Uniswap, and the lowest is Curve. DODO's leading capital efficiency is mainly due to its stablecoin trading pairs and professional market makers. The trading volume of DODO's stablecoin trading pairs is relatively high, and the PMM algorithm sets the k value to 0.01 for stablecoin trading pairs, which concentrates the liquidity of stablecoin trading pairs near the market price, resulting in better capital efficiency. The Uniswap Lab team also mentioned DODO's advantages in stablecoin trading at Dunecon.


Original article link


Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

举报 Correction/Report
This platform has fully integrated the Farcaster protocol. If you have a Farcaster account, you canLogin to comment
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit