CFAMM: Constant-Function Automated Market Maker
- CFAMMs are decentralized trading protocols that maintain a deterministic invariant function of asset reserves to enable continuous liquidity and serve as on-chain price oracles.
- They generalize classical models like constant-product and constant-mean AMMs, offering flexible designs that address trade slippage, impermanent loss, and dynamic fee optimization.
- By leveraging duality and option-theoretic interpretations, CFAMMs connect liquidity provision with prediction market mechanisms, optimizing incentives for market participants.
A Constant-Function Automated Market Maker (CFAMM) is a class of decentralized trading protocol in which feasible trades are those that leave a specified deterministic function of the pool’s asset reserves invariant. This mechanism generalizes multiple classical AMM models including constant-product, constant-sum, and constant-mean invariants, underpinning prominent decentralized exchanges such as Uniswap and Balancer. CFAMMs serve as critical primitives in decentralized finance, providing continuous liquidity, implicit price discovery, and an on-chain price oracle via arbitrage incentives.
1. Formal Structure and Canonical Invariant
A CFAMM is structurally defined by a reserve vector (for assets) and a continuous, typically concave, homogeneous trading function or invariant . A valid trade—formalized via input vector and output vector —transforms the reserves from to (with the fee-adjusted scaling), and must satisfy: or, in level-set form for classical invariants,
Exemplars include:
- Constant product AMM (Uniswap): ,
- Constant mean/balancer: , ,
- Elliptic/circle invariants: .
The trading set and reachable set encode all possible trades and resultant reserves, forming the basis for geometric, dual, and optimization-based analyses (Angeris et al., 2020, Angeris et al., 2023).
2. Price Discovery and Oracle Property
The invariant function implicitly defines the marginal (no-arbitrage) prices. Formally, for differentiable : Choosing a numéraire (e.g., asset ), the relative price between assets and is: for a constant-mean invariant. Arbitrage ensures that whenever the CFAMM’s internal prices deviate from external references, profit-seeking traders rebalance reserves until the supporting hyperplane (gradient of the constraint surface) matches the external vector of asset prices (Angeris et al., 2020).
Under path deficiency or its strict variant, the reserves' value (measured in any strictly positive price vector) is non-decreasing over feasible trade sequences, precluding “drain” exploits and rendering the CFAMM a robust oracle (Angeris et al., 2020).
3. Axiomatic Foundations and Equivalence to Prediction Markets
Axiomatic analyses reveal that CFAMMs emerge naturally from simple principles:
- Separability (independence) ensures the exchange rates between assets depend only on the relevant pair’s inventories, not on others.
- Scale invariance (for DeFi) leads to functional forms such as constant-product and constant-mean (“constant inventory elasticity” class), while translation invariance (for prediction markets) uniquely determines the LMSR cost function (Schlegel et al., 2022, Frongillo et al., 2023).
Consequently, every "good" (i.e., liquid, path-independent, responsive, and non-dominated) market maker is necessarily a CFAMM with a concave invariant, and vice versa. There exists a duality: every CFAMM defines a proper scoring rule, and every scoring-rule-based prediction market can be recast as a CFAMM with an invariant , where is the cost function (Frongillo et al., 2023).
4. Replication, Duality, and Portfolio Interpretation
The space of convex, homogeneous, nonnegative, nondecreasing “portfolio value” functions is equivalent to the space of CFAMMs via Fenchel conjugacy: Conversely, the set of feasible reserves is (Angeris et al., 2021). This duality, sometimes encoded as , statically replicates nonlinear payoff profiles—including those of European options and exotic derivatives—within the canonical CFAMM framework.
Geometric perspectives further demonstrate that the canonical trading function and the minimal-cost portfolio function are dually associated through the liquidity cone via conic duality: This equivalence persists with minimal assumptions: convexity and monotonicity suffice (Angeris et al., 2023).
5. Liquidity Microstructure, Slippage, and Impermanent Loss
CFAMMs enforce nonlinear price responses to order size due to their invariant curve geometry. For the constant-product model, marginal price sensitivity is , resulting in nonlinear “slippage.” Larger trades against shallow pools incur superlinear price impact, quantified explicitly by for a trade of fraction of a token reserve (Jensen et al., 2021).
For liquidity providers (LPs), providing capital to a CFAMM results in “impermanent loss” (IL): the difference between holding assets directly and keeping them in the pool. This is a deterministic, convex function of the spot price ratio and market volatility—losses increase in shallow or highly volatile conditions: Design flexibility is encoded in generalized invariants. The power root family
with interpolates sum, product, harmonic mean, and reserve invariants, tuning the trade-off between slippage (for traders) and impermanent loss (for LPs) (Wu et al., 2022).
6. Optimal Design, Fee Dynamics, and Practical Implementations
Recent frameworks treat CFAMM design as a convex optimization over the space of liquidity allocation functions , parameterized by beliefs (density ) on future asset prices. Constraints on total reserves and optimality (maximizing the fraction of settled trades or net profit) yield trading functions that minimize expected trade failure, with dual formulas for inferring LP beliefs from observed invariants (Goyal et al., 2022).
Dynamic fee optimization is analyzed as a stochastic control problem, leading to (i) two regimes: high fees to deter arbitrage when inventory drifts from balanced, and low or negative fees to attract noise traders and increase volume; and (ii) explicit, nearly linear fee formulas in inventory misalignment and external price deviation: where arises from the HJB equation solved for the AMM’s value function (Baggiani et al., 3 Jun 2025).
Concentrated liquidity protocols allow LPs to allocate over intervals ("ticks"), supporting strategic positioning based on profitability, volatility, and predicted price drift—analytic solutions exist in single-pool settings, whereas multi-pool provision leverages deep learning approaches such as LSTM networks for high-dimensional allocation (Monga, 23 Jul 2024).
7. Option-Theoretic Interpretation and LVR Analysis
A rigorous option-theoretic model represents a CFAMM liquidity position as a static portfolio of perpetual American continuous-instaLLMent (CI) options. Each option, funded at a constant rate per unit time, statically replicates the AMM’s delta exposure: where is the CFAMM value function and the replicated portfolio. The loss-versus-rebalancing (LVR)—the adverse-selection cost incurred by non-instantaneous rebalancing relative to continuous hedging—is proven analytically equal to the continuous funding theta of the at-the-money CI option: Calibration procedures allow mapping the perpetual volatility to term-structure-implied market values; the framework supports liquidity band selection that renders LVR nearly constant and predictable over arbitrary horizons (Singh et al., 5 Aug 2025).
Table: Core Invariant and Pricing Formulas
CFAMM Family | Invariant | Marginal Price Formula |
---|---|---|
Constant Product | ||
Constant-Mean | , | (numéraire ) |
Power Root | ||
Constant Ellipse |
References
- (Angeris et al., 2020): generalized framework, price oracle mechanism, path deficiency, supporting hyperplane method
- (Schlegel et al., 2022): axiomatic derivation, scale vs translation invariance, CPMM and LMSR connection
- (Frongillo et al., 2023): equivalence with prediction markets, scoring rules
- (Angeris et al., 2021): duality between payoff and trading function, replication via Fenchel conjugacy
- (Singh et al., 5 Aug 2025): option-theoretic replication and LVR interpretation
- (Baggiani et al., 3 Jun 2025): dynamic fee optimization and regime analysis
- (He et al., 20 Apr 2024): optimal design for LPs under risk preferences and portfolio efficiency
The CFAMM framework systematically underpins the microstructure and economic incentives of decentralized markets, generalizing myriad mechanisms for liquidity aggregation, price discovery, and incentive-compatible fee structures. Through geometric, dual, and axiomatic analyses, it demonstrates robust market properties—such as manipulability resistance, arbitrage protection, and capital-efficient liquidity allocation—while also exposing tractable trade-offs between trader experience, LP risk, and protocol design. The option-theoretic interpretation and optimization-based design offer rigorous paths for further innovation and empirical performance tuning in automated market infrastructure.