Tables
| View Name | Database | Source | ORDER BY |
|---|---|---|---|
agent.polymarket_trades | agent | polymarket_polygon.market_trades | block_time, tx_hash, evt_index |
agent.polymarket_market_details | agent | polymarket_polygon.market_details | condition_id, token_id |
agent.polymarket_events | agent | polymarket_polygon.events | — |
agent.polymarket_prices_daily | agent | polymarket_polygon.market_prices_daily | — |
agent.polymarket_prices_hourly | agent | polymarket_polygon.market_prices_hourly | — |
agent.polymarket_prices_latest | agent | polymarket_polygon.market_prices_latest | token_id |
agent.polymarket_volume_daily | agent | polymarket_polygon.market_volume_daily | condition_id, block_date |
agent.polymarket_volume_hourly | agent | polymarket_polygon.market_volume_hourly | condition_id, block_hour |
agent.polymarket_rolling_metrics | agent | polymarket_polygon.market_rolling_metrics | — |
agent.polymarket_open_interest_daily | agent | polymarket_polygon.market_open_interest_daily | condition_id, block_date |
agent.polymarket_user_activity | agent | polymarket_polygon.user_activity_v2 | account, token_id, block_time |
agent.kalshi_market_details | agent | kalshi.market_details | market_ticker |
agent.kalshi_trades | agent | kalshi.trades | ticker, created_time, trade_id |
agent.prediction_markets_daily | agent | prediction_markets.daily | — |
agent.prediction_markets_matched_markets | agent | prediction_markets.matched_markets | — |
agent.prediction_markets_matched_daily | agent | prediction_markets.matched_daily | — |
agent.polymarket_positions | agent | None | — |
Related Tables
agent.kalshi_daily_categorizedagent.kalshi_market_reportagent.prediction_category_daily
Sample Queries
1. Daily volume by platform
Table Schemas
agent.polymarket_trades
Individual Polymarket trade events (OrderFilled) with USD amounts, maker/taker addresses, condition IDs, and outcome context. One row per trade event. The primary source for Polymarket volume and trading activity analysis.
Engine: MergeTree | Partition: toYYYYMM(block_date) | ORDER BY: block_time, tx_hash, evt_index
| Column | Type | Description |
|---|---|---|
block_date | Date | Partition key. Always filter on this. |
block_time | DateTime64(3) | Trade timestamp. |
block_number | UInt64 | Block number |
tx_hash | String | Transaction hash |
evt_index | UInt32 | Event log index in transaction |
exchange_address | String | |
protocol | String | |
project | String | Protocol name |
order_hash | String | |
maker_address | String | Maker (liquidity provider) address. |
taker_address | String | Taker (liquidity consumer) address. |
maker_asset_id | String | |
taker_asset_id | String | |
maker_amount_filled | UInt256 | |
taker_amount_filled | UInt256 | |
fee_raw | UInt256 | |
outcome_token_id | String | |
shares | Float64 | |
amount_usd | Float64 | Trade notional value in USD (one-sided). |
price | Float64 | Token price in USD |
fee_usd | Float64 | |
condition_id | String | Unique market condition identifier. Links to market_details. |
question | String | |
outcome_index | UInt8 | |
outcome_label | String | |
category | String | Market category |
market_slug | String | |
market_end_date | DateTime | |
neg_risk | UInt8 | |
question_id | String | |
event_slug | String | |
event_title | String | Event title |
agent.polymarket_market_details
Polymarket market metadata dimension table. Contains market questions, descriptions, event groupings, resolution status, end dates, tags, and Polymarket links. One row per (condition_id, outcome_index) — use outcome_index=0 for one row per condition.
Engine: MergeTree | ORDER BY: condition_id, token_id
| Column | Type | Description |
|---|---|---|
condition_id | String | Primary market identifier. Links to all other Polymarket tables. |
question_id | String | Groups related conditions into a single question (e.g., ‘Will X win?’ has Yes/No conditions). |
question | String | Market question text (e.g., ‘Will Bitcoin reach $100K by December 2026?’). |
market_description | String | Longer market description with resolution criteria. |
token_id | String | |
outcome_index | UInt8 | 0 or 1. Use 0 for deduplication (one row per condition). |
outcome_label | String | |
token_outcome_name | String | |
category | String | Market category |
market_slug | String | |
event_slug | String | URL-safe event identifier for Polymarket links. |
event_title | String | Parent event title grouping multiple markets. |
market_end_date | DateTime | Scheduled market end date. |
neg_risk | UInt8 | Boolean. True = this is a neg-risk (multi-outcome) market. |
active | UInt8 | Boolean. True = market is currently open for trading. |
closed | UInt8 | Boolean. True = market has been closed (trading halted). |
archived | UInt8 | |
volume_total | Float64 | |
liquidity | Float64 | |
resolved_at | DateTime64(3) | Resolution timestamp. Null if unresolved. |
created_at | DateTime | |
updated_at | DateTime | |
market_id | UInt64 | |
start_time | DateTime | |
close_time | DateTime | |
game_start_time | DateTime | |
tags | String | Array of category tags. |
volume_1wk | Float64 | |
volume_1mo | Float64 | |
volume_1yr | Float64 | |
resolution_source | String | |
image | String | |
icon | String | |
neg_risk_market_id | String | |
event_description | String | |
event_start_time | DateTime | |
event_image | String | |
event_resolution_source | String | |
status | String | Market status (active, closed, resolved) |
winning_outcome_index | Int8 | |
polymarket_link | String | Direct URL to this market on polymarket.com. |
agent.polymarket_events
Polymarket event-level metadata. Events group related markets (conditions) under a single theme (e.g., “2026 US Presidential Election” groups multiple candidate-specific markets). Useful for navigating the market hierarchy.
agent.polymarket_prices_daily
Daily outcome token prices for Polymarket markets. Tracks the probability (price) of each outcome over time. Useful for building price charts and tracking market sentiment evolution.
agent.polymarket_prices_hourly
Hourly CLOB mid-prices per Polymarket outcome token. Provides intraday price (implied probability) resolution for building higher-frequency charts and detecting rapid sentiment shifts.
agent.polymarket_prices_latest
Latest snapshot price per Polymarket outcome token. A convenience view that returns the most recent price for each condition, eliminating the need for argMax() queries against the full prices table.
Engine: MergeTree | ORDER BY: token_id
| Column | Type | Description |
|---|---|---|
token_id | String | |
condition_id | String | Polymarket condition ID |
question | String | |
outcome_index | UInt8 | |
outcome_label | String | |
last_updated | Date | |
latest_price | Float64 |
agent.polymarket_volume_daily
Daily aggregated trading volume per Polymarket market condition. Pre-computed from individual trades for efficient time-series queries. One row per (condition_id, block_date).
Engine: MergeTree | Partition: toYYYYMM(block_date) | ORDER BY: condition_id, block_date
| Column | Type | Description |
|---|---|---|
block_date | Date | Date of the volume observation. |
condition_id | String | Market condition identifier. |
trade_count | UInt64 | |
notional_volume_usd | Float64 | Daily notional trading volume (one-sided, USD) |
agent.polymarket_volume_hourly
Hourly trading volume per Polymarket condition. Pre-aggregated from individual trades for efficient intraday volume analysis without scanning the full trades table.
Engine: MergeTree | Partition: toYYYYMM(toDate(block_hour)) | ORDER BY: condition_id, block_hour
| Column | Type | Description |
|---|---|---|
block_hour | DateTime | |
condition_id | String | Polymarket condition ID |
trade_count | UInt64 | |
notional_volume_usd | Float64 | Daily notional trading volume (one-sided, USD) |
agent.polymarket_rolling_metrics
Pre-computed rolling window metrics for Polymarket markets (e.g., 7-day volume, 30-day volume, trailing unique traders). Useful for ranking and screening markets by recent activity without expensive window function queries.
agent.polymarket_open_interest_daily
Cumulative open interest per Polymarket condition derived from on-chain events (splits, merges, redemptions, conversions). SPARSE: only has rows on days with events, not every calendar day. Requires gap-fill logic for time series.
Engine: MergeTree | Partition: toYYYYMM(block_date) | ORDER BY: condition_id, block_date
| Column | Type | Description |
|---|---|---|
block_date | Date | Date of the OI change event. SPARSE — not every day has a row. |
condition_id | String | Market condition identifier. |
daily_net_change_raw | Int256 | |
daily_net_change_usd | Float64 | |
open_interest_raw | Int256 | |
open_interest_usd | Float64 | Cumulative OI in USD for this condition on this date. Can be negative for neg-risk conditions. |
agent.polymarket_user_activity
Per-user trade activity on Polymarket including buy/sell counts, volume, and realized PnL. Aggregated by (address, condition_id) to show each user’s activity within each market.
Engine: MergeTree | Partition: toYYYYMM(block_date) | ORDER BY: account, token_id, block_time
| Column | Type | Description |
|---|---|---|
block_date | Date | UTC block date |
block_time | DateTime64(3) | UTC block timestamp |
block_number | UInt64 | Block number |
tx_hash | String | Transaction hash |
evt_index | UInt32 | Event log index in transaction |
account | String | |
token_id | String | |
event_type | String | |
side | String | |
amount | Float64 | Amount in display units (decimal-adjusted) |
price | Float64 | Token price in USD |
amount_usd | Float64 | USD value of transfer |
agent.kalshi_market_details
Kalshi market metadata and snapshot data. Contains market tickers, titles, categories, settlement details, and status. Kalshi uses a three-level hierarchy: series -> events -> markets. MVE (parlay) markets skip the event layer.
Engine: MergeTree | ORDER BY: market_ticker
| Column | Type | Description |
|---|---|---|
market_ticker | String | Unique market identifier (Kalshi) |
event_ticker | String | Parent event ticker. Empty for MVE (parlay) markets. |
event_title | String | Event title |
event_subtitle | String | |
title | String | Market title/question text. |
start_time | DateTime64(3) | |
end_time | DateTime64(3) | |
close_time | DateTime64(3) | |
category | String | Market category |
subcategory | String | Market subcategory |
payout_type | String | |
status | String | Market status: ‘active’, ‘closed’, ‘settled’, etc. |
last_price | Float64 | |
total_volume | UInt64 | Cumulative total volume |
daily_volume | UInt64 | Daily contract volume |
open_interest | Float64 | End-of-day open interest (contracts) |
result | String | Market result (if resolved) |
yes_bid | Float64 | |
yes_ask | Float64 | |
no_bid | Float64 | |
no_ask | Float64 | |
last_day_open_interest | Float64 |
agent.kalshi_trades
Individual Kalshi trade events. Each row represents a single fill on the Kalshi exchange with price, quantity, side, and market ticker. The raw trade-level data source for Kalshi volume analysis.
Engine: ReplacingMergeTree | Partition: toYYYYMM(trade_date) | ORDER BY: ticker, created_time, trade_id
| Column | Type | Description |
|---|---|---|
trade_id | String | |
ticker | String | |
num_contracts | UInt32 | |
taker_side | String | |
maker_side | String | |
yes_price | Float64 | |
no_price | Float64 | |
trade_date | Date | |
created_time | DateTime64(3) |