totalorganfailure commited on
Commit
a329a6c
·
verified ·
1 Parent(s): df2449d

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +153 -31
README.md CHANGED
@@ -1,59 +1,181 @@
1
  ---
2
- license: mit
3
- viewer: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
  # LOBSTER Sample Data
7
 
8
- Raw LOBSTER (Limit Order Book System) L3 order book data for June 21, 2012.
9
 
10
- **Important:** These are raw CSV files without headers. They cannot be automatically loaded by HuggingFace viewers. Use the loading code below with custom schemas.
11
 
12
- ## Available Datasets
13
 
14
  - **AAPL**: 1, 5, 10, 30, 50 levels
15
- - **AMZN**: 1, 5, 10 levels
16
  - **GOOG**: 1, 5, 10 levels
17
  - **INTC**: 1, 5, 10 levels
18
  - **MSFT**: 1, 5, 10, 30, 50 levels
19
  - **SPY**: 30, 50 levels
20
 
 
 
 
 
 
 
21
  ## File Structure
22
 
23
- 1. **Message file** (`*_message_*.csv`): Order book events (6 columns, no header)
 
 
24
  - Columns: time, event_type, order_id, size, price, direction
25
  - Types: 1=New, 2=Cancel, 3=Delete, 4=Exec(Visible), 5=Exec(Hidden), 7=Halt
26
 
27
- 2. **Orderbook file** (`*_orderbook_*.csv`): Order book snapshots (4N columns, no header)
28
  - Columns: ask_price_1, ask_size_1, bid_price_1, bid_size_1, ... (up to N levels)
29
  - Prices in fixed-point (multiply by 10^-4)
30
 
31
  ## Usage
32
 
33
  ```python
34
- from huggingface_hub import hf_hub_download
35
- import polars as pl
36
-
37
- message_file = hf_hub_download(
38
- repo_id="totalorganfailure/lobster-data",
39
- filename="LOBSTER_SampleFile_AAPL_2012-06-21_50/AAPL_2012-06-21_34200000_37800000_message_50.csv",
40
- repo_type="dataset"
41
- )
42
-
43
- # Define schema for message file
44
- MESSAGE_SCHEMA = {
45
- "time": pl.Float64,
46
- "type": pl.Int8,
47
- "order_id": pl.Int64,
48
- "size": pl.Int32,
49
- "price": pl.Int64,
50
- "direction": pl.Int8,
51
- }
52
-
53
- messages = pl.read_csv(message_file, has_header=False, schema=MESSAGE_SCHEMA)
54
  ```
55
 
56
- ## More Information
57
 
58
- - https://lobsterdata.com/
59
- - https://lobsterdata.com/info/DataSamples.php
 
1
  ---
