Papers
Topics
Authors
Recent
Search
2000 character limit reached

Constant Product Market Maker

Updated 19 January 2026
  • Constant Product Market Maker is a decentralized mechanism that uses the invariant x*y=k to set closed-form prices and enable liquidity provisioning.
  • It relies on mathematical optimality and axiomatic principles that balance low trader slippage against the risk of impermanent loss for liquidity providers.
  • CPMMs power major decentralized exchanges like Uniswap v2, with extensions supporting multi-asset pools and concentrated liquidity to enhance capital efficiency.

A constant product market maker (CPMM) is a subclass of constant function market makers (CFMMs), characterized by maintaining the product of two or more asset reserves constant throughout all admissible trades, modulo fees and external rebalancing. The CPMM is the foundational mechanism underpinning major decentralized exchanges, most notably Uniswap v2, and serves as a mathematically and axiomatized extremal point among AMMs for two-asset trading. The CPMM enforces an invariant of the form xy=kx \cdot y = k and offers closed-form pricing, predictable slippage, and robust liquidity provision across the entire price spectrum, albeit at the cost of structurally embedded impermanent loss for liquidity providers (LPs). Its unique position is supported by mathematical optimality results, axiomatic derivations, explicit connection to replicating portfolios, and empirical dominance in real-world DeFi protocols.

1. Formal Definition and Mathematical Invariant

A CPMM holds reserves xx of asset XX and yy of asset YY, and maintains the invariant

xy=k,k>0x \cdot y = k,\qquad k > 0

where kk is constant (in the absence of fee accruals or external asset inflows/outflows) (Goyal et al., 2022, Schlegel et al., 2022). The argument generalizes to nn assets as i=1nIiαi=k\prod_{i=1}^n I_i^{\alpha_i} = k for weights αi>0,iαi=1\alpha_i > 0, \sum_i \alpha_i = 1, with typical interest focused on the symmetric, two-asset case α1=α2=1/2\alpha_1 = \alpha_2 = 1/2.

Any allowed trade must preserve xy=kx \cdot y = k. Upon a swap of Δx\Delta x into the pool (with no fees),

x=x+Δx, y=kx+Δx, Δy=yy=yΔxx+Δx.\begin{align*} x^{\prime} &= x + \Delta x,\ y^{\prime} &= \frac{k}{x+\Delta x},\ \Delta y &= y - y' = \frac{y\,\Delta x}{x+\Delta x}. \end{align*}

This algebraic structure ensures continuous price quotation, convex slippage, and cannot be depleted in finite trades (Conrad et al., 2023).

Marginal (“spot”) price is given by

p(x,y)=(xy)x/(xy)y=yx.p(x, y) = \frac{\partial(xy)}{\partial x} \bigg/ \frac{\partial(xy)}{\partial y} = \frac{y}{x}.

Finite trades incur slippage: the average execution price for an input Δx\Delta x is yx+Δx<yx\frac{y}{x+\Delta x} < \frac{y}{x} (Conrad et al., 2023, Wang, 2020, Wu et al., 2022).

2. Axiomatic Derivation and Optimality

Within the axiomatic landscape of CFMMs, CPMMs are characterized by two crucial properties: independence (additive separability in reserve coordinates) and scale invariance (homogeneity of degree one) (Schlegel et al., 2022). Formally, a strictly increasing, continuous trading function f(I):R+nRf(I): \mathbb{R}_+^n \to \mathbb{R} satisfying these axioms must take the monomial form

f(I)=(i=1nαiIiγ)1/γf(I) = \left(\sum_{i=1}^n \alpha_i I_i^\gamma\right)^{1/\gamma}

with the constant product case corresponding to γ0\gamma\to 0: f(I)i=1nIiαi.f(I) \propto \prod_{i=1}^n I_i^{\alpha_i}.

Among all scale-invariant, symmetric, independent, non-concentrated AMMs, the CPMM is unique in offering the least curvature (i.e., minimum trader slippage at fixed liquidity), making it trader-optimal and the sole mechanism robust to cross-pair manipulation with fungible LP-shares (Schlegel et al., 2022).

Convex programming arguments further show CPMMs arise as the capital-efficient solution allocating liquidity evenly—and optimally—across all possible price ratios if the market-maker possesses no directional information (Goyal et al., 2022). For beliefs uniform in log-prices, the optimal liquidity profile is L(p)pL(p) \propto \sqrt{p} (liquidity per log-price increment), which integrates to xy=constx y = \text{const} as the level curve (Goyal et al., 2022).

3. Economic Properties and Value Functions

The payoff structure for LPs is tied to the geometric mean of external prices: The Fenchel conjugate value function at price vector (a,b)(a, b) is Vprod(a,b)=2abV_\text{prod}(a, b) = 2 \sqrt{ab} in the k=1k=1 normalization, and is often scaled as Vprod(a,b)=abV_\text{prod}(a, b) = \sqrt{ab} per convention (Wu et al., 2022, Angeris et al., 2021). This exact 50:50 rebalancing arises from constant-proportion portfolio theory, confirming that CPMMs replicate statistical rebalancing positions without external oracles (Angeris et al., 2021).

