Click Create a free API key (on a paid plan the button names your
plan) and copy the ps_live_… value shown once.
Open beta. Anyone can mint a key from the dashboard or
POST /v1/keys/bootstrap. A free key issued on or after
2026-09-05 can trade: it is minted with ["read", "trade"] and
places orders against a $100 API wallet that cannot be reset
or topped up, capped at 100 order placements per UTC day per
account. A free key issued before 2026-09-05 is read-only
(["read"]) — trade is stripped on every request even if the
key was stored with it; create a new key to get a trade-capable
one. Paid Pro / Pro+ keys trade against a $10,000 / $25,000
API wallet with no daily cap. See API Keys
and Authentication.
The full key is shown only once. Save it to your password
manager or a secret store immediately — only the SHA-256 hash is
retained server-side, so we can’t show it again later.
The dashboard handles the one-time bootstrap with your signed-in
Supabase session — you never see or paste a JWT. From here on
every API call uses X-API-Key: ps_live_....
Headless / CI: get your first key
Your first API key requires one browser sign-in. Sign in from any
device, create the key in the developer console, and save it in
your CI secret store. The machine running your job does not need
a browser after that.This API does not provide a browserless sign-in flow. The
bootstrap endpoint can create a key when you already hold a
valid sign-in session credential, but it does not issue that
credential. See Authentication
for the supported bootstrap and later key-management details.
This returns actively traded markets with live prices from Polymarket.
5
Place Your First Trade
The fastest path is the Python SDK — it picks a live market and places
a trade in a few lines. This snippet is complete and runnable as-is
(it resolves a real market for you — no IDs to fill in):
Python SDK
# pip install polysimulatorfrom polysim_sdk import PolySimClientwith PolySimClient() as client: # reads POLYSIM_API_KEY from env # active_only=True skips closed markets: an order on one is cancelled, not filled market = client.list_markets(limit=20, active_only=True)[0] fill = client.place_order( market_id=market["condition_id"], side="BUY", outcome="Yes", quantity=10, order_type="market", price="0.99", # worst-price cap; "0.99" on a YES = accept any fill ) print(f"filled {fill['status']} @ {fill.get('price')} — order {fill['order_id']}")
Install, run, filled — your first trade in seconds.
outcome takes the human-readable label ("Yes", "No", or custom labels like "Trump"), not Polymarket’s 77-digit token ID. To map a token ID to its outcome label, use GET /v1/markets-by-token/{token_id}.Market orders require price as a worst-price limit — Polymarket-faithful
slippage protection. A BUY won’t fill above it; a SELL won’t fill below it.
"0.99" on a YES means “accept any fill” (great for your first trade); for
tighter control use the current best ask × 1.05.
Prefer raw HTTP? Resolve a live market_id from the markets endpoint first,
then POST — these are runnable too:
# 1. grab a TRADEABLE market_id (jq)# Without active_only=true, /v1/markets also returns closed markets,# and an order against one is cancelled rather than filled. The jq# select is a second guard.MARKET_ID=$(curl -s -H "X-API-Key: $POLYSIM_API_KEY" \ "$POLYSIM_BASE_URL/v1/markets?limit=20&active_only=true" \ | jq -r '[.[] | select(.closed == false)][0].condition_id')# 2. place the tradecurl -X POST $POLYSIM_BASE_URL/v1/orders \ -H "X-API-Key: $POLYSIM_API_KEY" -H "Content-Type: application/json" \ -d "{\"market_id\":\"$MARKET_ID\",\"side\":\"BUY\",\"outcome\":\"Yes\",\"quantity\":\"10\",\"order_type\":\"market\",\"price\":\"0.99\"}"
import requests, osbase, key = os.environ["POLYSIM_BASE_URL"], os.environ["POLYSIM_API_KEY"]h = {"X-API-Key": key, "Content-Type": "application/json"}# resolve a live market, then trade# active_only=true skips closed markets (an order on one is cancelled);# the client-side check below is a second guard.markets = requests.get(f"{base}/v1/markets?limit=20&active_only=true", headers=h).json()market_id = next(m for m in markets if not m["closed"])["condition_id"]resp = requests.post(f"{base}/v1/orders", headers=h, json={ "market_id": market_id, "side": "BUY", "outcome": "Yes", "quantity": "10", "order_type": "market", "price": "0.99", # worst-price limit (slippage cap)})print(resp.json())
const base = process.env.POLYSIM_BASE_URL, key = process.env.POLYSIM_API_KEY;const h = { "X-API-Key": key, "Content-Type": "application/json" };// active_only=true skips closed markets (an order on one is cancelled);// the client-side check below is a second guard.const markets = await (await fetch(`${base}/v1/markets?limit=20&active_only=true`, { headers: h })).json();const market = markets.find((m) => !m.closed);const resp = await fetch(`${base}/v1/orders`, { method: "POST", headers: h, body: JSON.stringify({ market_id: market.condition_id, side: "BUY", outcome: "Yes", quantity: "10", order_type: "market", price: "0.99", // worst-price limit (slippage cap) }),});console.log(await resp.json());
Response (abridged; the full body also lists telemetry fields, most of
them null on a default market order):
Check status. A market order defaults to time_in_force: "FAK":
it fills what is available within your price cap and cancels the
rest. If nothing can fill (for example the market closed), the
response is still 200, with status: "CANCELLED" and a
cancelled_reason. See Placing Orders.The response does not report your balance on this path:
account_balance is null. Read it with
GET /v1/account/balance. Orders trade against your API wallet,
not the dashboard MAIN wallet. API wallets start at $100 (Free,
keys issued on or after 2026-09-05 — non-renewable), $10,000 (Pro)
or $25,000 (Pro+); a free key issued before 2026-09-05 is read-only
and cannot place this order. The fee follows the per-category
schedule in Trading Fees (this market’s category
charges none).Your price cap sizes the order. Before it fills, the order
reserves quantity × price from the wallet, so "0.99" on 10
shares needs $9.90 free even when the fill is at $0.22. On the
$100 Free wallet, keep quantity × price under your balance.
All numeric values are strings ("10", not 10). This prevents
floating-point precision loss — critical for financial applications.
See String Numerics for details.
Backtesting is the reason most people come to the API, and it was reachable from
here only as a link. This is the whole path, in four calls.Needs your plan’s analytics.backtesting entitlement. Every call takes
X-API-Key.Production (POLYSIM_BASE_URL=https://api.polysimulator.com) and staging serve
the same curated archive. A host with the simulation switch off answers
404 NOT_FOUND to every call below; see Simulation for how to
tell a switched-off host from a missing key (401).Use an archived market, not the one you just traded. The archive is a
curated sample: hourly order-book snapshots of about 960 markets between
2026-09-05 and 2026-09-08. The live market from the trade above is not in it,
and a backtest on it is refused with 422 UNIVERSE_EXCLUDED (not charged).
This walkthrough uses a soccer market with eight consecutive archived hours;
Simulation lists more.
# "Will Real Sociedad de Fútbol win on 2026-09-07?" (outcomes Yes / No)export MARKET_ID=0x3c0cec93dc9893cd92cdb63807d41fe28aed113215e097eb8c32cb1763e59fd9
Backtests are metered in market-hours — window length x number of markets. A
10-market, 3-day run costs 10 x 72 = 720 market-hours, not “one backtest”.
Check here before a large run rather than discovering the cap mid-request.
Do this first. A backtest is refused outright when book coverage for the
window is below the minimum (80% by default), and the refusal names the
percentage. Checking coverage turns a confusing rejection into a window you can
adjust. confidence and missing_periods in the response tell you which hours
are thin.
Submit once. Each successful POST charges the window’s market-hours and one
job against your monthly count. Re-running this block starts a second backtest;
it does not re-read the first.Worth knowing before you size a run: both endpoints count. The 14:00→21:00
window above is 8 market-hours, not 7: 14:00, 15:00 … 21:00 is eight hour
marks. Multiply by the number of markets.Buy 10 shares of Yes whenever it trades at or below 50c, sell at or above 60c.
depth_walk walks the real order book rather than assuming you fill at the top —
see Fill models for what each one assumes.outcome must be one of that market’s own outcome labels (case-insensitive).
"Yes" fits a Yes/No market; a crypto up/down market’s outcomes are "Up" and
"Down", and a sports market names its teams. A label the market does not have
is refused with 400 INVALID_REQUEST listing the labels it does have, before
anything is charged.You get back a job_id and status: "pending". The run is charged at
submission; a run that fails is refunded.
For this example the job completes with num_trades: 2. Measured on staging
on 2026-10-22: a BUY of 10 Yes at 0.45 on the 15:00 book, a SELL at 0.579 on
the 21:00 book, total_pnl about +1.04 after fees, 8 market-hours charged.Why the fills land one hour after the signal. Every run models the time an
order takes to arrive: latency_ms, default 104 (our measured production
API p50, in milliseconds). An order decided at a tick is priced on the book as
it stood latency_ms later. The archive holds one book snapshot per hour, so
that instant is never in it, and the order fills on the next archived book in
the window, one hour later. The entry signal at 14:00 (Yes about 0.45) fills
on the 15:00 book; the exit signal at 20:00 (Yes about 0.63) fills on the 21:00
book at 0.579. An order with no later book in the window does not fill, and
execution.orders_refused counts it as NO_BOOK_AFTER_LATENCY. A window of a
single archived hour therefore never fills at the default."latency_ms": 0 prices each order on the book its own signal saw. The same
run then fills at 14:00 and 20:00 (0.45 and 0.63, about +1.56), and the
summary reports execution.signals_used_pre_decision_data_only: false: the
fill used a price no real order could have reached in time. Keep the default
unless you are deliberately measuring that gap.
The latency_ms model ships with the 2.0 engine, which staging
(https://staging-api.polysimulator.com) runs today. Until 2.0 reaches
https://api.polysimulator.com, production prices each order on its signal’s
own book, so there this example gives the latency_ms: 0 result (fills at
14:00 and 20:00).
When status is completed, the summary carries total_pnl,
total_return_pct, and — read these — tick_mode, ticks_evaluated,
tick_degraded and tick_notice. tick_degraded: true means the run
evaluated at a coarser resolution than requested, and tick_notice says why.They do not, on their own, tell you the data was complete. Those two describe
the evaluation GRID; coverage describes the DATA. A window can clear the 80%
coverage gate with an hour missing, and if that hour held the only entry your
rules would have matched, the run completes with zero trades, tick_degraded: false, and nothing obviously wrong. Zero trades is a result to investigate,
not a finding: check execution.orders_refused in the summary (why orders
did not fill) and missing_periods from step 2 before concluding a strategy
does not trade.Then:
settlement_scored: false in the summary means the window ended before the
market resolved: any position still open was marked to its last observed price
rather than to a payout. That is the normal case for a sub-interval backtest and
not an error.
Simulation API — Historical fill / coverage. Live and key-gated: 401 without a key, not 404. Also needs your plan’s analytics.backtesting entitlement.
Was this page helpful?
⌘I
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/docs.json","name":"PolySimulator","description":"Virtual prediction market trading API — practice with real Polymarket data and simulated money.","colors":{"primary":"#00d26a","light":"#e6fff2","dark":"#0a0f1c"},"logo":{"light":"https://mintcdn.com/polysimulator/g3hLzzd62nMdIToN/logo/polysim-light.svg?fit=max\u0026auto=format\u0026n=g3hLzzd62nMdIToN\u0026q=85\u0026s=510d6e93b34b84b254f2ff702c7f2f11","dark":"https://mintcdn.com/polysimulator/g3hLzzd62nMdIToN/logo/polysim-dark.svg?fit=max\u0026auto=format\u0026n=g3hLzzd62nMdIToN\u0026q=85\u0026s=66470ef617df21d00b93aa5818ac88cb","href":"https://polysimulator.com"},"favicon":"https://mintcdn.com/polysimulator/G-TcC615M002Bemd/favicon.svg?fit=max\u0026auto=format\u0026n=G-TcC615M002Bemd\u0026q=85\u0026s=ea27fd1461a89daeb2375031fae575e4","api":{"playground":{}},"navbar":{"links":[{"href":"https://polysimulator.com/markets","label":"Dashboard"},{"href":"https://github.com/Bavariance/polysimulator-docs","label":"GitHub"}],"primary":{"type":"button","label":"Get API Key","href":"https://polysimulator.com/profile"}},"footer":{"socials":{"github":"https://github.com/Bavariance/polysimulator-docs","x":"https://x.com/PolySimulatorHQ"},"links":[{"header":"Product","items":[{"label":"Markets","href":"https://polysimulator.com/markets"},{"label":"Leaderboard","href":"https://polysimulator.com/leaderboard"}]},{"header":"Developers","items":[{"label":"API Reference","href":"/api-reference"},{"label":"GitHub","href":"https://github.com/Bavariance/polysimulator-docs"}]}]},"seo":{},"errors":{"404":{"redirect":true,"title":"Page Not Found","description":"The page you're looking for doesn't exist. Check the sidebar or search for what you need."}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"polysimulator","hasAudioNarration":false,"actualSubdomain":"polysimulator","customDomains":["docs.polysimulator.com"],"gitSource":{"type":"github","owner":"bavariance","repo":"polysimulator","deployBranch":"staging","contentDirectory":"docs-site","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae2b3c3997fc3d7b2d0f62d","collectionId":"6b44fd4c-86e3-4a78-9943-6cdf1f9efdc4","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae2b3c3997fc3d7b2d0f62d"},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{},"buildId":"6aeb280a245c712a705a482d","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"API Reference","count":146},{"language":"default","tag":"Endpoints","count":135},{"language":"default","tag":"Documentation","count":46},{"language":"default","tag":"CLOB Read (Public)","count":17},{"language":"default","tag":"Market Data","count":13},{"language":"default","tag":"Simulation","count":13},{"language":"default","tag":"Account","count":13},{"language":"default","tag":"API Keys","count":9},{"language":"default","tag":"CLOB Compat","count":9},{"language":"default","tag":"Developer Webhooks","count":9}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"quickstart","slug":"/quickstart","pageMetadata":{"title":"Quick Start","sidebarTitle":"Quick Start","description":"Get your API key and place your first trade in under 2 minutes.","href":"/quickstart"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Get your API key and place your first trade in under 2 minutes.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,hr:`hr`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,CodeBlock,CodeGroup,Frame,Heading,Info,Note,Step,Steps,Tip,Warning}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`quick-start`,children:`Quick Start`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Get an API Key`,children:[_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Sign up at `,_jsx(_components.a,{href:`https://polysimulator.com/signin`,children:`polysimulator.com/signin`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Open the developer console at `,_jsx(_components.a,{href:`https://polysimulator.com/console`,children:`polysimulator.com/console`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(_components.strong,{children:`Create a free API key`}),` (on a paid plan the button names your\nplan) and copy the `,_jsx(_components.code,{children:`ps_live_…`}),` value shown once.`]}),`\n`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Open beta.`}),` Anyone can mint a key from the dashboard or\n`,_jsx(_components.code,{children:`POST /v1/keys/bootstrap`}),`. `,_jsx(_components.strong,{children:`A free key issued on or after\n2026-09-05 can trade`}),`: it is minted with `,_jsx(_components.code,{children:`[\"read\", \"trade\"]`}),` and\nplaces orders against a `,_jsx(_components.strong,{children:`$100 API wallet`}),` that cannot be reset\nor topped up, capped at `,_jsx(_components.strong,{children:`100 order placements per UTC day`}),` per\naccount. `,_jsx(_components.strong,{children:`A free key issued before 2026-09-05 is read-only`}),`\n(`,_jsx(_components.code,{children:`[\"read\"]`}),`) — `,_jsx(_components.code,{children:`trade`}),` is stripped on every request even if the\nkey was stored with it; create a new key to get a trade-capable\none. `,_jsx(_components.strong,{children:`Paid Pro / Pro+`}),` keys trade against a $10,000 / $25,000\nAPI wallet with no daily cap. See `,_jsx(_components.a,{href:`/concepts/api-keys`,children:`API Keys`}),`\nand `,_jsx(_components.a,{href:`/authentication#open-beta`,children:`Authentication`}),`.`]})}),_jsx(Warning,{children:_jsxs(_components.p,{children:[`The full key is shown `,_jsx(_components.strong,{children:`only once`}),`. Save it to your password\nmanager or a secret store immediately — only the SHA-256 hash is\nretained server-side, so we can’t show it again later.`]})}),_jsx(Tip,{children:_jsxs(_components.p,{children:[`The dashboard handles the one-time bootstrap with your signed-in\nSupabase session — you never see or paste a JWT. From here on\nevery API call uses `,_jsx(_components.code,{children:`X-API-Key: ps_live_...`}),`.`]})}),_jsxs(Accordion,{title:`Headless / CI: get your first key`,id:`headless-ci-get-your-first-key`,children:[_jsx(_components.p,{children:`Your first API key requires one browser sign-in. Sign in from any\ndevice, create the key in the developer console, and save it in\nyour CI secret store. The machine running your job does not need\na browser after that.`}),_jsxs(_components.p,{children:[`This API does not provide a browserless sign-in flow. The\nbootstrap endpoint can create a key when you already hold a\nvalid sign-in session credential, but it does not issue that\ncredential. See `,_jsx(_components.a,{href:`/authentication#headless-and-ci-setups`,children:`Authentication`}),`\nfor the supported bootstrap and later key-management details.`]})]})]}),_jsx(Step,{title:`Set Your Environment`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ps_live_abc123...\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.polysimulator.com\"`})]}),`\n`]})})})}),_jsxs(Step,{title:`Check Connectivity`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/health`})]}),`\n`]})})}),_jsx(_components.p,{children:`Expected response:`}),_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ok\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"timestamp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-03-02T12:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"version\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1.0.0-beta\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`]})})})]}),_jsxs(Step,{title:`Fetch Hot Markets`,children:[_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/markets?limit=5\"`})]}),`\n`]})})}),_jsx(_components.p,{children:`This returns actively traded markets with live prices from Polymarket.`})]}),_jsxs(Step,{title:`Place Your First Trade`,children:[_jsxs(_components.p,{children:[`The fastest path is the `,_jsx(_components.strong,{children:`Python SDK`}),` — it picks a live market and places\na trade in a few lines. This snippet is `,_jsx(_components.strong,{children:`complete and runnable as-is`}),`\n(it resolves a real market for you — no IDs to fill in):`]}),_jsx(CodeBlock,{filename:`Python SDK`,numberOfLines:`15`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`15`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# pip install polysimulator`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` polysim_sdk `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` PolySimClient`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` PolySimClient() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client: `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# reads POLYSIM_API_KEY from env`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # active_only=True skips closed markets: an order on one is cancelled, not filled`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` market `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.list_markets(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`limit`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`active_only`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fill `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.place_order(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` market_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`market[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"condition_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` side`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"BUY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` outcome`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Yes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` quantity`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`10`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` order_type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"market\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` price`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0.99\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# worst-price cap; \"0.99\" on a YES = accept any fill`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"filled `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`fill[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'status'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @ `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`fill.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'price'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` — order `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`fill[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'order_id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),_jsx(Frame,{caption:`Install, run, filled — your first trade in seconds.`,children:_jsx(`img`,{src:`https://mintcdn.com/polysimulator/yamXMnET-_yzDqBX/images/first-trade.gif?s=8587546f95b7049921b43df78ca32f55`,alt:`A terminal: pip install polysimulator, then python first_trade.py prints 'filled FILLED @ 0.23 — order 102973'.`,noZoom:true,\"data-og-width\":`554`,width:`554`,\"data-og-height\":`196`,height:`196`,\"data-path\":`images/first-trade.gif`,\"data-optimize\":`true`,\"data-opv\":`3`})}),_jsxs(Info,{children:[_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`outcome`}),` takes the human-readable label`]}),` (`,_jsx(_components.code,{children:`\"Yes\"`}),`, `,_jsx(_components.code,{children:`\"No\"`}),`, or custom labels like `,_jsx(_components.code,{children:`\"Trump\"`}),`), not Polymarket’s 77-digit token ID. To map a token ID to its outcome label, use `,_jsx(_components.code,{children:`GET /v1/markets-by-token/{token_id}`}),`.`]}),_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`Market orders require `,_jsx(_components.code,{children:`price`}),` as a worst-price limit`]}),` — Polymarket-faithful\nslippage protection. A BUY won’t fill above it; a SELL won’t fill below it.\n`,_jsx(_components.code,{children:`\"0.99\"`}),` on a YES means “accept any fill” (great for your first trade); for\ntighter control use the current best ask × 1.05.`]})]}),_jsxs(_components.p,{children:[`Prefer raw HTTP? Resolve a live `,_jsx(_components.code,{children:`market_id`}),` from the markets endpoint first,\nthen POST — these are runnable too:`]}),_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`12`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 1. grab a TRADEABLE market_id (jq)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Without active_only=true, /v1/markets also returns closed markets,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# and an order against one is cancelled rather than filled. The jq`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# select is a second guard.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`MARKET_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/markets?limit=20\u0026active_only=true\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` jq`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -r`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '[.[] | select(.closed == false)][0].condition_id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# 2. place the trade`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/orders`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`market_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$MARKET_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`,`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`side`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`BUY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`,`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`outcome`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`Yes`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`,`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`quantity`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`10`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`,`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`order_type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`market`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`,`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`price`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`0.99`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python (requests)`,numberOfLines:`16`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests, os`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`base, key `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POLYSIM_BASE_URL\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`], os.environ[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"POLYSIM_API_KEY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`h `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-API-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: key, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# resolve a live market, then trade`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# active_only=true skips closed markets (an order on one is cancelled);`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# the client-side check below is a second guard.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`markets `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.get(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`base`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/markets?limit=20\u0026active_only=true\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`h).json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`market_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` next`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(m `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` m `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` markets `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` not`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` m[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"closed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"condition_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resp `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`base`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/orders\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`h, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"market_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: market_id, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"side\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"BUY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"outcome\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Yes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"quantity\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"10\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"order_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"market\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"price\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0.99\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# worst-price limit (slippage cap)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(resp.json())`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`16`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` base`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` h`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"X-API-Key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` key`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// active_only=true skips closed markets (an order on one is cancelled);`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// the client-side check below is a second guard.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` markets`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`base`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/v1/markets?limit=20\u0026active_only=true`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` h`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` market`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` markets`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`find`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`((`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`m`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`m`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`closed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` resp`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`base`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/v1/orders`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"POST\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` h`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` market_id:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` market`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`condition_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`side:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"BUY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`outcome:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Yes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` quantity:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"10\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`order_type:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"market\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` price:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"0.99\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// worst-price limit (slippage cap)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`]})})})]}),_jsxs(_components.p,{children:[`Response (abridged; the full body also lists telemetry fields, most of\nthem `,_jsx(_components.code,{children:`null`}),` on a default market order):`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`17`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`17`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"order_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`685346`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"FILLED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"order_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"market\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"side\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"BUY\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"outcome\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Yes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"price\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0.2200\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"quantity\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"10.0000\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"notional\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2.20\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"fee\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0.00\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"filled_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-10-20T21:53:48.832350+00:00\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"cancelled_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"slippage_bps\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`232`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"account_balance\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"client_order_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"srv_d68d89fb12d942749768b112dd1925b5\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"amount_interpreted_as\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"shares\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(Note,{children:[_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`Check `,_jsx(_components.code,{children:`status`}),`.`]}),` A market order defaults to `,_jsx(_components.code,{children:`time_in_force: \"FAK\"`}),`:\nit fills what is available within your `,_jsx(_components.code,{children:`price`}),` cap and cancels the\nrest. If nothing can fill (for example the market closed), the\nresponse is still `,_jsx(_components.code,{children:`200`}),`, with `,_jsx(_components.code,{children:`status: \"CANCELLED\"`}),` and a\n`,_jsx(_components.code,{children:`cancelled_reason`}),`. See `,_jsx(_components.a,{href:`/trading/placing-orders`,children:`Placing Orders`}),`.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`The response does not report your balance on this path`}),`:\n`,_jsx(_components.code,{children:`account_balance`}),` is `,_jsx(_components.code,{children:`null`}),`. Read it with\n`,_jsx(_components.code,{children:`GET /v1/account/balance`}),`. Orders trade against your `,_jsx(_components.strong,{children:`API wallet`}),`,\nnot the dashboard MAIN wallet. API wallets start at $100 (Free,\nkeys issued on or after 2026-09-05 — non-renewable), $10,000 (Pro)\nor $25,000 (Pro+); a free key issued before 2026-09-05 is read-only\nand cannot place this order. The `,_jsx(_components.code,{children:`fee`}),` follows the per-category\nschedule in `,_jsx(_components.a,{href:`/trading/fees`,children:`Trading Fees`}),` (this market’s category\ncharges none).`]}),_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`Your `,_jsx(_components.code,{children:`price`}),` cap sizes the order.`]}),` Before it fills, the order\nreserves `,_jsx(_components.code,{children:`quantity`}),` × `,_jsx(_components.code,{children:`price`}),` from the wallet, so `,_jsx(_components.code,{children:`\"0.99\"`}),` on 10\nshares needs $9.90 free even when the fill is at $0.22. On the\n$100 Free wallet, keep `,_jsx(_components.code,{children:`quantity`}),` × `,_jsx(_components.code,{children:`price`}),` under your balance.`]})]})]}),_jsx(Step,{title:`Check Your Portfolio`,children:_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/account/portfolio`})]}),`\n`]})})})})]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`All numeric values are strings`}),` (`,_jsx(_components.code,{children:`\"10\"`}),`, not `,_jsx(_components.code,{children:`10`}),`). This prevents\nfloating-point precision loss — critical for financial applications.\nSee `,_jsx(_components.a,{href:`/concepts/string-numerics`,children:`String Numerics`}),` for details.`]})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`run-your-first-backtest`,children:`Run your first backtest`}),`\n`,_jsx(_components.p,{children:`Backtesting is the reason most people come to the API, and it was reachable from\nhere only as a link. This is the whole path, in four calls.`}),`\n`,_jsxs(_components.p,{children:[`Needs your plan’s `,_jsx(_components.code,{children:`analytics.backtesting`}),` entitlement. Every call takes\n`,_jsx(_components.code,{children:`X-API-Key`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Production (`,_jsx(_components.code,{children:`POLYSIM_BASE_URL=https://api.polysimulator.com`}),`) and staging serve\nthe same curated archive. A host with the simulation switch off answers\n`,_jsx(_components.code,{children:`404 NOT_FOUND`}),` to every call below; see `,_jsx(_components.a,{href:`/simulation`,children:`Simulation`}),` for how to\ntell a switched-off host from a missing key (`,_jsx(_components.code,{children:`401`}),`).`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Use an archived market, not the one you just traded.`}),` The archive is a\ncurated sample: hourly order-book snapshots of about 960 markets between\n2026-09-05 and 2026-09-08. The live market from the trade above is not in it,\nand a backtest on it is refused with `,_jsx(_components.code,{children:`422 UNIVERSE_EXCLUDED`}),` (not charged).\nThis walkthrough uses a soccer market with eight consecutive archived hours;\n`,_jsx(_components.a,{href:`/simulation#markets-you-can-backtest`,children:`Simulation`}),` lists more.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# \"Will Real Sociedad de Fútbol win on 2026-09-07?\" (outcomes Yes / No)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`export`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` MARKET_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0x3c0cec93dc9893cd92cdb63807d41fe28aed113215e097eb8c32cb1763e59fd9`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`1-check-what-you-have-left`,children:`1. Check what you have left`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/simulation/quota`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Backtests are metered in `,_jsx(_components.strong,{children:`market-hours`}),` — window length x number of markets. A\n10-market, 3-day run costs `,_jsx(_components.code,{children:`10 x 72 = 720`}),` market-hours, not “one backtest”.\nCheck here before a large run rather than discovering the cap mid-request.`]}),`\n`,_jsx(Heading,{level:`3`,id:`2-check-the-market-has-the-data`,children:`2. Check the market has the data`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/simulation/coverage?condition_id=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$MARKET_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\u0026start=2026-09-07T14:00:00Z\u0026end=2026-09-07T21:00:00Z\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Do this first.`}),` A backtest is refused outright when book coverage for the\nwindow is below the minimum (80% by default), and the refusal names the\npercentage. Checking coverage turns a confusing rejection into a window you can\nadjust. `,_jsx(_components.code,{children:`confidence`}),` and `,_jsx(_components.code,{children:`missing_periods`}),` in the response tell you which hours\nare thin.`]}),`\n`,_jsx(Heading,{level:`3`,id:`3-submit-the-run`,children:`3. Submit the run`}),`\n`,_jsx(_components.p,{children:`Save the request body first — the next step reuses it:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`22`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`22`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`cat`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` backtest.json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`JSON`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"condition_ids\": [\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$MARKET_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"],`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"start\": \"2026-09-07T14:00:00Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"end\": \"2026-09-07T21:00:00Z\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"initial_bankroll\": \"1000\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"strategy\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"spec_version\": \"1\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"side\": \"BUY\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"outcome\": \"Yes\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"size\": \"10\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"fill_model\": \"depth_walk\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"entry\": [{\"field\": \"price\", \"op\": \"lte\", \"value\": \"0.50\"}],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"exit\": [{\"field\": \"price\", \"op\": \"gte\", \"value\": \"0.60\"}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`JSON`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`JOB_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -s`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/simulation/backtests`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @backtest.json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` python3`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'import sys,json;print(json.load(sys.stdin)[\"job_id\"])'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$JOB_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Submit once.`}),` Each successful POST charges the window’s market-hours and one\njob against your monthly count. Re-running this block starts a `,_jsx(_components.em,{children:`second`}),` backtest;\nit does not re-read the first.`]}),`\n`,_jsxs(_components.p,{children:[`Worth knowing before you size a run: `,_jsx(_components.strong,{children:`both endpoints count`}),`. The 14:00→21:00\nwindow above is `,_jsx(_components.strong,{children:`8 market-hours, not 7`}),`: 14:00, 15:00 … 21:00 is eight hour\nmarks. Multiply by the number of markets.`]}),`\n`,_jsxs(_components.p,{children:[`Buy 10 shares of Yes whenever it trades at or below 50c, sell at or above 60c.\n`,_jsx(_components.code,{children:`depth_walk`}),` walks the real order book rather than assuming you fill at the top —\nsee `,_jsx(_components.a,{href:`/simulation`,children:`Fill models`}),` for what each one assumes.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`outcome`}),` must be one of `,_jsx(_components.strong,{children:`that market’s own`}),` outcome labels (case-insensitive).\n`,_jsx(_components.code,{children:`\"Yes\"`}),` fits a Yes/No market; a crypto up/down market’s outcomes are `,_jsx(_components.code,{children:`\"Up\"`}),` and\n`,_jsx(_components.code,{children:`\"Down\"`}),`, and a sports market names its teams. A label the market does not have\nis refused with `,_jsx(_components.code,{children:`400 INVALID_REQUEST`}),` listing the labels it does have, before\nanything is charged.`]}),`\n`,_jsxs(_components.p,{children:[`You get back a `,_jsx(_components.code,{children:`job_id`}),` and `,_jsx(_components.code,{children:`status: \"pending\"`}),`. The run is `,_jsx(_components.strong,{children:`charged at\nsubmission`}),`; a run that fails is refunded.`]}),`\n`,_jsx(Heading,{level:`3`,id:`4-poll-for-the-result`,children:`4. Poll for the result`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/simulation/backtests/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$JOB_ID`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`For this example the job completes with `,_jsx(_components.code,{children:`num_trades: 2`}),`. Measured on staging\non 2026-10-22: a BUY of 10 Yes at 0.45 on the 15:00 book, a SELL at 0.579 on\nthe 21:00 book, `,_jsx(_components.code,{children:`total_pnl`}),` about `,_jsx(_components.code,{children:`+1.04`}),` after fees, 8 market-hours charged.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Why the fills land one hour after the signal.`}),` Every run models the time an\norder takes to arrive: `,_jsx(_components.code,{children:`latency_ms`}),`, default `,_jsx(_components.code,{children:`104`}),` (our measured production\nAPI p50, in milliseconds). An order decided at a tick is priced on the book as\nit stood `,_jsx(_components.code,{children:`latency_ms`}),` later. The archive holds one book snapshot per hour, so\nthat instant is never in it, and the order fills on the next archived book in\nthe window, one hour later. The entry signal at 14:00 (Yes about 0.45) fills\non the 15:00 book; the exit signal at 20:00 (Yes about 0.63) fills on the 21:00\nbook at 0.579. An order with no later book in the window does not fill, and\n`,_jsx(_components.code,{children:`execution.orders_refused`}),` counts it as `,_jsx(_components.code,{children:`NO_BOOK_AFTER_LATENCY`}),`. A window of a\nsingle archived hour therefore never fills at the default.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`\"latency_ms\": 0`}),` prices each order on the book its own signal saw. The same\nrun then fills at 14:00 and 20:00 (0.45 and 0.63, about `,_jsx(_components.code,{children:`+1.56`}),`), and the\nsummary reports `,_jsx(_components.code,{children:`execution.signals_used_pre_decision_data_only: false`}),`: the\nfill used a price no real order could have reached in time. Keep the default\nunless you are deliberately measuring that gap.`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`latency_ms`}),` model ships with the 2.0 engine, which staging\n(`,_jsx(_components.code,{children:`https://staging-api.polysimulator.com`}),`) runs today. Until 2.0 reaches\n`,_jsx(_components.code,{children:`https://api.polysimulator.com`}),`, production prices each order on its signal’s\nown book, so there this example gives the `,_jsx(_components.code,{children:`latency_ms: 0`}),` result (fills at\n14:00 and 20:00).`]})}),`\n`,_jsxs(_components.p,{children:[`When `,_jsx(_components.code,{children:`status`}),` is `,_jsx(_components.code,{children:`completed`}),`, the summary carries `,_jsx(_components.code,{children:`total_pnl`}),`,\n`,_jsx(_components.code,{children:`total_return_pct`}),`, and — read these — `,_jsx(_components.code,{children:`tick_mode`}),`, `,_jsx(_components.code,{children:`ticks_evaluated`}),`,\n`,_jsx(_components.code,{children:`tick_degraded`}),` and `,_jsx(_components.code,{children:`tick_notice`}),`. `,_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`tick_degraded: true`}),` means the run\nevaluated at a coarser resolution than requested`]}),`, and `,_jsx(_components.code,{children:`tick_notice`}),` says why.`]}),`\n`,_jsxs(_components.p,{children:[`They do `,_jsx(_components.strong,{children:`not`}),`, on their own, tell you the data was complete. Those two describe\nthe evaluation GRID; coverage describes the DATA. A window can clear the 80%\ncoverage gate with an hour missing, and if that hour held the only entry your\nrules would have matched, the run completes with zero trades, `,_jsx(_components.code,{children:`tick_degraded: false`}),`, and nothing obviously wrong. `,_jsx(_components.strong,{children:`Zero trades is a result to investigate,\nnot a finding`}),`: check `,_jsx(_components.code,{children:`execution.orders_refused`}),` in the summary (why orders\ndid not fill) and `,_jsx(_components.code,{children:`missing_periods`}),` from step 2 before concluding a strategy\ndoes not trade.`]}),`\n`,_jsx(_components.p,{children:`Then:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/simulation/backtests/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$JOB_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/trades`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$POLYSIM_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` $POLYSIM_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/v1/simulation/backtests/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$JOB_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/equity`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`settlement_scored: false`}),` in the summary means the window ended before the\nmarket resolved: any position still open was marked to its last observed price\nrather than to a payout. That is the normal case for a sub-interval backtest and\nnot an error.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what’s-next`,children:`What’s Next?`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/authentication`,children:`Authentication deep dive`}),` — Key management, security, permissions`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/concepts/rate-limits`,children:`Rate Limits`}),` — Understand your tier’s request budget`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/bots/example-trading-bot`,children:`Build a trading bot`}),` — Complete Python example`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.a,{href:`/simulation`,children:`Simulation API`}),` — Historical fill / coverage. `,_jsx(_components.strong,{children:`Live and key-gated`}),`: 401 without a key, not 404. Also needs your plan’s `,_jsx(_components.code,{children:`analytics.backtesting`}),` entitlement.`]}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Quick Start","sidebarTitle":"Quick Start","description":"Get your API key and place your first trade in under 2 minutes.","href":"/quickstart"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Quick Start","slug":"quick-start","depth":1,"children":[]},{"title":"Run your first backtest","slug":"run-your-first-backtest","depth":2,"children":[{"title":"1. Check what you have left","slug":"1-check-what-you-have-left","depth":3,"children":[]},{"title":"2. Check the market has the data","slug":"2-check-the-market-has-the-data","depth":3,"children":[]},{"title":"3. Submit the run","slug":"3-submit-the-run","depth":3,"children":[]},{"title":"4. Poll for the result","slug":"4-poll-for-the-result","depth":3,"children":[]}]},{"title":"What’s Next?","slug":"what’s-next","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"polysimulator","siteName":"PolySimulator","title":"Quick Start - PolySimulator","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-26T04:22:19.475Z","originalFileLocation":"quickstart.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Get your API key and place your first trade in under 2 minutes.\">\u003cmeta data-mint-head name=\"application-name\" content=\"PolySimulator\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/polysimulator/Z7O8VINNN1g3IFN9/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/polysimulator/Z7O8VINNN1g3IFN9/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/polysimulator/Z7O8VINNN1g3IFN9/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/polysimulator/Z7O8VINNN1g3IFN9/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/polysimulator/Z7O8VINNN1g3IFN9/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/polysimulator/Z7O8VINNN1g3IFN9/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/polysimulator/Z7O8VINNN1g3IFN9/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/polysimulator/Z7O8VINNN1g3IFN9/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/polysimulator/Z7O8VINNN1g3IFN9/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Quick Start - PolySimulator\">\u003cmeta data-mint-head property=\"og:description\" content=\"Get your API key and place your first trade in under 2 minutes.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"PolySimulator\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.polysimulator.com/quickstart\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://polysimulator.mintlify.app/_mintlify/api/og/v2?division=Getting+Started\u0026amp;title=Quick+Start\u0026amp;description=Get+your+API+key+and+place+your+first+trade+in+under+2+minutes.\u0026amp;theme=836fae47dd9286134dc806ca\u0026amp;signature=66be0c978d836d4b136a8b542c2a43a002598c026b6c8ce5aab8156b93bc816b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Quick Start - PolySimulator\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Get your API key and place your first trade in under 2 minutes.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://polysimulator.mintlify.app/_mintlify/api/og/v2?division=Getting+Started\u0026amp;title=Quick+Start\u0026amp;description=Get+your+API+key+and+place+your+first+trade+in+under+2+minutes.\u0026amp;theme=836fae47dd9286134dc806ca\u0026amp;signature=66be0c978d836d4b136a8b542c2a43a002598c026b6c8ce5aab8156b93bc816b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/polysimulator/Z7O8VINNN1g3IFN9/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"PolySimulator\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#00d26a\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.polysimulator.com/quickstart\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/quickstart.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.polysimulator.com/#organization\",\"name\":\"PolySimulator\",\"url\":\"https://docs.polysimulator.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/polysimulator/g3hLzzd62nMdIToN/logo/polysim-light.svg?fit=max\u0026auto=format\u0026n=g3hLzzd62nMdIToN\u0026q=85\u0026s=510d6e93b34b84b254f2ff702c7f2f11\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.polysimulator.com#website\",\"name\":\"PolySimulator\",\"url\":\"https://docs.polysimulator.com\",\"publisher\":{\"@id\":\"https://docs.polysimulator.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.polysimulator.com/quickstart#webpage\",\"url\":\"https://docs.polysimulator.com/quickstart\",\"name\":\"Quick Start\",\"description\":\"Get your API key and place your first trade in under 2 minutes.\",\"dateModified\":\"2026-10-26T04:22:19.475Z\",\"isPartOf\":{\"@id\":\"https://docs.polysimulator.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.polysimulator.com/quickstart#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.polysimulator.com/quickstart#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Getting Started\",\"item\":\"https://docs.polysimulator.com/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quick Start\",\"item\":\"https://docs.polysimulator.com/quickstart\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.polysimulator.com/quickstart#article\",\"headline\":\"Quick Start\",\"name\":\"Quick Start\",\"description\":\"Get your API key and place your first trade in under 2 minutes.\",\"url\":\"https://docs.polysimulator.com/quickstart\",\"mainEntityOfPage\":{\"@id\":\"https://docs.polysimulator.com/quickstart#webpage\"},\"dateModified\":\"2026-10-26T04:22:19.475Z\",\"publisher\":{\"@id\":\"https://docs.polysimulator.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.polysimulator.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"PolySimulator\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"PolySimulator","nav":{"global":null,"tabs":[{"tab":"Documentation","icon":"book","groups":[{"group":"Getting Started","icon":"rocket","pages":[{"title":"PolySimulator API","sidebarTitle":"Introduction","description":"Virtual prediction market trading API — build and test HFT bots with real Polymarket data and simulated money. PolySimulator does not place orders on Polymarket.","href":"/introduction"},{"title":"Quick Start","sidebarTitle":"Quick Start","href":"/quickstart"},{"title":"Python SDK","sidebarTitle":"Python SDK","description":"The official polysimulator Python package — a clean native client plus a py-clob-client drop-in, in one pip install.","href":"/sdk"},{"title":"Polymarket py-sdk Mirror","sidebarTitle":"py-sdk Mirror","href":"/sdk-polymarket"},{"title":"Authentication","sidebarTitle":"Authentication","href":"/authentication"},{"title":"Changelog","icon":"clock-rotate-left","href":"/changelog"},{"title":"Use with AI assistants","sidebarTitle":"AI Assistants (MCP)","href":"/ai-assistants"}]},{"group":"Core Concepts","icon":"lightbulb","pages":[{"title":"API Keys","sidebarTitle":"API Keys","href":"/concepts/api-keys"},{"title":"Rate Limits","sidebarTitle":"Rate Limits","href":"/concepts/rate-limits"},{"title":"Simulation Realism \u0026 Honest Limits","sidebarTitle":"Honest Limits","href":"/concepts/honest-limits"},{"title":"String Numerics","sidebarTitle":"String Numerics","href":"/concepts/string-numerics"},{"title":"CLOB Compatibility","sidebarTitle":"CLOB Compatibility","href":"/concepts/clob-compatibility"},{"title":"py-sdk Compatibility","sidebarTitle":"py-sdk Compatibility","href":"/concepts/py-sdk-compatibility"},{"title":"Polymarket Raw-HTTP Endpoints","sidebarTitle":"Polymarket Raw HTTP","href":"/concepts/pm-raw-http"}]},{"group":"Trading Guide","icon":"chart-line","pages":[{"title":"Placing Orders","sidebarTitle":"Placing Orders","href":"/trading/placing-orders"},{"title":"Order Management","sidebarTitle":"Order Management","href":"/trading/order-management"},{"title":"Batch Orders","sidebarTitle":"Batch Orders","href":"/trading/batch-orders"},{"title":"Slippage Protection","sidebarTitle":"Slippage Protection","href":"/trading/slippage-protection"},{"title":"Trading Fees","sidebarTitle":"Fees","href":"/trading/fees"},{"title":"Heartbeats (Dead-Man's-Switch)","sidebarTitle":"Heartbeats","href":"/trading/heartbeats"},{"title":"Trade Execution Internals","href":"/trading/execution-internals"}]},{"group":"Market Data","icon":"chart-bar","pages":[{"title":"Markets","sidebarTitle":"Markets","href":"/market-data/markets"},{"title":"Events","sidebarTitle":"Events","href":"/market-data/events"},{"title":"Up/Down Markets","sidebarTitle":"Up/Down Markets","href":"/market-data/updown-markets"},{"title":"Order Book","sidebarTitle":"Order Book","href":"/market-data/order-book"},{"title":"Price Candles","sidebarTitle":"Price Candles","href":"/market-data/price-candles"},{"title":"Batch Prices","sidebarTitle":"Batch Prices","href":"/market-data/batch-prices"},{"title":"Datalake Schema","sidebarTitle":"Datalake Schema","href":"/market-data/datalake-schema"}]},{"group":"Simulation","icon":"flask","pages":[{"title":"Simulation API","sidebarTitle":"Simulation","href":"/simulation"}]},{"group":"Account \u0026 Portfolio","icon":"wallet","pages":[{"title":"Wallets","sidebarTitle":"Wallets","href":"/account/wallets"},{"title":"Balance","sidebarTitle":"Balance","href":"/account/balance"},{"title":"Positions","sidebarTitle":"Positions","href":"/account/positions"},{"title":"Portfolio","sidebarTitle":"Portfolio","href":"/account/portfolio"},{"title":"Trade History","sidebarTitle":"Trade History","href":"/account/trade-history"},{"title":"Equity Curve","sidebarTitle":"Equity Curve","href":"/account/equity-curve"},{"title":"Profile Analysis","href":"/account/profile-analysis"}]},{"group":"WebSocket Feeds","icon":"signal-stream","pages":[{"title":"WebSocket Overview","sidebarTitle":"Overview","href":"/websockets/overview"},{"title":"Price Feed","sidebarTitle":"Price Feed","href":"/websockets/price-feed"},{"title":"Execution Feed","sidebarTitle":"Execution Feed","href":"/websockets/execution-feed"},{"title":"Polymarket-compat WebSocket","sidebarTitle":"PM-compat WS","href":"/websockets/pm-compat-market"}]},{"group":"Webhooks","icon":"bell","pages":[{"title":"Webhooks","sidebarTitle":"Webhooks","href":"/webhooks"}]},{"group":"Bot Development","icon":"robot","pages":[{"title":"Example Trading Bot","sidebarTitle":"Example Bot","href":"/bots/example-trading-bot"},{"title":"WebSocket Trading Bot","sidebarTitle":"WebSocket Bot","href":"/bots/websocket-bot"},{"title":"Error Handling","sidebarTitle":"Error Handling","href":"/bots/error-handling"},{"title":"Best Practices","sidebarTitle":"Best Practices","href":"/bots/best-practices"}]},{"group":"Porting to Polymarket","icon":"rocket-launch","pages":[{"title":"Porting a Bot to Polymarket","sidebarTitle":"Porting to Polymarket","href":"/deployment/live-migration"}]}]},{"tab":"API Reference","icon":"square-terminal","pages":[{"title":"API Reference","href":"/api-reference/overview"}]}]},"basePath":"","title":"Quick Start - PolySimulator","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":["07c022d89b"],"chunks":["Frame-BdiBGm0H.js","DynamicMarkdown-CbqEDjbV.js"]}