pm-AMM math
BOOKIE prices every bet with pm-AMM, the automated market maker designed for outcome tokens in "pm-AMM: A Uniform AMM for Prediction Markets" by Ciamac Moallemi and Dan Robinson (Paradigm, November 2024). This page restates the parts BOOKIE uses. The paper is the source; read it for the proofs.
The curve
A market has two tokens, YES and NO. Together one YES and one NO are always worth exactly 1 USDG, because one of them will pay 1 and the other 0. The pool holds x YES and y NO, and a liquidity number L. The static pm-AMM keeps this true after every trade:
(y - x) * Phi((y - x) / L) + L * phi((y - x) / L) - y = 0
Phi is the standard normal cumulative distribution and phi its density. The price of YES is
P(YES) = Phi((y - x) / L) P(NO) = 1 - P(YES)
With x = y the price is exactly 50 cents, and x = y = L * phi(0), about 0.3989 * L. A pool seeded with 10,000 USDG at 50 cents has L of about 25,066.
A BOOKIE market does not always open at 50 cents. It opens at the model's own price, Phi(ln(spot / strike) / (sigma * sqrt(tau))), from the feed's latest print, a listed volatility sigma for that stock and the time left tau. The opening YES price is kept between 2.3 and 97.7 cents.
A bet, step by step
Buying YES with d USDG:
- The
dUSDG mintsdYES anddNO into the pool. - The pool keeps the NO side:
ybecomesy + d. - The pool solves the curve for the new
x, and pays you every YES above it:shares = x + d - x_new.
From the 10,000 USDG pool above, a 100 USDG bet on YES buys about 199.37 YES shares, an average of about 50.16 cents each, and moves the YES price from 50.00 to about 50.32 cents. A second 100 USDG chip on NO brings it back near 50.00. This is the practice table on the landing page, before fees. In a live market the fee comes out of the stake first: a 100 USDG bet at a 1% fee prices 99 USDG on the curve.
Why it shrinks liquidity over time
Near expiry an outcome price can jump from 50 cents toward 0 or 1 on a small move in the stock. A pool that keeps the same depth all the way to the bell sells cheap shares to traders who see that move first, and it does so faster and faster as the bell gets closer. The paper calls this loss LVR (loss versus rebalancing).
The dynamic pm-AMM lowers liquidity on a fixed schedule:
L_t = L_0 * sqrt((T - t) / T)
where T is the market's life and t the time since it opened. The reserves freed as L_t falls go back to the liquidity owner, which in BOOKIE is the house.
What the paper proves, and what it does not
In the paper's model (the stock's score moves as a Brownian motion and arbitrageurs trade the pool to the fair price):
- The expected loss rate of the dynamic pm-AMM is constant over time and the same at every price. This is the "uniform" in the title.
- Over a market's whole life the house is expected to end with half of the value it put in: half comes back as liquidity is released, half is lost to informed traders, before fees.
- With fixed liquidity (static pm-AMM) the expected loss rate climbs toward the bell and the whole stake is expected to be gone at expiry.
Uniform is not zero. pm-AMM makes the house's loss predictable so that fees can be set to cover it. It does not remove the loss. See house risk.
On chain
The engine evaluates Phi and phi in fixed point with 18 decimals and solves the curve with Newton steps, checked against an off-chain reference computed to 100 digits. Liquidity is stored as k with L(t) = k * sqrt(expiry - t), so the schedule needs no keeper: every trade and anyone calling sweep returns the released reserves to the house. Rounding always favours the pool, so no trade can take out more than the curve allows.