Skip to main content

Execution contract

This page states how a simulated order is filled on PolySimulator: which data it is filled against, when, at which price, with which costs, and what the simulator does not model. It answers the questions a developer needs settled before trusting a simulated fill. It is not a performance promise. PolySimulator never sends your orders to Polymarket. A simulated fill says what our model decided against our copy of Polymarket’s public data at that moment. It does not say what Polymarket would have done with a real order.
Version 1.0, dated 2026-11-19. Checked against the code on our pre-release line (staging at commit 6c13694345, 2026-11-19). Production runs an older code line until the 2.0 release on 24 November 2026. Where production differs, this page says so. Every measured number carries its source, its vantage point and its date. Numbers age; the change log at the bottom records every revision.
How to read the status labels on this page:

The eight questions, answered


1. Data path and latency

What feeds the matcher

  • Source. Market identity and fee metadata come from Polymarket’s Gamma API. Order books come from Polymarket’s CLOB WebSocket. Our ingest checks the streamed books against Polymarket’s REST books and repairs a book that has drifted.
  • Coalescing. Our ingest writes a changed book to Redis at most once per 100 ms per book in production (setting since 2026-11-13). On a busy book, intermediate states that last less than that are never seen by the matcher.
  • Which book a fill used. The placement path reads the cached book when pricing the order. The matcher can reuse a token’s top-of-book prices and depth across orders in the same cycle, so a later order can see the book read for an earlier order. Fast-market freshness checks and the book-integrity gate re-read Redis for the fill decision. Paths that refresh a stale book can fetch it from Polymarket’s REST API. See Stale books.

Measured delays

All numbers are in milliseconds, as p50 / p95 (or p90) / p99. They were measured inside our system, before the API and your network, unless the row says otherwise. They are not what you will see from your own machine, which adds your network and our API. Rust can also flush books for actively watched markets on a separate, configurable interval (RUST_SSE_WATCH_FLUSH_MS with API viewer tracking). That path is off by default. These intervals describe server-side batching. Book age measures how old the input book was when the simulator used it for pricing. Order-to-fill latency measures the time from order receipt to fill and includes order handling, any matcher wait and settlement. To include notification delivery in your measurement, time from submission to receipt of the response or fill event on your client. What we expect after launch (estimates, not measurements). These are projections from the pre-release measurements and a production-scale lab run on 2026-11-18, not measurements. Polymarket’s own delivery tail (up to ~250 ms at p99 in London) reaches a direct Polymarket client in the same way it reaches our ingest. It is therefore not part of the gap between a direct Polymarket client and PolySimulator, but it sets a floor on how fresh any copy of the book can be.

Stale books

A book’s age is measured from when our system stored it. The fill-time thresholds below are code defaults. Deployments can override them. The optional fast-market refresh threshold can tighten the default on eligible Up/Down markets. It is off by default and separate from the 10 s fallback limit. In 2.0 a synchronous market executor can also return VWAP_EXCEEDS_SANITY_BAND when a walk lands too far from the reference price. See Execution Internals. An accepted resting order can stay pending when a book is refused. The matcher’s price sanity check can cancel a resting order after 60 consecutive failures by default, and cancels an immediate order it is evaluating on the first such failure. In both cases the order has status CANCELLED with cancelled_reason: stale_or_mismatched_book. Synchronous IOC/FAK orders that find no usable price can also return a successful HTTP response with CANCELLED status and a reason for the failed attempt.

No executable depth

With the integrity gate off, the general depth requirement exempts Up/Down markets. On account and sandbox market-FOK paths, a cache miss can still fall through to other price sources if their own guards allow it.

2. Matching

Marketable orders: decided at placement

Live. A market order (FAK/IOC by default, or FOK) is filled in its own request against the book in Redis. A GTC/GTD limit order that is marketable when placed is also filled in its request (“fill on placement”, switched on in production since 2026-09-03; the code default is off). If fill on placement skips an order, for example because less than 2 s of the request deadline is left, the order rests and the matcher picks it up.

