Skip to main content

Order Book

The Seesaw order book is a fully on-chain matching engine that pairs buyers and sellers of YES shares. Understanding how it works helps you place better orders and get better prices.

Order Book Architecture

Single Book Design

Seesaw maintains one order book per market for YES shares only. All NO orders are converted:

Your OrderBecomes
Buy YES @ 0.55Bid @ 0.55
Sell YES @ 0.60Ask @ 0.60
Buy NO @ 0.45Ask @ 0.55 (sell YES)
Sell NO @ 0.40Bid @ 0.60 (buy YES)

Why Single Book?

  1. Simpler matching - One book instead of two
  2. Better liquidity - All orders in one place
  3. No arbitrage - Prices stay in sync
  4. Consistent pricing - YES @ 0.60 ↔ NO @ 0.40

Order Types

Limit Orders

Specify exact price. Order rests on book until filled or cancelled.

Buy 100 YES @ 0.55 (limit)
├── If market ask <= 0.55: Execute immediately
└── If market ask > 0.55: Rest on book at 0.55

Market Orders (Effective)

Submit limit at extreme price to guarantee fill:

Buy YES "at market":
└── Submit Buy YES @ 1.00 (max price)
└── Fills against best available asks

Sell YES "at market":
└── Submit Sell YES @ 0.01 (min price)
└── Fills against best available bids

Price-Time Priority

Orders match based on price first, then time:

Matching Algorithm

incoming_order = Sell 100 YES @ 0.55

while incoming_order.quantity > 0:
    best_bid = orderbook.get_best_bid()

    if best_bid is None:
        break  # No bids

    if best_bid.price < incoming_order.price:
        break  # Price doesn't cross

    # Match at bid price (price improvement for seller)
    fill_qty = min(incoming_order.quantity, best_bid.quantity)
    execute_trade(buyer=best_bid.owner, seller=incoming_order.owner,
                  price=best_bid.price, quantity=fill_qty)

    incoming_order.quantity -= fill_qty
    best_bid.quantity -= fill_qty

if incoming_order.quantity > 0:
    orderbook.add_ask(incoming_order)  # Rest remainder

Tick Size

Prices must align to tick boundaries:

Tick SizeValue
Minimum1 bp (0.0001 USDC)
Standard100 bp (0.01 USDC)

Tick Rounding Rules

  • Bids round DOWN to nearest tick
  • Asks round UP to nearest tick

This ensures the protocol never loses money on rounding.

Submitted: Buy @ 0.5567
Tick: 0.01
Rounded: Buy @ 0.55 (down)

Submitted: Sell @ 0.5567
Tick: 0.01
Rounded: Sell @ 0.56 (up)

No Crossed Book Invariant

The order book cannot have bids >= asks:

If a new order would cross, it immediately executes against resting orders until uncrossed or fully filled.

No Naked Shorts

Users can only sell shares they own:

Alice owns: 50 YES shares

✓ Sell 50 YES @ 0.60  (valid)
✗ Sell 100 YES @ 0.60 (rejected - insufficient shares)

To "short" YES (bet on DOWN), users must:

  1. Buy NO shares, OR
  2. Mint YES+NO pair and sell YES

Order Lifecycle

Order States

StateMeaning
SubmittedTransaction sent
ValidatedPassed all checks
RestingOn book, awaiting match
Partially FilledSome quantity executed
Fully FilledComplete execution
CancelledUser cancelled
ExpiredMarket closed

Reading the Order Book

Depth Chart

Price    Bid Size    Ask Size    Cumulative
─────────────────────────────────────────────
0.65                 200         650
0.60                 300         450
0.58                 150         150
────────── spread ──────────
0.55     100                     100
0.54     250                     350
0.52     500                     850

Key Metrics

MetricFormulaMeaning
SpreadBest Ask - Best BidCost to cross
Mid Price(Best Bid + Best Ask) / 2Fair value estimate
DepthSum of sizes at levelLiquidity available
ImbalanceBid Vol / Ask VolDirectional pressure

Order Book Events

Events emitted for indexers and UIs:

// Order placed
{
  type: "OrderPlaced",
  orderId: "abc123",
  side: "Bid",
  price: 5500,  // 0.55 in bps
  quantity: 100,
  owner: "7abc..."
}

// Trade executed
{
  type: "Trade",
  price: 5500,
  quantity: 50,
  maker: "7abc...",
  taker: "9xyz...",
  makerFee: -5,   // rebate
  takerFee: 15
}

// Order cancelled
{
  type: "OrderCancelled",
  orderId: "abc123",
  remainingQuantity: 50
}

Best Practices

For Makers (Liquidity Providers)

  1. Quote both sides - Earn rebates on both bid and ask
  2. Manage inventory - Don't accumulate too much of one side
  3. Update frequently - Adjust to price movements
  4. Watch the spread - Wider spread = more profit per trade

For Takers (Traders)

  1. Check liquidity - Ensure enough depth for your size
  2. Use limit orders - Avoid slippage with price limits
  3. Split large orders - Better execution across price levels
  4. Time your trades - Spreads widen near market close