Skip to main content
Execution: venue.trade() in chat code, strategy.execute() in strategy agents. Data reference: Polymarket Data.

Overview

Polymarket is an on-chain prediction market exchange. Markets are binary or multi-outcome events whose outcome tokens trade between 0.00and0.00 and 1.00, so prices read as probabilities. Scalar Field connects to Polymarket in two modes: a live account funded through a managed Polygon wallet, and a paper account with virtual USDC whose fills are simulated against the live order book.

Order Semantics

  • Symbols are outcome token IDs, taken from the token_ids column of screenPolymarkets(). There are no tickers.
  • Fills are synchronous on both live and paper accounts.
  • Paper fills are simulated against the live order book with realistic execution prices and real taker fees, so paper results track live behavior closely. The paper account is auto-provisioned with virtual USDC on first use — no wallet or connection needed.
  • Fractional quantities are supported. When sizing from a dollar budget, use round(budget / price, 2) rather than int(), which floors to zero when the budget is below one share price.
  • Orders below the market’s minimum size are rejected with ORDER_BELOW_MINIMUM.
  • A platform fee is charged separately from the fill; fee_bps and fee_amount appear in the trade response when active.

Market Resolution

Every market resolves at its end date (market_end_date). After resolution, positions are settled and can no longer be traded. screenPolymarkets() exposes winning_outcome_indexNone while unresolved. Strategies holding outcome tokens should track time to resolution and exit before it by policy (stop loss, take profit, exit buffer), since a position held through resolution cannot be managed.

Connecting and Funding

  1. Paper: no setup — POLYMARKET_PAPER is provisioned automatically on first use.
  2. Live: Scalar Field provisions a managed wallet on Polygon (WALLET_POL). Fund it with USDC from the portfolio page; the wallet funds the exchange account.

Usage

In strategy agents, use strategy.execute(token_id, target_qty) instead — see Strategies.

Data Functions

All functions read public on-chain and CLOB data; wallet positions and trades are visible for any address. Full parameter and schema documentation: Polymarket Data.

Notes

  • Selling an entire position may leave a dust quantity from rounding; treat positions with abs(market_value) < $0.10 as closed.
  • Positions and balances read on-chain state that can lag a fill by a moment — allow for settlement delay before re-querying after a trade.
  • Live-account funds are held in the Polygon wallet (WALLET_POL), not on the exchange account; venue.balances() reflects this.

Related