smf-ulm commited on
Commit
93ae5bb
·
verified ·
1 Parent(s): f7a8587

Rebuild as quant-bench: hourly/daily OHLCV bars over high-liquidity resolved markets

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. README.md +169 -135
  2. polymarket/bars_daily/bars_0_10000.parquet +3 -0
  3. polymarket/bars_daily/bars_1000000_1010000.parquet +3 -0
  4. polymarket/bars_daily/bars_100000_110000.parquet +3 -0
  5. polymarket/bars_daily/bars_10000_20000.parquet +3 -0
  6. polymarket/bars_daily/bars_1010000_1020000.parquet +3 -0
  7. polymarket/bars_daily/bars_1020000_1030000.parquet +3 -0
  8. polymarket/bars_daily/bars_1030000_1040000.parquet +3 -0
  9. polymarket/bars_daily/bars_1040000_1050000.parquet +3 -0
  10. polymarket/bars_daily/bars_1050000_1060000.parquet +3 -0
  11. polymarket/bars_daily/bars_1060000_1070000.parquet +3 -0
  12. polymarket/bars_daily/bars_1070000_1080000.parquet +3 -0
  13. polymarket/bars_daily/bars_1080000_1090000.parquet +3 -0
  14. polymarket/bars_daily/bars_1090000_1100000.parquet +3 -0
  15. polymarket/bars_daily/bars_1100000_1110000.parquet +3 -0
  16. polymarket/bars_daily/bars_110000_120000.parquet +3 -0
  17. polymarket/bars_daily/bars_1110000_1120000.parquet +3 -0
  18. polymarket/bars_daily/bars_1120000_1130000.parquet +3 -0
  19. polymarket/bars_daily/bars_1130000_1140000.parquet +3 -0
  20. polymarket/bars_daily/bars_1140000_1150000.parquet +3 -0
  21. polymarket/bars_daily/bars_1150000_1160000.parquet +3 -0
  22. polymarket/bars_daily/bars_1160000_1170000.parquet +3 -0
  23. polymarket/bars_daily/bars_1170000_1180000.parquet +3 -0
  24. polymarket/bars_daily/bars_1180000_1190000.parquet +3 -0
  25. polymarket/bars_daily/bars_1190000_1200000.parquet +3 -0
  26. polymarket/bars_daily/bars_1200000_1210000.parquet +3 -0
  27. polymarket/bars_daily/bars_120000_130000.parquet +3 -0
  28. polymarket/bars_daily/bars_1210000_1220000.parquet +3 -0
  29. polymarket/bars_daily/bars_1220000_1230000.parquet +3 -0
  30. polymarket/bars_daily/bars_1230000_1240000.parquet +3 -0
  31. polymarket/bars_daily/bars_1240000_1250000.parquet +3 -0
  32. polymarket/bars_daily/bars_1250000_1260000.parquet +3 -0
  33. polymarket/bars_daily/bars_1260000_1270000.parquet +3 -0
  34. polymarket/bars_daily/bars_1270000_1280000.parquet +3 -0
  35. polymarket/bars_daily/bars_1280000_1290000.parquet +3 -0
  36. polymarket/bars_daily/bars_1290000_1300000.parquet +3 -0
  37. polymarket/bars_daily/bars_1300000_1310000.parquet +3 -0
  38. polymarket/bars_daily/bars_130000_140000.parquet +3 -0
  39. polymarket/bars_daily/bars_1310000_1320000.parquet +3 -0
  40. polymarket/bars_daily/bars_1320000_1330000.parquet +3 -0
  41. polymarket/bars_daily/bars_1330000_1340000.parquet +3 -0
  42. polymarket/bars_daily/bars_1340000_1350000.parquet +3 -0
  43. polymarket/bars_daily/bars_1350000_1360000.parquet +3 -0
  44. polymarket/bars_daily/bars_1360000_1370000.parquet +3 -0
  45. polymarket/bars_daily/bars_1370000_1380000.parquet +3 -0
  46. polymarket/bars_daily/bars_1380000_1390000.parquet +3 -0
  47. polymarket/bars_daily/bars_1390000_1400000.parquet +3 -0
  48. polymarket/bars_daily/bars_1400000_1410000.parquet +3 -0
  49. polymarket/bars_daily/bars_140000_150000.parquet +3 -0
  50. polymarket/bars_daily/bars_1410000_1420000.parquet +3 -0
README.md CHANGED
@@ -2,212 +2,246 @@
2
  license: cc-by-4.0
3
  language:
4
  - en
