vike

Recipe 15 of 30

Buy versus sell pressure and Yes versus No volume of a Polymarket market, by hour

Fetch a day of trade prints for both outcome tokens from /events with event_type=trade and fold them by hour, token and side; sizes are shares, and price times size is the USDC that changed hands.

GET /v1/polymarket/events with event_type=trade answers it in one call per day: every recorded print of the tokens you name over a window of up to 24 hours, each with price, size in shares and the taker's side. Ask for both outcome tokens of the market and fold the rows by hour with a jq tail: you get taker buys and sells per token per hour, plus the dollars traded. The full parameter list is on Event tape.

Quick answer

Ask for a day of prints on both tokens and fold them by hour.

cURL
# a day of prints on both tokens of one market, folded into hours: taker buys and sells per token, and USDC traded
curl -s -H "X-API-Key: $VIKE_API_KEY" \
  "https://data.vike.io/v1/polymarket/events?token_ids=95532524407959903145510583684979049735028502452973932716346555811355282494630,107869950127184141743772429738701578723770582686430100389837827512148691029625&event_type=trade&from_ms=1787097233324&to_ms=1787183633324&limit=1000" \
  | jq '.events | group_by([(.ts / 3600000 | floor), .token_id]) | map({hour: (.[0].ts / 3600000 | floor * 3600 | todate), token: .[0].token_id[0:8], trades: length, buy_shares: (map(select(.side == "buy") | .size) | add // 0 | round), sell_shares: (map(select(.side == "sell") | .size) | add // 0 | round), usd: (map(.price * .size) | add | round)})'

Example response

Captured from the live API on 2026-10-24 at 17:21 UTC. 122 prints, folded by the call's jq tail into 21 rows, trimmed to 6. 95532524… is the market's first token (Yes) and 10786995… its second (No); token_ids lists a market's tokens in the order of its outcomes. side is the taker's side, so buy_shares were taken from the asks and sell_shares were sold into the bids; usd is the sum of price times size. A sale of No is a bet on Yes, so the net pressure on Yes in the 17:00 hour is 2,372 + 12,742 − 0 − 203 = 14,911 shares.

Example response
[
  {"hour": "2026-08-19T15:00:00Z", "token": "10786995", "trades": 26, "buy_shares": 927, "sell_shares": 14530, "usd": 2924},
  {"hour": "2026-08-19T15:00:00Z", "token": "95532524", "trades": 11, "buy_shares": 1104, "sell_shares": 903, "usd": 1704},
  {"hour": "2026-08-19T16:00:00Z", "token": "10786995", "trades": 15, "buy_shares": 315, "sell_shares": 2766, "usd": 361},
  {"hour": "2026-08-19T16:00:00Z", "token": "95532524", "trades": 8, "buy_shares": 1880, "sell_shares": 3642, "usd": 4763},
  {"hour": "2026-08-19T17:00:00Z", "token": "10786995", "trades": 8, "buy_shares": 203, "sell_shares": 12742, "usd": 1809},
  {"hour": "2026-08-19T17:00:00Z", "token": "95532524", "trades": 6, "buy_shares": 2372, "sell_shares": 0, "usd": 2041}
]

Variations

Buy versus sell on one token. Name one token and fold by hour only.

cURL — one token
# taker buys and sells of the Yes token, per hour
curl -s -H "X-API-Key: $VIKE_API_KEY" \
  "https://data.vike.io/v1/polymarket/events?token_id=95532524407959903145510583684979049735028502452973932716346555811355282494630&event_type=trade&from_ms=1787097233324&to_ms=1787183633324&limit=1000" \
  | jq '.events | group_by(.ts / 3600000 | floor) | map({hour: (.[0].ts / 3600000 | floor * 3600 | todate), buy_shares: (map(select(.side == "buy") | .size) | add // 0 | round), sell_shares: (map(select(.side == "sell") | .size) | add // 0 | round)})'

The day before. Step the window back 24 hours. Windows are half-open on local_ts, so [a, b) then [b, c) never counts a print twice.

cURL — previous day
# the 24 hours before the first window
curl -H "X-API-Key: $VIKE_API_KEY" \
  "https://data.vike.io/v1/polymarket/events?token_ids=95532524407959903145510583684979049735028502452973932716346555811355282494630,107869950127184141743772429738701578723770582686430100389837827512148691029625&event_type=trade&from_ms=1787010833324&to_ms=1787097233324&limit=1000"

Lifetime volume in one call. /market_stats gives one token's trade count and traded shares over its whole recording.

cURL — lifetime
# total prints and shares traded on the Yes token since its recording began
curl -H "X-API-Key: $VIKE_API_KEY" \
  "https://data.vike.io/v1/polymarket/market_stats?token_id=95532524407959903145510583684979049735028502452973932716346555811355282494630"

Before you rely on it

Shares, not dollars, and one day per call

size counts outcome shares. A share of a 0.97 token and a share of a 0.03 token are both 1, so compare dollars (price times size) when you weigh the two tokens against each other. A window is at most 24 hours: a week is seven calls. The tape lists prints, not who made them; no row carries a wallet.

Paging trades can skip a print

Every trade row carries seq 0, and two prints of one token can share a millisecond. The cursor resumes strictly after (local_ts, seq, token_id), so a page that ends between two such prints loses the second. Ask for a limit that holds the whole window (up to 50,000) and split the window in two if has_more is still true.

Ask your agent

Connected to the Vike MCP server (https://vike.io/mcp) in Claude, ChatGPT or Cursor, ask it in plain words. The polymarket_tape tool answers, at 1 credit a call.

Ask your agent
Sum the buys and sells of Polymarket tokens 95532524407959903145510583684979049735028502452973932716346555811355282494630 and 107869950127184141743772429738701578723770582686430100389837827512148691029625 by hour for the 24 hours before 2026-08-19 23:53 UTC
Example response
[  {"hour": "2026-08-19T15:00:00Z", "token": "10786995", "trades": 26, "buy_shares": 927, "sell_shares": 14530, "usd": 2924},  {"hour": "2026-08-19T15:00:00Z", "token": "95532524", "trades": 11, "buy_shares": 1104, "sell_shares": 903, "usd": 1704},  {"hour": "2026-08-19T16:00:00Z", "token": "10786995", "trades": 15, "buy_shares": 315, "sell_shares": 2766, "usd": 361},  {"hour": "2026-08-19T16:00:00Z", "token": "95532524", "trades": 8, "buy_shares": 1880, "sell_shares": 3642, "usd": 4763},  {"hour": "2026-08-19T17:00:00Z", "token": "10786995", "trades": 8, "buy_shares": 203, "sell_shares": 12742, "usd": 1809},  {"hour": "2026-08-19T17:00:00Z", "token": "95532524", "trades": 6, "buy_shares": 2372, "sell_shares": 0, "usd": 2041}]