2
+ configs:
3
+ - config_name: AAPL_1levels
4
+ data_files:
5
+ - split: message
6
+ path: "LOBSTER_SampleFile_AAPL_2012-06-21_1/*_message_1.csv"
7
+ - split: orderbook
8
+ path: "LOBSTER_SampleFile_AAPL_2012-06-21_1/*_orderbook_1.csv"
9
+ - config_name: AAPL_5levels
10
+ data_files:
11
+ - split: message
12
+ path: "LOBSTER_SampleFile_AAPL_2012-06-21_5/*_message_5.csv"
13
+ - split: orderbook
14
+ path: "LOBSTER_SampleFile_AAPL_2012-06-21_5/*_orderbook_5.csv"
15
+ - config_name: AAPL_10levels
16
+ data_files:
17
+ - split: message
18
+ path: "LOBSTER_SampleFile_AAPL_2012-06-21_10/*_message_10.csv"
19
+ - split: orderbook
20
+ path: "LOBSTER_SampleFile_AAPL_2012-06-21_10/*_orderbook_10.csv"
21
+ - config_name: AAPL_30levels
22
+ data_files:
23
+ - split: message
24
+ path: "LOBSTER_SampleFile_AAPL_2012-06-21_30/*_message_30.csv"
25
+ - split: orderbook
26
+ path: "LOBSTER_SampleFile_AAPL_2012-06-21_30/*_orderbook_30.csv"
27
+ - config_name: AAPL_50levels
28
+ data_files:
29
+ - split: message
30
+ path: "LOBSTER_SampleFile_AAPL_2012-06-21_50/*_message_50.csv"
31
+ - split: orderbook
32
+ path: "LOBSTER_SampleFile_AAPL_2012-06-21_50/*_orderbook_50.csv"
33
+ - config_name: AMZN_1levels
34
+ data_files:
35
+ - split: message
36
+ path: "LOBSTER_SampleFile_AMZN_2012-06-21_1/*_message_1.csv"
37
+ - split: orderbook
38
+ path: "LOBSTER_SampleFile_AMZN_2012-06-21_1/*_orderbook_1.csv"
39
+ - config_name: AMZN_5levels
40
+ data_files:
41
+ - split: message
42
+ path: "LOBSTER_SampleFile_AMZN_2012-06-21_5/*_message_5.csv"
43
+ - split: orderbook
44
+ path: "LOBSTER_SampleFile_AMZN_2012-06-21_5/*_orderbook_5.csv"
45
+ - config_name: AMZN_10levels
46
+ data_files:
47
+ - split: message
48
+ path: "LOBSTER_SampleFile_AMZN_2012-06-21_10/*_message_10.csv"
49
+ - split: orderbook
50
+ path: "LOBSTER_SampleFile_AMZN_2012-06-21_10/*_orderbook_10.csv"
51
+ - config_name: GOOG_1levels
52
+ data_files:
53
+ - split: message
54
+ path: "LOBSTER_SampleFile_GOOG_2012-06-21_1/*_message_1.csv"
55
+ - split: orderbook
56
+ path: "LOBSTER_SampleFile_GOOG_2012-06-21_1/*_orderbook_1.csv"
57
+ - config_name: GOOG_5levels
58
+ data_files:
59
+ - split: message
60
+ path: "LOBSTER_SampleFile_GOOG_2012-06-21_5/*_message_5.csv"
61
+ - split: orderbook
62
+ path: "LOBSTER_SampleFile_GOOG_2012-06-21_5/*_orderbook_5.csv"
63
+ - config_name: GOOG_10levels
64
+ data_files:
65
+ - split: message
66
+ path: "LOBSTER_SampleFile_GOOG_2012-06-21_10/*_message_10.csv"
67
+ - split: orderbook
68
+ path: "LOBSTER_SampleFile_GOOG_2012-06-21_10/*_orderbook_10.csv"
69
+ - config_name: INTC_1levels
70
+ data_files:
71
+ - split: message
72
+ path: "LOBSTER_SampleFile_INTC_2012-06-21_1/*_message_1.csv"
73
+ - split: orderbook
74
+ path: "LOBSTER_SampleFile_INTC_2012-06-21_1/*_orderbook_1.csv"
75
+ - config_name: INTC_5levels
76
+ data_files:
77
+ - split: message
78
+ path: "LOBSTER_SampleFile_INTC_2012-06-21_5/*_message_5.csv"
79
+ - split: orderbook
80
+ path: "LOBSTER_SampleFile_INTC_2012-06-21_5/*_orderbook_5.csv"
81
+ - config_name: INTC_10levels
82
+ data_files:
83
+ - split: message
84
+ path: "LOBSTER_SampleFile_INTC_2012-06-21_10/*_message_10.csv"
85
+ - split: orderbook
86
+ path: "LOBSTER_SampleFile_INTC_2012-06-21_10/*_orderbook_10.csv"
87
+ - config_name: MSFT_1levels
88
+ data_files:
89
+ - split: message
90
+ path: "LOBSTER_SampleFile_MSFT_2012-06-21_1/*_message_1.csv"
91
+ - split: orderbook
92
+ path: "LOBSTER_SampleFile_MSFT_2012-06-21_1/*_orderbook_1.csv"
93
+ - config_name: MSFT_5levels
94
+ data_files:
95
+ - split: message
96
+ path: "LOBSTER_SampleFile_MSFT_2012-06-21_5/*_message_5.csv"
97
+ - split: orderbook
98
+ path: "LOBSTER_SampleFile_MSFT_2012-06-21_5/*_orderbook_5.csv"
99
+ - config_name: MSFT_10levels
100
+ data_files:
101
+ - split: message
102
+ path: "LOBSTER_SampleFile_MSFT_2012-06-21_10/*_message_10.csv"
103
+ - split: orderbook
104
+ path: "LOBSTER_SampleFile_MSFT_2012-06-21_10/*_orderbook_10.csv"
105
+ - config_name: MSFT_30levels
106
+ data_files:
107
+ - split: message
108
+ path: "LOBSTER_SampleFile_MSFT_2012-06-21_30/*_message_30.csv"
109
+ - split: orderbook
110
+ path: "LOBSTER_SampleFile_MSFT_2012-06-21_30/*_orderbook_30.csv"
111
+ - config_name: MSFT_50levels
112
+ data_files:
113
+ - split: message
114
+ path: "LOBSTER_SampleFile_MSFT_2012-06-21_50/*_message_50.csv"
115
+ - split: orderbook
116
+ path: "LOBSTER_SampleFile_MSFT_2012-06-21_50/*_orderbook_50.csv"
117
+ - config_name: SPY_30levels
118
+ data_files:
119
+ - split: message
120
+ path: "LOBSTER_SampleFile_SPY_2012-06-21_30/*_message_30.csv"
121
+ - split: orderbook
122
+ path: "LOBSTER_SampleFile_SPY_2012-06-21_30/*_orderbook_30.csv"
123
+ - config_name: SPY_50levels
124
+ data_files:
125
+ - split: message
126
+ path: "LOBSTER_SampleFile_SPY_2012-06-21_50/*_message_50.csv"
127
+ - split: orderbook
128
+ path: "LOBSTER_SampleFile_SPY_2012-06-21_50/*_orderbook_50.csv"
129
  ---
