verex

Hybrid AMM + CLOB (Vertex-style liquidity)

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).

Why

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.

Design (Vertex model, adapted to Verex)

Two components, merged into one book:

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.

Adaptation notes (Verex specifics)

Extreme-probability slippage — CPMM limitation (added 2026-07-17)

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):

  1. Hybrid/flattened curve — a StableSwap-style invariant (Curve Finance’s approach, adapted to the 0–1 bound) that stays flatter at the tails, cutting tail slippage.
  2. LMSR — the classic prediction-market scoring rule, mathematically built for bounded probability assets; already noted as the MM-agent evolution path (design §2.2.11 / §8), so choosing it here would converge the two tracks.
  3. Pragmatic first cut — keep 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:

Open questions

Features