Slippage and impermanent loss are intrinsic:

  • Price impact for finite trades is s(Δx)=Δxx+Δxs(\Delta x) = \frac{\Delta x}{x+\Delta x},
  • Impermanent loss for a price move by factor α\alpha is Iprod(α)=2α1+α1I_\text{prod}(\alpha) = \frac{2\sqrt{\alpha}}{1+\alpha} - 1 (Wu et al., 2022, Wang, 2020).
  • The LP’s “Greeks”: Delta is M1/2M^{-1/2}, Gamma is 0.5M3/2-0.5 M^{-3/2}, indicating short volatility exposure.

These formulas establish the CPMM’s convexity-imposed trade-off: low slippage implies high impermanent loss, and vice versa.

4. Microstructure and Path-Dependence

CPMMs are path-dependent: sequences of swaps and liquidity changes do not commute. Empirically and theoretically, final pool states, and thus observable prices, depend not only on net order flow but also on the order and timing of events (Pillay, 28 Feb 2025). This non-commutativity has been formally established:

  • Adding liquidity and then swapping differs from swapping and then adding liquidity, with the difference proportional to the product of swap and addition sizes.
  • Real-world data (ETH/USDC) demonstrates economically significant divergences (mean impact 0.0716%-0.0716\%, up to 0.68%0.68\% in single events), ratifying the practical significance of path-dependence.

In decentralized prediction markets, this undercuts the interpretation of AMM-based prices as pure, path-independent forecasts—they retain memory of market operation sequence (Pillay, 28 Feb 2025).

5. Fee Structures, Arbitrage, and Profitability Frontiers

CPMMs can accumulate trading fees in two architectures: auto-compounding (fees added into the pool) or fee-splitting (fees segregated for LP claims) (Conrad et al., 2023). Fee-splitting is strictly more profitable in the presence of price moves, as fee accruals are not subject to impermanent loss.

Liquidity provider profitability depends on the balance between fee income and impermanent loss ("divergence loss"). The “profitability frontier” in (x,y)(x, y)-space quantifies the set of pool end-states that outperform simply holding assets, with empirical Uniswap V2 data revealing that only large, long-term LPs in low-volatility pools consistently earn net profits after accounting for network fees and divergence loss (Bitterli et al., 2023). Arbitrage is essential for restoring price alignment but imposes a quantifiable cost on LPs, reflecting the necessity of fee calibration.

6. Extensions, Generalizations, and Innovations

6.1 Multi-Asset Generalization

The CPMM emerges naturally as the two-asset, symmetric, equal-weights member of generalized multi-asset AMMs derived from self-financing and rebalancing axioms (Forgy et al., 2021). For nn tokens, the invariant generalizes to I(α)=i=1nαiwiI(\alpha) = \prod_{i=1}^n \alpha_i^{w_i} (with wiw_i as target weight), and in the limit n=2,w1=w2=1/2n=2, w_1 = w_2 = 1/2 recovers xy=constxy = \text{const}. This generalization underpins designs such as Balancer.

6.2 Power Root and Mixed Curves

Within the family of constant power root market makers, CPMMs correspond to the geometric mean (power q0q \to 0), interpolating between harmonic, geometric, and arithmetic mean AMMs (Wu et al., 2022). This parameter qq allows designers to trade off trader slippage against LP impermanent loss continuously.

Mixing CPMMs with constant-sum AMMs via arithmetic, geometric, or homotopic interpolations generates new invariants supporting custom liquidity/price curves, as in Stableswap and other hybrid pools (Port et al., 2022).

6.3 Coupled and Global Structures

When CPMMs are coupled (e.g., via intermediate assets or oracles), price drift, depth, and “basket” inflation/deflation behave according to explicit compound formulas. Global aggregation of CPMM liquidity (GMMs) eliminates inter-pool arbitrage, reduces sandwich attack profitability, and improves LP outcomes by minimizing aggregate impermanent loss and maximizing market efficiency (Bagnulo et al., 12 Mar 2025, Sterrett et al., 7 Oct 2025).

6.4 Concentrated Liquidity

Uniswap v3’s concentrated liquidity (CL) extension allows LPs to allocate capital to specific price ranges, sharply boosting capital efficiency (by orders of magnitude for typical fee tiers) at the cost of “concentration risk” (potential deactivation if spot price exits chosen range) and requiring more active management (Monga, 2024).

7. Comparative Analysis and Practical Considerations

CPMMs are computationally efficient (multiplication/division only), highly composable, path-dependent, and offer guaranteed liquidity at every price; however, they are susceptible to front-running (MEV), especially in low-depth pools due to unbounded slippage at the edges (Wang, 2020). Alternative AMM forms, such as the constant-elasticity and constant-ellipse innovations, provide more controlled slippage and can in principle reduce extractable MEV but at varying complexity and capital efficiency (Wang, 2020, Wu et al., 2022).

Within empirical and stochastic frameworks, the LP’s wealth process in a CPMM is governed by a reflected diffusion with boundaries set by the trading fee. The closed-form long-run growth rate of LP wealth is negative in the absence of sufficient fees and price drift, further emphasizing the need for careful parameter design and dynamic liquidity allocation (Lee et al., 2024).

References

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Constant Product Market Maker.