Skip to main content
Python functions: screenPolymarkets(), getPolymarketOHLCV(), getPolymarketPriceAndBook(), getPolymarketTrades(), screenPolymarketWallets(), getPolymarketPositions(), getPolymarketProfile()

Product Overview

Overview

Polymarket Data provides comprehensive access to Polymarket’s on-chain prediction market exchange. The dataset spans seven functions covering market discovery, price history, live order books, trade-level data, wallet analytics, position tracking, and trader profiles. Prediction markets on Polymarket are binary or multi-outcome events (e.g. “Will X happen?”) where outcome tokens trade between 0.00and0.00 and 1.00. Each market has one or more outcome tokens identified by token_id, which you obtain from screenPolymarkets() and use across all other functions. Because prices are probabilities and every trade is on-chain, this dataset supports strategies that have no equivalent in traditional markets: probability arbitrage between related markets, event-driven signals extracted from prediction prices, and copy-trading of wallets with verified track records.
Polymarket is a tradable venue on Scalar Field: outcome tokens execute live or in paper mode through venue.trade() or strategy.execute(). See Trading on Polymarket for order semantics, funding, and connection steps.

Functions at a Glance

Data Pipeline

Scalar Field ingests Polymarket data through several complementary paths:
  • Events & Markets: Polled from the Polymarket Gamma API every ~1 minute. Market metadata (questions, outcomes, prices, volume, status) stays current within seconds of changes on Polymarket.
  • On-chain Trades: Indexed directly from Polymarket’s exchange contracts on Polygon, with ~2-second polling. Each trade is enriched with market and event metadata before storage.
  • OHLCV Bars: Aggregated from on-chain trades at 5-minute, hourly, and daily granularity. 15-minute and 30-minute bars are derived from 5-minute bars at query time.
  • Order Books & Last Trade: Fetched live from Polymarket’s CLOB API per query — full bid/ask depth, tick size, and minimum order size per outcome token.
  • Wallet, Position & Profile data: Proxied live from the Polymarket API — each query fetches current data directly, with no local caching delay.

Coverage

  • Markets: All active and resolved Polymarket prediction markets, continuously synced.
  • Trades: On-chain trade history from Polymarket’s V2 exchange contracts on Polygon, plus earlier indexed trades.
  • Categories: sports, politics, crypto, culture, weather, economics, tech, finance.
  • OHLCV Timeframes: daily, hourly, 30-min, 15-min, 5-min.

Querying the Data

screenPolymarkets()

Search and filter prediction markets. Returns market metadata, current prices, volume, token IDs, and resolution status. Strategy angle: the universe-selection step. An event-driven strategy screens for open markets in its category (e.g. 'crypto' or 'economics'); an arbitrage strategy searches for related markets (e.g. several markets about the same election) whose implied probabilities should be consistent — and trades when they are not. market_outcome_prices is a live probability estimate you can compare against your own model.

Parameters

Return Schema


getPolymarketOHLCV()

OHLCV price bars for prediction market outcome tokens. Supports daily, hourly, and sub-hourly timeframes. Omit start and end for live mode (latest bar). Strategy angle: since prices are probabilities, these bars are a time series of the market’s belief. Backtest how fast markets converge to resolution (buying favorites at 0.90 and holding to resolution is a measurable, testable strategy), study overreaction to news with 5-minute bars around known events, or use a Polymarket probability series (e.g. a Fed-decision market) as an input feature for strategies trading other asset classes.

Parameters

Return Schema

Returns Dict[str, pd.DataFrame] keyed by token ID. Each DataFrame:

getPolymarketPriceAndBook()

Latest trade price and live order book for outcome tokens, fetched from Polymarket’s CLOB API: full bid/ask depth plus the last executed trade per token. Strategy angle: the pre-trade check for any Polymarket strategy. Prediction market books can be thin — walk the ask side to see how much of your intended size fills near the quoted probability before committing. The bid-ask spread is also an opportunity in itself: wide spreads in low-attention markets reward patient limit orders over market orders, and tick_size / min_order_size tell you exactly how to place them.

Parameters

Return Schema

Returns Dict[str, dict] keyed by token ID:

getPolymarketTrades()

Trade-level history for prediction markets. Filter by token, wallet, market, event, side, size, price, or USDC value. At least one filter parameter is required. Strategy angle: the informed-money detector. Filtering by min_usdc_value isolates whale trades — a sudden cluster of large buys on one outcome often precedes a price move, since big prediction-market bets tend to be information-driven. Filtering by wallets turns this into the monitoring leg of a copy-trading strategy: watch a proven wallet’s trades in near real time and mirror them.

Parameters

Return Schema

Base columns (always present): Additional columns (when include_market_info=True, the default):

screenPolymarketWallets()

Wallet leaderboards by PnL or volume, filterable by prediction market category and time period. Strategy angle: the discovery step of a copy-trading pipeline — and the category filter is the edge. A wallet at the top of the 'sports' leaderboard has demonstrated skill in sports markets specifically; follow it there rather than in politics. Comparing week vs all rankings separates durable performers from hot streaks before you commit to mirroring anyone.

Parameters

Return Schema


getPolymarketPositions()

Open and closed positions for a wallet in prediction markets, or all holders of a specific market. At least one of wallet or token_id is required. Strategy angle: two strategies in one function. In wallet mode, poll a top trader’s open positions on a schedule and trade the changes — new positions and exits are the copy-trading signal. In token mode, map who holds each side of a market you are researching: if the largest, most profitable holders are concentrated on one outcome, that is a smart-money positioning signal; realized_pnl on closed positions shows who exited early — and whether they were right.

Parameters

Return Schema

Columns vary depending on the query: By wallet (open positions): By wallet (closed positions): By token_id (all holders):

getPolymarketProfile()

Trader profile information for a Polymarket wallet. Strategy angle: the vetting step before copying a wallet. portfolio_value and markets_traded distinguish a seasoned trader with broad experience from a one-market lottery winner, and created_at reveals whether a strong PnL was earned over years or weeks.

Parameters

Return Schema

Returns a single-row DataFrame:

Strategy Playbook

Concrete ways to combine these functions into a strategy:
  • Copy-trading. screenPolymarketWallets(category=...) to shortlist category specialists, getPolymarketProfile() and closed positions from getPolymarketPositions() to vet their history, then poll getPolymarketTrades(wallets=[...]) and mirror new trades via venue.trade() on the Polymarket venue.
  • Whale-flow momentum. getPolymarketTrades(min_usdc_value=50000) as a rolling scanner for large one-sided flow; confirm with getPolymarketPriceAndBook() that the book still offers a reasonable entry, and size against visible depth.
  • Favorite convergence. Screen for high-volume markets trading at 0.85–0.95, backtest resolution convergence with getPolymarketOHLCV() on resolved markets (closed=True, using winning_outcome_index), and hold near-certain outcomes to resolution while managing tail risk.
  • Cross-market consistency. Related markets (same event, different framings or thresholds) imply probability relationships that must hold. Screen them together with screenPolymarkets(), compare market_outcome_prices, and trade violations when book depth on both legs supports it.
  • Prediction prices as signals elsewhere. Markets on rate decisions, elections, or crypto milestones produce clean probability series via getPolymarketOHLCV() — usable as features in strategies that execute in equities (Alpaca) or crypto (Hyperliquid, Jupiter) rather than on Polymarket itself.