Research Summary: Constant Power Root Market Makers

TLDR

  • Automated market makers like Uniswap only allow trades that hold a function of the reserves constant. The choice of function has large consequences on the capital efficiency of the market, impacting both the value to traders and the payoff to liquidity providers.
  • In this work, we present a family of new automated market makers that toggle between constant sum and constant product, two popular classes used in practice. These constant “power root” market makers trade off between impermanent loss for liquidity providers and price impact for traders, providing more flexibility for market designers.
  • By deriving theoretical properties of constant power root market makers, we explore its strengths and weaknesses in potential applications like long-tail markets, stable token swaps, or prediction markets.

Core Research Question

Can impermanent loss for liquidity providers be meaningfully reduced by carefully designing the curvature of the invariant in Automated Market Makers?

Citation

Wu, Mike, and Will McTighe. “Constant Power Root Market Makers.” arXiv preprint arXiv:2205.07452 (2022).
[2205.07452] Constant Power Root Market Makers

Background

  • Decentralized exchange (DEX): An exchange operating through a smart contract that allows users to trade tokens without a central intermediary.
  • Reserves: the store of tokens owned by a DEX smart contract that is used to fulfill swap requests from traders.
  • Automated market maker (AMM): A popular type of DEX that holds tokens in liquidity pools funded by investors seeking yield. Traders are able to swap tokens using the pool at an exchange rate set by a function of the reserves.
  • Constant function market makers (CFMM): A type of AMM that only allows trades that hold a function of the reserves constant. This function can be used to derive relative token price.
  • Trading function or invariant: Two names for the function in a CFMM.
  • Constant product market maker: A popular CFMM that uses a product of the reserves as the invariant. This is used by Uniswap and Balancer among many other protocols.
  • Constant sum market maker: A CFMM that uses a sum of the reserves as the invariant. This CFMM faces no price slippage but reserves for a single token can be depleted completely.
  • Exchange fees: Fees paid by traders in each AMM transaction to liquidity providers.
  • Uniswap: The largest DEX (and AMM). Uses a constant product market maker. Holds several billion USD in total value locked.
  • Curve: A DEX for swapping stable coins. Uses an invariant that is the linear combination of the sum and product functions. Minimizes price slippage by re-pegging the trading function around the current price between tokens.
  • Liquidity providers: Individuals who provide tokens to AMMs in exchange for liquidity tokens that can be exchanged for assets at a later time. In most CFMMs, liquidity providers (LPs) are required to provide a pair of tokens together. At withdrawal time, LPs burn their liquidity tokens and retrieve tokens at the current market price plus fees.
  • Payoff functions: A mathematical description of the value in numeraire obtained by a liquidity provider as a function of the price of a token.
  • Concave function: A function in which the derivative is strictly monotonically decreasing. Concavity poses constraints on the allowable curvature of said function.
  • 1-homogeneous function: A function is said to be 1-homogenous if the following holds: if all arguments of a function are multiplied by a scalar value, then the output is also multiplied by that same scalar value. This is a strong constraint on a function. An example of a 1-homogeneous function is any linear map.
  • Non-negative function: A function that never takes negative values (zero is allowed).
  • Duality between invariants and payoff functions: Given any payoff function that is concave, 1-homogeneous, and non-negative, there exists an invariant (trading function) such that a liquidity provider of a CFMM with that invariant achieves exactly the payoff function. This invariant is the solution to a convex optimization problem. See “Replicating Market Makers” by Angeris et. al.
  • Replicating market makers: A broad term for a special class of CFMMs whose invariants are chosen to replicate specific payoff functions. A popular Replicating Market Maker (RMM) is Primitive’s RMM-01, which replicates a Black-Scholes covered call payoff.
  • Power roots: For some value q < 1, the power root is the expression (x^q + y^q)^{1/q}. If x and y are both positive, this is a q-norm. The power p can vary between negative infinity and 1. Special cases include the sum function (q = 1), the product function (q=0), a HODL function (q=-\infty), and the harmonic mean function (q = -1).
  • Marginal price: The price of one token in terms of the other assuming an infinitesimally small trade amount. A more mathematical description is that the marginal price is the negative derivative of one token in terms of the other (using the invariant).
  • Impermanent loss: The (normalized) difference between an LP’s payoff from providing liquidity to an AMM and an LP’s payoff from holding onto the tokens outside of the pool. For the constant product market maker, impermanent loss (IL) is high as the price drifts away from the initial price the LP deposited liquidity at. LPs can benefit from lower levels of IL.
  • Price Impact: A measure of the sensitivity of price to a change in the reserve quantities in an AMM. Price impact is closely related to the amount of slippage. Traders in an AMM benefit from smaller levels of price impact.
  • Reserve Depletion: The event in which the reserves of a token in an AMM go to zero. This is often discouraged by invariants that increase the relative price of a token as its reserves shrink. For other invariants however, it is possible to deplete a reserve.

