Goal: combine a constant-product AMM with the existing CLOB so every market has always-on liquidity — solving the cold-start / empty-order-book problem.
Priority: earlier than the default MM-agent slot — jay wants this mechanism early. Modeled on Vertex Protocol’s hybrid design (not the actual Vertex/Uniswap code).
New or low-volume markets on a pure order book suffer the “empty order book” problem: no
makers → huge bid-ask spread → traders can’t fill without heavy slippage. An AMM curve
(x·y=k) mathematically covers prices from 0 to ∞, so there’s always a price to trade.
Two components, merged into one book:
x·y=k, Uniswap-V2-style math) holding
YES/NO position-token + collateral liquidity. Own smart contracts (not the Uniswap protocol).Liquidity mapping — read the on-chain pool balances (x, y); using x·y=k, compute the
execution price for any order size; overlay that curve onto the order book as virtual
resting orders (to a trader it looks like limit orders fill every price tick).
Smart routing — a market order is matched against combined depth (real limit orders + AMM virtual orders) and split to whoever offers the best price (e.g. buy 10: 3 vs limit orders, 7 vs the AMM) → lower slippage than either venue alone.
Slo-mo fallback — if the off-chain matcher/MM is down, traders bypass it and trade directly against the on-chain AMM, keeping the exchange decentralized / censorship-resistant.
Source: jay’s “extreme probabilities” note, pasted in session 2026-07-17 (no source file; this section is the canonical copy).
In a prediction market price = probability ($0.90 token ⇒ 90%). “Extreme probabilities” means the tails — near $0.99 (near-certain) or $0.01 (near-impossible).
The problem with pure x·y=k there: the CPMM hyperbola is flat around $0.50 but bends
toward its asymptotes at the tails. At $0.95, even a small buy walks the curve so steeply
that the price jumps toward $0.99 — the user saw a spot price of $0.95 but gets an
execution price of $0.98–0.99. Massive price impact exactly where prediction markets
spend most of their life (markets converge to the tails as resolution nears).
Structural mismatch: x·y=k prices the range 0→∞, but binary outcome tokens are
bounded to $0–$1. The curve “covering every price” (the Why section above) is real, but
most of that coverage is wasted on prices that can never occur, while the usable tail region
gets the worst part of the curve.
Mitigation options (decide before building the pools):
x·y=k but have the router/UI enforce a max-price-impact
guard at the tails, and lean on CLOB depth (MM agent quotes) there; revisit the curve
after measuring real slippage.Dev items:
x·y=k, flattened,
LMSR), plots execution price vs order size at spot $0.50 / $0.90 / $0.95 / $0.99 —
quantify the tail penalty before committing
→ done 2026-08-03: packages/api/scripts/sim-amm-slippage.ts,
results + recommendation in docs/analysis/2026-08-03-amm-curve-slippage-sim.md
(CPMM quotes >$1.00 at the tails; StableSwap resists repricing and still crosses $1 at depth;
LMSR recommended, tail guard kept regardless)x·y=k (Uniswap V2, as requested) vs LMSR (classic prediction-market AMM,
already noted as the MM-agent evolution path). Start with x·y=k per the request.
→ 2026-07-17: sharpened by the extreme-probability slippage section above — pure
x·y=k is a poor fit for 0–1-bounded tokens at the tails; run the slippage simulation
before locking the curve in.x·y=k pools for YES/NO positions + collateralx·y=k vs LMSR, pool topology, and where routing lives