header-langage
简体中文
English
Tiếng Việt
Scan to Download the APP
Partnered With:

An article to understand the curvature trade-off of DeFi constant function market maker CFMM

Read this article in 10 Minutes
How to understand that Curve is smoother than Uniswap?
Original title: "An article to understand the curvature trade-off of DeFi constant function market maker (CFMM) (1)"
Original source: Babbitt, free and easy


The rise of  Uniswap  in 2019 is a watershed for DeFi transactions. The simplicity, gas efficiency, and performance of Uniswap quickly made it the main venue for on-chain transactions. And  Curve , launched earlier this year, showed that even small changes to the design of a constant function market maker (CFMM) can dramatically improve capital efficiency and performance. In particular, Curve pioneers locally smoother curves, which provide lower slippage for transactions between stablecoins. This tweak allows Curve to capture significant volume while routinely outperforming existing centralized exchanges and OTC exchanges. 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-offs of DeFi constant function market maker CFMM

Apparently it is difficult for people to hear the shape of the drum (Marc Kac, 1966 ), what about CFMM?


In this series of articles we begin to develop the concept of CFMM curvature shapes. We discuss the impact of curvature choice on equilibrium price, stability, liquidity provider (LP) returns, and market microstructure. The opinions of these articles come from our upcoming paper "When does the dog's tail wag?" Curvature and Market Making". We will publish this paper at the same time as the third article in this series.


In this 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. Largely due to yield farming activities, the CFMM market is increasingly becoming the most liquid market for various asset pairs. This requires a new analytical framework to study these markets. We find that curvature provides the missing link for studying the CFMM-dominated market. When CFMM becomes the most liquid trading venue, other trading venues mostly adjust to CFMM's price. The first step in our framework is to understand how places with limited mobility interact with each other.


Two Market Model


Assume that there are two trading venues that can trade a given asset pair. And one of the trading venues is more liquid than the other. So how do we model differences in mobility? A simple exercise is to look at the impact of trades of a fixed size. If a trade of the same size causes a larger price change in one market than another, we can roughly say "the former is less liquid". In the case of CFMMs, this simple model is surprisingly descriptive. CFMM implements a specific curve for each asset pair, allowing us to precisely describe the impact of a given trade, which is where the curvature comes from. Informally, curvature describes the absolute change in price reported by a CFMM after a small trade. All else being equal, a CFMM with a higher amount of funds stored will exhibit lower curvature. However, for a given value of stored funds, some CFMMs have lower curvature than others. By comparing Uniswap and Curve, we can see the difference. Starting from the point where the amount of storage 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-offs of DeFi constant function market maker CFMM


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


Most CFMM models assume a CFMM with limited liquidity and a "reference" market with unlimited liquidity. These models suggest that, under fairly common conditions, CFMM prices will be adjusted by arbitrageurs to reflect prices in the reference market. These models work well in practice because arbitrage problems on Uniswap versus other trading venues are often convex, so arbitrageurs can easily figure out how to adjust reserves to reflect current market prices.


This theory underpins the use of CFMMs as price oracles in various on-chain applications (e.g. Uniswap v2 oracles). However, after the CFMM boom of summer 2020, we need a model that better captures the realities of CFMM-driven markets.


To do this, flip the script. Suppose we have a highly liquid (low curvature) CFMM and a less liquid (high curvature) reference market. Reference markets can be based on CFMMs, order books, request-for-quote systems, auctions or any combination. The choice of the market does not affect the model as long as it has non-zero curvature (finite liquidity). If the prices in the two markets differ, an arbitrageur can profit by making offsetting trades in each market until the prices reported by the two markets match.


If the liquidity of the two markets is equal, we expect the resulting no-arbitrage price to be between the pre-trade prices of the two markets. However, if the CFMM is more liquid, the final price will be closer to the CFMM quote before the arbitrage. In other words, if the liquidity of the CFMM is significantly higher than that of the reference market, then changes in the reference market price have less impact on the no-arbitrage price.


To understand this, consider the example below. We have a 60:40  Balancer  pool as well as a Uniswap pool. For the same value of reserve funds, the curvature of the Uniswap pool will be slightly lower. To emphasize the difference, let's assume the Uniswap pool is slightly larger. In the graph below, quotes on Balancer and Uniswap start at different points (their tangents have different slopes). Arbitrageurs buy in one market and sell in the other until the slopes of the two tangents are equal. Note that Balancer's price changes more than Uniswap pools, but the difference is not huge. This is because the curvature of the two markets is actually quite close, even though the Uniswap market has higher reserves and slightly more balanced weights.


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

Arbitrage between Uniswap and Balancer


Then we swap out the comparison for a Uniswap pool, and a Curve pool, which have roughly equal reserves. In this case, Curve's price barely moved, while Uniswap's price adjustment was larger.


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

Arbitrage between Uniswap and Curve