Resting orders: decided in cycles

Live. A background matcher loads pending orders and schedules up to 2,000 resting GTC/GTD orders per cycle by default. It rotates across markets and continues through each market’s backlog on later cycles. Pending IOC/FAK/FOK orders are evaluated first and are outside the resting-order cap. A BUY can fill when the best executable ask is at or below its limit. A SELL can fill when the best executable bid is at or above its limit. A last-trade print alone does not trigger a fill. Under Polymarket v2 order semantics, fills classified as maker fills use the order’s own limit. An order that was marketable at placement can reach the matcher later and still receive taker pricing at the touch or depth-walk VWAP. When marketability at placement is unknown, the matcher falls back to its order-age and taker-intent rules.

Event-driven matching

Planned, production from 2026-11-25 (estimate). The matcher is woken when a book that has resting orders on it changes, instead of waiting for the next cycle. Expected effect: a decision within ≤ 50 ms of the book change at the median; the p99 stays bounded by a cycle already running (~400 ms). The part that records which books have resting orders is in the code but switched off (MATCHING_RESTING_INDEX_ENABLED=false); the part that wakes the matcher is not merged yet.

The Redis matching engine

Planned. Shadow mode from 2026-11-25; live for Up/Down markets first, from early December 2026 (estimate). A new engine decides each fill inside Redis, in one atomic step that claims the order and records the depth it used, and writes the result to Postgres right after. Measured on a design spike (2026-11-19): the decision step takes ~2–7 ms at p50, against ~200–250 ms for today’s cycle. Rollout runs in shadow first: the engine decides alongside today’s matcher and its decisions are compared before it decides any real fill. The planned queue model, refill curve and private depletion use this engine.

3. Fills

3.1 Book walk for marketable orders

Live. A BUY consumes asks from the lowest price upward; a SELL consumes bids from the highest price downward. The walk stops at your limit price, or at the worst price you allow on a market order, and never fills a level past it. FOK fills the full size or nothing. FAK/IOC fills what is available and cancels the rest. The average price of the walk is your fill price. Mirrored levels. In a binary market, a bid for one outcome at price p is also an offer of the other outcome at 1 − p. The walk therefore merges the outcome’s own book with the mirrored levels of its complement. Where both books show the same effective price, the larger of the two sizes is used, not the sum, because they are usually the same resting orders seen from two sides. See Execution Internals for the fallback price sources and the sanity checks on the walk.

3.2 Fees

Live (formula and maker/taker split); in 2.0 (24.11) (per-market rates). Takers pay a fee and makers pay none:
  • From 2.0 (24.11): feeRate and exponent come from each market’s Gamma feeSchedule (feesEnabled: false means no fee). Our copy of the schedules refreshes about every 30 s for Up/Down markets and about every 30–40 minutes for the rest of the catalogue, so a venue change can take up to about 70 minutes to reach every market. A category table is used only when a market has no fee metadata. See Trading Fees.
  • Production before 24.11: rates come from a fixed table by market category (crypto 7%, sports 3%, finance / politics / mentions / tech 4%, economics / culture / weather / other 5%, geopolitics 0%), not from each market’s schedule.
  • Polymarket changes its fee rates on 2026-11-20 at 23:59 UTC. From then until the 2.0 release, production charges the old category rates, which differ from Polymarket’s new ones on most categories. From 2.0 the new per-market rates arrive through Gamma; the fallback category table can still lag until it is updated.
  • A GTC/GTD order that was marketable when placed pays the taker fee, including on later fills of its remainder.
  • From 2.0, placing an order with a signed fee quote (the web trade panel) can return 409 FEE_CHANGED if the fee at placement would exceed the quote. An accepted resting order stores a fee ceiling. If the fee later rises above that ceiling, the matcher caps the fee on each fill.
  • Maker rebates and liquidity rewards are not credited. /v1/fee-rate reports the market’s rebate_rate for reference only.

