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 Order | Becomes |
|---|---|
| Buy YES @ 0.55 | Bid @ 0.55 |
| Sell YES @ 0.60 | Ask @ 0.60 |
| Buy NO @ 0.45 | Ask @ 0.55 (sell YES) |
| Sell NO @ 0.40 | Bid @ 0.60 (buy YES) |
Why Single Book?
- Simpler matching - One book instead of two
- Better liquidity - All orders in one place
- No arbitrage - Prices stay in sync
- 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 Size | Value |
|---|---|
| Minimum | 1 bp (0.0001 USDC) |
| Standard | 100 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:
- Buy NO shares, OR
- Mint YES+NO pair and sell YES
Order Lifecycle
Order States
| State | Meaning |
|---|---|
| Submitted | Transaction sent |
| Validated | Passed all checks |
| Resting | On book, awaiting match |
| Partially Filled | Some quantity executed |
| Fully Filled | Complete execution |
| Cancelled | User cancelled |
| Expired | Market 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
| Metric | Formula | Meaning |
|---|---|---|
| Spread | Best Ask - Best Bid | Cost to cross |
| Mid Price | (Best Bid + Best Ask) / 2 | Fair value estimate |
| Depth | Sum of sizes at level | Liquidity available |
| Imbalance | Bid Vol / Ask Vol | Directional 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)
- Quote both sides - Earn rebates on both bid and ask
- Manage inventory - Don't accumulate too much of one side
- Update frequently - Adjust to price movements
- Watch the spread - Wider spread = more profit per trade
For Takers (Traders)
- Check liquidity - Ensure enough depth for your size
- Use limit orders - Avoid slippage with price limits
- Split large orders - Better execution across price levels
- Time your trades - Spreads widen near market close