A brief analysis of the curvature trade-off of the DeFi constant function market maker CFMM

A brief analysis of the curvature trade-off of the DeFi constant function market maker CFMM

Loading

How does the choice of curvature affect the liquidity and price stability of the constant function market maker CFMM?

Original title: ” An article to understand the curvature trade-off of DeFi constant function market maker (CFMM) (1)
Written by: Tarun Chitra, Guillermo Angeris and Alex Evans
Translation: Free and easy

The rise of Uniswap in 2019 is a watershed in DeFi transactions. Uniswap’s simplicity, gas efficiency and performance make it quickly become the main place for on-chain transactions. The Curve, launched earlier this year, shows that even minor changes to the design of the Constant Function Market Maker (CFMM) can significantly improve capital efficiency and performance. In particular, Curve created a locally smoother curve, which provides a lower slippage for transactions between stablecoins. This adjustment allows Curve to capture a large amount of trading volume while surpassing existing centralized exchanges and over-the-counter trading platforms under normal circumstances. Due to the success of Curve, curvature is increasingly recognized as an integral part of the CFMM design space. However, the exact impact of the choice of curvature on market behavior has not been thoroughly studied.

A brief analysis of the curvature trade-off of the DeFi constant function market maker CFMMObviously, it is difficult for people to hear the shape of the drum (Marc Kac, 1966), what about CFMM?

In this series of articles, we began to propose the concept of CFMM curvature shape. We discussed the effect of curvature selection on equilibrium prices, stability, liquidity provider (LP) returns, and market microstructure. The opinions of these articles come from the paper “When will the dog’s tail wave?” Curvature and market making. We will publish this paper at the same time when the third article in the series is published.

In the first article, we will provide a definition of curvature and discuss its impact on liquidity and price stability.

The summer of 2020 changed the face of CFMM. In large part due to the impact of yield farming activities, the CFMM market has increasingly become the most liquid market for various assets. This requires a new analytical framework to study these markets. We found that curvature provided the missing link in studying the CFMM dominance market. When CFMM becomes the most liquid trading place, most other trading places will adjust according to the price of CFMM. The first step in our framework is to understand how places with limited mobility affect each other.

Two market models

Suppose there are two trading venues that can trade a given asset pair. And the liquidity of one trading venue is higher than the other. So how do we model the difference in liquidity? A simple exercise is to observe the impact of fixed-scale transactions. If transactions of the same size result in greater changes in price in one market than in another, we can roughly judge that “the former is less liquid.” In the case of CFMM, this simple model is surprisingly descriptive. CFMM implements a specific curve for each asset pair, allowing us to accurately describe the impact of a given transaction, which is the source of curvature. Informally, curvature describes the absolute change in price reported by CFMM after a small transaction. Under the same other conditions, a CFMM with a higher amount of stored funds will show a lower curvature. However, for a given value of stored funds, some CFMMs have a lower curvature than others. By comparing Uniswap and Curve, we can see the difference. Starting from the point where the storage capacity is equal, it can be seen from the figure below that Uniswap has a higher curvature than Curve at the point x = y = 5.

A brief analysis of the curvature trade-off of the DeFi constant function market maker CFMM

As we have seen, curvature provides an elegant model of the liquidity of a given market. The lower the curvature of the market, the smaller the price impact of a given transaction.

Most CFMM models assume a CFMM with limited liquidity and a “reference” market with unlimited liquidity. These models indicate that under fairly common conditions, CFMM prices will be adjusted by arbitrageurs to reflect prices in the reference market. These models perform well in practice, because the arbitrage problems between Uniswap and other trading venues are usually convex, so arbitrageurs can easily figure out how to adjust reserves to reflect current market prices. This theory consolidates the use of CFMM as a price oracle machine in various on-chain applications (such as Uniswap v2 oracle machine). However, after experiencing the boom of CFMM in the summer of 2020, we need a model that can better capture the reality of the CFMM-driven market.

To do this, flip the script. Suppose we have a CFMM with high liquidity (low curvature) and a reference market with less liquidity (high curvature). The reference market can be based on CFMM, order book, quote request system, auction or any combination. The choice of the market will not affect the model, as long as it has a non-zero curvature (limited liquidity). If the prices in the two markets are different, arbitrageurs can profit by offsetting transactions in each market until the prices reported in the two markets agree. If the liquidity in the two markets is equal, we expect the resulting no-arbitrage price will be between the pre-trade prices in the two markets. However, if CFMM is more liquid, the final price will be closer to the quotation before CFMM arbitrage. In other words, if the CFMM’s liquidity is significantly higher than the reference market, then changes in the reference market price will have less impact on the no-arbitrage price.

To understand this, consider the following example. We have a 60:40 Balancer pool and a Uniswap pool. For reserve funds of the same value, the curvature of the Uniswap pool will be slightly lower. To emphasize the difference, we assume that the Uniswap pool is slightly larger. In the image below, the quotations on Balancer and Uniswap start from different points (their tangent slopes are different). Arbitrageurs buy in one market and sell in another market until the slopes of the two tangents are equal. Please note that the price change of Balancer is larger than the price change of Uniswap pool, but the difference is not very large. This is because the curvatures of the two markets are actually quite similar, although the Uniswap market has higher reserves and slightly balanced weights.

A brief analysis of the curvature trade-off of the DeFi constant function market maker CFMMArbitrage between Uniswap and Balancer

Then we replaced the comparison object with a Uniswap pool and a Curve pool, which have roughly equal reserve funds. In this case, the price of Curve has hardly changed, while the price adjustment of Uniswap is relatively large.

A brief analysis of the curvature trade-off of the DeFi constant function market maker CFMMArbitrage between Uniswap and Curve

