Constant Product AMMs
- Constant Product AMMs are decentralized exchange protocols that enforce the invariant x·y=k to determine trade pricing along a hyperbolic curve.
- They feature non-linear price impact (slippage) and symmetric impermanent loss, affecting liquidity provider returns and arbitrage strategies.
- Extensions like concentrated liquidity and multi-asset generalizations enable practical trade-offs for enhanced capital efficiency in dynamic markets.
A Constant Product Automated Market Maker (CPMM) is a class of decentralized exchange protocol that deterministically prices swaps by enforcing the invariant , where and are reserves of two tokens and is constant between liquidity provision ("mint"/"burn") events. CPMMs are foundational to many decentralized finance (DeFi) platforms—Uniswap V2 being the canonical implementation—and are characterized by continuous, path-independent liquidity, endogenous spot pricing, non-linear price impact (slippage), and symmetric impermanent loss for liquidity providers (LPs). Theoretical and empirical literature has detailed their mechanism design, microstructure, axiomatic justification, profitability frontier, optimization problems for arbitrageurs/LPs, and various extensions, including multi-asset, mixed-invariant, and concentrated-liquidity generalizations.
1. Mathematical Fundamentals and Invariant Enforcement
A CPMM maintains a reserve pair and enforces the invariant , which defines a rectangular hyperbola in the positive quadrant. Any valid trade moves the reserves along this curve. For a swap in which a trader deposits units of into the pool to receive of , the protocol updates reserves: 0 Solving this yields the output formula: 1 The marginal price for an infinitesimal trade is the slope of the curve: 2 Thus, the instantaneous exchange rate quoted by the pool is always the ratio 3 (Jensen et al., 2021, Wang, 2020, Conrad et al., 2023, Zang et al., 9 Mar 2026).
For trades involving fees, e.g., a fraction 4 of the input is retained as protocol fee, the effective input is 5, and all swap/output formulas are modified accordingly (Conrad et al., 2023).
2. Economic Properties: Price Impact, Slippage, and Impermanent Loss
Swaps in CPMMs incur non-linear price impact—slippage—increasing with trade size relative to pool depth. For a trade of size 6, the average execution price in units of 7 per unit 8 is: 9 Instantaneous price before the trade is 0, after the trade 1. The leading-order slippage is proportional to 2: 3 Relative slippage for a large trade can be compactly expressed as: 4 Impermanent loss (IL) arises when the market price of the assets diverges from the initial pool price. Given a price move factor 5 for the risky asset, the IL for an LP is: 6 IL is purely a function of relative price change and is largest for large, volatile price moves (Jensen et al., 2021, Port et al., 2022).
3. Axiomatic and Mechanism Design Foundations
Axiomatic characterizations (Schlegel et al., 2022) show that CPMMs are the unique solution among scale-invariant, independent, symmetric, nonconcentrated constant function market makers (CFMMs), maximizing "trader-friendliness" subject to the core economic desiderata: independence (price of any subset only depends on its own reserves), scale invariance (liquidity-proportional scaling does not alter marginal rates), symmetry (no asset is privileged ex ante), non-concentration (no liquidity curve hits an axis), and convexity (cost of moving the price increases with trade size). The constant-product curve is shown to be extremal: for any alternate symmetric, scale-invariant CFMM, the CPMM always delivers at least as much output for a given input.
4. Liquidity Provisioning, Profitability Frontier, and Empirical Outcomes
Liquidity providers add balanced deposits and are minted LP shares proportional to 7, ensuring proportional ownership of the pool (Jensen et al., 2021, Conrad et al., 2023). The profitability of liquidity provision is non-trivial due to IL and fees. The "profitability frontier" (Bitterli et al., 2023) is the locus in 8-space where an LP is indifferent between having passively held their initial tokens (“HODL”) and having participated as an LP, given swap/fee history: 9 with the profitability condition 0. Empirical analyses on Uniswap V2 show that small/medium LPs in volatile ("open-market") pools are typically unprofitable absent substantial trading fees or large capital size; stable pools (low-volatility pairs) are more likely to be profitable courtesy of minimal divergence losses, especially over longer holding periods.
5. Generalizations, Variants, and Mitigations
Concentrated Liquidity (CL)
Uniswap v3 and subsequent protocols introduced concentrated liquidity (Cartea et al., 2023, Monga, 2024), partitioning the price axis into ticks with LPs allowed to deploy depth over arbitrary price intervals. For a tick range 1, an LP's asset allocation and fee flow are piecewise functions of the prevailing midprice. Narrower bands amplify fee earning per unit capital but also increase exposure to unhedgeable predictable loss and concentration risk (frequency of price moving outside the band), captured analytically as: 2 where 3 is band width, 4 a concentration penalty, 5 the fee rate, 6 price volatility (Cartea et al., 2023, Monga, 2024).
Mixed Invariants and Multi-Asset Generalizations
CPMMs are special cases in larger parameterized AMM families, e.g. the constant mean (Balancer-style 7) and Stableswap's interpolated sum/product surface (Forgy et al., 2021, Port et al., 2022). Mixing CPMM with constant-sum or geometric invariants can be accomplished via arithmetic, geometric, or homotopy combinations, as in Curve's “amplification” parameter. This allows for design trade-offs between infinite liquidity (product), lower slippage (sum), and price range/flexibility (Port et al., 2022).
Defensive Rebalancing and Global Market Makers (GMM)
In fragmented AMM landscapes, value leakage occurs as arbitrageurs capitalize on cross-pool discrepancies. Global Market Makers (GMMs) (Bagnulo et al., 12 Mar 2025) aggregate liquidity across pools and enforce consistent pricing, reducing arbitrage cost and slippage by capping local CPMM outputs to a global formula. Defensive Rebalancing (Devorsetz et al., 26 Jan 2026) formalizes off-chain/on-chain mechanisms to reallocate reserves among CPMMs by solving convex optimization problems, maximizing aggregate liquidity while eliminating arbitrage opportunities and preserving participant utility.
6. Dynamic Equilibria, Strategic Behavior, and Empirical Microstructure
Dynamic equilibrium models (Zang et al., 9 Mar 2026) analyze the strategic interaction between arbitrageurs, LPs, and noise traders in environments with stochastic volatility and endogenous gas fees. Even in the absence of exogenous price drift, the CPMM geometry induces an intrinsic buy-sell asymmetry: identical-sized buy and sell trades result in systematically different execution costs due to convexity of the bonding curve.
The model demonstrates that if all order flow is informed/arbitrage-driven, LP returns are strictly negative (arbitrage jump returns exceed fee revenue). In environments with noise trading and time-varying costs, an interior liquidity provision equilibrium emerges: LP participation is maximal at intermediate volatility levels (hump-shaped curve), with profitability decreasing at extremes due to high gas or unhedgeable IL.
7. Computational Efficiency, Formalization, and Extensions
CPMMs are computationally minimal: swaps require only arithmetic operations (multiplication, division, addition, subtraction) (Wang, 2020). Higher-complexity AMMs (e.g., LS-LMSR, constant-ellipse) require exponentials, logarithms, or roots, incurring significant gas and implementation overheads. Fully mechanized, machine-checked formalizations of CPMMs, including arbitrage closure, swap correctness, and liquidity tracking, have been realized in Lean 4 (Pusceddu et al., 2024), providing a rigorous proof foundation for economic and security properties.
Summary Table: Key CPMM Mathematical Relations
| Concept | Formula/Description | Source(s) |
|---|---|---|
| Invariant | 8 | (Jensen et al., 2021, Conrad et al., 2023) |
| Marginal price | 9 | (Conrad et al., 2023, Wang, 2020) |
| Swap output (no fee) | 0 | (Conrad et al., 2023, Wang, 2020) |
| Slippage (finite trade) | 1 | (Pusceddu et al., 2024) |
| Impermanent loss (IL) | 2, 3 = price move factor | (Jensen et al., 2021, Port et al., 2022) |
| LP token minting | Proportional to 4 | (Jensen et al., 2021) |
| Arbitrage closure | Achieved in one optimal swap (5) | (Pusceddu et al., 2024) |
CPMMs form the indispensable foundation for decentralized, non-custodial, and permissionless trading protocols. Their tractable mechanics, full on-chain determinism, and path-independent pricing underpin the stability, capital efficiency, and risk allocation structures observed in deployed DeFi ecosystems. However, inherent non-linearity in price impact, asymptotic slippage, arbitrage-driven value transfer, and IL demand careful parameterization, empirical analysis, and—in some cases—protocol-level augmentation to optimize performance and robustness across market conditions and applications (Jensen et al., 2021, Bitterli et al., 2023, Zang et al., 9 Mar 2026, Bagnulo et al., 12 Mar 2025).