@usherlabs/cex-broker 0.2.49 → 0.2.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/cex-canonical-orderbook-export.js +7747 -883
- package/dist/commands/cex-canonical-orderbook-export.js.map +41 -10
- package/dist/commands/cli.js +127 -34
- package/dist/commands/market-data-vendor-backfill.js +8284 -6391
- package/dist/commands/market-data-vendor-backfill.js.map +16 -15
- package/dist/helpers/canonical-orderbook-export/parquet-projection.d.ts +19 -0
- package/dist/helpers/market-data-archive/canonical-orderbook.d.ts +1 -1
- package/dist/helpers/market-data-preparation/conformance-fixtures.d.ts +114 -2
- package/dist/helpers/market-data-preparation/contracts.d.ts +1298 -18
- package/dist/helpers/market-data-preparation/required-clock-qualification.d.ts +43 -0
- package/dist/helpers/market-data-preparation/source-tape-dependencies.d.ts +19 -0
- package/dist/helpers/market-data-preparation/source-tape-operation.d.ts +109 -0
- package/dist/helpers/market-data-source-forensics.d.ts +400 -0
- package/dist/helpers/market-data-vendor-backfill/conformance-fixtures.d.ts +3 -5
- package/dist/helpers/market-data-vendor-backfill/contracts.d.ts +21 -56
- package/dist/helpers/market-data-vendor-backfill/core.d.ts +1 -0
- package/dist/helpers/market-data-vendor-backfill/cryptohftdata.d.ts +45 -5
- package/dist/helpers/market-data-vendor-backfill/manifests.d.ts +31 -1083
- package/dist/helpers/market-data-vendor-backfill/promotion.d.ts +1 -0
- package/dist/helpers/source-tape-sandbox.d.ts +82 -0
- package/dist/helpers/source-tape.d.ts +165 -0
- package/dist/helpers/trace-context.d.ts +8 -0
- package/dist/index.js +128 -35
- package/dist/index.js.map +7 -6
- package/dist/market-data-preparation/fixtures/{conformance-v2.json → conformance-v3.json} +257 -60
- package/dist/market-data-preparation/policies/capability-policy.json +15 -4
- package/dist/market-data-preparation/policies/resource-policy.json +3 -3
- package/dist/market-data-preparation/policies/source-tape-capability-v1.json +35 -0
- package/dist/market-data-preparation/schema-manifest.json +30 -10
- package/dist/market-data-preparation/schemas/canonical-orderbook-export-request-v1.schema.json +5 -1
- package/dist/market-data-preparation/schemas/{canonical-orderbook-export-result-v1.schema.json → canonical-orderbook-export-result-v2.schema.json} +20 -6
- package/dist/market-data-preparation/schemas/order-book-depth-summary-parquet-projection-v1.schema.json +256 -0
- package/dist/market-data-preparation/schemas/order-book-levels-parquet-projection-v1.schema.json +220 -0
- package/dist/market-data-preparation/schemas/{preparation-product-pin-v1.schema.json → preparation-product-pin-v2.schema.json} +59 -9
- package/dist/market-data-preparation/schemas/promotion-receipt-v1.schema.json +5 -1
- package/dist/market-data-preparation/schemas/source-forensics-ledger-v1.schema.json +463 -0
- package/dist/market-data-preparation/schemas/source-qualification-record-v1.schema.json +394 -0
- package/dist/market-data-preparation.d.ts +7 -0
- package/dist/market-data-preparation.js +35443 -25203
- package/dist/market-data-preparation.js.map +118 -78
- package/dist/market-data-vendor-backfill.d.ts +8 -5
- package/dist/market-data-vendor-backfill.js +19444 -15553
- package/dist/market-data-vendor-backfill.js.map +65 -60
- package/package.json +1 -5
- package/dist/market-data-preparation/policies/capability-policy-v1.json +0 -28
- package/dist/market-data-vendor-backfill/fixtures/conformance-v1.json +0 -448
- package/dist/market-data-vendor-backfill/policies/capability-policy-v2.json +0 -28
- package/dist/market-data-vendor-backfill/policies/capability-policy.json +0 -28
- package/dist/market-data-vendor-backfill/policies/resource-policy.json +0 -16
- package/dist/market-data-vendor-backfill/schema-manifest.json +0 -31
- package/dist/market-data-vendor-backfill/schemas/archive-selection.schema.json +0 -224
- package/dist/market-data-vendor-backfill/schemas/promotion-receipt.schema.json +0 -171
- package/dist/market-data-vendor-backfill/schemas/request.schema.json +0 -166
- package/dist/market-data-vendor-backfill/schemas/required-clock.schema.json +0 -47
- package/dist/market-data-vendor-backfill/schemas/result.schema.json +0 -198
package/dist/market-data-preparation/schemas/canonical-orderbook-export-request-v1.schema.json
CHANGED
|
@@ -25,7 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"depth": { "type": "integer", "minimum": 1, "maximum": 500 },
|
|
27
27
|
"construction_mode": {
|
|
28
|
-
"enum": [
|
|
28
|
+
"enum": [
|
|
29
|
+
"sampled_top_n_snapshot",
|
|
30
|
+
"exact_l2_reconstruction",
|
|
31
|
+
"policy_neutral_top_n_state_change_tape/v1"
|
|
32
|
+
]
|
|
29
33
|
},
|
|
30
34
|
"canonical_schema_version": {
|
|
31
35
|
"type": "string",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://schemas.usher.so/cex-canonical-orderbook-export-result/
|
|
4
|
-
"title": "CEX canonical order-book exact-selection export result
|
|
3
|
+
"$id": "https://schemas.usher.so/cex-canonical-orderbook-export-result/v2",
|
|
4
|
+
"title": "CEX canonical order-book exact-selection export result v2",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": false,
|
|
7
7
|
"required": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"properties": {
|
|
18
18
|
"schema_id": {
|
|
19
|
-
"const": "https://schemas.usher.so/cex-canonical-orderbook-export-result/
|
|
19
|
+
"const": "https://schemas.usher.so/cex-canonical-orderbook-export-result/v2"
|
|
20
20
|
},
|
|
21
21
|
"result_sha256": { "$ref": "#/$defs/sha256" },
|
|
22
22
|
"job_id": { "$ref": "#/$defs/uuid" },
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
],
|
|
177
177
|
"properties": {
|
|
178
178
|
"product_id": { "const": "cex-canonical-orderbook-export" },
|
|
179
|
-
"product_version": { "const": "cex-canonical-orderbook-export/
|
|
179
|
+
"product_version": { "const": "cex-canonical-orderbook-export/v2" },
|
|
180
180
|
"package": {
|
|
181
181
|
"type": "object",
|
|
182
182
|
"additionalProperties": false,
|
|
@@ -215,7 +215,14 @@
|
|
|
215
215
|
"artifact": {
|
|
216
216
|
"type": "object",
|
|
217
217
|
"additionalProperties": false,
|
|
218
|
-
"required": [
|
|
218
|
+
"required": [
|
|
219
|
+
"file_name",
|
|
220
|
+
"rows",
|
|
221
|
+
"bytes",
|
|
222
|
+
"sha256",
|
|
223
|
+
"projection_schema_id",
|
|
224
|
+
"projection_schema_sha256"
|
|
225
|
+
],
|
|
219
226
|
"properties": {
|
|
220
227
|
"file_name": {
|
|
221
228
|
"type": "string",
|
|
@@ -231,7 +238,14 @@
|
|
|
231
238
|
"minimum": 8,
|
|
232
239
|
"maximum": 9007199254740991
|
|
233
240
|
},
|
|
234
|
-
"sha256": { "$ref": "#/$defs/sha256" }
|
|
241
|
+
"sha256": { "$ref": "#/$defs/sha256" },
|
|
242
|
+
"projection_schema_id": {
|
|
243
|
+
"enum": [
|
|
244
|
+
"https://schemas.usher.so/cex-order-book-levels-parquet-projection/v1",
|
|
245
|
+
"https://schemas.usher.so/cex-order-book-depth-summary-parquet-projection/v1"
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
"projection_schema_sha256": { "$ref": "#/$defs/sha256" }
|
|
235
249
|
}
|
|
236
250
|
}
|
|
237
251
|
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.usher.so/cex-order-book-depth-summary-parquet-projection/v1",
|
|
4
|
+
"title": "CEX order-book depth-summary Parquet capture-core projection v1",
|
|
5
|
+
"canonical_schema_id": "cex-order-book-canonical/v1",
|
|
6
|
+
"file_name": "order_book_depth_summary.parquet",
|
|
7
|
+
"parquet_metadata": {
|
|
8
|
+
"key_value_metadata": []
|
|
9
|
+
},
|
|
10
|
+
"columns": [
|
|
11
|
+
{
|
|
12
|
+
"name": "source",
|
|
13
|
+
"physical_type": "BYTE_ARRAY",
|
|
14
|
+
"logical_type": "UTF8",
|
|
15
|
+
"nullable": false
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "deployment_id",
|
|
19
|
+
"physical_type": "BYTE_ARRAY",
|
|
20
|
+
"logical_type": "UTF8",
|
|
21
|
+
"nullable": false
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "capture_bundle_id",
|
|
25
|
+
"physical_type": "BYTE_ARRAY",
|
|
26
|
+
"logical_type": "UTF8",
|
|
27
|
+
"nullable": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "exchange",
|
|
31
|
+
"physical_type": "BYTE_ARRAY",
|
|
32
|
+
"logical_type": "UTF8",
|
|
33
|
+
"nullable": false
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "symbol",
|
|
37
|
+
"physical_type": "BYTE_ARRAY",
|
|
38
|
+
"logical_type": "UTF8",
|
|
39
|
+
"nullable": false
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "trading_pair",
|
|
43
|
+
"physical_type": "BYTE_ARRAY",
|
|
44
|
+
"logical_type": "UTF8",
|
|
45
|
+
"nullable": false
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "source_symbol",
|
|
49
|
+
"physical_type": "BYTE_ARRAY",
|
|
50
|
+
"logical_type": "UTF8",
|
|
51
|
+
"nullable": false
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "asset_type",
|
|
55
|
+
"physical_type": "BYTE_ARRAY",
|
|
56
|
+
"logical_type": "UTF8",
|
|
57
|
+
"nullable": false
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "feed",
|
|
61
|
+
"physical_type": "BYTE_ARRAY",
|
|
62
|
+
"logical_type": "UTF8",
|
|
63
|
+
"nullable": false
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "provider",
|
|
67
|
+
"physical_type": "BYTE_ARRAY",
|
|
68
|
+
"logical_type": "UTF8",
|
|
69
|
+
"nullable": false
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "source_mode",
|
|
73
|
+
"physical_type": "BYTE_ARRAY",
|
|
74
|
+
"logical_type": "UTF8",
|
|
75
|
+
"nullable": false
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "capture_origin",
|
|
79
|
+
"physical_type": "BYTE_ARRAY",
|
|
80
|
+
"logical_type": "UTF8",
|
|
81
|
+
"nullable": false
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "source_time_ms",
|
|
85
|
+
"physical_type": "INT64",
|
|
86
|
+
"logical_type": "UINT_64",
|
|
87
|
+
"nullable": false
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "received_time_ms",
|
|
91
|
+
"physical_type": "INT64",
|
|
92
|
+
"logical_type": "UINT_64",
|
|
93
|
+
"nullable": false
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "raw_capture_id",
|
|
97
|
+
"physical_type": "BYTE_ARRAY",
|
|
98
|
+
"logical_type": "UTF8",
|
|
99
|
+
"nullable": true
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "raw_capture_scope",
|
|
103
|
+
"physical_type": "BYTE_ARRAY",
|
|
104
|
+
"logical_type": "UTF8",
|
|
105
|
+
"nullable": true
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "schema_version",
|
|
109
|
+
"physical_type": "BYTE_ARRAY",
|
|
110
|
+
"logical_type": "UTF8",
|
|
111
|
+
"nullable": false
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "checksum_algorithm",
|
|
115
|
+
"physical_type": "BYTE_ARRAY",
|
|
116
|
+
"logical_type": "UTF8",
|
|
117
|
+
"nullable": false
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "raw_checksum",
|
|
121
|
+
"physical_type": "BYTE_ARRAY",
|
|
122
|
+
"logical_type": "UTF8",
|
|
123
|
+
"nullable": true
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "provenance_complete",
|
|
127
|
+
"physical_type": "INT32",
|
|
128
|
+
"logical_type": "UINT_8",
|
|
129
|
+
"nullable": false
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "snapshot_id",
|
|
133
|
+
"physical_type": "BYTE_ARRAY",
|
|
134
|
+
"logical_type": "UTF8",
|
|
135
|
+
"nullable": false
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "construction_mode",
|
|
139
|
+
"physical_type": "BYTE_ARRAY",
|
|
140
|
+
"logical_type": "UTF8",
|
|
141
|
+
"nullable": false
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "gap_policy",
|
|
145
|
+
"physical_type": "BYTE_ARRAY",
|
|
146
|
+
"logical_type": "UTF8",
|
|
147
|
+
"nullable": false
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "depth_limit",
|
|
151
|
+
"physical_type": "INT32",
|
|
152
|
+
"logical_type": "UINT_16",
|
|
153
|
+
"nullable": false
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "sequence",
|
|
157
|
+
"physical_type": "INT64",
|
|
158
|
+
"logical_type": "UINT_64",
|
|
159
|
+
"nullable": true
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "exact_l2_reconstruction_complete",
|
|
163
|
+
"physical_type": "INT32",
|
|
164
|
+
"logical_type": "UINT_8",
|
|
165
|
+
"nullable": false
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "best_bid",
|
|
169
|
+
"physical_type": "FIXED_LEN_BYTE_ARRAY",
|
|
170
|
+
"logical_type": "DECIMAL(38,18)",
|
|
171
|
+
"nullable": false
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "best_ask",
|
|
175
|
+
"physical_type": "FIXED_LEN_BYTE_ARRAY",
|
|
176
|
+
"logical_type": "DECIMAL(38,18)",
|
|
177
|
+
"nullable": false
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "best_bid_amount",
|
|
181
|
+
"physical_type": "FIXED_LEN_BYTE_ARRAY",
|
|
182
|
+
"logical_type": "DECIMAL(38,18)",
|
|
183
|
+
"nullable": false
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "best_ask_amount",
|
|
187
|
+
"physical_type": "FIXED_LEN_BYTE_ARRAY",
|
|
188
|
+
"logical_type": "DECIMAL(38,18)",
|
|
189
|
+
"nullable": false
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "mid_price",
|
|
193
|
+
"physical_type": "FIXED_LEN_BYTE_ARRAY",
|
|
194
|
+
"logical_type": "DECIMAL(38,18)",
|
|
195
|
+
"nullable": false
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "spread",
|
|
199
|
+
"physical_type": "FIXED_LEN_BYTE_ARRAY",
|
|
200
|
+
"logical_type": "DECIMAL(38,18)",
|
|
201
|
+
"nullable": false
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "spread_bps",
|
|
205
|
+
"physical_type": "DOUBLE",
|
|
206
|
+
"logical_type": null,
|
|
207
|
+
"nullable": false
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"name": "staleness_ms",
|
|
211
|
+
"physical_type": "INT64",
|
|
212
|
+
"logical_type": "UINT_64",
|
|
213
|
+
"nullable": false
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "bid_level_count",
|
|
217
|
+
"physical_type": "INT32",
|
|
218
|
+
"logical_type": "UINT_16",
|
|
219
|
+
"nullable": false
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"name": "ask_level_count",
|
|
223
|
+
"physical_type": "INT32",
|
|
224
|
+
"logical_type": "UINT_16",
|
|
225
|
+
"nullable": false
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"name": "measurement_bands_bps",
|
|
229
|
+
"physical_type": "LIST",
|
|
230
|
+
"logical_type": "LIST<UINT_32>",
|
|
231
|
+
"nullable": false
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "bid_depth_by_band",
|
|
235
|
+
"physical_type": "LIST",
|
|
236
|
+
"logical_type": "LIST<DECIMAL(38,18)>",
|
|
237
|
+
"nullable": false
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"name": "ask_depth_by_band",
|
|
241
|
+
"physical_type": "LIST",
|
|
242
|
+
"logical_type": "LIST<DECIMAL(38,18)>",
|
|
243
|
+
"nullable": false
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"name": "normalized_row_checksum",
|
|
247
|
+
"physical_type": "BYTE_ARRAY",
|
|
248
|
+
"logical_type": "UTF8",
|
|
249
|
+
"nullable": false
|
|
250
|
+
}
|
|
251
|
+
],
|
|
252
|
+
"metadata": {
|
|
253
|
+
"cex.canonical_schema_id": "cex-order-book-canonical/v1",
|
|
254
|
+
"cex.projection_schema_id": "https://schemas.usher.so/cex-order-book-depth-summary-parquet-projection/v1"
|
|
255
|
+
}
|
|
256
|
+
}
|
package/dist/market-data-preparation/schemas/order-book-levels-parquet-projection-v1.schema.json
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schemas.usher.so/cex-order-book-levels-parquet-projection/v1",
|
|
4
|
+
"title": "CEX order-book levels Parquet capture-core projection v1",
|
|
5
|
+
"canonical_schema_id": "cex-order-book-canonical/v1",
|
|
6
|
+
"file_name": "order_book_levels.parquet",
|
|
7
|
+
"parquet_metadata": {
|
|
8
|
+
"key_value_metadata": []
|
|
9
|
+
},
|
|
10
|
+
"columns": [
|
|
11
|
+
{
|
|
12
|
+
"name": "source",
|
|
13
|
+
"physical_type": "BYTE_ARRAY",
|
|
14
|
+
"logical_type": "UTF8",
|
|
15
|
+
"nullable": false
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "deployment_id",
|
|
19
|
+
"physical_type": "BYTE_ARRAY",
|
|
20
|
+
"logical_type": "UTF8",
|
|
21
|
+
"nullable": false
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "capture_bundle_id",
|
|
25
|
+
"physical_type": "BYTE_ARRAY",
|
|
26
|
+
"logical_type": "UTF8",
|
|
27
|
+
"nullable": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "exchange",
|
|
31
|
+
"physical_type": "BYTE_ARRAY",
|
|
32
|
+
"logical_type": "UTF8",
|
|
33
|
+
"nullable": false
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "symbol",
|
|
37
|
+
"physical_type": "BYTE_ARRAY",
|
|
38
|
+
"logical_type": "UTF8",
|
|
39
|
+
"nullable": false
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "trading_pair",
|
|
43
|
+
"physical_type": "BYTE_ARRAY",
|
|
44
|
+
"logical_type": "UTF8",
|
|
45
|
+
"nullable": false
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "source_symbol",
|
|
49
|
+
"physical_type": "BYTE_ARRAY",
|
|
50
|
+
"logical_type": "UTF8",
|
|
51
|
+
"nullable": false
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "asset_type",
|
|
55
|
+
"physical_type": "BYTE_ARRAY",
|
|
56
|
+
"logical_type": "UTF8",
|
|
57
|
+
"nullable": false
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "feed",
|
|
61
|
+
"physical_type": "BYTE_ARRAY",
|
|
62
|
+
"logical_type": "UTF8",
|
|
63
|
+
"nullable": false
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "provider",
|
|
67
|
+
"physical_type": "BYTE_ARRAY",
|
|
68
|
+
"logical_type": "UTF8",
|
|
69
|
+
"nullable": false
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "source_mode",
|
|
73
|
+
"physical_type": "BYTE_ARRAY",
|
|
74
|
+
"logical_type": "UTF8",
|
|
75
|
+
"nullable": false
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "capture_origin",
|
|
79
|
+
"physical_type": "BYTE_ARRAY",
|
|
80
|
+
"logical_type": "UTF8",
|
|
81
|
+
"nullable": false
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "source_time_ms",
|
|
85
|
+
"physical_type": "INT64",
|
|
86
|
+
"logical_type": "UINT_64",
|
|
87
|
+
"nullable": false
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "received_time_ms",
|
|
91
|
+
"physical_type": "INT64",
|
|
92
|
+
"logical_type": "UINT_64",
|
|
93
|
+
"nullable": false
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "raw_capture_id",
|
|
97
|
+
"physical_type": "BYTE_ARRAY",
|
|
98
|
+
"logical_type": "UTF8",
|
|
99
|
+
"nullable": true
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "raw_capture_scope",
|
|
103
|
+
"physical_type": "BYTE_ARRAY",
|
|
104
|
+
"logical_type": "UTF8",
|
|
105
|
+
"nullable": true
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "schema_version",
|
|
109
|
+
"physical_type": "BYTE_ARRAY",
|
|
110
|
+
"logical_type": "UTF8",
|
|
111
|
+
"nullable": false
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "checksum_algorithm",
|
|
115
|
+
"physical_type": "BYTE_ARRAY",
|
|
116
|
+
"logical_type": "UTF8",
|
|
117
|
+
"nullable": false
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"name": "raw_checksum",
|
|
121
|
+
"physical_type": "BYTE_ARRAY",
|
|
122
|
+
"logical_type": "UTF8",
|
|
123
|
+
"nullable": true
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "provenance_complete",
|
|
127
|
+
"physical_type": "INT32",
|
|
128
|
+
"logical_type": "UINT_8",
|
|
129
|
+
"nullable": false
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "snapshot_id",
|
|
133
|
+
"physical_type": "BYTE_ARRAY",
|
|
134
|
+
"logical_type": "UTF8",
|
|
135
|
+
"nullable": false
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"name": "construction_mode",
|
|
139
|
+
"physical_type": "BYTE_ARRAY",
|
|
140
|
+
"logical_type": "UTF8",
|
|
141
|
+
"nullable": false
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "gap_policy",
|
|
145
|
+
"physical_type": "BYTE_ARRAY",
|
|
146
|
+
"logical_type": "UTF8",
|
|
147
|
+
"nullable": false
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"name": "depth_limit",
|
|
151
|
+
"physical_type": "INT32",
|
|
152
|
+
"logical_type": "UINT_16",
|
|
153
|
+
"nullable": false
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "sequence",
|
|
157
|
+
"physical_type": "INT64",
|
|
158
|
+
"logical_type": "UINT_64",
|
|
159
|
+
"nullable": true
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "exact_l2_reconstruction_complete",
|
|
163
|
+
"physical_type": "INT32",
|
|
164
|
+
"logical_type": "UINT_8",
|
|
165
|
+
"nullable": false
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"name": "side",
|
|
169
|
+
"physical_type": "BYTE_ARRAY",
|
|
170
|
+
"logical_type": "UTF8",
|
|
171
|
+
"nullable": false
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "level_index",
|
|
175
|
+
"physical_type": "INT32",
|
|
176
|
+
"logical_type": "UINT_16",
|
|
177
|
+
"nullable": false
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "price",
|
|
181
|
+
"physical_type": "FIXED_LEN_BYTE_ARRAY",
|
|
182
|
+
"logical_type": "DECIMAL(38,18)",
|
|
183
|
+
"nullable": false
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"name": "amount",
|
|
187
|
+
"physical_type": "FIXED_LEN_BYTE_ARRAY",
|
|
188
|
+
"logical_type": "DECIMAL(38,18)",
|
|
189
|
+
"nullable": false
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "notional",
|
|
193
|
+
"physical_type": "FIXED_LEN_BYTE_ARRAY",
|
|
194
|
+
"logical_type": "DECIMAL(38,18)",
|
|
195
|
+
"nullable": false
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "mid_price",
|
|
199
|
+
"physical_type": "FIXED_LEN_BYTE_ARRAY",
|
|
200
|
+
"logical_type": "DECIMAL(38,18)",
|
|
201
|
+
"nullable": false
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"name": "spread_from_mid_bps",
|
|
205
|
+
"physical_type": "DOUBLE",
|
|
206
|
+
"logical_type": null,
|
|
207
|
+
"nullable": false
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"name": "normalized_row_checksum",
|
|
211
|
+
"physical_type": "BYTE_ARRAY",
|
|
212
|
+
"logical_type": "UTF8",
|
|
213
|
+
"nullable": false
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"metadata": {
|
|
217
|
+
"cex.canonical_schema_id": "cex-order-book-canonical/v1",
|
|
218
|
+
"cex.projection_schema_id": "https://schemas.usher.so/cex-order-book-levels-parquet-projection/v1"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "cex-market-data-preparation-product-pin/
|
|
4
|
-
"title": "CEX market-data preparation product pin
|
|
3
|
+
"$id": "cex-market-data-preparation-product-pin/v2",
|
|
4
|
+
"title": "CEX market-data preparation product pin v2",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": false,
|
|
7
7
|
"required": [
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
"schema_manifest",
|
|
12
12
|
"schema_pins",
|
|
13
13
|
"capability_policy",
|
|
14
|
-
"
|
|
14
|
+
"source_tape_capability",
|
|
15
|
+
"resource_policy",
|
|
16
|
+
"preparation_library"
|
|
15
17
|
],
|
|
16
18
|
"properties": {
|
|
17
|
-
"schema_id": { "const": "cex-market-data-preparation-product-pin/
|
|
19
|
+
"schema_id": { "const": "cex-market-data-preparation-product-pin/v2" },
|
|
18
20
|
"package": {
|
|
19
21
|
"type": "object",
|
|
20
22
|
"additionalProperties": false,
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
"product_version": {
|
|
65
67
|
"enum": [
|
|
66
68
|
"market-data-vendor-backfill/v1",
|
|
67
|
-
"cex-canonical-orderbook-export/
|
|
69
|
+
"cex-canonical-orderbook-export/v2"
|
|
68
70
|
]
|
|
69
71
|
},
|
|
70
72
|
"relative_path": {
|
|
@@ -81,7 +83,7 @@
|
|
|
81
83
|
"required": ["schema_id", "manifest_sha256", "relative_path"],
|
|
82
84
|
"properties": {
|
|
83
85
|
"schema_id": {
|
|
84
|
-
"const": "https://schemas.usher.so/market-data-vendor-backfill-schema-manifest/
|
|
86
|
+
"const": "https://schemas.usher.so/market-data-vendor-backfill-schema-manifest/v3"
|
|
85
87
|
},
|
|
86
88
|
"manifest_sha256": { "$ref": "#/$defs/sha256" },
|
|
87
89
|
"relative_path": {
|
|
@@ -91,8 +93,8 @@
|
|
|
91
93
|
},
|
|
92
94
|
"schema_pins": {
|
|
93
95
|
"type": "array",
|
|
94
|
-
"minItems":
|
|
95
|
-
"maxItems":
|
|
96
|
+
"minItems": 12,
|
|
97
|
+
"maxItems": 12,
|
|
96
98
|
"uniqueItems": true,
|
|
97
99
|
"items": {
|
|
98
100
|
"type": "object",
|
|
@@ -105,7 +107,55 @@
|
|
|
105
107
|
}
|
|
106
108
|
},
|
|
107
109
|
"capability_policy": { "$ref": "#/$defs/policyPin" },
|
|
108
|
-
"
|
|
110
|
+
"source_tape_capability": { "$ref": "#/$defs/policyPin" },
|
|
111
|
+
"resource_policy": { "$ref": "#/$defs/policyPin" },
|
|
112
|
+
"preparation_library": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"additionalProperties": false,
|
|
115
|
+
"required": [
|
|
116
|
+
"exported_subpath",
|
|
117
|
+
"runtime_entry_sha256",
|
|
118
|
+
"declaration_sha256",
|
|
119
|
+
"operations"
|
|
120
|
+
],
|
|
121
|
+
"properties": {
|
|
122
|
+
"exported_subpath": {
|
|
123
|
+
"const": "@usherlabs/cex-broker/market-data-preparation"
|
|
124
|
+
},
|
|
125
|
+
"runtime_entry_sha256": { "$ref": "#/$defs/sha256" },
|
|
126
|
+
"declaration_sha256": { "$ref": "#/$defs/sha256" },
|
|
127
|
+
"operations": {
|
|
128
|
+
"type": "array",
|
|
129
|
+
"prefixItems": [
|
|
130
|
+
{
|
|
131
|
+
"type": "object",
|
|
132
|
+
"additionalProperties": false,
|
|
133
|
+
"required": ["symbol", "operation_id"],
|
|
134
|
+
"properties": {
|
|
135
|
+
"symbol": { "const": "runMarketDataSourceTape" },
|
|
136
|
+
"operation_id": { "const": "market-data-source-tape/v1" }
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "object",
|
|
141
|
+
"additionalProperties": false,
|
|
142
|
+
"required": ["symbol", "operation_id"],
|
|
143
|
+
"properties": {
|
|
144
|
+
"symbol": {
|
|
145
|
+
"const": "runMarketDataRequiredClockQualification"
|
|
146
|
+
},
|
|
147
|
+
"operation_id": {
|
|
148
|
+
"const": "market-data-required-clock-qualification/v1"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"items": false,
|
|
154
|
+
"minItems": 2,
|
|
155
|
+
"maxItems": 2
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
109
159
|
},
|
|
110
160
|
"$defs": {
|
|
111
161
|
"sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
@@ -68,7 +68,11 @@
|
|
|
68
68
|
"window": { "$ref": "#/$defs/interval" },
|
|
69
69
|
"depth": { "type": "integer", "minimum": 1, "maximum": 500 },
|
|
70
70
|
"construction_mode": {
|
|
71
|
-
"enum": [
|
|
71
|
+
"enum": [
|
|
72
|
+
"sampled_top_n_snapshot",
|
|
73
|
+
"exact_l2_reconstruction",
|
|
74
|
+
"policy_neutral_top_n_state_change_tape/v1"
|
|
75
|
+
]
|
|
72
76
|
},
|
|
73
77
|
"canonical_schema": {
|
|
74
78
|
"type": "object",
|