When the trading assets are roughly equal to the price, the curvature of Curve is much lower than that of Uniswap. This means that even if prices in places with less liquidity fluctuate greatly, the final price will not differ too much from Curve’s quotation. Note that this arbitrage is extremely common in practice. Arbitrage robots on Ethereum constantly adjust prices in Balancer, Uniwap, Curve pools, and exchanges based on order books. In our forthcoming paper, we determined this effect mathematically. If CFMM has higher liquidity relative to the reference market, even if the reference market price has a large deviation, the impact on the no-arbitrage price will be minimal. We prove that this holds true as long as price jumps are limited by some (potentially large) constant. This assumption excludes extreme situations, such as the complete decoupling of stablecoin anchors. Finally, in footnote 0 and footnote 1, we outline some technical and mathematical considerations that need to be considered when describing curvature formally.

The peculiar case of sUSD

We have already seen that the low-curvature CFMM can “impose its own will” on the wider market. This also helps explain another phenomenon: price stability. Starting in March 2020, Synthetix announced that it will incentivize the liquidity of sUSD on Curve to better support the sUSD anchor exchange rate. The creation of this sUSD pool on Curve had an almost direct impact on anchoring: sUSD began to track the prices of other stablecoins more closely. Below, we show the price of sUSD on Uniswap from the end of 2019 to September 2020. The sUSD pool was officially launched in mid-March 2020 (restarted shortly after the security incident). From the end of March to the beginning of June 2020, the price of sUSD on Uniswap is well anchored. We expect that the arbitrage between Curve and Uniswap contributes to this effect: as long as the price fluctuations of sUSD near the anchor exchange rate are bounded, arbitrageurs will be incentivized to keep Uniswap prices consistent with Curve prices.

Please note that sUSD lacks liquidity in all other markets except Curve, which results in a very large difference in curvature between Curve and all other markets.

A brief analysis of the curvature trade-off of the DeFi constant function market maker CFMM

At the same time, these data also show the limitations of our two market models. In the second week of June, sUSD began to decouple more frequently. This new situation almost coincides with the emergence of profitable farming in June 2020. From early to mid-June 2020, Compound and Balancer launched the first liquidity mining plan. The price of SNX (the main collateral for sUSD) began to show an inflection point, more than tripled in June, and continued to rise throughout the summer. Other DeFi projects have also launched liquid mining, and stablecoins are at the core of most liquid mining strategies. As a result, almost all stablecoins have increased volatility due to the demand for income farming. Obviously, our dual market model does not capture these factors. Therefore, we need to extend the model to include income farming and its interaction with curvature. We will discuss this extension in a later article.

The cost of curvature

Low curvature is a trade-off. If the curvature of CFMM is zero, CFMM’s quotation will not change, regardless of the transaction volume. Therefore, the constant sum curve (such as mStable) sets a limit for each stablecoin that CFMM can hold to prevent LP from completely holding the worst performing asset.

CFMM with low curvature performs better when assets are highly correlated and the mean returns. In this environment, CFMM can attract more transaction volume and fees through lower curvature, while mean reversion adjusts the impact of impermanence loss. Stable currency and stable currency CFMM now basically follow this principle, and the same is true for maturing assets such as bonds. In the next article, we will discuss the curvature trade-off of LP in the case of asymmetric information, mean reversion, and impermanence loss.

footnote:

[0] One of the main differences between Curve and Uniswap is that Curve’s pricing function is “smooth” in a certain area of ​​the price-quantity space, and “steer” in other price areas. The economic intuition of why people prefer this change in the pricing curve is as follows:

  1. We have two assets whose prices (relative to the other) are mean reversion and low variance (for example, their prices are usually equal);
  2. Transactions that keep these assets close to each other (such as “soft” anchors) should be cheap because they encourage arbitrageurs to implement anchors. This is achieved by flattening the curve, which can reduce slippage and market shocks faced by traders;
  3. However, when assets “decouple”, traders will face higher slippage. This is actually to compensate liquidity providers for deviating from anchoring and to ensure that they will not withdraw from liquidity and freeze the market;

Unlike Uniswap, which has a more uniform level of curvature for all prices, Curve adapts to the price process (such as mean regression, bounded variance) on which transactions are expected. This example shows that the choice of CFMM pricing function is closely related to the type of asset being traded and the incentives needed to keep liquidity providers satisfied.

[1] Apart from the vaguely “smoother” or “steeper” concept, is there any way to formalize us? The answer is yes, thanks to Karl Friedrich Gauss. In the past few centuries, mathematicians have used analysis and algebra to quantify and classify geometric intuitions. One of the main links between analysis and algebra comes from the concept of inherent curvature. The inherent curvature of a curved surface represents the ratio of the area of ​​a small triangle on the curved surface to the area of ​​a triangle with the same circumference on the plane. A key feature of intrinsic curvature is that it does not depend on the direction or parameterization of the surface. For example, when a beach ball rotates at any angle in any direction, its inherent curvature will not change. We can define the “intrinsic” attribute more generally as:

For any rotation matrix A and translation vector b, the surface defined by f(Ax+b) = k has the same curvature as the surface defined by f(x) = k.

Gauss’s Theorema Egregium is one of the key achievements in the early stages of differential geometry. It shows that the curvature of the implicitly defined surface (for example, the surface of f(x) = k) is inherent.

What does this have to do with the intuitive concept of CFMM curvature? Recall that the equivalent way to define CFMM is through transaction sets, similar to the epigraph of its invariant function. The boundary of the set is a surface defined by a constant function invariant. When we talk about Curve being smoother (lower curvature) than Uniswap, we are talking about the curvature of this surface.

Source link: medium.com