Constant Product Market Maker
- 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 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 of asset and of asset , and maintains the invariant
where 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 assets as for weights , with typical interest focused on the symmetric, two-asset case .
Any allowed trade must preserve . Upon a swap of into the pool (with no fees),
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
Finite trades incur slippage: the average execution price for an input is (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 satisfying these axioms must take the monomial form
with the constant product case corresponding to :
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 (liquidity per log-price increment), which integrates to 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 is in the normalization, and is often scaled as 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 ,
- Impermanent loss for a price move by factor is (Wu et al., 2022, Wang, 2020).
- The LP’s “Greeks”: Delta is , Gamma is , 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 , up to 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 -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 tokens, the invariant generalizes to (with as target weight), and in the limit recovers . 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 ), interpolating between harmonic, geometric, and arithmetic mean AMMs (Wu et al., 2022). This parameter 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
- "Constant Power Root Market Makers" (Wu et al., 2022)
- "Path Dependence in AMM-Based Markets: Mathematical Proof and Implications for Truth Discovery" (Pillay, 28 Feb 2025)
- "Axioms for Constant Function Market Makers" (Schlegel et al., 2022)
- "About constant-product automated market makers" (Conrad et al., 2023)
- "Automated Market Makers for Decentralized Finance (DeFi)" (Wang, 2020)
- "Replicating Monotonic Payoffs Without Oracles" (Angeris et al., 2021)
- "Decentralized Exchanges: The Profitability Frontier of Constant Product Market Makers" (Bitterli et al., 2023)
- "Pooling Liquidity Pools in AMMs" (Bagnulo et al., 12 Mar 2025)
- "A Family of Multi-Asset Automated Market Makers" (Forgy et al., 2021)
- "Growth rate of liquidity provider's wealth in G3Ms" (Lee et al., 2024)
- "A Microstructure Analysis of Coupling in CFMMs" (Sterrett et al., 7 Oct 2025)
- "Mixing Constant Sum and Constant Product Market Makers" (Port et al., 2022)
- "Finding the Right Curve: Optimal Design of Constant Function Market Makers" (Goyal et al., 2022)
- "Automated Market Making and Decentralized Finance" (Monga, 2024)
- "UAMM: Price-oracle based Automated Market Maker" (Im et al., 2023)