3.3 Taker delay

In 2.0 (24.11), off by default. Polymarket holds taker orders on some markets (flagged itode, mainly fast crypto markets) before matching them. The simulator can apply the same kind of hold: The hold applies to marketable orders, before pricing. Orders that genuinely rest are not deliberately delayed. If the request has too little time left for the hold, the order is refused with 503 SERVER_BUSY and Retry-After: 1 instead of shortening the hold. With the switch off, which is the state on launch day, marketable orders are not held. On flagged markets that makes them faster than the same order on Polymarket.

3.4 Depletion: how taken liquidity comes back

Live (per-snapshot); in 2.0 (24.11) (2 s window). Polymarket never sees a simulated fill, so its book does not shrink when you trade. The simulator keeps its own record of what simulated fills took:
  • Production before 24.11: the matcher and synchronous pending-order executors that use its depth walk with Polymarket v2 order semantics share a per-snapshot depletion record. A new snapshot for that outcome restores the full displayed size. The separate account and direct-wallet market FOK executors use a book walk without this per-snapshot depletion.
  • From 2.0 (24.11): the default depletion window is 2,000 ms after the last consumption at the level (BOOK_DEPLETION_HOLD_MS), including on the separate market FOK paths when Polymarket v2 order semantics are enabled. Each new recorded consumption restarts the window. Book updates leave the window intact. Setting the hold to zero selects per-snapshot depletion on the matcher depth-walk path and disables it on the separate market FOK paths.
  • The record is shared by all accounts on one deployment: what one user took is unavailable to the next user while it is withheld.
  • The record is kept per outcome token. See the known double-fill below.
Known issue: the mirror double-fill (live today). Consuming the Up ask at p records the consumption on the Up book only. The same liquidity, shown as the Down bid at 1 − p, is not marked as taken, so the next walk can offer it again at the same effective price. Displayed liquidity on a binary market can therefore be filled up to twice while it is withheld. The Redis matching engine fixes this with one liquidity record shared by both views of a level, as its default when it goes live (early December 2026, estimate). The current matcher will not be patched. Planned, from early December 2026 (estimate), with the Redis engine:
  • Private depletion by default. What you take reduces only the book that you see. Your fills then do not depend on other users’ activity. Shared depletion will be available only inside a named session, such as a tournament.
  • A refill curve instead of the fixed window. Liquidity comes back gradually, along a curve measured on Polymarket’s books. Live book updates do not cancel the deficit you caused.
Calibrated refill defaults (research measurement on BTC Up/Down books, 14–18 October 2026, curves fitted 2026-11-19): The curves were measured only on best levels that a real taker emptied. They have not been measured for partial consumption, deeper levels or other market families, and the tail beyond 30 s is an assumption (60 s decay). For comparison, the fixed 2 s window in 2.0 withholds all of the taken size for 2 s, while about half of real emptied BTC 5-minute levels are back within 0.4 s and about 28% are still not fully back after 2 s.

3.5 Queue position

Not modelled today (live behaviour is “cross only”). A resting order fills as soon as the book crosses its limit, regardless of how much size was ahead of it at that price. In fast markets this tends to fill makers too late. At the touch in slow markets it tends to fill them too early and too often. Planned, from early December 2026 (estimate), with the Redis engine. We plan to estimate the size ahead of resting orders from Polymarket’s public book updates and trade prints. Polymarket’s public book shows aggregate size at each price, so queue position can only be estimated.

3.6 Rounding

Price, share and cash rounding are live. Per-level fee rounding for book-walk fills is in 2.0 (24.11). Prices, sizes and balances are sent as JSON strings; see String Numerics.

3.7 Which stream reports which fills

