Papers
Topics
Authors
Recent
Search
2000 character limit reached

Constant-Function Market Makers (CFMMs)

Updated 29 January 2026
  • CFMMs are decentralized protocols that enforce a constant invariant on liquidity pool reserves to ensure no-arbitrage and coherent price curves.
  • They leverage techniques like convex optimization, differential geometry, and axiomatic principles to model trading functions and fee optimization.
  • CFMMs enable advanced features including derivative replication, defensive rebalancing, and optimal curve design, enhancing liquidity and capital efficiency.

Constant-Function Market Makers (CFMMs) are decentralized exchange protocols that accept or reject asset trades by enforcing a deterministic invariant—a “constant function”—of the reserve holdings in a liquidity pool. Their trading rules, mathematical structure, and economic properties underpin almost all major Automated Market Makers (AMMs) in DeFi, including Uniswap, Balancer, and Curve. Modern CFMM designs are analyzed through convex optimization, axiomatic characterization, and differential geometry. This article provides a comprehensive technical account of CFMMs for researchers and professionals familiar with arXiv literature.

1. Mathematical Structure and Trading Functions

A CFMM maintains a reserve vector R=(RA)AAR+A\mathbf{R} = (R_A)_{A \in \mathcal{A}} \in \mathbb{R}_+^\mathcal{A} over a set A\mathcal{A} of assets. Trades are permitted if the reserves move along a predefined invariant, ϕ:R+AR\phi: \mathbb{R}_+^\mathcal{A} \to \mathbb{R}:

