- A complete set — one unit of collateral is always named outcomes + Invalid.
- One OutcomeAmm per market — LPs are the book. Named prices satisfy
p_i ∝ 1/x_i.
The peg
The book
Each market clones one OutcomeAmm. Named outcomes trade against that AMM. Invalid is held for split/merge. On-chainOutcomeAmm.prices()[numOutcomes] is always 0; market.prices().rows does not include that slot. Buy/sell of Invalid reverts.
Spot prices (1e18) over named outcomes:
x_i is the AMM’s reserve of outcome i. Named prices sum to 1. Invalid is not in that sum.
A buy of Yes is not minting a set into the trader’s wallet. The AMM splits collateral, pays out Yes, and keeps the rest of the set as inventory. Yes reserve falls; other named reserves rise. Yes’s price goes up; the others go down. No separate rebalancer is required.
How LPs work.
Who gets paid
totalFeeBips = 100 protocol + lpBips + creatorBips + referrerBips. Variable cuts (lp + creator + referrer) cap at 150 bps. SDK defaults: LP 80, creator 50, referrer 20. Same schedule on buy, sell, and redeem.
LPs do not get a USDC stream. Their cut is inventory. Mark-to-market vs cost is the LP book. Worked numbers: LP calculator.
From spark to settled
- Create —
createMarket. PassseedWei+oddsBpsfor create-and-seed in one factory tx (approve the factory). OmitseedWeifor an empty book. - Seed — if you did not seed on create:
market.seed(addFundingwith opening odds, Invalid = 0). - Trade — people
buy/sellone named outcome at a time. - Resolve — payouts are published. Named shares are now 0 or 1.
buy / sell revert Resolved once Conditional Tokens has a payout denominator. A live curve quoting 0.62 while redemption is 1 or 0 is free arb on LP inventory.
After resolve, /chart pins the winner at 100 and losers at 0. Periodic price snapshots skip resolved markets. Creators can one-way pauseTrading (OpenZeppelin Pausable) before resolve; buy/sell/addFunding stop, removeFunding and redeem stay open.
Outcome shares: market.redeem. LP shares after resolve: market.redeemLp (burns pool shares, redeems the basket to collateral). Open-market LP exit is still removeFunding (token basket, not cash).