Skip to main content

Slippage Protection

PolySimulator uses the same slippage protection model as Polymarket: the price field on every market order acts as a worst-price limit. There is no separate slippage parameter — the price is your slippage protection.

How It Works

On Polymarket, all orders are limit orders. A “market order” is simply a limit order at a marketable price with FOK (Fill-or-Kill) time-in-force. PolySimulator mirrors this exactly. The price field is required on market orders and sets the worst price you’ll accept:
  • BUY: fills at the best ask, but never above your price
  • SELL: fills at the best bid, but never below your price

BUY Example

SELL Example

Polymarket migration: This is identical to how Polymarket’s price field works. Your existing slippage logic transfers directly to PolySimulator — and vice versa when you migrate to live trading.

Price Is Required

Market orders must include a price field. Submitting a market order without price returns a 400 PRICE_REQUIRED error:
This matches Polymarket’s design: there are no “blind” market orders. You always control the worst price you’ll accept.

Time in Force

Market orders default to FOK (Fill-or-Kill), matching Polymarket. You can also use FAK (Fill-and-Kill), Polymarket’s term for IOC.
If you omit time_in_force on a market order, it defaults to FOK. If you explicitly set GTC, it is overridden to FOK — market orders never persist in the book.

Execution Model

Market orders fill at the best available price — BUY at the best ask, SELL at the best bid — matching Polymarket’s execution model. The fill-price resolution cascade (each tier falls through to the next on a miss or a failed sanity guard):
  1. Order-book walk (VWAP) across live CLOB levels — most realistic
  2. Best bid/ask from the CLOB order book (cross the spread)
  3. CLOB midpoint — sub-ms cache fast-path, then the cached read-through
  4. Live CLOB midpoint — synchronous fetch (cold-market guard)
  5. Cached display price — last-resort fallback
See Trade Execution Internals for the full cascade and the exact price_source labels each tier emits.

Fill Diagnostics

Every market order response includes transparency metadata:
The slippage_bps field is informational only — it shows how far the fill price deviated from the cached mid-price, in basis points. It does not affect order execution. Your price (worst-price limit) is the only protection mechanism.

Price Sources

price_source is an opaque diagnostic label — log it for post-trade analysis, but treat it as a non-stable enum (the label set evolves with engine changes). Some labels carry a transport prefix (e.g. ws:) when the underlying snapshot arrived over a streaming source rather than a poll — strip the prefix or substring-match. The labels the engine actually emits today, from highest to lowest confidence:
Monitor price_source in your bot logs. Frequent fills on the clob_midpoint_* or cached-display-price labels (rather than book_walk / best_ask / best_bid) mean the live book was unavailable — consider pausing during degraded price quality. (Labels like clob_book or redis_cache are not emitted — don’t grep for them.)

Recommendations by Strategy

For illiquid markets with wide spreads, consider limit orders instead of market orders. Limits give you price certainty at the cost of fill uncertainty.

Comparison: PolySimulator vs Polymarket


Fees

PolySimulator charges the same per-category taker fee schedule as Polymarket V2 — fees are not zero, takers pay and makers pay zero, and the charged amount is returned in OrderResponse.fee. A bot computing PnL on the assumption of zero fees will be wrong on most markets. See Trading Fees for the canonical formula, the full per-category rate table, the maker/taker (marketability) classification, and the documented divergences from Polymarket.
Always read OrderResponse.fee when computing realized PnL — don’t infer it from the rate alone, since the charged amount is price-dependent. To discover a market’s rate up front, call GET /v1/fee-rate?token_id=… and read the fee_rate_bps field (the effective category rate in bps). See Trading Fees.

Next Steps