Source-linked AI summary

Improved Price Oracles: Constant Function Market Makers

Guillermo Angeris, Tarun Chitra

arXiv:2003.10001v4q-fin.TRmath.OC

TL;DR

The paper studies how constant function market makers can provide reliable asset prices without relying on centralized authorities. It develops a general framework and identifies conditions under which arbitrageurs can efficiently synchronize prices, while also establishing reserve and asset-value guarantees.

  • Problem

    The paper addresses whether decentralized exchanges built from CFMMs can accurately report external asset prices while avoiding trust in centralized oracles.

  • Method

    The paper analyzes CFMMs through their trading sets and convexity, using optimization and supporting hyperplanes to characterize arbitrage and reported marginal prices.

  • Results

    The framework covers practical CFMMs and gives sufficient conditions for incentive-compatible price reporting, computationally efficient arbitrage, and resistance to reserve draining.

  • Takeaways & Limitations

    CFMM design can be tailored to asset types and volatilities while retaining useful guarantees for pricing and liquidity provision.

  • Takeaways & Limitations

    The paper notes that comparisons with LMSR and other scoring rules may not be possible using only its no-arbitrage framework.

Abstract

from arXiv · show

Automated market makers, first popularized by Hanson's logarithmic market scoring rule (or LMSR) for prediction markets, have become important building blocks, called 'primitives,' for decentralized finance. A particularly useful primitive is the ability to measure the price of an asset, a problem often known as the pricing oracle problem. In this paper, we focus on the analysis of a very large class of automated market makers, called constant function market makers (or CFMMs) which includes existing popular market makers such as Uniswap, Balancer, and Curve, whose yearly transaction volume totals to billions of dollars. We give sufficient conditions such that, under fairly general assumptions, agents who interact with these constant function market makers are incentivized to correctly report the price of an asset and that they can do so in a computationally efficient way. We also derive several other useful properties that were previously not known. These include lower bounds on the total value of assets held by CFMMs and lower bounds guaranteeing that no agent can, by any set of trades, drain the reserves of assets held by a given CFMM.

1 Introduction

Automated market makers address liquidity and pricing needs for digital assets, while CFMM-based decentralized exchanges offer a prominent route to trustless trading and price measurement. The paper develops a general CFMM framework and gives conditions supporting accurate, efficient price reporting and reserve protection.

  • Motivation: Digital assets often have complex interactions and low liquidity, motivating automated market makers that pool assets and price them algorithmically.AMMs encourage passive participants to lend assets to pools.
  • CFMMs: CFMMs are alternative AMMs that include Uniswap’s constant product and constant mean mechanisms, primarily used to build decentralized exchanges.These exchanges enable security-like asset trading without a trusted third party.
  • The oracle problem: A decentralized exchange can serve as a price oracle when its prices match external market prices and can be queried as ground truth by other smart contracts.DEXs also provide a way to measure relative prices of on-chain asset pairs.
  • The oracle problem: The oracle problem arises because decentralized smart contracts struggle to query external data trustlessly, creating opportunities for participants to manipulate reported outcomes.Decentralized oracle designs use voting and mechanisms intended to address adverse selection, bribery, and collusion.
  • Generalizations: Uniswap’s popularity has prompted generalizations for assets with differing volatilities, stablecoins, and simultaneous multi-asset pricing.Curve charges relatively low fees near the stablecoin peg and higher fees farther away; multi-asset mechanisms can reduce transaction counts.
  • Generalizations: Multi-asset mechanisms resemble ETF creation-redemption, allowing portfolio exchanges and arbitrage without a trusted intermediary.ETFs represent weighted baskets of shares, while creation and redemption support arbitrage when the ETF is mispriced.
  • Paper contribution: The paper unifies many practical mechanisms as CFMMs and provides conditions for accurate price reporting, computationally efficient arbitrage, and protection against reserve draining.It also derives properties including total asset-value bounds and presents extensions and future directions.

2 Constant function market makers

