Cost-Function Market Makers
- Cost-function market makers are automated systems where a convex cost function governs pricing, liquidity, and risk management in decentralized trading and prediction markets.
- They unify constant-function market makers and scoring rule markets through translation invariance and path-independence, ensuring arbitrage-free and bounded-loss conditions.
- These models enable adaptive fee strategies and robust risk control, as demonstrated by implementations like LMSR and constant-product designs.
A cost-function market maker is a formalism for automated market makers (AMMs) in which a convex cost function determines prices and trade admissibility, unifying the theory of decentralized trading protocols, prediction markets, and scoring rule markets. Every classical constant-function market maker (CFMM)—including designs such as Uniswap, Balancer, and the logarithmic market scoring rule (LMSR)—admits an equivalent cost-function representation. This approach provides a mathematically tractable, economically interpretable, and computationally efficient basis for liquidity provision, price determination, risk management, and mechanism design in both financial and information aggregation markets.
1. Mathematical Definition and Foundational Equivalence
In the cost-function model, the market maker maintains a state vector recording net obligations or token reserves across %%%%1%%%% assets or outcome states. The core object is a convex, monotonic cost function satisfying (the 1-invariance property) for all , ensuring translation-invariant pricing and cash elimination (Frongillo et al., 2023, Chen et al., 2012).
If a trader demands an increment , the price is determined as
The instantaneous (marginal) price vector is given by
under differentiability. The market or pool is arbitrage-free and bounded-loss provided is convex and growing, with worst-case loss over all possible outcomes and portfolios strictly finite (Chen et al., 2012).
There is an equivalence between the cost-function market maker and the constant-function (concave potential) market maker:
- Every increasing, concave function defines a CFMM by the invariant .
- There exists a unique convex cost function related by , and conversely, . Thus, cost-function market makers and proper scoring rule markets are unified in a single analytic framework (Frongillo et al., 2023, Goyal et al., 2022, Angeris et al., 2021).
2. Theoretical Foundations: Axiomatic and Duality Perspective
Cost-function market makers have been axiomatized via four properties (Frongillo et al., 2023):
- NoDominatedTrades: No strictly better (pointwise) trade exists for the same cost (arbitrage-free).
- PathIndependence: The total effect of a sequence of trades depends only on net change, allowing trade aggregation.
- Liquidation: For any pair of bundles, positive multiples allow exchanges, guaranteeing exchange rates between assets.
- DemandResponsiveness: Marginal prices are nondecreasing in demand, embedding slippage and fair pricing under increased usage.
Any market satisfying these axioms, under suitable regularity, is represented by an increasing, concave potential function, hence can be encoded as a cost-function market maker.
The cost-function approach is dually related to proper scoring rules: any convex has a conjugate and strictly proper scoring rule via
and the cost-function includes both utility-based market makers (exponential/HARA utility) and scoring-rule AMMs (LMSR, quadratic) as special cases (Chen et al., 2012, Frongillo et al., 2023).
3. Representative Families and Instantiations
Several canonical designs are cost-function market makers:
| Market Type | Cost Function | Key Features |
|---|---|---|
| LMSR | Translation invariance, bounded loss (Wang, 2020) | |
| Constant-product | (or ) | Liquidity-sensitivity, infinite support, slippage (Dewey et al., 2023) |
| Constant-power-root | , | Interpolates sum, product, harmonic, min-reserve (Wu et al., 2022) |
| Constant-ellipse | Convex, bounded slippage, path independence (Wang, 2020) |
Each function defines instantaneous prices and admits mechanical computation of trade execution for finite orders.
4. Economic Properties and Risk Analysis
Cost-function market makers have tractable expressions for worst-case loss, liquidity, and slippage:
- Worst-case loss. ; for LMSR with , (Chen et al., 2012).
- Liquidity. The inverse price sensitivity, , quantifies liquidity depth (Chen et al., 2012).
- Slippage. For a trade of size , price impacts are governed by cost-function curvature: flatter at the current state implies higher liquidity and lower slippage, but also higher potential worst-case loss (Dewey et al., 2023, Goyal et al., 2022).
- Impermanent Loss. For near constant-product, LP's PnL under external price movement is negative gamma, satisfying:
where gamma is the second derivative of LP's portfolio value with respect to price (Dewey et al., 2023).
5. Fee Design, Competition, and Adaptive Mechanisms
Cost-function market makers accommodate fee mechanisms, competitive equilibria, and adaptive selection:
- Fee embedding. Trading fees modify the effective cost function, e.g., in Uniswap, only a fraction of the incoming asset modifies the invariant; affects both marginal and executed prices (Dewey et al., 2023).
- Fee competition. In competitive environments with multiple pools, optimal fees arise as Nash equilibria, balancing LP returns and traded volume; equilibria are strictly positive and depend on pool sizes, ensuring no "race to the bottom" (Fritsch et al., 2021).
- Adaptive cost selection. Distribution-free profit and bounded loss are preserved when adapting parameters (e.g. "overround") using bandit algorithms, facilitating regret minimization versus the best-in-hindsight static design (Penna et al., 2011).
- Information-utility decay. Special cost-function constructions allow dynamic reduction in utility for revealed or time-deprecating information in prediction markets (via Bregman-divergence adaptation), guaranteeing information preservation, no-arbitrage, and controlled loss (Dudík et al., 2014).
6. Optimization, Design Synthesis, and Applications
Explicit convex-programming frameworks enable customized CFMM design and analysis:
- Optimal CFMM design. For any belief distribution over future prices, a convex program yields the liquidity allocation (and thus the cost function) that optimally balances profit, slippage, and provider divergence loss given capital constraints (Goyal et al., 2022).
- Payoff replication. There is a one-to-one correspondence between convex cost functions, concave, nonnegative, 1-homogeneous payoff functions, and trading invariants via Fenchel–Legendre conjugacy; every design with a permitted payoff curve can be mapped to a unique CFMM (Angeris et al., 2021).
- Dynamic or hybrid invariants. Newer CFMM designs interpolate between geometric mean, arithmetic mean, harmonic mean, and even derive option-like payoff replication (e.g. covered-call and options) through judicious choice of the invariant and cost function, as in RMM-01 (Jepsen et al., 2023).
7. Implementation, Robustness, and Extensions
Cost-function market makers are computationally efficient, path-independent, and robust to strategic behavior:
- Low computational burden. Families such as constant-ellipse or constant-product admit evaluation with only multiplications, additions, and occasional square roots, avoiding exponentiation/log costly on-chain (Wang, 2020).
- Slippage and MEV resistance. Bounded or smoothly-varying slippage can mitigate front-running and sandwich attacks (MEV) relative to constant-product and concave curve designs (Wang, 2020).
- Extensions to combinatorial and decentralized settings. Natural generalizations operate efficiently in high-dimensional and combinatorial state spaces, supporting prediction markets and complex outcome sets (Penna et al., 2011, Dudík et al., 2014).
In summary, the cost-function approach provides a principled and flexible analytic foundation for market-making automation across financial and informational domains. It clarifies the deep connection between decentralized finance AMMs and information aggregation, enables optimal and adaptive market design, and ensures both risk control and operational tractability (Frongillo et al., 2023, Goyal et al., 2022, Chen et al., 2012).