130
 
131
  # LOBSTER Sample Data
132
 
133
+ LOBSTER (Limit Order Book System) sample L3 order book data for June 21, 2012.
134
 
135
+ ## Dataset Description
136
 
137
+ LOBSTER provides limit order book data from NASDAQ TotalView-ITCH messages.
138
 
139
  - **AAPL**: 1, 5, 10, 30, 50 levels
140
+ - **AMZN**: 1, 5, 10 levels
141
  - **GOOG**: 1, 5, 10 levels
142
  - **INTC**: 1, 5, 10 levels
143
  - **MSFT**: 1, 5, 10, 30, 50 levels
144
  - **SPY**: 30, 50 levels
145
 
146
+ ## Configurations
147
+
148
+ Each ticker/level combination has its own configuration with two splits:
149
+ - **message**: Order book events (time-series of market events)
150
+ - **orderbook**: Order book snapshots at each event time
151
+
152
  ## File Structure
153
 
154
+ Each ticker has two CSV files:
155
+
156
+ 1. **Message file** (`*_message_*.csv`): Order book events
157
  - Columns: time, event_type, order_id, size, price, direction
158
  - Types: 1=New, 2=Cancel, 3=Delete, 4=Exec(Visible), 5=Exec(Hidden), 7=Halt
159
 
160
+ 2. **Orderbook file** (`*_orderbook_*.csv`): Order book snapshots
161
  - Columns: ask_price_1, ask_size_1, bid_price_1, bid_size_1, ... (up to N levels)
162
  - Prices in fixed-point (multiply by 10^-4)
163
 
164
  ## Usage
165
 
166
  ```python
167
+ from datasets import load_dataset
168
+
169
+ # Load a specific ticker configuration
170
+ dataset = load_dataset("your-username/lobster-sample-data", "AAPL_10levels")
171
+
172
+ # Access message data
173
+ messages = dataset["message"]
174
+
175
+ # Access orderbook data
176
+ orderbooks = dataset["orderbook"]
 
 
 
 
 
 
 
 
 
 
177
  ```
178
 
179
+ ## Source
180
 
181
+ Data provided by [LOBSTER](https://lobsterdata.com/) - Limited Order Book System.