btc15-dataset
收藏资源简介:
BTC15 Kalshi交易数据集是一个完整记录Kalshi交易所KXBTC15M市场量化交易的公开数据集,专注于比特币15分钟二元期权的交易活动。它包含模型对每个15分钟窗口的预测概率、逐秒行情盘口数据(如BTC现货价格和合约买卖价)、开仓/对冲决策、真实成交与取消记录、最终结算结果以及收益曲线。数据集采用活数据集模式,随源项目自动迭代更新,由两台交易机器持续产生数据,导出器定期刷新。数据集包含8个主要数据表:运行记录表(记录交易元数据)、策略定义表(存储策略代码和参数)、预测数据表、结算结果表、权益曲线表、成交记录表、订单数据表和高频行情表(提供逐秒市场快照)。数据集特别区分三种交易类型:模拟交易(乐观成交假设)、真实下单交易和纸面交易,这是研究模拟与真实交易差距的核心维度。数据使用window_id作为跨表连接的主键,时间戳采用UTC epoch秒和可读字符串两种格式,结算规则基于窗口收盘均价与开盘均价的比较。该数据集适用于多个研究领域,包括成交率建模(比较立即成交与挂单的差异)、预测校准分析、二元期权做市策略研究,以及模拟交易与真实交易差距的量化分析。
BTC15 Kalshi Trading Dataset is a public dataset that fully records the quantitative trading activities of the KXBTC15M market on the Kalshi Exchange, focusing on Bitcoin's 15-minute binary options trading. It includes the prediction probability of each 15-minute window generated by the model, real-time second-level market quote data (such as BTC spot price and contract bid/ask prices), position opening/hedging decisions, actual transaction and cancellation records, final settlement results, and profit curves. This dataset adopts a live dataset mode, which automatically iterates and updates with the source project, with data continuously generated by two trading machines and regularly refreshed by the exporter. The dataset contains 8 main data tables: the operation record table (recording trading metadata), the strategy definition table (storing strategy codes and parameters), the prediction data table, the settlement result table, the equity curve table, the transaction record table, the order data table, and the high-frequency market data table (providing second-by-second market snapshots). The dataset specifically distinguishes three trading types: simulated trading (with optimistic execution assumption), real order trading, and paper trading, which serves as a core dimension for researching the gap between simulated and real trading. The dataset uses window_id as the primary key for cross-table joins, and timestamps are provided in both UTC epoch seconds and human-readable string formats. The settlement rule is based on the comparison between the average closing price and the average opening price of each window. This dataset is applicable to multiple research fields, including fill rate modeling (comparing the differences between immediate execution and pending orders), prediction calibration analysis, market making strategy research for binary options, and quantitative analysis of the gap between simulated and real trading.
数据集名称
BTC15 Kalshi Trading Dataset(Kalshi 比特币 15 分钟二元期权交易数据集)
许可证
MIT
数据集描述
这是一个公开数据集,完整记录了 Kalshi KXBTC15M 市场(比特币15分钟二元期权)的量化交易信息,包括模型对每个15分钟窗口的预测、逐秒行情盘口、开仓/对冲决策、真实成交与取消、最终结算及收益曲线。数据集支持研究:成交率建模(IOC vs 挂单)、预测校准、二元期权做市、模拟与实盘差距分析。
数据集结构
数据集包含8个子配置(config),每个配置对应一个表,以Parquet格式存储:
| 配置名 | 说明 | 关键列 |
|---|---|---|
runs |
交易运行记录(5行) | run_id, machine, kind, preset, model_id, started_ts, last_ts, status |
strategies |
交易策略定义(8行) | code, title, description_md, params_json, lifecycle, updated_ts |
predictions |
模型预测结果(1行) | run_id, model_id, window_id, obs_ts, p_yes |
settlements |
结算结果(0行) | window_id, settle_ts, outcome |
equity |
权益曲线(29行) | run_id, strategy_code, ts, cash, equity |
trades |
成交记录(1行) | id, run_id, strategy_code, ts, window_id, type, side, p_yes |
orders |
订单记录(2行) | event_id, run_id, wallet, ts, window_id, strategy_id, status, side |
market_ticks |
逐秒高频行情盘口快照 | tick_iso, window_id, window_anchor_ts, seconds_from_open, btc_last, btc_open, yes_bid, yes_ask, no_bid, yes_book_json, no_book_json, yes_book_levels, no_book_levels, yes_bid_size, no_bid_size 等 |
数据字段与约定
- 时间字段:
*_ts为 UTC 纪元秒(整数),*_iso为可读字符串。 - 运行类型(
kind):sim(模拟,乐观成交)、live(真实下单)、paper(纸面交易)。分析时必须区分,因同策略 sim 与 live 差距大,是核心研究问题。 - 窗口标识:
window_id/window_anchor_ts标识15分钟窗口,是跨表联表主键。 - 结算规则:窗口收盘均价 ≥ 开盘均价 →
outcome=1(YES 赢)。 - 盘口深度:
yes_book_json/no_book_json存储升序[[价, 美元量], ...]档位,最优bid在末档;Kalshi 只报双边bid,ask通过对偶价yes_ask = 1 - no_best_bid计算。yes_book_levels/no_book_levels表示档数,yes_bid_size/no_bid_size为最优档美元量。旧feeder行深度列为空,可通过yes_book_levels非空过滤。
使用示例
python from datasets import load_dataset
trades = load_dataset("huthvincent/btc15-dataset", "trades", split="train") predictions = load_dataset("huthvincent/btc15-dataset", "predictions", split="train") ticks = load_dataset("huthvincent/btc15-dataset", "market_ticks", split="train") orders = load_dataset("huthvincent/btc15-dataset", "orders", split="train")
可用于训练成交率预测模型(fill-model),通过 window_id 或时间联接下单、盘口和是否成交信息。
数据生成与维护
- 自动生成:由 huthvincent/BTC15 项目的
scripts/tools/export_dataset.py脚本生成。decisions子命令从 hub.db 导出决策表,market子命令从各机器 collector 目录导出行情数据。Schema 定义在src/btc15/dataset/schema.py。 - 活数据集:数据集随项目自动迭代,两台交易机器持续产生数据,导出器定期将 hub.db(决策)和 collector(高频行情)增量更新至此处。最后更新时间为
2026-07-06 19:47 UTC。 - 存储分区:
market_ticks按machine=<机器>/date=<日期>/part.parquet分片。




