Skip to main content

Unified market invariants

Slip has one account family.
  • Market: PDA ["market", creator, id_le]
  • MarketTicket: PDA ["ticket", market, owner, nonce_le]
  • Vault: settlement-mint ATA owned by the market PDA
  • Instructions: create_market, buy_ticket, resolve_market, claim_ticket, void_market

Terms

A market stores one complete MarketExpression, never a goals-only product enum. It accepts the canonical TxLINE stat keys 1–8 and period prefixes 1000–7000. Full-match keys use the program’s canonical period tag 100. Side, key, period, optional second stat, and operation must agree. Two to five unique labels partition the expression’s integer result through two to eight ordered, contiguous bands. Bands cover negative infinity through positive infinity. Multiple disjoint bands may point at one outcome, which expresses rules such as Draw / Not draw without another primitive.

Money

total = sum(pools)
fee   = floor(total * fee_bps / 10_000)
tip   = floor(total * tip_bps / 10_000)
net   = total - fee - tip
payout(ticket) = floor(ticket.stake * net / winning_pool)
All arithmetic is integer-only with u128 multiplication. The final winning claim sends deterministic rounding dust to the fee treasury. Tickets are immutable audit records; one wallet may buy several. At least two outcomes must be funded. Resolution also requires liquidity in the proved winner. If either condition fails, the market voids. A permissionless timeout void is allowed after void_at. Voided tickets refund their full stake. Losing and double claims fail.

Proof

Resolution reuses the hardened Tier-A path: proof stat leaves, fold to the event root, fold the fixture subtree, Borsh-hash the tagged fixture leaf, fold to the daily root, and compare the TxLINE epoch-day and five-minute slot PDA. Both stats must come from the same terminal phase: 5, 10, 13, or the documented game_finalised period 100. Zero-valued leaves can be absent upstream. A missing proof is not a false result and not permission to void a funded market early; the keeper defers until proof availability or the explicit timeout policy.

Real Surfpool matrix

The suite creates 1X2 and five-band corners markets, rejects invalid bands and key/side Terms, buys different stakes, checks vault equality, rejects late buys, resolves from a two-stat terminal proof, checks fee and resolver-tip routing, pays the hand-calculated winner amount, rejects losers and double claims, supports a multi-band binary complement, voids one-sided books, and voids/refunds a funded book after timeout.