ϕ(R)=ϕ(R)\phi(\mathbf{R}') = \phi(\mathbf{R})

for every post-trade R\mathbf{R}'. The function ϕ\phi is typically nondecreasing, concave, homogeneous of degree one, and continuous; these properties enforce no-arbitrage, path independence, and well-behaved price curves (Angeris et al., 2020, Angeris et al., 2023, Frongillo et al., 2023).

Common CFMM invariants include:

Invariant Type Functional Form Example
Constant-product iRiwi\prod_{i} R_i^{w_i}, iwi=1\sum_i w_i = 1 Uniswap/Balancer
Power mean (iwiRiγ)1/γ\left( \sum_i w_i R_i^\gamma \right)^{1/\gamma} Generalized Mean
Constant-sum iRi\sum_i R_i Stablecoin pools
Log-score (LMSR) iwilnRi\sum_i w_i \ln R_i Prediction Mkts

The instantaneous marginal price Pij(R)P_{i \to j}(\mathbf{R}) is given by

Pij(R)=ϕRiϕRjP_{i \to j}(\mathbf{R}) = \frac{\frac{\partial\phi}{\partial R_i}}{\frac{\partial\phi}{\partial R_j}}

2. Key Axioms: Separability, Scale and Translation Invariance

CFMMs are characterized axiomatically by:

  • Separability (Independence): Trading a subset BA\mathcal{B} \subseteq \mathcal{A} leaves exchange ratios unaffected by nontraded assets. Formally, ϕ(RB,SB)=ϕ(S)ϕ(SB,RB)=ϕ(R)\phi(\mathbf{R}_{\mathcal{B}}, \mathbf{S}_{-\mathcal{B}}) = \phi(\mathbf{S}) \Leftrightarrow \phi(\mathbf{S}_{\mathcal{B}}, \mathbf{R}_{-\mathcal{B}}) = \phi(\mathbf{R}).
  • Scale invariance (DeFi): ϕ(R)=ϕ(S)ϕ(λR)=ϕ(λS)\phi(\mathbf{R}) = \phi(\mathbf{S}) \Rightarrow \phi(\lambda \mathbf{R}) = \phi(\lambda \mathbf{S}) for all λ>0\lambda > 0. LP positions are fungible and liquidity curves scale naturally.
  • Translation invariance (Prediction markets): ϕ(R)=ϕ(S)ϕ(R+α1)=ϕ(S+α1)\phi(\mathbf{R}) = \phi(\mathbf{S}) \Rightarrow \phi(\mathbf{R} + \alpha\mathbf{1}) = \phi(\mathbf{S} + \alpha\mathbf{1}) for αR\alpha \in \mathbb{R}; fundamental for cost-function-based prediction markets such as LMSR (Schlegel et al., 2022, Frongillo et al., 2023).

These principles classify CFMMs as generalized mean mechanisms or log-score mechanisms according to the target application.

3. Generalized Mean Market Makers (G3Ms) and Gf3Ms

The family of Generalized Mean Market Makers (G3Ms) parametrizes CFMM invariants using the pp-power mean:

ϕp(x;w)={(i=1nwixip)1/pp0 i=1nxiwip=0\phi_p(\mathbf{x}; \mathbf{w}) = \begin{cases} \left( \sum_{i=1}^n w_i x_i^p \right)^{1/p} & p \neq 0 \ \prod_{i=1}^n x_i^{w_i} & p = 0 \end{cases}

with weights iwi=1\sum_i w_i = 1.

Canonical cases:

  • p=1p=1: weighted arithmetic mean — zero slippage, but trade size bounded by reserves.
  • p0p \to 0: weighted geometric mean (Uniswap/Balancer) — unbounded trade size, slippage grows rapidly.
  • $0 < p < 1$: strictly interpolates between the two, offering unbounded trade size and parametrically lower slippage (Zanger, 2022).

The extension to Generalized ff-Mean Market Makers (Gf3Ms) employs quasi-arithmetic means:

Mf,w(x)=f1(i=1nwif(xi))M_{f,w}(\mathbf{x}) = f^{-1}\left( \sum_{i=1}^n w_i f(x_i) \right)

for ff continuous and strictly monotonic. When Mf,wM_{f,w} satisfies nondecreasing, concave, differentiable, and homogeneous properties, it produces a valid CFMM invariant.

4. Game-Theoretic Fee Selection and Capital Allocation

CFMM protocols must choose optimal fee rates γ\gamma to balance LP compensation against accurate price reporting and competitive trading volume. In multi-pool competitive settings, each pool sets γi\gamma_i to maximize its fee-revenue against the trader’s liquidity allocation, subject to a Nash equilibrium constraint:

ui(γ)=γixi(γ1,,γn)u_i(\gamma) = \gamma_i x_i(\gamma_1,\ldots,\gamma_n)

Fee adjustment equilibria are proven to exist, and, typically, equilibrium fees are significantly below prevailing market standards. LP ROI is higher in smaller pools, incentivizing capital migration until equilibrium (Fritsch et al., 2021). In G3Ms, fee minimization recovers the ideal constant-mix LP payoff in the zero-fee limit (Evans et al., 2021).

5. Slippage, Liquidity, and Curvature

The price impact of large trades, or slippage, is determined by the curvature of the invariant ϕ\phi. For geometric mean CFMMs (Uniswap):

  • Slippage for trade size ε\varepsilon is bounded by μ\mu-stability, with μ\mu the maximum derivative of marginal price. Effective liquidity is thus Λ=1/μ\Lambda = 1/\mu.
  • For constant-sum models, μ=0\mu = 0 (no slippage until exhaustion).
  • High-curvature CFMMs mitigate adverse selection from informed traders but impose greater slippage on uninformed flows (Angeris et al., 2020).
  • In G3Ms, slippage can be interpolated by choice of pp (Zanger, 2022).

Yield-farming and liquidity incentives are mathematically linked to curvature: higher curvature demands greater subsidies to maintain LP profitability.

6. Routing, Batch Integration, and Defensive Rebalancing

Optimal trade execution across CFMM networks or within batch auctions is formulated as a convex program subject to invariant constraints. Routing splits trades to maximize output, accounting for slippage, fees, and fixed costs; arbitrage detection is a special case (Angeris et al., 2022, Angeris et al., 2021, Ramseyer et al., 2022).

When CFMM configurations are arbitrage-prone, defensive rebalancing allows direct pool-to-pool asset transfers to a Pareto-efficient, arbitrage-free state while maximizing global liquidity. The optimization procedure is convex and efficiently solved; active/passive pool distinctions permit flexible protocol integration and MEV mitigation (Devorsetz et al., 26 Jan 2026, Kulkarni et al., 2022).

In batch auctions, CFMMs can be combined with limit orders; path independence, joint price discovery, Pareto-optimality, and price coherence are formalized, but not all properties can coexist (Ramseyer et al., 2022).

7. Portfolio-Valued CFMMs and Derivative Replication

CFMMs can be engineered to replicate specific payoff profiles, including option payoffs and covered calls. Any concave, nonnegative, homogeneous function V(c)V(c) of asset prices can be realized as the minimal mark-to-market portfolio value constrained by CFMM invariants:

V(c)=inf{cTRϕ(R)0}V(c) = \inf\left\{ c^T R \mid \phi(R) \ge 0 \right\}

Fenchel conjugacy provides a canonical construction mapping desired payoffs to CFMM trading functions (Angeris et al., 2021). Derivative-like market makers (e.g., RMM-01) can create LP tokens tracking Black-Scholes covered calls or other contracts (Jepsen et al., 2023).

8. Optimal Curve Design and Inference of Market Beliefs

CFMM trading functions can be optimally tailored to the market-maker’s beliefs about future asset prices via infinite-dimensional convex programming, maximizing capital efficiency and minimizing unserved trade fraction. The liquidity allocated at each price directly encodes LP beliefs, solving for ϕ\phi as an optimal curve; conversely, observed trading curves enable reverse inference of the maker’s implicit beliefs (Goyal et al., 2022).

This approach unifies the construction, analysis, and reverse engineering of CFMMs as belief-based convex programs.

References


Constant-Function Market Makers are mathematically tractable, axiomatizable, and convex-optimization-based exchange mechanisms that subsume all major AMM designs and their information-theoretic or economic counterparts in prediction markets. Modern innovations in curve design, defensive mechanisms, fee competition, and derivative replication stem from their rigorous mathematical foundation and modular composition rules.

Topic to Video (Beta)

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-Function Market Makers (CFMMs).