5
- pretty_name: Polymarket GeopoliticsMarkets, Trades, Blocks (strict filter)
6
  size_categories:
7
- - 1M<n<10M
8
  task_categories:
9
  - other
10
  tags:
11
  - polymarket
12
  - prediction-markets
13
- - geopolitics
14
  - blockchain
15
  - polygon
16
  - market-microstructure
 
 
 
17
  configs:
18
  - config_name: markets
19
  data_files:
20
  - split: train
21
  path: "polymarket/markets/markets_*.parquet"
22
- - config_name: trades
23
  data_files:
24
  - split: train
25
- path: "polymarket/trades/trades_*.parquet"
26
- - config_name: blocks
27
  data_files:
28
  - split: train
29
- path: "polymarket/blocks/blocks_*.parquet"
30
  ---
31
 
32
- # Polymarket Geopoliticsmarkets, trades, blocks (strict filter)
33
 
34
- A curated subset of [Polymarket](https://polymarket.com) markets and on-chain
35
- trade events covering the **Geopolitics** category. Polymarket is a
36
- decentralised prediction market on the Polygon blockchain; binary
37
- contracts settle to one USDC if the underlying event occurs and zero
38
- otherwise. The dataset is intended for teaching and research on price
39
- discovery, calibration, and trader behaviour in prediction markets.
40
 
41
- ## Contents (strict filter applied)
 
 
 
 
 
42
 
43
  | File group | Rows | Description |
44
  |---|---:|---|
45
- | `polymarket/markets/markets_*.parquet` | 4,852 | One row per Polymarket question classified as Geopolitics. |
46
- | `polymarket/trades/trades_*.parquet` | 9,885,296 | One row per CTF-Exchange `OrderFilled` event for tokens belonging to those markets. |
47
- | `polymarket/blocks/blocks_*.parquet` | ~12 M | Polygon `block_number` `timestamp` lookup, sampled every 100 blocks and linearly interpolated. |
48
 
49
- Each file group is chunked into 10,000-row parquet shards — same chunking
50
- convention as the upstream release.
51
 
52
  ## Provenance and attribution
53
 
54
- The raw market metadata, trade events, and block index were collected and
55
- released by **Jon Becker** at
56
  [github.com/jbecker19/polymarket-data](https://github.com/jbecker19/polymarket-data).
57
- This dataset is a category-restricted derivative of that release: all
58
- column schemas are byte-identical to Jon's upstream parquet files, with
59
- one added column (`category`) on the markets table.
60
-
61
- If you use this dataset, please cite Jon Becker's original release.
62
-
63
- ## How the strict Geopolitics subset is selected
64
-
65
- An earlier version of this dataset used a two-tier text classifier (a
66
- keyword-score Tier 1 and a TF-IDF + logistic-regression Tier 2 fallback)
67
- to assign every Polymarket question to one of eight categories. The
68
- two-tier pipeline maximised recall but, at the Tier-2 decision boundary,
69
- admitted some markets that did not really belong in Geopolitics
70
- (e.g. sports questions about Russian teams, celebrity news about Iranian
71
- public figures).
72
-
73
- This release trades recall for **precision**. A market is kept only
74
- when **both** of the following hold:
75
-
76
- 1. The two-tier classifier's final assignment is `Geopolitics`.
77
- 2. An *independent* Tier-1 keyword pass — with no tie-breaking magic and
78
- no Tier-2 rescue also scores Geopolitics highest. By construction
79
- this requires at least one of the Geopolitics keywords
80
- (`war`, `ukraine`, `russia`, `israel`, `gaza`, `nato`, `nuclear`,
81
- `ceasefire`, `iran`, `north korea`, `taiwan`, `sanctions`, `geopolit`,
82
- `coup`, `regime`, `summit`, `unsc`, `embargo`, `houthi`, `hezbollah`,
83
- `hamas`, `border`, ...) to fire in the market's `question`, `slug`,
84
- or `description`.
85
-
86
- Markets that pass only the LR fallback but lack an explicit keyword hit
87
- are excluded. The result is a smaller but cleaner extract; trade counts
88
- shrink correspondingly because token-id membership flows from the kept
89
- markets.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
  ## Schemas
92
 
93
  ### `markets/markets_*.parquet`
94
 
 
 
 
95
  | column | type | description |
96
  |---|---|---|
97
  | `id` | string | Polymarket market id (primary key). |
98
  | `condition_id` | string | Parent CTF condition id. |
99
- | `question` | string | The question prompt shown to users. |
100
- | `slug` | string | URL slug Polymarket uses to route this market. |
101
- | `outcomes` | string | JSON-encoded array of outcome labels, e.g. `["Yes","No"]`. |
102
- | `outcome_prices` | string | JSON-encoded array of final outcome prices. Resolution threshold > `0.99`. |
103
- | `clob_token_ids` | string | JSON-encoded array of CTF outcome-token ids (typically two: YES and NO). Use these to filter `trades/`. |
104
- | `volume` | double | Cumulative traded volume in USDC. |
105
- | `liquidity` | double | Snapshot of market depth. |
106
- | `active` | bool | Whether the market is currently open. |
107
- | `closed` | bool | Whether trading has ended. |
108
- | `end_date` | timestamp | Wall-clock end-of-life. |
109
- | `created_at` | timestamp | Wall-clock creation time. |
110
- | `market_maker_address` | string | Legacy FPMM contract address; NULL for CTF-Exchange markets. |
111
- | `_fetched_at` | timestamp | Snapshot time at which this metadata row was scraped. |
112
- | `category` | string | **New column.** Always `"Geopolitics"` for this extract. |
113
-
114
- ### `trades/trades_*.parquet`
115
-
116
- Each row is one on-chain trade fill. Unique key is
117
- `(transaction_hash, log_index)` — `transaction_hash` repeats because
118
- Polymarket uses batch fill.
119
 
120
  | column | type | description |
121
  |---|---|---|
122
- | `block_number` | int64 | Polygon block in which the trade was mined. |
123
- | `transaction_hash` | string | Polygon transaction hash. |
124
- | `log_index` | int32 | Position within the transaction's event log. |
125
- | `order_hash` | string | EIP-712 hash of the order. |
126
- | `maker` | string | Polygon address of the order maker. |
127
- | `taker` | string | Polygon address of the order taker. |
128
- | `maker_asset_id` | string | Asset id the maker delivered. `'0'` = USDC. |
129
- | `taker_asset_id` | string | Asset id the taker delivered. |
130
- | `maker_amount` | int64 | Atomic units; divide by `1e6` for USDC or token units. |
131
- | `taker_amount` | int64 | Atomic units. |
132
- | `fee` | int64 | Polymarket fee in USDC atomic units. |
133
- | `timestamp` | timestamp | **Always NULL.** Join to `blocks/` to recover wall-clock. |
134
- | `_fetched_at` | timestamp | Scrape time. |
135
- | `_contract` | string | `"CTF Exchange"` or `"NegRisk CTF Exchange"`. |
136
-
137
- ### `blocks/blocks_*.parquet`
138
-
139
- | column | type | description |
140
- |---|---|---|
141
- | `block_number` | int64 | Polygon block number. |
142
- | `timestamp` | string (ISO-8601) | Block timestamp, cast to `POSIXct` for arithmetic. |
143
-
144
- ### Computing trade price and signed direction
145
-
146
- ```
147
- price_cents = 100 * usdc_amount / token_amount
148
- = 100 * (maker_amount if maker_asset_id == '0' else taker_amount)
149
- / (taker_amount if maker_asset_id == '0' else maker_amount)
150
-
151
- # Taker direction: positive = taker bought outcome tokens
152
- if maker_asset_id == '0':
153
- taker_signed_size = -taker_amount / 1e6 # taker delivered tokens; sold
154
- else:
155
- taker_signed_size = +maker_amount / 1e6 # taker delivered USDC; bought
156
- ```
157
 
158
  ## Quick start in R
159
 
 
 
160
  ```r
161
- install.packages(c("arrow", "dplyr", "jsonlite", "duckdb"))
 
162
  library(arrow)
163
  library(dplyr)
164
- library(jsonlite)
 
 
 
165
 
 
166
  markets <- open_dataset("polymarket/markets/")
167
- trades <- open_dataset("polymarket/trades/")
168
- blocks <- open_dataset("polymarket/blocks/")
169
 
170
- m <- markets %>% arrange(desc(volume)) %>% head(1) %>% collect()
171
- token_ids <- jsonlite::fromJSON(m$clob_token_ids)
 
172
 
173
- market_trades <- trades %>%
174
- filter(maker_asset_id %in% token_ids | taker_asset_id %in% token_ids) %>%
175
  collect() %>%
176
- arrange(block_number, log_index) %>%
177
- left_join(collect(blocks), by = "block_number") %>%
178
- mutate(timestamp = as.POSIXct(timestamp, tz = "UTC")) %>%
179
  mutate(
180
- is_usdc_maker = maker_asset_id == "0",
181
- usdc_amount = ifelse(is_usdc_maker, maker_amount, taker_amount),
182
- token_amount = ifelse(is_usdc_maker, taker_amount, maker_amount),
183
- price_cents = 100 * usdc_amount / token_amount,
184
- taker_signed_size = ifelse(is_usdc_maker, -taker_amount / 1e6, +maker_amount / 1e6)
 
185
  )
186
  ```
187
 
188
- ## Streaming via the HuggingFace `datasets` library (Python)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
189
 
190
  ```python
191
  from datasets import load_dataset
192
- markets = load_dataset("smf-ulm/polymarket-geopolitics", "markets", split="train")
193
- trades = load_dataset("smf-ulm/polymarket-geopolitics", "trades", split="train", streaming=True)
194
- blocks = load_dataset("smf-ulm/polymarket-geopolitics", "blocks", split="train")
195
  ```
196
 
197
  ## License
198
 
199
  [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/). Please cite
200
- both this release and Jon Becker's upstream repository when using the
201
- data in published work.
202
 
203
  ## Citation
204
 
205
  ```bibtex
206
- @misc{polymarket_geopolitics_2026,
207
  author = {Padmaperuma, Oliver},
208
- title = {Polymarket Geopolitics: Markets, Trades, Blocks (derived subset, strict filter)},
209
  year = {2026},
210
- howpublished = {HuggingFace dataset, smf-ulm/polymarket-geopolitics},
211
  note = {Derived from Jon Becker's polymarket-data release at
212
  \url{https://github.com/jbecker19/polymarket-data}}
213
  }
 
2
  license: cc-by-4.0
3
  language:
4
  - en
5
+ pretty_name: Polymarket Quant Bench OHLCV bars for high-liquidity resolved markets
6
  size_categories:
7
+ - 10M<n<100M
8
  task_categories:
9
  - other
10
  tags:
11
  - polymarket
12
  - prediction-markets
 
13
  - blockchain
14
  - polygon
15
  - market-microstructure
16
+ - ohlcv
17
+ - backtesting
18
+ - quantitative-finance
19
  configs:
20
  - config_name: markets
21
  data_files:
22
  - split: train
23
  path: "polymarket/markets/markets_*.parquet"
24
+ - config_name: bars_hourly
25
  data_files:
26
  - split: train
27
+ path: "polymarket/bars_hourly/bars_*.parquet"
28
+ - config_name: bars_daily
29
  data_files:
30
  - split: train
31
+ path: "polymarket/bars_daily/bars_*.parquet"
32
  ---
33
 
34
+ # Polymarket Quant Bench OHLCV bars for high-liquidity resolved markets
35
 
36
+ A teaching-grade derivative of the [Polymarket](https://polymarket.com)
37
+ on-chain trade history, designed for indicator-engineering and
38
+ walk-forward back-testing assignments. Polymarket is a decentralised
39
+ prediction market on the Polygon blockchain; binary contracts settle to
40
+ one USDC if the underlying event occurs and zero otherwise.
 
41
 
42
+ This release replaces the per-trade fill stream of the upstream dataset
43
+ with **per-token OHLCV bars** at hourly and daily resolution, restricted
44
+ to high-liquidity *resolved* markets so every market has a known outcome
45
+ for P&L scoring and enough depth for rolling indicators.
46
+
47
+ ## Contents
48
 
49
  | File group | Rows | Description |
50
  |---|---:|---|
51
+ | `polymarket/markets/markets_*.parquet` | 36,831 | One row per resolved market with cumulative volume >= $100,000 and >= 200 on-chain trade fills. Full upstream schema plus a `category` column. |
52
+ | `polymarket/bars_hourly/bars_*.parquet` | 12,655,266 | One row per `(token_id, calendar hour)` with OHLCV plus trade and direction counts. |
53
+ | `polymarket/bars_daily/bars_*.parquet` | 1,462,282 | One row per `(token_id, calendar day)`, aggregated from the hourly bars. |
54
 
55
+ Each file group is chunked into 10,000-row parquet shards.
 
56
 
57
  ## Provenance and attribution
58
 
59
+ The raw market metadata and trade events were collected and released by
60
+ **Jon Becker** at
61
  [github.com/jbecker19/polymarket-data](https://github.com/jbecker19/polymarket-data).
62
+ This dataset is a derivative: market metadata is restricted to the
63
+ filter described below and trades are aggregated into OHLCV bars. If you
64
+ use this dataset, please also cite Jon Becker's release.
65
+
66
+ ## How prices are computed
67
+
68
+ Each on-chain `OrderFilled` event swaps **USDC** for an **outcome
69
+ token** (or vice versa). Both assets use 6 decimals, so the raw atomic
70
+ ratio of USDC to token quantity is already a dimensionless probability
71
+ in `[0, 1]` -- the price the Polymarket UI shows in cents-per-dollar.
72
+
73
+ For each trade `t`:
74
+
75
+ ```
76
+ if t.maker_asset_id == '0': # maker delivered USDC, taker delivered tokens
77
+ usdc_amount = t.maker_amount
78
+ token_amount = t.taker_amount
79
+ taker_is_seller = True # taker handed over tokens -> sold
80
+ else: # maker delivered tokens, taker delivered USDC
81
+ usdc_amount = t.taker_amount
82
+ token_amount = t.maker_amount
83
+ taker_is_seller = False # taker handed over USDC -> bought
84
+
85
+ price = usdc_amount / token_amount # in [0, 1]
86
+ volume_usd = usdc_amount / 1e6 # in USD
87
+ signed_size = (-1 if taker_is_seller else +1) * token_amount / 1e6
88
+ ```
89
+
90
+ `price` is the implied probability of the outcome the token represents.
91
+
92
+ ## How bars are aggregated
93
+
94
+ For each `(token_id, bar_period)` group:
95
+
96
+ | Field | Formula |
97
+ |---|---|
98
+ | `open` | `price` of the first trade in the bar (ordered by `block_number, log_index`) |
99
+ | `high` | `MAX(price)` |
100
+ | `low` | `MIN(price)` |
101
+ | `close` | `price` of the last trade |
102
+ | `vwap` | `SUM(price * volume_usd) / SUM(volume_usd)` |
103
+ | `volume_usd` | `SUM(volume_usd)` |
104
+ | `n_trades` | total fills in the bar |
105
+ | `n_buys` / `n_sells` | fills where the taker bought / sold outcome tokens |
106
+
107
+ Bars are emitted **only when at least one trade occurred in the period**
108
+ (sparse representation). Use `tidyr::fill()` or
109
+ `data.table::nafill()` to forward-fill if a dense series is required by
110
+ your indicator.
111
+
112
+ The hour boundary is defined by `block_number // 1800` (Polygon ~2 s per
113
+ block; 1 800 blocks = 1 hour). Wall-clock `period_start` is attached
114
+ post-aggregation by looking up the first block of each hour in the
115
+ blocks-timestamp index and extrapolating forward at 2 seconds per
116
+ block.
117
+
118
+ Bars are emitted **per token** rather than per market. A Polymarket
119
+ market has two complementary tokens (YES and NO); the `markets` table
120
+ exposes both via `clob_token_ids`. If you want a single market-level
121
+ mid-price series, pair the two token series yourself.
122
+
123
+ ## Filter applied to upstream markets
124
+
125
+ A market is included iff **all** of the following hold:
126
+
127
+ 1. The market is **resolved** (one outcome price closed above 0.99 in
128
+ the upstream snapshot).
129
+ 2. **Cumulative trading volume >= $100,000** -- removes the long
130
+ tail of dust markets.
131
+ 3. **At least 200 on-chain trade fills** -- ensures enough
132
+ depth to compute rolling indicators meaningfully.
133
+
134
+ This intentionally trades coverage for per-market depth. About
135
+ 36,831 markets remain out of the ~409 k in the upstream snapshot.
136
 
137
  ## Schemas
138
 
139
  ### `markets/markets_*.parquet`
140
 
141
+ Upstream columns from Jon Becker's release plus `category`. Notable
142
+ ones:
143
+
144
  | column | type | description |
145
  |---|---|---|
146
  | `id` | string | Polymarket market id (primary key). |
147
  | `condition_id` | string | Parent CTF condition id. |
148
+ | `question` | string | The question prompt. |
149
+ | `slug` | string | URL slug. |
150
+ | `outcomes` | string | JSON outcome labels, e.g. `["Yes","No"]`. |
151
+ | `outcome_prices` | string | JSON outcome prices at snapshot time. The winning outcome closes near 1. |
152
+ | `clob_token_ids` | string | JSON `[yes_token_id, no_token_id]`. Use to join bars to a market. |
153
+ | `volume` | double | Cumulative USDC traded. |
154
+ | `liquidity` | double | Snapshot depth. |
155
+ | `end_date` | timestamp | Useful as `resolution_date` for held-out cohorts. |
156
+ | `created_at` | timestamp | Market creation. |
157
+ | `category` | string | Best-effort topic label. Use cautiously. |
158
+
159
+ ### `bars_hourly/bars_*.parquet` and `bars_daily/bars_*.parquet`
 
 
 
 
 
 
 
 
160
 
161
  | column | type | description |
162
  |---|---|---|
163
+ | `token_id` | string | CTF outcome-token id. |
164
+ | `period_start` | timestamp | Bar start, UTC. |
165
+ | `period_end` | timestamp | `period_start + 1 hour` (or `+ 1 day`). |
166
+ | `open` / `high` / `low` / `close` | double | Implied probability in `[0, 1]`. |
167
+ | `vwap` | double | Volume-weighted average price. |
168
+ | `volume_usd` | double | Total USDC traded in the bar. |
169
+ | `n_trades` | int64 | Number of `OrderFilled` events in the bar. |
170
+ | `n_buys` / `n_sells` | int64 | Taker-side direction counts. |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
 
172
  ## Quick start in R
173
 
174
+ ### Setup
175
+
176
  ```r
177
+ install.packages(c("arrow", "dplyr", "jsonlite", "lubridate", "slider",
178
+ "TTR", "PerformanceAnalytics", "glmnet"))
179
  library(arrow)
180
  library(dplyr)
181
+ library(slider)
182
+ ```
183
+
184
+ ### Build a per-token feature frame
185
 
186
+ ```r
187
  markets <- open_dataset("polymarket/markets/")
188
+ bars <- open_dataset("polymarket/bars_hourly/")
 
189
 
190
+ # Pick a large market and grab its YES token id.
191
+ m <- markets %>% filter(volume > 1e6) %>% head(1) %>% collect()
192
+ yes_token_id <- jsonlite::fromJSON(m$clob_token_ids)[1]
193
 
194
+ ts <- bars %>%
195
+ filter(token_id == yes_token_id) %>%
196
  collect() %>%
197
+ arrange(period_start) %>%
 
 
198
  mutate(
199
+ sma_24h = slide_dbl(close, mean, .before = 24, .complete = TRUE),
200
+ ema_24h = TTR::EMA(close, n = 24),
201
+ ret_1h = log(close / lag(close)),
202
+ rsi_14 = TTR::RSI(close, n = 14),
203
+ boll = TTR::BBands(close, n = 20, sd = 2)[, "pctB"],
204
+ days_to_resolution = as.numeric(difftime(m$end_date, period_start, units = "days"))
205
  )
206
  ```
207
 
208
+ ### Walk-forward elastic net + back-test
209
+
210
+ ```r
211
+ library(glmnet)
212
+ library(PerformanceAnalytics)
213
+
214
+ fit <- cv.glmnet(X_train, y_train, alpha = 0.5)
215
+ signal <- predict(fit, newx = X_test, s = "lambda.min")
216
+
217
+ # 1% per-trade cost, threshold-based position.
218
+ pos <- sign(signal) * (abs(signal) > threshold)
219
+ ret <- pos * y_test - 0.01 * abs(diff(c(0, pos)))
220
+ charts.PerformanceSummary(ret)
221
+ ```
222
+
223
+ ## Streaming via the HuggingFace `datasets` library
224
 
225
  ```python
226
  from datasets import load_dataset
227
+ markets = load_dataset("smf-ulm/polymarket-quant-bench", "markets", split="train")
228
+ bars_hourly = load_dataset("smf-ulm/polymarket-quant-bench", "bars_hourly", split="train", streaming=True)
229
+ bars_daily = load_dataset("smf-ulm/polymarket-quant-bench", "bars_daily", split="train")
230
  ```
231
 
232
  ## License
233
 
234
  [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/). Please cite
235
+ both this release and Jon Becker's upstream repository.
 
236
 
237
  ## Citation
238
 
239
  ```bibtex
240
+ @misc{polymarket_quant_bench_2026,
241
  author = {Padmaperuma, Oliver},
242
+ title = {Polymarket Quant Bench: OHLCV bars for high-liquidity resolved markets},
243
  year = {2026},
244
+ howpublished = {HuggingFace dataset, smf-ulm/polymarket-quant-bench},
245
  note = {Derived from Jon Becker's polymarket-data release at
246
  \url{https://github.com/jbecker19/polymarket-data}}
247
  }
polymarket/bars_daily/bars_0_10000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d1b3509daa5cb991c9fa0e65ed28dd92902fe67b4a8e017f5f8a1b0550ef8dd
3
+ size 363477
polymarket/bars_daily/bars_1000000_1010000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:23bd166afc62013c981571636796e302a5bfa78f8f06b7c8095dfa52f8e3e31e
3
+ size 374556
polymarket/bars_daily/bars_100000_110000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7bd93746e6676fe8d671eb2fd8cd3d5b54856be2259062997fe7fc297a47555
3
+ size 359482
polymarket/bars_daily/bars_10000_20000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1f2ee9a5ee4377b813266ed0082954efbdc72ee44ba8c8e259649dc3321aa7ee
3
+ size 360038
polymarket/bars_daily/bars_1010000_1020000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:340d49ed4f10a2cc266645a56568f8a22328fedb5c11b6029cc754613e92496c
3
+ size 360715
polymarket/bars_daily/bars_1020000_1030000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:064173cc238a99b870ffd89bee3728ed2800fc565e07bf48f647cf052b9a589c
3
+ size 368352
polymarket/bars_daily/bars_1030000_1040000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:555305f6ba63f95b915ecb8081c1bd8168e08ad07e5db4769525844668de2663
3
+ size 364004
polymarket/bars_daily/bars_1040000_1050000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ea6f58edeb674b3c487f3f44f9b4b7fa33412eef4437601d0bc926cc0830f23f
3
+ size 359967
polymarket/bars_daily/bars_1050000_1060000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02f2e94bf58c45cf33c4fb8aad4df3bc0615e96e99271f94dea4a23888c514c4
3
+ size 368710
polymarket/bars_daily/bars_1060000_1070000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d46ac1babf091e935944dd19ba6944b6fadccab29907b9539eb8ef5f40754cbe
3
+ size 373938
polymarket/bars_daily/bars_1070000_1080000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01557b6cb778b21abc2a21b2595a2cd6165ace09fe030f2bc121e36ce0294836
3
+ size 372051
polymarket/bars_daily/bars_1080000_1090000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b25eb75e619190b5b5c9b01326c17ae639309f51c787555fdfb4895292bd7211
3
+ size 365521
polymarket/bars_daily/bars_1090000_1100000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4404cad2b5aaa229b0d94b4cf5422369f3b60b2fce4e5983ea449a1928c478da
3
+ size 359140
polymarket/bars_daily/bars_1100000_1110000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9dd206b80007388ee1d398acfad60929a0cf64641ac7ba102c7bad35dc0f9fe5
3
+ size 360915
polymarket/bars_daily/bars_110000_120000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69904e4b07ea4467f6b2fb6e9d23f18fd6fef1b64380f2bf3a7091d48fd49a12
3
+ size 361505
polymarket/bars_daily/bars_1110000_1120000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0aad3b5c5efc35957abc34ed79141e894f2db9ffcf98ec0f6a6695c2394f4ed9
3
+ size 365129
polymarket/bars_daily/bars_1120000_1130000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b212bd739b7e38301cdcd9326559331cba48d7bcfd6213dd6f9310bae3c6b95
3
+ size 349142
polymarket/bars_daily/bars_1130000_1140000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0054e83620cfd544ea007d99d202f6c4421f394b8da40a4cf10ec3eb1ab0c987
3
+ size 360845
polymarket/bars_daily/bars_1140000_1150000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3de9b886358015f4697cbf0909c82c8e4f3dc86d412d0b23894ca6e553ccbe01
3
+ size 362556
polymarket/bars_daily/bars_1150000_1160000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0c9f07eb8e138c70fe0117f6c54972179d38fcd446b9e2f135f554e1bc581149
3
+ size 368943
polymarket/bars_daily/bars_1160000_1170000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:87445dcd84899225baf21f4320eacab1678ab1582a139ede0fa6b97cc133585b
3
+ size 365800
polymarket/bars_daily/bars_1170000_1180000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c30c74c4d393aa01b5a8947edec8ac97d318b1108cadc9c5d675d505d9cd7294
3
+ size 350630
polymarket/bars_daily/bars_1180000_1190000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0046899e959484d14fe45ebdbfe75b3030319f5f05cadce87a6ce4477bcf5754
3
+ size 364905
polymarket/bars_daily/bars_1190000_1200000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a29b290c0abefe4e39824c7cd4aabdcaef1725d8dfd45f6130a91f998741d5c1
3
+ size 360179
polymarket/bars_daily/bars_1200000_1210000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d884832fae5c17588ec6fdbfe3beeaeccaef3382d7d2827928283ad40afcf404
3
+ size 375689
polymarket/bars_daily/bars_120000_130000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fd36c8a5fcae20032748c16775d0259eff388e236c2257b1c5c54387232abcb
3
+ size 363420
polymarket/bars_daily/bars_1210000_1220000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7effc29f2ea9d559caaf18100be9b59bb0f60ab81c21113cd749d1a4c82f2bf3
3
+ size 369198
polymarket/bars_daily/bars_1220000_1230000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4fecaae03ba8403fdc3da5031c36ae0c12d43e954cfb6e68c96815e2647122eb
3
+ size 364419
polymarket/bars_daily/bars_1230000_1240000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:88646795db9f895bc5cfbdf5d557cc99c56aa44a2db7480c0ba724b4d3d4ba4e
3
+ size 367062
polymarket/bars_daily/bars_1240000_1250000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:534ab9c5b1aad2de4e717466a8db22fad4422ce4cf3e09e2ea626a30074066fb
3
+ size 365662
polymarket/bars_daily/bars_1250000_1260000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d13d29a8c27efc6b21f84ca622bbd717307acad192e3dfeda12955e593c5bbcf
3
+ size 365899
polymarket/bars_daily/bars_1260000_1270000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35e6ceadb7ac9af417e21161d644df441d75d012796f113cde270d5635d8ec56
3
+ size 364502
polymarket/bars_daily/bars_1270000_1280000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c91d0f44206fbe05a23786010e09ecb47c10dcd19aea1868ef387d0af2c8a85a
3
+ size 371090
polymarket/bars_daily/bars_1280000_1290000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5639ebecabf909f324b28e73683dfc70f23570613e96cfa0727cb2ed000bb61
3
+ size 354114
polymarket/bars_daily/bars_1290000_1300000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:532e70e31b2ab04e04b9479fcfcc9bf0d97b96ca3f9ca955787361b975ee24c6
3
+ size 362763
polymarket/bars_daily/bars_1300000_1310000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d3c59ca4e552383d2057f2c32ee5fc1ead4ad07ea173c108ad7b34dc17e7eb3e
3
+ size 361253
polymarket/bars_daily/bars_130000_140000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:801d9842cb7ee1e8eb6550e32bcf729c68f6e422a1e8a773ccb2085a7c424c3a
3
+ size 360225
polymarket/bars_daily/bars_1310000_1320000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb4c37b30971008d2a6146a28b0be4006a9800904c394fae46f0702b4f2d03b7
3
+ size 355565
polymarket/bars_daily/bars_1320000_1330000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:357d408976128b50dfffbb10e1ce5be6a4c3986f7f0209e871b3bc5ec5974b5e
3
+ size 354878
polymarket/bars_daily/bars_1330000_1340000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9268973dbaf90ba864768cde206f9f4f0fc3cfd505ddf307a84bdb677af07606
3
+ size 351357
polymarket/bars_daily/bars_1340000_1350000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4144705cc22bee9e553158db05912d1e007d90c00b1de778b486721663be2fbb
3
+ size 365599
polymarket/bars_daily/bars_1350000_1360000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66bbf8838004af5f31e0d3da552625cddee1ce5bda14e437e901862487b607ed
3
+ size 360070
polymarket/bars_daily/bars_1360000_1370000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07a508c1ae17920402a8e9addc2332cd5d1a36c8df228cfd46414b7c24b6855c
3
+ size 357415
polymarket/bars_daily/bars_1370000_1380000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:096faeb153e2a38f8a9cdfd28e20acf705c2b9b7a4b68fd32838fff472791b23
3
+ size 362202
polymarket/bars_daily/bars_1380000_1390000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c828faec67669a5fa2686bfa00be38f8715273e68d2613de8eac9801f9b1142
3
+ size 356123
polymarket/bars_daily/bars_1390000_1400000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43e403b5f35341eacdf4d1d31867863ad69d1fa4ccf703762b623118d391d1fe
3
+ size 357003
polymarket/bars_daily/bars_1400000_1410000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d7a17402b9d56c8b9b4275fdb2b4532ff61ab3ba4df2d78b553cfd8c550fdcd
3
+ size 367199
polymarket/bars_daily/bars_140000_150000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2991a3c08ef613c79cc6307cb5ddc1a87bd513ad67d67bcdf9216763d51c8f5c
3
+ size 363009
polymarket/bars_daily/bars_1410000_1420000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:95e420b54ac07a3f253f40808735ed22ec8bb3d1a8560da9ac0bc65b82e2461d
3
+ size 356491