When the asset pairs traded are roughly equal in price, the curvature of Curve is much lower than that of Uniswap. This means that even if prices in less liquid venues fluctuate wildly, the final price will not deviate too much from what Curve quotes. Note that this type of arbitrage is extremely common in practice. Arbitrage bots on Ethereum are constantly adjusting prices on Balancer, Uniwap, Curve pools, and order book-based exchanges. In our forthcoming paper, we have determined this effect mathematically. If the CFMM has higher liquidity relative to the reference market, then even large deviations in the reference market price will have minimal impact on the no-arbitrage price. We show that this holds true as long as price jumps are bounded by some (potentially large) constant. This assumption rules out corner cases, such as a complete decoupling of the stablecoin peg. Finally, in footnotes 0 and 1, we outline some technical and mathematical considerations that need to be considered when formally describing curvature.


The Curious Case of sUSD


We have seen that CFMMs with low curvature can "incorporate own will” to impose on the wider market. It also helps explain another phenomenon: price stability. Beginning in March 2020, Synthetix announced that it will incentivize sUSD liquidity on Curve to better support the sUSD peg.


Creating this sUSD pool on Curve had a near-immediate effect on pegs: sUSD started tracking the prices of other stablecoins more closely. Below, we show the price of sUSD on Uniswap from late 2019 to September 2020. This 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 was well anchored. We expect that arbitrage between Curve and Uniswap contributes to this effect: as long as the price volatility of sUSD around the peg is bounded, arbitrageurs are incentivized to keep Uniswap’s price in line with Curve’s price.


Note that sUSD is illiquid in all other markets except Curve, which results in a very large curvature difference between Curve and all other markets.


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

At the same time, these data also show the limitations of our two market models. During the second week of June, sUSD started decoupling more frequently. This new situation coincides almost exactly with the emergence of yield farming in June 2020. In early to mid-June 2020, Compound and Balancer launched their first liquidity mining program.


The price of SNX (sUSD’s primary collateral) started to turn an inflection point, more than tripling in June and continuing to rise throughout the summer. Other DeFi projects have also launched liquidity mining, and stablecoins are at the heart of most liquidity mining strategies.


The result is that almost all stablecoins have increased volatility due to the need for yield farming. Obviously, our two-market model does not capture these factors. Therefore, we need to extend the model to include yield 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 If zero, the CFMM quotes will not change regardless of the volume. Thus, constant sum curves (like mStable) set bounds for each stablecoin a CFMM can hold, preventing LPs from fully holding the worst performing assets.


Low curvature CFMMs perform better when assets are highly correlated and mean reverting. In this environment, CFMM is able to attract more volume and fees through lower curvature, while mean reversion moderates the impact of impermanent losses. Stablecoins and stablecoin CFMMs basically follow this principle now, as do CFMMs for maturing assets such as bonds. In the next post, we will discuss the curvature tradeoff 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 the pricing function of Curve "smoother" in one area and "steeper" in other price areas. The economic intuition for why people prefer this shift in the pricing curve is as follows:


We have two assets whose price (relative to the other) is the mean reverts and low spreads (e.g. their prices are usually equal); deals that keep these assets close to each other (e.g. "soft" pegs) should be cheap as they encourage arbitrageurs to implement pegs. This is accomplished by flattening the curve, which reduces slippage and market shocks traders face; however, when assets are “decoupled,” traders face higher slippage. This is actually to compensate liquidity providers for deviating from the anchor, and to ensure that they do not exit liquidity, freezing the market;


With Uniswap for all Instead of a more uniform level of curvature, Curve adapts to the price process it is expected to trade on (e.g. mean reversion, bounded variance). This example shows that the choice of CFMM pricing function is closely related to the type of assets traded and the incentives needed to keep liquidity providers happy.


[1] Is there a way for us to formalize other than the vague notion of "smoother" or "steperer"? The answer is yes, thanks to Carl Friedrich Gauss. Over the centuries, mathematicians have quantified and categorized geometric intuitions through analysis and algebra. One of the main connections between analysis and algebra comes from the concept of inherent curvature. The intrinsic curvature of a surface is the ratio of the area of a small triangle on the surface to the area of a triangle of the same length on a plane. A key feature of intrinsic curvature is that it does not depend on the orientation or parameterization of the surface. For example, the inherent curvature of a beach ball does not change when it is rotated by any angle in any direction. We can define the "intrinsic" property more generally as:
For any rotation matrix A and translation vector b, the surface defined by f(Ax+b) = k is identical to f(x) = k The defined surfaces have the same curvature.


Gauss's Theorem Egregium, one of the key early results in differential geometry, stated that the curvature of an implicitly defined surface (e.g., f( x) = k) is inherent.


How does this relate to CFMM's intuitive notion of curvature? Recall that an equivalent way to define a CFMM is through a transaction set, analogous to an epigraph of its invariant function. The boundaries of this set are surfaces defined by constant function invariants. When we talk about Curve being smoother (lower curvature) than Uniswap, we are referring to the curvature of this surface.


Original 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
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit