Room ID:
Endpoint:
Rate: 0.025 credits per message
polymarket_events_stream Endpoint:
wss://api.struct.to/ws Rate: 0.025 credits per message
PolymarketEvent rows — same shape that GET /polymarket/events returns. The server maintains an in-memory cache of open events only, refreshed via a slow full poll plus a fast 500ms newest-first poll, and merged live from the prediction_event_metrics and prediction_trades Kafka streams with per-timeframe block/timestamp ordering.
No initial snapshot is pushed on subscribe. Clients seed local state from GET /polymarket/events and then apply deltas from this stream.
Subscription model
Each client has up to 8 active slots per room (4 cadences × 2 modes). Re-subscribing to the same(interval_ms, mode) pair replaces the previous subscription. Unsubscribe one slot with action: "unsubscribe" plus interval_ms and mode, or clear everything with action: "unsubscribe_all".
- Cadence (
interval_ms):500,1000,3000, or10000. Each cadence is a separate flush bucket. - Filter mode: evaluated in-memory on every flush against rows that actually changed since the last tick. Same validation as the REST list endpoint.
- Ids mode: filter by explicit
event_slugsand/orevent_ids. Max 500 ids per subscription.
latest_block >= cached, (b) a confirmed trade with block >= cached, (c) a slow-poll field diff, or (d) the fast newest-first poll discovering a brand-new event. Quiet events produce zero messages.
Subscribe
Message fields
| Field | Type | Required | Description |
|---|---|---|---|
action | "subscribe" | "unsubscribe" | "unsubscribe_all" | Yes | Slot lifecycle action. |
interval_ms | 500 | 1000 | 3000 | 10000 | For subscribe / unsubscribe | Flush cadence. Defaults to 1000 if omitted. |
mode | "filter" | "ids" | No | Subscription mode. Defaults to filter. |
filter | EventsStreamFilter | mode=filter only | Filter body; all fields optional. |
event_slugs | string[] | mode=ids only | Event slugs to watch. |
event_ids | string[] | mode=ids only | Event ids to watch. |
Filter fields (mode=filter)
search is a case-insensitive substring match on title (3–100 chars). All other fields follow the same validation as the REST list endpoint (timeframe, list size caps).
Example — filter mode
Example — ids mode
Unsubscribe one slot
Response
Events
events_stream_update
Server-pushed event fired only for rows that changed AND matched this subscription since the last flush tick. data contains full PolymarketEvent rows — not deltas — so clients should merge by id.
Envelope
| Field | Type | Description |
|---|---|---|
type | "events_stream_update" | Envelope discriminator. |
room_id | "polymarket_events_stream" | Room identifier. |
mode | "filter" | "ids" | The mode this subscription was created with. |
interval_ms | 500 | 1000 | 3000 | 10000 | The cadence slot this event is flushed under. |
data | PolymarketEvent[] | Full event rows, same shape as GET /polymarket/events. |
PolymarketEvent
| Field | Type | Description |
|---|---|---|
id | string | Event ID. |
event_slug | string | null | URL-safe event slug. |
title | string | null | Human-readable title. |
ticker | string | null | Short ticker, when present. |
description | string | null | Long description. |
resolution_source | string | null | Resolution source URL. |
category | string | null | Primary category label. |
image_url | string | null | CDN image URL. |
market_count | integer | Number of child markets. |
created_time | integer | null | Unix seconds. |
closed_time | integer | null | Unix seconds. |
start_time | integer | null | Unix seconds. |
end_time | integer | null | Unix seconds. |
neg_risk | boolean | Whether this event uses the neg-risk market. |
neg_risk_market_id | string | null | Neg-risk market ID, when applicable. |
game_status | string | null | Sports-event game status. |
show_market_images | boolean | Whether child market images should be shown. |
status | string | null | "open" or "closed". |
metrics | Record<Timeframe, SimpleTimeframeMetrics> | Keyed by timeframe (1m, 5m, 30m, 1h, 6h, 24h, 7d, 30d). |
tags | PolymarketTag[] | Event tags. |
markets | EventMarket[] | Child markets with enriched outcomes. |
series | PolymarketSeries | null | Parent series, when present. |
SimpleTimeframeMetrics
| Field | Type | Description |
|---|---|---|
volume | number | USD volume within the window. |
fees | number | USD fees within the window. |
txns | integer | Trade count within the window. |
unique_traders | integer | Unique wallet count within the window. |
PolymarketTag
| Field | Type | Description |
|---|---|---|
id | string | Tag ID. |
label | string | Display label. |
slug | string | null | URL-safe slug. |
EventMarket
| Field | Type | Description |
|---|---|---|
condition_id | string | 0x-prefixed condition ID. |
id | string | null | Market ID. |
title | string | null | Market title. |
question | string | Market question. |
market_slug | string | URL-safe market slug. |
status | string | Market status. |
created_time | integer | null | Unix seconds. |
end_time | integer | null | Unix seconds. |
volume | number | null | Lifetime USD volume. |
liquidity_usd | number | null | Current USD liquidity. |
volume_24hr | number | null | 24h USD volume. |
image_url | string | null | CDN image URL. |
market_maker_address | string | null | Market maker contract. |
creator | string | null | Wallet address of creator. |
category | string | null | Category label. |
accepting_orders | boolean | null | Whether CLOB is accepting new orders. |
uma_resolution_status | string | null | UMA oracle resolution status. |
clob_rewards | ClobReward[] | Active reward configs. |
outcomes | EventMarketOutcome[] | Market outcomes. |
winning_outcome | EventMarketOutcome | null | Resolved winning outcome, when applicable. |
EventMarketOutcome
| Field | Type | Description |
|---|---|---|
name | string | Outcome label (e.g. "Yes"). |
price | number | null | Latest price (0 – 1). |
position_id | string | null | ERC-1155 outcome token ID (decimal string). |
outcome_index | integer | null | 0-indexed outcome position. |
PolymarketSeries
| Field | Type | Description |
|---|---|---|
id | string | Series ID. |
slug | string | null | URL-safe slug. |
ticker | string | null | Ticker, when present. |
title | string | null | Display title. |
description | string | null | Long description. |
series_type | string | null | Series type discriminator. |
recurrence | string | null | Recurrence cadence (e.g. "daily"). |
layout | string | null | UI layout hint. |
image_url | string | null | CDN image URL. |
icon_url | string | null | CDN icon URL. |
active | boolean | Whether the series is currently active. |
closed | boolean | Whether the series is closed. |
archived | boolean | Whether archived. |
featured | boolean | Whether featured in discovery surfaces. |
restricted | boolean | Whether the series is region-restricted. |
pyth_token_id | string | null | Pyth price feed ID, when applicable. |
cg_asset_name | string | null | CoinGecko asset name, when applicable. |
start_date | integer | null | Unix seconds. |
event_count | integer | Number of child events. |
ClobReward shape — it is shared across both stream rooms.