Cost-function market makers
A whole family of automated market makers collapses into a single object: a convex potential $C(q)$ over the vector of outstanding shares. Abernethy, Chen & Wortman Vaughan (2013) showed that to build a market maker you need only pick such a potential: prices are its gradient. Two slogans about that construction are wrong and are corrected below, namely that no-arbitrage is convexity, and that the worst-case subsidy is the spread of the potential. LMSR is one instance (the entropic one); Uniswap-style CFMMs are the same object seen from the reserves side.
A convex potential is a market maker
Fix $n$ outcomes (or share types) and a convex function $C:\mathbb{R}^n \to \mathbb{R}$, the cost function. The maker tracks the vector $q$ of shares it has sold. A trader who moves the book from $q$ to $q+\delta$ pays the increment in potential, $C(q+\delta)-C(q)$, and the instantaneous price vector is the gradient:
That single choice determines everything else. There is no order book and no
counterparty quoting a spread; the price of outcome $i$ is just
$\partial C/\partial q_i$, read off the current inventory. This is exactly
what CostFunctionMarketMaker does in
mechanisms/cmm.py:
it takes a callable cost (and optional analytic grad),
and exposes prices() $=\nabla C(q)$, cost_to_trade(delta),
and buy(outcome, shares). When no gradient is supplied it falls
back to a central finite difference, underscoring that the potential alone
defines the mechanism.
What convexity does, and what it does not
Three properties are often run together here, and they are separate.
Path independence is free. If a move from $q$ to $q'$ costs $C(q') - C(q)$, then any sequence of trades telescopes to its endpoints, so a round trip costs nothing. That holds for any $C$ whatsoever, convex or not; it is a property of charging by differences of a state function, not of convexity.
Convexity gives monotone prices, so buying an outcome raises its price. That is the information incorporation property, and it is what the standard axiom sets impose.
No-arbitrage is a separate condition: the marginal prices must lie in the convex hull of the payoff vectors. For $n$ mutually exclusive unit-paying claims that means $\nabla C(q) \in \Delta$, together with the translation property $C(q + \alpha\mathbf 1) = C(q) + \alpha$. Convexity alone does not deliver it. The quadratic potential further down this page is its own counterexample: with $C(q) = \tfrac{\alpha}{2}\lVert q\rVert^2$, buy $\delta$ of every one of the $n$ claims for $\tfrac{\alpha n}{2}\delta^2$ and collect $\delta$ whichever outcome occurs, a sure profit for every $0 < \delta < 2/(\alpha n)$.
The construction that does deliver no-arbitrage is the one used in the algebra paper: take a closed convex regulariser $R$ on the payoff simplex (more generally the payoff polytope) and set $C = R^\ast$. Then prices are forced into the feasible hull and the translation property holds by construction. Conversely, dropping information incorporation while keeping prices in the hull leaves a coherent non-convex maker, which is the subject of Non-Convex Market Makers.
Worst-case loss is the range of the regulariser
The maker is a subsidized device: it may pay out more than it took in. Its worst-case loss is not the range of $C$ over inventories. LMSR settles that immediately: $C(q + t\mathbf 1) = C(q) + t$, so that range is infinite, while LMSR's worst-case loss is the finite $b \log n$.
Writing $C = R^\ast$ for a regulariser $R$ on the payoff simplex and starting from $q = 0$, the loss if outcome $i$ occurs is $\sup_q \{q_i - C(q) + C(0)\} = R(e_i) - \inf_{p \in \Delta} R(p)$, so
the range of the regulariser over the payoff set, not of the potential over inventories. This is the budget a sponsoring institution knowingly puts up in exchange for the information the market aggregates, finite, and fixed by the choice of $R$ before any trade occurs. Note also that the conjugate domain is not the dial: every LMSR liquidity $b$ has the same domain, the simplex, and it is the range and curvature of $R$ that change with $b$.
LMSR: the entropic special case
Hanson's logarithmic market scoring rule is the instance where $C$ is the scaled log-partition function, with liquidity parameter $b \gt 0$:
The gradient is the softmax, so prices are automatically non-negative and
sum to one, a genuine probability estimate. Here the conjugate is negative
entropy (LMSR is the entropic regulariser of online learning's
Follow-the-Regularised-Leader, with learning rate $\eta = 1/b$, so $b$ is
the inverse learning rate or temperature rather than the rate itself), and the
worst-case-loss bound evaluates to the clean $b \log n$. In code,
lmsr_potential(b) returns exactly this (cost, grad)
pair, computed with a max-subtraction for numerical stability.
A quadratic potential: a bounded-budget, non-probability maker
Softmax is one choice of potential among many. Take instead a simple quadratic,
This is convex, but its prices $\alpha q$ are not normalized to the
probability simplex; they can be negative and need not sum to one. As shown
above, that is exactly why it is not arbitrage-free when read as a
market in mutually exclusive claims: buying a little of everything is a sure
profit. It is a bounded-budget quotation rule rather than a probability
market, and a useful illustration that convexity by itself does not make a
cost function a coherent maker. It is provided as
quadratic_potential(alpha) in
mechanisms/cmm.py,
sitting behind the same CostFunctionMarketMaker interface as
LMSR.
The dual: cost-function makers and CFMMs
The DeFi constant-function market makers, Uniswap, Balancer, Curve, are the same theory through convex duality. A cost-function maker is a convex potential $C(q)$ priced by $\nabla C(q)$; a CFMM is a concave trading function $\varphi(R)$ over reserves $R$, with spot prices read off the ratio of its partials. The correspondence runs through convex duality, but it is not the bare Fenchel conjugate $C^\ast(p) = \sup_q \langle p,q\rangle - C(q)$: bounded-reserve CFMMs require a level-set or perspective construction, under additional monotonicity and reserve-domain assumptions. The algebra paper states the correspondence carefully; this page's earlier phrasing as a plain conjugate was wrong.
Under this correspondence, prices in the payoff hull map to no-arbitrage of the pool, and a bounded regulariser range maps to bounded loss. So the prediction-market side (bounded-loss information elicitation) and the DeFi side (fees, impermanent loss, capital efficiency) are two readings of one convex object, see CFMMs for the reserves-side picture.
Try it
Any convex potential $C$ defines a maker, with prices $\nabla C$. Here a quadratic potential $C(q)=\tfrac{\alpha}{2}\lVert q\rVert^2$ gives the linear price $\alpha q$, a bounded-budget maker whose price is not a probability, showing LMSR's softmax is just one choice of potential.
Code: mechanisms/cmm.py · Demo: examples/sim_cmm.py · Related: LMSR, CFMMs · Research: market-scoring-rules-and-amms.md