--- language: - en license: mit pretty_name: BTCUSDT Microbar v2 tags: - finance - cryptocurrency - market-microstructure - binance - futures - btcusdt size_categories: - 10M/.parquet # individual trades ├── book_ticks//.parquet # best bid/ask updates ├── depth//.parquet # top-5 order book snapshots ├── liquidations//.parquet # forced liquidations ├── mark_price//.parquet # mark price + funding └── mini_ticker//.parquet # 24h rolling stats ``` Files are flushed to disk every 60 seconds. Each row carries a `timestamp_ms` (exchange clock, UTC) which is the only safe key for joins — wall-clock arrival times are not preserved. ## Schemas ### `trades/` | column | type | description | |-------------------|---------|-----------------------------------------------| | `timestamp_ms` | int64 | exchange trade time, ms since epoch UTC | | `price` | float64 | trade price (USDT) | | `quantity` | float64 | trade quantity (BTC) | | `is_buyer_maker` | bool | True = aggressive sell, False = aggressive buy | Volume: ~50 trades/sec → ~4M rows/day. ### `book_ticks/` | column | type | description | |----------------|---------|------------------------------------------| | `timestamp_ms` | int64 | exchange event time | | `bid_price` | float64 | best bid price | | `bid_qty` | float64 | best bid quantity | | `ask_price` | float64 | best ask price | | `ask_qty` | float64 | best ask quantity | Volume: ~100 updates/sec → ~8M rows/day. ### `depth/` Top 5 order book levels. Columns: `timestamp_ms`, `bid_price_0..4`, `bid_qty_0..4`, `ask_price_0..4`, `ask_qty_0..4`. Snapshots arrive every 500 ms → ~170k rows/day. ### `liquidations/` | column | type | description | |----------------|---------|------------------------------------------------------------| | `timestamp_ms` | int64 | liquidation time | | `price` | float64 | average fill price | | `quantity` | float64 | liquidated size | | `side` | string | `"BUY"` = short squeezed (bullish), `"SELL"` = long liquidated (bearish) | Sparse — bursts during volatile moves. ### `mark_price/` Updates every 3 seconds. Columns: `timestamp_ms`, `mark_price`, `index_price`, `funding_rate`, `next_funding_time_ms`. Funding rate is the most predictive macro signal in crypto futures. ### `mini_ticker/` Updates every second. Columns: `timestamp_ms`, `open_24h`, `high_24h`, `low_24h`, `close`, `volume_24h`, `quote_volume_24h`. Distance from 24h high/low is a support/resistance signal. ## Loading ```python from huggingface_hub import snapshot_download import pandas as pd from pathlib import Path local = snapshot_download( "Torch-Trade/btcusdt-microbar-v2", repo_type="dataset", allow_patterns=["trades/2026-04-29/*.parquet"], ) trades = pd.concat( pd.read_parquet(f) for f in sorted(Path(local, "trades/2026-04-29").glob("*.parquet")) ) ``` To compute aggregated microstructure features over arbitrary timeframes, use the [`binance-microbar`](https://github.com/TorchTrade/binance-microbar) library — `examples/build_feature_dataset.py` rebuilds 54-feature ML-ready datasets directly from these raw streams. ## Collection - **Source**: Binance USD-M Futures public WebSocket streams (no auth required) - **Collector**: [`binance-microbar`](https://github.com/TorchTrade/binance-microbar) at commit `f88a52a` or later - **Host**: continuous collection on a Raspberry Pi 5 (`colony1`), uploads daily at 03:00 UTC - **Coverage**: starts 2026-04-29; the immediate prior period (2026-04-28 → 2026-04-29) is missing because the collector was offline for the routing-fix deployment ## License MIT. Market data is sourced from Binance's public WebSocket streams and is provided as-is. No financial advice; not affiliated with Binance.