krish301 commited on
Commit
303a3f0
·
verified ·
1 Parent(s): 23e3ab4

docs: README for 15m raw data collector

Browse files
Files changed (1) hide show
  1. README.md +143 -0
README.md ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - time-series-forecasting
5
+ - tabular-regression
6
+ tags:
7
+ - polymarket
8
+ - prediction-market
9
+ - cryptocurrency
10
+ - bitcoin
11
+ - ethereum
12
+ - on-chain
13
+ - trade-data
14
+ - orderbook
15
+ size_categories:
16
+ - 100K<n<1M
17
+ ---
18
+
19
+ # Polymarket Raw Data — 15m Up-or-Down Windows
20
+
21
+ **Continuous live collection of every single trade and orderbook tick on Polymarket's 15m Bitcoin/Ethereum/Solana/XRP/Dogecoin/BNB/Hype "Up or Down" prediction markets.**
22
+
23
+ This dataset is built for institutional quantitative research. It captures **complete user trade activity** with **every available metadata field** from the Polymarket APIs, **plus the full live orderbook** at every resolution boundary.
24
+
25
+ ## Coverage
26
+
27
+ - **Assets:** btc, eth, sol, xrp, doge, bnb, hype
28
+ - **Duration:** 15m
29
+ - **Window size:** 900 seconds
30
+ - **Polling interval:** 5s during the window (orderbook), 30s for trade tape refresh
31
+ - **Storage:** Per-window JSONL files (one file per market resolution)
32
+ - **Collection start:** 2026-06-04
33
+
34
+ ## Data sources (no synthetic data, no nulls)
35
+
36
+ For every 15m window that resolves, we capture:
37
+
38
+ 1. **Market metadata** (from Gamma `keyset`): `conditionId`, `slug`, `question`, `description`, `endDate`, `closedTime`, `tickSize`, `minOrderSize`, `negRisk`, `outcomes`, `clobTokenIds`, `icon`, `image`, `category`, `tags`, `volumeNum`, `liquidity`, `commentCount`, `createdAt`, `updatedAt`, `closed`, `active`, `archived`, `restricted`, `featured`, `new`, `groupBy`, `events`, and the full `markets` record.
39
+ 2. **Full trade tape** (from `data-api.polymarket.com/trades?conditionId=...&limit=500`): every fill with 19 fields: `proxyWallet`, `side`, `asset`, `conditionId`, `size`, `price`, `timestamp`, `title`, `slug`, `eventSlug`, `outcome`, `outcomeIndex`, `name`, `pseudonym`, `bio`, `profileImage`, `profileImageOptimized`, `transactionHash`.
40
+ 3. **Live orderbook snapshots** (from `clob.polymarket.com/book?token_id=...`): at the end of each window, the full L2 orderbook for both up and down tokens. Each snapshot has `bids`, `asks`, `timestamp`, `hash`, `tick_size`, `min_order_size`, `last_trade_price`.
41
+ 4. **On-chain event log** (from Goldsky v1 subgraph + Polygon v2 RPC): the underlying `OrderFilled` events that ground the trade tape. Includes `transactionHash`, `maker`, `taker`, `makerAssetId`, `takerAssetId`, `makerAmountFilled`, `takerAmountFilled` for verification.
42
+
43
+ ## File layout
44
+
45
+ ```
46
+ data/
47
+ btc/
48
+ 2026-06-04/
49
+ btc-updown-15m-1780534500/
50
+ meta.json # Market metadata (all Gamma fields)
51
+ trades.jsonl # All trade tape (19 fields per row)
52
+ orderbook_snapshots.jsonl # L2 orderbook snapshots
53
+ onchain_events.jsonl # OrderFilled events for this market
54
+ resolve.json # Resolution: final price, winner, volume, etc.
55
+ README.md
56
+ ```
57
+
58
+ ## Schema — trades.jsonl (one row per fill)
59
+
60
+ | Field | Type | Description |
61
+ |---|---|---|
62
+ | `proxyWallet` | string | The user's wallet address (lowercase) |
63
+ | `side` | string | `BUY` or `SELL` (from user's perspective) |
64
+ | `asset` | string | The tokenId being traded (decimal string) |
65
+ | `conditionId` | string | The CTF conditionId (hex with 0x prefix) |
66
+ | `size` | number | Number of shares |
67
+ | `price` | number | Price in [0, 1] |
68
+ | `timestamp` | number | Unix epoch seconds (when the order was placed) |
69
+ | `title` | string | Market question |
70
+ | `slug` | string | `{ASSET}-updown-15m-{{epoch}}` |
71
+ | `eventSlug` | string | Same as slug for these markets |
72
+ | `outcome` | string | `Up` or `Down` |
73
+ | `outcomeIndex` | number | `0` (Up) or `1` (Down) |
74
+ | `name` | string | The user's display name (Polymarket profile) |
75
+ | `pseudonym` | string | The user's pseudonym (Polymarket profile) |
76
+ | `bio` | string | The user's bio |
77
+ | `profileImage` | string | URL to profile image (or empty) |
78
+ | `profileImageOptimized` | string | Optimized CDN URL |
79
+ | `transactionHash` | string | The on-chain transaction hash (for verification) |
80
+
81
+ ## Schema — orderbook_snapshots.jsonl (one row per snapshot)
82
+
83
+ | Field | Type | Description |
84
+ |---|---|---|
85
+ | `timestamp` | number | Unix epoch ms when snapshot was taken |
86
+ | `token_id` | string | The token being snapshotted |
87
+ | `outcome` | string | `Up` or `Down` |
88
+ | `bids` | array of `price, size` | Sorted descending by price |
89
+ | `asks` | array of `price, size` | Sorted ascending by price |
90
+ | `tick_size` | number | Minimum price increment |
91
+ | `min_order_size` | number | Minimum order size |
92
+ | `last_trade_price` | number | Last trade price at snapshot time |
93
+ | `hash` | string | CLOB orderbook hash for integrity |
94
+
95
+ ## Schema — meta.json
96
+
97
+ A full snapshot of the Gamma `markets` record for this market (40+ fields). No fields are dropped.
98
+
99
+ ## Schema — onchain_events.jsonl
100
+
101
+ One row per `OrderFilled` event from the Goldsky v1 subgraph or Polygon v2 RPC:
102
+
103
+ | Field | Type | Description |
104
+ |---|---|---|
105
+ | `id` | string | `{txHash}_{logIndex}` |
106
+ | `timestamp` | number | Unix epoch seconds |
107
+ | `maker` | string | Maker address |
108
+ | `taker` | string | Taker address |
109
+ | `makerAssetId` | string | Token being sold by maker (0 for USDC) |
110
+ | `takerAssetId` | string | Token being acquired by maker (0 for USDC) |
111
+ | `makerAmountFilled` | number | Amount (6-decimal) |
112
+ | `takerAmountFilled` | number | Amount (6-decimal) |
113
+ | `transactionHash` | string | On-chain transaction hash |
114
+
115
+ ## Usage
116
+
117
+ ```python
118
+ from datasets import load_dataset
119
+ ds = load_dataset("krish301/polymarket-raw-15m")
120
+ ```
121
+
122
+ Or directly:
123
+ ```python
124
+ import json
125
+ with open("data/btc/2026-06-04/btc-updown-15m-1780534500/trades.jsonl") as f:
126
+ for line in f:
127
+ trade = json.loads(line)
128
+ print(trade["proxyWallet"], trade["side"], trade["price"], trade["size"])
129
+ ```
130
+
131
+ ## Provenance
132
+
133
+ - Collected from public Polymarket APIs (`gamma-api.polymarket.com`, `data-api.polymarket.com`, `clob.polymarket.com`)
134
+ - Cross-referenced with the Goldsky v1 subgraph (project_cl6mb8i9h0003e201j6li0diw) and Polygon v2 CTF Exchange contract (0xE111180000d2663C0091e4f400237545B87B996B)
135
+ - No PII is collected beyond what is publicly visible on Polymarket profiles
136
+
137
+ ## License
138
+
139
+ MIT
140
+
141
+ ## Maintainer
142
+
143
+ Collected continuously from an AWS EC2 instance running a custom collector service.