Summary

  • The motivation for the research is to study the impact of the curvature of the AMM invariant on trading and liquidity provision.
  • The constant product market maker, the most popular trading function, does not appear suitable for (1) long tail assets due to poor terms for LPs nor (2) stableswaps due to high slippage potential.
  • A technical description of CFMM is provided along with popular examples including sum, product, HODL, and Curve.
  • Formal definitions of marginal price and impermanent loss are derived for constant sum and constant product market makers. The payoff functions for LPs are derived and visualized for various CFMMs.
  • We introduce a power root payoff function and show that the payoff functions of the sum, product, and HODL invariants are special cases of the power root payoff function.
  • Using the duality between invariants and payoff functions, we produce a closed form expression for the family of invariants that give rise to the power root payoff function. We call this family of invariants constant power root market makers, or CPrMM.

  • We derive expressions for the marginal price, price impact, impermanent loss, and the Greeks for CPrMM and show that popular invariants are special cases of the CPrMM.
  • In particular, we find a trade-off between impermanent loss and price impact. Toggling the power between negative infinity and 1 gives you control between the two. At one end, we obtain no price impact at the cost of high IL; at the other, we minimize IL for high slippage.
  • For all negative powers, CPrMM achieves lower IL than Uniswap.
  • A limitation of the CPrMMs is that for non-negative powers, the market is susceptible to reserve depletion, much like the constant sum market maker. For negative powers, CPrMM enjoys the same protection from reserve depletion as Uniswap.
  • We explore an extension for future work to investigate “dynamic” CPrMMs that vary the power as a function of either time or reserves.

Results

  • The power root payoff function where a and b are prices of two tokens and p is a power between -\infty and 1:

  • If p = 1, the power root payoff = payoff of HODL-ing. If p = 0, the power root payoff = product payoff. If p = -\infty, the power root payoff = sum payoff. These are all special cases of power root payoffs.

  • The power root payoff function is equivalent to the Constant Elasticity of Substitution function from economic theory, of which Cobb-Douglas (product function), Leontief (sum function), and Perfect Substitute (HODL-ing function) are all special cases.

  • We show that the power root payoff function is concave, 1-homogeneous, and non-negative.

  • The CPrMM invariant where q is a (dual) power. The duality between the CPrMM payoff and its invariant is equivalent to the duality of norms.

  • The sum function can be viewed as an arithmetic mean. The product function (Uniswap) can be viewed as a geometric mean. We propose another special case of power roots: the harmonic mean as an invariant.

  • If q = 0, CPrMM is constant product. If q = 1, CPrMM is constant sum. If q = -1, CPrMM is constant harmonic mean. If q = -infty, CPrMM is HODL.

  • The marginal price for CPrMMs:

  • The impermanent loss for CPrMMs where M is marginal price and alpha is a percentage of price change:

  • A visualization of IL as a function of power. For all powers < 0, IL is less than Uniswap’s across all price.

  • A visualization of marginal price and price impact as a function of power. For all powers q < 0, price impact is greater than that of Uniswap.

  • Visualization of reserve depletion: all lines (q > 0) that intersect the x axis are susceptible to market collapse by reserve depletion.