Live. The native feed offers at-least-once delivery and replays up to 50 fills newer than the reconnect watermark, including persisted immediate fills. The PM-compatible feed sends live trade frames on subscribed markets and has no reconnect replay. Deployments can enable live delivery on both feeds for synchronous fills through the pending-order executor. Both live feeds omit the fee. Read it from GET /v1/orders or account history. See Execution Feed, PM-Compatible WebSocket, and Webhooks.

4. Fill-quality fields

Today (live)

Returned on a FILLED order in the POST /v1/orders response (OrderResponse). The quality fields are filled when the fill came from a book walk. They can be empty otherwise. For market IOC/FAK book walks, quote_age_ms measures elapsed time since the stalest consumed book was cached. It is empty when the age of a consumed book is unknown. On market FOK, read it alongside price_source:
  • An on-demand REST refresh or live midpoint can report 0 by convention.
  • A source tagged :ws_live_unchanged can report 0 when the resolver accepts an older quote as unchanged on a quiet market with the CLOB WebSocket connected. The original cache timestamp can be older.
  • On the legacy direct-wallet cached-price path, used when book walking is disabled and fallback pricing is allowed, the field measures Redis fetch duration.
GET /v1/account/history returns fee, price_source and any stored price_age_ms. For IOC/FAK quote age, retain the original placement response. Maker/taker liquidity is not reported per fill today.

Planned, from early December 2026 (estimate)

A stored fill receipt for every fill, on every tier, with:
  • order received time, decision time and fill time (UTC, ms);
  • the book used: source (stream / REST-verified / upstream), the Polymarket timestamp of its last update, its age at decision, and a hash of its top levels;
  • the levels consumed (price, size), the average price, the fee and the fee rule applied;
  • liquidity already taken at those levels by earlier simulated fills;
  • for resting orders: the size ahead when the order joined, and the queue wait;
  • maker or taker;
  • markouts at 1, 10 and 60 s, and shortfall against the mid on arrival.
With a receipt, anyone who records Polymarket’s public feed can check a single fill against their own recording.

5. Known differences from Polymarket

  • PolySimulator does not send orders to Polymarket. Nobody trades against you, and Polymarket’s book never reacts to your orders.
  • Queue position is not modelled. Resting orders fill when the book crosses them (section 3.5).
  • Resting orders are decided in cycles, not on every book change (section 2).
  • Our copy of the book is behind Polymarket’s by the delays in section 1, and short-lived book states can be skipped on busy books.
  • The venue’s taker delay is off by default, so marketable orders on flagged markets are not held (section 3.3).
  • No cancel latency: a cancel takes effect when we process it.
  • On paths that apply depletion, withheld liquidity comes back all at once. Per-snapshot depletion clears on the next book update. The default 2.0 window clears after 2 s without further consumption (section 3.4).
  • Depletion is shared between all users on a deployment, so your fills can depend on other users’ activity.
  • The same displayed liquidity on a binary market can be filled twice through its mirrored level (section 3.4).
  • No permanent price impact from your own trades.
  • Maker rebates and liquidity rewards are not credited.
  • Until the 2.0 release on 24.11, production charges fixed category fee rates, which differ from Polymarket’s per-market rates (and from its new rates after 2026-11-20 23:59 UTC). From 2.0, fallback category rates can still differ when a market has no fee metadata.
  • When a fresh book cannot be fetched, an older cached book can still price a fill: with no age limit in production before 24.11, and up to 60 s old (10 s on fast markets) from 2.0 (section 1, Stale books).
  • No gas, no blockchain settlement and no on-chain finality.
  • Some markets or intervals listed on Polymarket are not available here.

6. Versioning

Each revision of this page has a version number and a date. The page’s version is separate from PolySimulator release numbers. A minor version (1.0 → 1.1) adds measurements or corrects wording. A major version (1.x → 2.0 of this page) changes how fills are decided: a new default, a new model, or a feature moving from planned to live. Behaviour changes are also listed in the API Changelog.

Change log