The paper develops a general CFMM framework based on trading sets, derives path-based conditions for efficient arbitrage, and connects these conditions to price reporting and reserve-value guarantees.

  • 2 Constant function market makers: CFMMs are defined by trading functions and reserve vectors, while their trading sets collect feasible input-output trades and often provide a simpler mathematical representation.The trading set contains the important information supplied by the trading function and can be used in equivalent analyses.
  • 2 Constant function market makers: Equivalent CFMM representations can be constructed with trading functions that are nonincreasing in inputs and nondecreasing in outputs.This monotonicity follows from the paper’s trading-set definition and preserves the equivalent CFMM.
  • 2 Constant function market makers: A closed convex trading set supports efficient agent optimization because convex optimization methods can solve payoff-maximization problems when the set has a compact representation.The paper assumes each trading set T(R) is closed and convex.
  • 2 Constant function market makers: Path deficiency prevents any multistep arbitrage strategy from outperforming the single optimal trade, while strict path deficiency makes subdividing trades strictly worse.It also guarantees reserve lower bounds after any sequence of feasible trades.
  • 2 Constant function market makers: Reported prices are obtained from supporting-hyperplane slopes of the reachable reserve set, and arbitrage against a reference market incentivizes correcting mismatched CFMM prices.For path-independent CFMMs, reported and marginal prices coincide; multiple supporting hyperplanes can nevertheless imply multiple no-arbitrage prices.
  • 2 Constant function market makers: Path deficiency ensures total reserve value does not decrease for a fixed cost vector, while strict path deficiency makes it strictly increase; reserve values can be computed by one-variable convex optimization.The framework recovers the zero-fee Uniswap reserve-value result as a special case.

3 Extensions and future work

The paper extends its CFMM framework to trading fees, optimization, time dependence, and liquidity provision, while identifying limits to comparing CFMMs with scoring-rule market makers.

  • Trading fees: Input fees make trades require 1/γ more input and turn path-independent CFMMs into path-deficient ones.The resulting CFMM retains reserve-value lower bounds from the fee-free formulation.
  • Trading fees: Variable input or output fees may preserve different desirable CFMM properties, but suitable fee classes are left for future work.
  • Comparison to scoring rules: CFMMs and scoring-rule market makers cannot generally be compared using only the paper’s no-arbitrage framework.The paper’s thought experiment gives a known price increase p2 − p1 and shows reported prices can diverge by any desired amount.
  • Optimization over possible CFMMs: Optimizing a CFMM for a chosen performance metric is likely computationally difficult exactly, although heuristics may work and n = 2 may be tractable.The framework can identify approximately optimal CFMMs, including through parameter optimization for parametrized trading functions.
  • Future extensions: Extending the framework to time-dependent trading functions may preserve some analysis when arbitrage is instantaneous, but reachable-set definitions remain open.Liquidity provision is also not covered and may expose liquidity providers to large losses under unrestricted reserve additions.

4 Conclusion

The paper presents CFMMs as optimization-friendly mechanisms for synchronizing off-chain and on-chain prices, and uses its generalization to guide designs for different assets and volatility profiles.

  • CFMMs provide an easy optimization problem for arbitrageurs to synchronize off-chain and on-chain pricing data.
  • The framework encompasses all live CFMMs cited by the paper and supplies conditions associated with well-behaved operation.
  • The analysis provides guidance for designing CFMMs suited to particular asset types and volatilities.

A.1 An equivalent monotonic trade function

Any trade set can be represented by an equivalent monotonic trade function, and convex trade sets make the resulting optimization problem convex and computationally tractable in suitable representations.

  • Monotonicity: Any trade function can be replaced by an equivalent function monotonic in inputs and outputs for fixed reserves.
  • Equivalent construction: A squared-distance-to-set construction produces a trade function whose zero-level trade set matches the original closed trade set.
  • Monotonicity: The monotonicity proof uses closed sets and shows distance to the relevant set decreases as the first argument increases.
  • Optimization: The equivalence follows because feasible trades remain feasible and an optimum cannot lie strictly inside the relaxed inequality region.
  • Optimization: When the trade set is convex, the relaxed formulation becomes a convex optimization problem.The optimization variables are Λ and ∆, with reserves R and c as problem data.

A.2 Marginal price for path independent CFMMs

For path-independent CFMMs, the optimal arbitrage trade identifies a supporting hyperplane whose reported price equals the post-trade marginal price.

  • The price of a trade is defined as the minimum cost of obtaining desired output when coin values are c_i > 0.
  • After optimal arbitrage, the reported price c supports the reachable set at the post-trade reserves R′.
  • Path independence preserves the reachable set after the optimal trade, enabling comparison of reported and marginal prices at R′.
  • The reported price matches the marginal price at the post-trade reserves.

A.3 Conjugate of reciprocal product

This section derives the Fenchel conjugate of a convex reciprocal-product function. The proof separates positive, zero, and strictly negative coordinates of y and uses convex optimality conditions in the final case.

  • The section states that the convex reciprocal-product function has a Fenchel conjugate.
  • If any coordinate y_i is positive, scaling the corresponding x_i makes y^T x diverge while f(x) tends to zero, so f*(y)=+∞.
  • For y≤0, the proof establishes the relevant upper bound because f(x)≥0 on its effective domain and is +∞ outside it.
  • When some y_i=0, the bound is attained by sending x_i to infinity and the other coordinates to zero, yielding y^T x→0 and f(x)→0.
  • When every coordinate is strictly negative, first-order optimality conditions are applied over x, with convexity and differentiability making them sufficient and necessary.
Loading 2003.10001v4…