Discussion and Key Takeaways

  • CPrMMs are an umbrella class of CFMMs that include many of the popular CFMMs used today as special cases. The harmonic mean function is an interesting special case of CPrMMs not yet explored in today’s real world AMMs.
  • Liquidity providers and traders are locked in a zero-sum game in an AMM. The family of CPrMMs allow market designs to customize the value accrued to either party through impermanent loss and price slippage.
  • Reserve depletion is a challenge for constant sum market makers and continues to be a challenge for some members of the CPrMM family.

Implications and Follow-Ups

  • The obvious corollary of CPrMMs is to design new “dynamic” invariants that change power as a function of the market. This design could lead to new payoff functions not achievable by a single invariant alone, perhaps circumventing some of strict constraints. The challenge of doing so is to avoid new forms of arbitrage introduced by dynamic invariants. This requires more in-depth theoretical analysis for future work.
  • Future work should study the use of dynamic fee in relation to dynamic invariants, which could be one solution to round trip arbitrage. As fees contribute to LP payoff, this could again result in new payoff functions not achievable through conventional means.
  • The presentation of CPrMMs has focused on two tokens but all findings hold in cases with more than two tokens. Here, the invariant would take the form of a norm.

Applicability

  • The research is primarily theoretical and the applications discussed below have not been built nor verified in real world implementations.
  • First, using CPrMM with negative power reduces IL, which could incentivize liquidity provision in long tail assets where price moves more. Dynamic curvature could be explored here to reduce curvature as liquidity increases, reducing price impact over time.
  • Second, using CPrMM with dynamic powers that change as a function of reserves could be applied to stableswaps: if reserve ratios are roughly equivalent, the power converges to 1 (constant sum) which means no slippage for traders. If the reserves change such that one token is in much higher demand, the power decreases to prevent depletion. This may improve market stability in black swan events.
  • Third, dynamically varying power in CPrMM markets has been explored in protocols like Clipper, a DEX for small trades, or Yieldspace, which creates AMM pools with finite lifetimes. In these contexts, curvature is varied between constant product (q=0) to constant sum (q=1) as a function of time. There may be applications of CPrMM to prediction markets in a similar manner.
7 Likes

Silly question, I’m sure, but could something like this be used to improve placing liquidity on Uniswap v3 @grubiroth ?

1 Like

Not a silly question at all! A few thoughts:

  • I think it could have some advantages in comparison to Uniswap v2 in terms of more flexibility between impermanent loss and slippage - this is hypothetical as power root functions have not been used in practice yet. I don’t think it would be strictly better than Uniswap v2, but does give the market designer more control.
  • In my opinion Uniswap v3 pushing in a separate direction of bounded liquidity, letting liquidity providers take a more directional bet in terms of payoff. A similar thing could be done with other trading functions outside of constant product e.g. bounding liquidity on power root functions.
  • Overall, I think the main interesting property of the power root research is dynamic-ness. Given a wide range of trading functions with continuously varying curvature, what can you do with it? Yieldspace uses it in an interesting way. I wonder what else can be done.
3 Likes

@grubiroth

Yes, by carefully designing the curvature of the invariant in automated market makers, liquidity providers can significantly reduce impermanent loss. Losses can be minimized during periods of high volatility or turbulence in the markets by adjusting the curvature to be more forgiving. Because automated market makers are critical to maintaining liquidity and stability in financial markets, it is critical that they can function effectively even during difficult times.

Hello Mike,

I am a bit late to the party. The following might be interesting for you: We have written an axiomatic paper on AMMs that chracterizes exactly the class of AMMs that you are describing. They are the only ones that are separable (exchange rates are independent of the exchange rates between other pairs) and homogeneous (liquidity is fungible): https://christophschlegel.com/wp-content/uploads/2022/09/Product_AMM.pdf (older arxiv version: [2210.00048] Axioms for Constant Function AMMs)

We didn’t know that these functions had been discussed in your paper. We should add a citation for the next version. As you write you can rank these AMMs by convexity. We frame it as “optimal for traders”, but optimal for traders is just the dual way of saying “high impermanent loss” :slight_smile: Depends on whether you are a glass-half-full or glass-half-empty kind of guy…

1 Like