polymarket-updown-microstructure
收藏资源简介:
Polymarket加密资产涨跌预测市场(5分钟/15分钟)微观结构数据集提供了六周(2026年5月27日至6月24日)的真实订单簿微观结构、交易记录和由预言机结算的二元市场结果数据。该数据集旨在为研究零售交易者在短期加密资产涨跌预测市场中面临亏损的原因提供真实底层数据,特别关注接近收盘时的逆向选择问题,并支持相关研究论文《honest-backtest》结果的可复现性。数据集包含三个Parquet格式表格:slots表(每个市场为一行,包含市场标识符、标的资产、时段长度、时间戳、行权价、现货价、代币ID、结算方向和手续费率等字段)、book_snapshots表(记录订单簿顶部快照,采样频率在稳态时约每30秒一次,接近收盘时加密至约1Hz,包含时间戳、距收盘秒数、买卖价及规模、价格阶梯、现货价等字段)和pm_trades表(记录公开的真实交易流水,包含时间戳、代币ID、成交价格、成交数量和交易方向等字段)。数据规模在100万到1000万之间,所有市场标识符对应Polymarket上已结束的真实公开市场,并经过严格匿名化处理,仅包含市场观察数据,排除任何私有信息。数据集适用于微观结构研究、逆向选择和执行质量分析、使用《honest-backtest》工具进行真实市场条件下的回测,以及短期二元预测市场的公允价值模型校准。需要注意的是,原始订单簿数据存在高频交叉挂单或虚挂现象,建模时应以实际交易流水为锚点。数据集采用CC BY 4.0许可证发布。
The Polymarket Crypto Asset Price Movement Prediction Market (5-minute/15-minute) Microstructure Dataset provides real order book microstructure, trade records, and oracle-settled binary market outcome data over a six-week period (May 27 to June 24, 2026). This dataset aims to provide real-world underlying data for researching the causes of losses incurred by retail traders in short-term crypto asset price movement prediction markets, with a particular focus on adverse selection near market close, and supports the reproducibility of results from the associated research paper *honest-backtest*. The dataset includes three Parquet-format tables: 1. **slots table**: Each row represents one market (i.e., a specific price movement prediction time window), containing key fields such as market identifier (condition_id), underlying asset (coin), time window duration (duration), opening and closing timestamps (open_ts, close_ts), strike price (strike), spot prices at opening and closing (spot_at_open/spot_at_close), yes/no token IDs (yes_token_id, no_token_id), resolved settlement side (resolved_side), and fee rate (fee_rate). 2. **book_snapshots table**: Records top-of-book order book snapshots, with a sampling frequency of approximately once every 30 seconds in steady state, and increased to ~1Hz during the final ~5 seconds before each window's close. Fields include timestamp (ts_ms), seconds remaining until close (secs_to_close), best bid/ask prices and sizes for yes/no tokens, top 5-level price ladder strings, spot price (spot), and data stream spot price (ds_spot). 3. **pm_trades table**: Records public real trade logs, including fields such as timestamp (ts_ms), token ID (token_id), execution price (price), execution size (size), and trade direction (taker_buy: 1 indicates taker-initiated buy, 0 indicates taker-initiated sell). The dataset has a scale between 1 million and 10 million entries (1M < n < 10M). All market identifiers (condition_id, token_id, slug) correspond to real closed public markets on Polymarket. The dataset has undergone strict anonymization, only containing market observation data, and completely excludes any private information such as individual traders' orders, trades, positions, wallet addresses, transaction hashes, strategy labels, or profit and loss logs. This dataset is applicable to microstructure research, adverse selection and execution quality analysis, backtesting under real market conditions using the `honest-backtest` toolkit, and calibration of fair value models for short-term binary prediction markets. It should be noted that the raw order book data contains frequent overlapping or non-displayed limit orders (affecting approximately 98% of the raw incremental data), and stale price levels in the quote depth are rarely removed. Therefore, modeling should anchor on actual trade logs (pm_trades) rather than solely relying on the displayed prices in the order book. The dataset is released under the CC BY 4.0 license.
数据集概述
该数据集记录了 Polymarket 平台上加密货币“Up or Down”二元市场的微观结构数据,覆盖 5 分钟和 15 分钟时间槽,采集时间为 2026 年 5 月 27 日至 6 月 24 日,共六周。
数据构成
包含三个 Parquet 格式表格,每张表对应一个配置:
| 表格名称 | 每行代表 | 关键字段 |
|---|---|---|
slots |
一个单独的市场时间槽 | condition_id, coin, duration, open_ts, close_ts, strike, spot_at_open/close, yes_token_id, no_token_id, resolved_side, fee_rate |
book_snapshots |
订单簿快照样本(稳态约30秒采样,临近收盘约1Hz) | ts_ms, secs_to_close, yes/no 最优 bid/ask 及数量,前5档 ladder 字符串,spot, ds_spot |
pm_trades |
一笔真实交易记录 | ts_ms, token_id, price, size, taker_buy(1=买入,0=卖出) |
condition_id/token_id/slug是 Polymarket 公开的市场标识符。- 不包含任何账户、钱包、订单或操作者自身交易信息。
数据采集与处理
- 采集方式:单一常驻记录器通过 Polymarket 的 CLOB 市场 WebSocket 订阅订单簿和交易数据,同时订阅独立的现货/预言机喂价。
book_snapshots在时间槽最后约5秒内采样频率提升至约1Hz。pm_trades为原始的公开交易流水。 - 真实结果标注:
slots.resolved_side仅来源于 Polymarket 的 Gamma 权威结算预言机(outcomePrices),通过15分钟定时任务回填,绝不根据现货价格推断。YES 代币在resolved_side=Yes时支付1美元,NO 代币同理。 - 匿名化处理:导出过程仅保留三个市场观察表格及固定列列表,排除了所有与操作者相关的信息(如订单、成交、仓位、交易哈希、策略标签等)。
已知注意事项
- 交叉/虚假订单簿:显示的订单簿经常出现交叉现象(例如
yes_ask + no_ask ≠ 1),不应直接用于回测。真实的内部市场应以pm_trades(实际成交)为锚点。 - 陈旧档位残留:订单簿深度会随时间槽生命周期增长,建议过滤出近期或大额数据,或以交易记录为锚点。
- 数据窗口起始时间:为2026年5月27日,此前(5月11-23日)的早期数据中约39%的
resolved_side因基于现货推断的错误而被污染,已排除在外。 - 现货价格来源:
spot字段为 Binance 帧共识,与 Polymarket 结算所用的 data_streams 预言机存在约10个基点的偏差。建议仅使用现货的变动值(相对于spot_at_open),而非绝对价格。 - 缺少订单单边数据:仅有公开交易记录,订单拒绝/成交选择的非对称性研究需参考论文中的操作者私有账本。
建议用途
- 微观结构研究
- 逆向选择与执行质量分析
- 基于真实数据的回测(可使用
honest-backtest工具复现论文结果) - 短期二元市场的公允值模型校准
注意:该数据集不适合作为盈利交易信号的来源,论文显示在该平台上可实现的实际超额收益接近于零。
论文结果复现
可通过以下命令复现论文的标题结果(需安装 honest-backtest 和 Hugging Face CLI):
bash pip install "honest-backtest[parquet]" huggingface-cli download kinzikdza/polymarket-updown-microstructure --repo-type dataset --local-dir pm_data python -m honest_backtest.examples.no_overpriced pm_data/parquet
预期输出中 edge_real 接近或低于零(实时锚点为 -0.004)。
许可证
CC BY 4.0。Polymarket 市场标识符为公开信息,本数据集未添加任何专有或个人数据。




