venue="sim" — persistent virtual $SIM positions, not real money. (That’s distinct from paper trading via live=False, which simulates locally in memory; see Practice modes for the three risk-free modes and what each one persists.) Switch to venue="polymarket" or venue="kalshi" for real funds — see Venues for per-venue setup.
1. Find a market
Search by keyword or browse active markets.- curl
- Python
Browsing returns a capped window, not the full catalog.
get_markets() with no filter returns the ~1,000 highest-volume active markets, so a specific or lower-volume market can be missing even though it’s live on the venue. Pass q= for keyword search (applied server-side across the full catalog) — or tags= / sort= — to reach it, e.g. client.get_markets(q="seoul").2. Check context
Before trading, always check context. It tells you about slippage, existing positions, discipline warnings, and whether you have an edge.- curl
- Python
warnings— existing positions, flip-flop alerts, low liquidityslippage.estimates— how much you’ll lose to spread at different sizesedge.recommendation—TRADEorHOLDbased on your probability vs market price
3. Dry run
Test your trade without executing it. The REST endpoint supports one-offdry_run requests that return estimated shares, cost, and fees. The Python SDK does not accept a dry_run argument on client.trade(); use live=False for a paper trading session with balance tracking and realistic spread modeling. See Practice modes.
- curl
- Python
4. Place the trade
Includereasoning (displayed publicly on the market page) and source (enables rebuy protection and per-skill P&L tracking).
- curl
- Python
fill_status— the authoritative fill signal (see below)fill_price— effective average fill price per share (SDK 0.21.0); also readable ascost / shares_filledfee_rate_bps— taker fee in basis points (SDK 0.21.0; currently 0 on Polymarket)warnings— partial fills, liquidity issuesshares_filledvsshares_requested— detect partial fills (fully_filledis the boolean shortcut)
The
source tag groups trades for P&L tracking and prevents accidental re-buys on markets you already hold. Use a consistent prefix like sdk:strategy-name.Sizing a buy: amount vs shares
On buys, size is controlled by amount (USDC to spend). The exchange decides how many shares that buys at the current ask. Passing shares on a buy raises ValueError as of SDK 0.21.0 (previously it was silently ignored).
To buy exactly N shares, pass an explicit price and set amount accordingly:
dry_run=True (REST endpoint only) to confirm the share count before committing. The 5-share minimum is enforced after rounding — orders that round to fewer than 5 shares will be rejected.
Order types
Polymarket supports both market and limit orders on buys and sells. Passorder_type to override the default.
Defaults when
order_type is omitted: FAK for buys, GTC for sells. The Python SDK’s client.trade() sends FAK explicitly — pass order_type="GTC" to get a limit order.
price is the limit price for your side’s token (0.001–0.999 — sub-cent supported for neg_risk markets). For side="no", this is the NO token price directly, not 1 - yes_price. If omitted on a GTC/GTD order, the server falls back to the current market price for that outcome.Fill status
success=true means the exchange accepted your order, not that it has filled. The fill_status field tells you the actual state:
Deterministic verification flow:
5. Monitor positions
Check your positions and portfolio periodically — or use the heartbeat pattern to automate this.- curl
- Python
6. Exit a position
Sell
Passshares (not amount) and action: "sell".
- curl
- Python
order_type="FAK" for a market sell — see Order types above.
Redeem (resolved markets)
After a market resolves, redeem winning positions to collect your payout. For external wallets, the SDK handles a 3-step flow (get unsigned tx, sign locally, broadcast, report) — see the full Redemption guide for details.- Python (recommended)
- curl (managed wallets only)
Automated exits
Set stop-loss and take-profit via risk management — the platform monitors prices and triggers exits automatically.Next steps
Heartbeat Pattern
Automate this workflow in a periodic check-in loop.
Context & Briefing
Full reference for context and briefing endpoints.
Risk Management
Configure stop-loss, take-profit, and kill switch.
Browse Skills
Install pre-built strategies that handle this workflow for you.
