Slippage & Fill Estimation#
How Seesaw previews what your order will actually cost before you sign — and what protects you on-chain after you do.
In plain English#
When you submit an order, the app shows a fill preview: how many shares will likely fill, at what average price, the worst price you'd touch, and the fee. That preview is computed by walking the live order book level by level, exactly the way the on-chain matching engine would.
Two numbers in the preview are easy to confuse:
| Term | Definition | Question it answers |
|---|---|---|
| Slippage | Average fill price vs. the best price on the book when you arrived | "How much worse than the top of book do I pay on average?" |
| Price impact | Worst (deepest) fill price vs. the best price on the book | "How far into the book does my order push the price?" |
Both are expressed in basis points (bps; 100 bps = 1% of a $1 share) and both are zero when your whole order fills at the top of the book.
The preview is an estimate. The binding protection is on-chain: your limit price (Limit / Post-Only orders) or your
worst_acceptable_price_bpsbound (Immediate-or-Cancel orders). The program will never fill you outside those bounds, no matter what the book looked like when the preview was rendered.
Why a binary order book is special#
Each market's order-book account holds two outcome lanes, YES and NO (see Order Book). Every order rests in its own outcome's lane at the price you sent, in that outcome's own price space. Orders only match inside one lane:
| Your order | Stored side | Lane | Consumes in that lane |
|---|---|---|---|
| Buy YES @ q | BuyYes | YES | SellYes asks (lowest first) |
| Sell YES @ q | SellYes | YES | BuyYes bids (highest first) |
| Buy NO @ q | BuyNo | NO | SellNo asks (lowest first) |
| Sell NO @ q | SellNo | NO | BuyNo bids (highest first) |
So a fill estimate for a NO order walks the NO lane and nothing else. YES liquidity can never fill a NO order, and no price is converted. Every price the estimator returns is in your order's own outcome space.
The unified estimator#
Web, mobile, and the SDKs share one implementation: estimateFillForIntent in
@seesaw/core (packages/core/src/orderbook.ts). It takes one outcome's lane
(the shape produced by aggregateOrderbookLanes or served by the indexer's
per-lane book) and a prospective order, and returns a FillEstimate. See
SDK: Reading Data — Estimating Fills and Slippage.
How the walk works#
Key rules of the walk:
- Levels are consumed best-first within your outcome's lane: ascending asks for buys, descending bids for sells. This holds for YES and NO alike.
- The walk stops at your price bound. For Limit orders that's your limit
price, in your outcome's own price space. For IOC orders with a
worst_acceptable_price_bps, that tighter bound is used instead — unless it's the disable sentinel (0for buys,10000for sells), in which case the limit price applies. - PostOnly never takes liquidity, so its estimate always shows zero filled and the full quantity resting.
- Fees are estimated for each consumed level and summed, using the
estimator's
fee.capBpsandfee.decayBpsinputs. Clients pass the livetaker_fee_coefficient_bpsas both, and the estimate is then exactly the program's linear fee described in Fee Structure.
Worked example#
This example uses the shipped coefficient taker_fee_coefficient_bps = 400
(fee defaults), so a fill at price p pays
400 × (10000 − p) / 10000 bps with no cap. It assumes a settlement token with
six decimals.
YES lane (price in YES bps × quantity in shares):
Asks (sell YES): Bids (buy YES):
5500 × 100 5300 × 150
5800 × 200 5100 × 250
6200 × 300
Order: Buy 250 YES, Limit @ 6000 bps (0.60 USDT).
- Reference price = best ask = 5500.
- Walk asks ascending, respecting the 6000 bound:
- 100 shares @ 5500 → 150 still needed
- 150 shares @ 5800 (5800 ≤ 6000, take it) → done
- next level 6200 > 6000 → would have stopped here anyway
- Results:
| Field | Value | Working |
|---|---|---|
filled | 250 | 100 + 150 |
remaining | 0 | |
avgPriceBps | 5680 | (100×5500 + 150×5800) / 250 |
worstPriceBps | 5800 | deepest level touched |
refPriceBps | 5500 | best ask before the order |
slippageBps | 180 | 5680 − 5500 |
priceImpactBps | 300 | 5800 − 5500 |
cost | 142.00 USDT | (100×5500 + 150×5800) / 10000 |
feeAmount | 2.451600 USDT | 55 × 180 / 10000 + 87 × 168 / 10000 = 0.99 + 1.4616 |
totalCost | 144.451600 USDT | cost + fee; displayed to cents as 144.45 |
If the same order had a limit of 5600, only the first level fills:
filled = 100, remaining = 150, and (as a Limit order) the remainder
rests on the book at your limit price — restsRemainder = true.
NO-lane example: Buy 100 NO, Limit @ 4800 bps (0.48 USDT).
The same market's NO lane (price in NO bps × quantity in shares):
Asks (sell NO): Bids (buy NO):
4700 × 60 4400 × 120
4900 × 80
- The order is stored as
BuyNoand walks the NO asks only. The YES lane above is never consulted: no YES order can fill a NO order at any price. - Reference price = best NO ask = 4700.
- Walk NO asks ascending, respecting the 4800 bound:
- 60 shares @ 4700 → 40 still needed
- next level 4900 > 4800 → stop
- Results:
| Field | Value | Working |
|---|---|---|
filled | 60 | only the 4700 level is at or below 4800 |
remaining | 40 | 100 − 60 |
avgPriceBps | 4700 | one level touched |
refPriceBps | 4700 | best NO ask before the order |
slippageBps | 0 | 4700 − 4700 |
priceImpactBps | 0 | 4700 − 4700 |
cost | 28.20 USDT | 60 × 4700 / 10000 |
feeAmount | 0.597840 USDT | fee_bps = 400 × 5300 / 10000 = 212; 28.20 × 212 / 10000 |
totalCost | 28.797840 USDT | cost + fee |
As a Limit order, the 40 unfilled shares rest as a BuyNo bid at 4800 NO
bps, locking 40 × 4800 / 10000 = 19.20 USDT. They wait for a SellNo at 4800
or lower.
Why the preview can differ from reality#
The estimate reads a snapshot of the book; the chain executes against the book as it exists when your transaction lands. The preview does not model:
- Book movement in flight — other orders may land before yours.
- Self-trade handling —
Abortrejects the transaction;CancelProvidecancels the crossed maker order;DecrementTakereduces overlapping quantities without a fill. See the mode table. - Tick rounding of the resting remainder — bids round down, asks round up to the market's tick (default 100 bps).
- Per-order rounding within an aggregated level — the program rounds up
per fill; the preview rounds once per level. Its
feeAmountUpperBoundaccounts for extra rounding when order counts are available. Applying the curve to the average price would give a different result.
That is why the on-chain bounds — not the preview — are the contract:
| Order type | What binds on-chain |
|---|---|
| Limit | Your limit price: no fill at a worse price; remainder rests at your price |
| PostOnly | Never takes; rejected (WouldCross) if it would match immediately |
| IOC | worst_acceptable_price_bps (plus optional min_fill_quantity); the unfilled remainder is cancelled, never rests |
Related docs#
- Placing Orders — user-facing guide to the order form and fill preview
- Order Book — matching rules, tick rounding, the YES and NO outcome lanes
- Maker Price Band — where resting orders are allowed to post
- SDK: Reading Data — calling the estimator from your own code