@usherlabs/cex-broker 0.2.52 → 0.3.0

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.
Files changed (144) hide show
  1. package/dist/commands/cli.js +364 -71
  2. package/dist/index.js +365 -72
  3. package/dist/index.js.map +14 -13
  4. package/package.json +5 -28
  5. package/dist/commands/cex-canonical-orderbook-export.d.ts +0 -23
  6. package/dist/commands/cex-canonical-orderbook-export.js +0 -34275
  7. package/dist/commands/cex-canonical-orderbook-export.js.map +0 -266
  8. package/dist/commands/market-data-vendor-backfill.d.ts +0 -24
  9. package/dist/commands/market-data-vendor-backfill.js +0 -34930
  10. package/dist/commands/market-data-vendor-backfill.js.map +0 -268
  11. package/dist/handlers/execute-action/context.d.ts +0 -50
  12. package/dist/handlers/execute-action/deposit.d.ts +0 -2
  13. package/dist/handlers/execute-action/handler.d.ts +0 -19
  14. package/dist/handlers/execute-action/index.d.ts +0 -10
  15. package/dist/handlers/execute-action/internal-transfer.d.ts +0 -2
  16. package/dist/handlers/execute-action/order-book-call.d.ts +0 -3
  17. package/dist/handlers/execute-action/orders.d.ts +0 -2
  18. package/dist/handlers/execute-action/pass-through.d.ts +0 -2
  19. package/dist/handlers/execute-action/perp-config.d.ts +0 -2
  20. package/dist/handlers/execute-action/registry.d.ts +0 -5
  21. package/dist/handlers/execute-action/treasury-call.d.ts +0 -2
  22. package/dist/handlers/execute-action/withdraw.d.ts +0 -2
  23. package/dist/handlers/subscribe/broker-lifecycle.d.ts +0 -13
  24. package/dist/handlers/subscribe/handler.d.ts +0 -20
  25. package/dist/handlers/subscribe/index.d.ts +0 -2
  26. package/dist/handlers/types.d.ts +0 -23
  27. package/dist/helpers/account-balance-archive-poller.d.ts +0 -19
  28. package/dist/helpers/auth.d.ts +0 -5
  29. package/dist/helpers/balance-update-archive-consumer.d.ts +0 -16
  30. package/dist/helpers/binance-user-data-normalization.d.ts +0 -3
  31. package/dist/helpers/binance-user-data-stream.d.ts +0 -58
  32. package/dist/helpers/broker-execution-archive/capture.d.ts +0 -41
  33. package/dist/helpers/broker-execution-archive/index.d.ts +0 -7
  34. package/dist/helpers/broker-execution-archive/journal-export.d.ts +0 -20
  35. package/dist/helpers/broker-execution-archive/loss-journal.d.ts +0 -36
  36. package/dist/helpers/broker-execution-archive/redact.d.ts +0 -7
  37. package/dist/helpers/broker-execution-archive/rows.d.ts +0 -134
  38. package/dist/helpers/broker-execution-archive/types.d.ts +0 -26
  39. package/dist/helpers/broker-execution-archive/withdrawal-observation-tracker.d.ts +0 -23
  40. package/dist/helpers/broker-execution-archive/writer.d.ts +0 -105
  41. package/dist/helpers/broker.d.ts +0 -38
  42. package/dist/helpers/canonical-orderbook-export/exact-selection.d.ts +0 -21
  43. package/dist/helpers/canonical-orderbook-export/exporter.d.ts +0 -26
  44. package/dist/helpers/canonical-orderbook-export/parquet-projection.d.ts +0 -19
  45. package/dist/helpers/constants.d.ts +0 -36
  46. package/dist/helpers/deposit-archive-poller.d.ts +0 -66
  47. package/dist/helpers/deposit.d.ts +0 -5
  48. package/dist/helpers/exchange-credentials.d.ts +0 -10
  49. package/dist/helpers/fill-archive-poller.d.ts +0 -42
  50. package/dist/helpers/grpc/broker.d.ts +0 -5
  51. package/dist/helpers/grpc/callbacks.d.ts +0 -9
  52. package/dist/helpers/grpc/payload.d.ts +0 -9
  53. package/dist/helpers/grpc/status.d.ts +0 -8
  54. package/dist/helpers/index.d.ts +0 -44
  55. package/dist/helpers/logger.d.ts +0 -13
  56. package/dist/helpers/market-data-archive/canonical-orderbook.d.ts +0 -20
  57. package/dist/helpers/market-data-archive/capture-context.d.ts +0 -53
  58. package/dist/helpers/market-data-archive/capture-contract.d.ts +0 -30
  59. package/dist/helpers/market-data-archive/capture.d.ts +0 -22
  60. package/dist/helpers/market-data-archive/index.d.ts +0 -13
  61. package/dist/helpers/market-data-archive/legacy-migration.d.ts +0 -37
  62. package/dist/helpers/market-data-archive/ohlcv-bar-tracker.d.ts +0 -11
  63. package/dist/helpers/market-data-archive/ohlcv-bootstrap.d.ts +0 -1
  64. package/dist/helpers/market-data-archive/ohlcv-history.d.ts +0 -8
  65. package/dist/helpers/market-data-archive/orderbook-depth.d.ts +0 -5
  66. package/dist/helpers/market-data-archive/orderbook-sampler.d.ts +0 -12
  67. package/dist/helpers/market-data-archive/parse-stream.d.ts +0 -26
  68. package/dist/helpers/market-data-archive/rows.d.ts +0 -14
  69. package/dist/helpers/market-data-archive/types.d.ts +0 -83
  70. package/dist/helpers/market-data-preparation/conformance-fixtures.d.ts +0 -128
  71. package/dist/helpers/market-data-preparation/contracts.d.ts +0 -2970
  72. package/dist/helpers/market-data-preparation/file-job.d.ts +0 -38
  73. package/dist/helpers/market-data-preparation/required-clock-qualification.d.ts +0 -43
  74. package/dist/helpers/market-data-preparation/source-tape-dependencies.d.ts +0 -19
  75. package/dist/helpers/market-data-preparation/source-tape-operation.d.ts +0 -109
  76. package/dist/helpers/market-data-source-forensics.d.ts +0 -400
  77. package/dist/helpers/market-data-vendor-backfill/archive-reader.d.ts +0 -26
  78. package/dist/helpers/market-data-vendor-backfill/batching.d.ts +0 -10
  79. package/dist/helpers/market-data-vendor-backfill/conformance-fixtures.d.ts +0 -78
  80. package/dist/helpers/market-data-vendor-backfill/contracts.d.ts +0 -358
  81. package/dist/helpers/market-data-vendor-backfill/core.d.ts +0 -101
  82. package/dist/helpers/market-data-vendor-backfill/cryptohftdata.d.ts +0 -118
  83. package/dist/helpers/market-data-vendor-backfill/forwarder-client.d.ts +0 -25
  84. package/dist/helpers/market-data-vendor-backfill/identity.d.ts +0 -10
  85. package/dist/helpers/market-data-vendor-backfill/manifests.d.ts +0 -61
  86. package/dist/helpers/market-data-vendor-backfill/promotion.d.ts +0 -10
  87. package/dist/helpers/market-data-vendor-backfill/qualification.d.ts +0 -20
  88. package/dist/helpers/market-data-vendor-backfill/selection.d.ts +0 -30
  89. package/dist/helpers/market-data-vendor-backfill/semantic-verification.d.ts +0 -25
  90. package/dist/helpers/market-type.d.ts +0 -16
  91. package/dist/helpers/order-activity-tracker.d.ts +0 -22
  92. package/dist/helpers/order-book.d.ts +0 -79
  93. package/dist/helpers/order-telemetry.d.ts +0 -50
  94. package/dist/helpers/otel.d.ts +0 -83
  95. package/dist/helpers/passive-order.d.ts +0 -8
  96. package/dist/helpers/public-market-data-feed/identity.d.ts +0 -12
  97. package/dist/helpers/public-market-data-feed/index.d.ts +0 -5
  98. package/dist/helpers/public-market-data-feed/orderbook-coalescing-evidence.d.ts +0 -79
  99. package/dist/helpers/public-market-data-feed/orderbook-profile.d.ts +0 -54
  100. package/dist/helpers/public-market-data-feed/subscriber-buffer.d.ts +0 -31
  101. package/dist/helpers/public-market-data-feed/supervisor.d.ts +0 -82
  102. package/dist/helpers/shared/errors.d.ts +0 -14
  103. package/dist/helpers/shared/guards.d.ts +0 -2
  104. package/dist/helpers/source-tape-sandbox.d.ts +0 -82
  105. package/dist/helpers/source-tape.d.ts +0 -165
  106. package/dist/helpers/stream-health-publisher.d.ts +0 -41
  107. package/dist/helpers/trace-context.d.ts +0 -8
  108. package/dist/helpers/transfer-network.d.ts +0 -12
  109. package/dist/helpers/travel-rule-deposit-reconciler.d.ts +0 -159
  110. package/dist/helpers/travel-rule.d.ts +0 -75
  111. package/dist/helpers/treasury-discovery.d.ts +0 -17
  112. package/dist/helpers/user-asset-archive-poller.d.ts +0 -19
  113. package/dist/helpers/user-data-stream-supervisor.d.ts +0 -27
  114. package/dist/helpers/verity.d.ts +0 -5
  115. package/dist/index.d.ts +0 -56
  116. package/dist/market-data-preparation/fixtures/conformance-v3.json +0 -621
  117. package/dist/market-data-preparation/policies/capability-policy.json +0 -39
  118. package/dist/market-data-preparation/policies/resource-policy.json +0 -16
  119. package/dist/market-data-preparation/policies/source-tape-capability-v1.json +0 -35
  120. package/dist/market-data-preparation/schema-manifest.json +0 -66
  121. package/dist/market-data-preparation/schemas/archive-selection-v1.schema.json +0 -224
  122. package/dist/market-data-preparation/schemas/backfill-request-v1.schema.json +0 -166
  123. package/dist/market-data-preparation/schemas/backfill-result-v2.schema.json +0 -212
  124. package/dist/market-data-preparation/schemas/canonical-orderbook-export-request-v1.schema.json +0 -61
  125. package/dist/market-data-preparation/schemas/canonical-orderbook-export-result-v2.schema.json +0 -252
  126. package/dist/market-data-preparation/schemas/order-book-depth-summary-parquet-projection-v1.schema.json +0 -256
  127. package/dist/market-data-preparation/schemas/order-book-levels-parquet-projection-v1.schema.json +0 -220
  128. package/dist/market-data-preparation/schemas/preparation-product-pin-v2.schema.json +0 -176
  129. package/dist/market-data-preparation/schemas/promotion-receipt-v1.schema.json +0 -175
  130. package/dist/market-data-preparation/schemas/required-clock-v1.schema.json +0 -47
  131. package/dist/market-data-preparation/schemas/source-forensics-ledger-v1.schema.json +0 -463
  132. package/dist/market-data-preparation/schemas/source-qualification-record-v1.schema.json +0 -394
  133. package/dist/market-data-preparation.d.ts +0 -11
  134. package/dist/market-data-preparation.js +0 -37488
  135. package/dist/market-data-preparation.js.map +0 -277
  136. package/dist/market-data-vendor-backfill.d.ts +0 -21
  137. package/dist/market-data-vendor-backfill.js +0 -22463
  138. package/dist/market-data-vendor-backfill.js.map +0 -199
  139. package/dist/proto/node.descriptor.d.ts +0 -127
  140. package/dist/proto-loader-options.d.ts +0 -7
  141. package/dist/proto-package-definition.d.ts +0 -2
  142. package/dist/schemas/action-payloads.d.ts +0 -88
  143. package/dist/server.d.ts +0 -10
  144. package/dist/types.d.ts +0 -100
@@ -1,35 +0,0 @@
1
- {
2
- "policy_id": "market-data-source-tape-capability/v1",
3
- "provider": "cryptohftdata",
4
- "adapter_version": "cryptohftdata-orderbook/v2",
5
- "acquisition_policy_id": "cryptohftdata-hourly-acquisition/v2",
6
- "exchange": "okx",
7
- "market_type": "spot",
8
- "feed": "ORDERBOOK",
9
- "trading_pairs": ["ARB-USDC", "ARB-USDT"],
10
- "construction_mode": "policy_neutral_top_n_state_change_tape/v1",
11
- "canonical_schema_id": "cex-order-book-canonical/v1",
12
- "depth": 100,
13
- "source_window_scan": "complete_independent_of_required_clock",
14
- "provider_object_inventory": "positive_expected_observed_equality",
15
- "state_emission": "initialization_then_every_sequence_valid_state_or_freshness_change",
16
- "state_window": "one_support_state_then_changes_in_half_open_window",
17
- "archive_target": {
18
- "environment": "sandbox",
19
- "cluster": "cex-archive-local"
20
- },
21
- "archive_path": "normal_forwarder_promotion_qualification_selection_exporter_v2",
22
- "submission_bounds": {
23
- "max_states_per_yield": 4,
24
- "max_rows_per_batch": 1000,
25
- "max_bytes_per_batch": 5242880,
26
- "max_in_flight": 1
27
- },
28
- "clickhouse_image": "clickhouse/clickhouse-server:24.8.14.39@sha256:1ffa82edee000a42c09313bd9f1293d94c570aee74babc1b3ca9983a35fa597b",
29
- "clickhouse_server_version": "24.8.14.39",
30
- "projection_schema_ids": [
31
- "https://schemas.usher.so/cex-order-book-levels-parquet-projection/v1",
32
- "https://schemas.usher.so/cex-order-book-depth-summary-parquet-projection/v1"
33
- ],
34
- "policy_sha256": "203300cc7060f018de073fa96eee7ba8210bbd5a768063166c1a7c2b2adcbe05"
35
- }
@@ -1,66 +0,0 @@
1
- {
2
- "schema_id": "https://schemas.usher.so/market-data-vendor-backfill-schema-manifest/v3",
3
- "artifacts": [
4
- {
5
- "schema_id": "https://schemas.usher.so/market-data-vendor-backfill-request/v1",
6
- "path": "schemas/backfill-request-v1.schema.json",
7
- "schema_sha256": "94eea61421e2dbbb77a583d60aa18208debee31bb7284b0a57e844d8ff34e0ad"
8
- },
9
- {
10
- "schema_id": "https://schemas.usher.so/market-data-vendor-backfill-result/v2",
11
- "path": "schemas/backfill-result-v2.schema.json",
12
- "schema_sha256": "31d9768cc34d2b46c4e6e98428dbacb066429d412679f21fea331908db556df4"
13
- },
14
- {
15
- "schema_id": "https://schemas.usher.so/market-data-vendor-backfill-required-clock/v1",
16
- "path": "schemas/required-clock-v1.schema.json",
17
- "schema_sha256": "9f850ddb07aaf4cd339ce60e8c54f80313a090bed1a30c82a6db5877c9b4fbf3"
18
- },
19
- {
20
- "schema_id": "https://schemas.usher.so/market-data-vendor-backfill-archive-selection/v1",
21
- "path": "schemas/archive-selection-v1.schema.json",
22
- "schema_sha256": "1c76ee8579abdaa6f060a14361ed8fe1a93dcf484418b91eede9210d88f99aea"
23
- },
24
- {
25
- "schema_id": "https://schemas.usher.so/market-data-vendor-backfill-promotion-receipt/v1",
26
- "path": "schemas/promotion-receipt-v1.schema.json",
27
- "schema_sha256": "95629b9d6d8544f84d42caac4e40c7995f4933836fbb974cb186d11293739438"
28
- },
29
- {
30
- "schema_id": "https://schemas.usher.so/cex-canonical-orderbook-export-request/v1",
31
- "path": "schemas/canonical-orderbook-export-request-v1.schema.json",
32
- "schema_sha256": "f82096cd3e0fb8d513ad5a9dbdb817d1c6e3e56dbbde745d4d8ff3be7c1528eb"
33
- },
34
- {
35
- "schema_id": "https://schemas.usher.so/cex-canonical-orderbook-export-result/v2",
36
- "path": "schemas/canonical-orderbook-export-result-v2.schema.json",
37
- "schema_sha256": "315dc2c6e00d5504c1152ddf00b1e8eabd18008293eb6aca3e696adc8b0e11d6"
38
- },
39
- {
40
- "schema_id": "cex-market-data-preparation-product-pin/v2",
41
- "path": "schemas/preparation-product-pin-v2.schema.json",
42
- "schema_sha256": "03bb7b0ffc5293a6a2dbceb871ff75fc83e54a979cd22bc2c99e7751b761c833"
43
- },
44
- {
45
- "schema_id": "https://schemas.usher.so/cex-order-book-levels-parquet-projection/v1",
46
- "path": "schemas/order-book-levels-parquet-projection-v1.schema.json",
47
- "schema_sha256": "dbf98aabe22f715388d7fa8d791935a3131fe8d372cfe7041296fd3ace501ffc"
48
- },
49
- {
50
- "schema_id": "https://schemas.usher.so/cex-order-book-depth-summary-parquet-projection/v1",
51
- "path": "schemas/order-book-depth-summary-parquet-projection-v1.schema.json",
52
- "schema_sha256": "7fca0794401e0a8de767c4f70bd3b258e20eee94565060c0749ebcb75588e9d1"
53
- },
54
- {
55
- "schema_id": "https://schemas.usher.so/market-data-source-forensics-ledger/v1",
56
- "path": "schemas/source-forensics-ledger-v1.schema.json",
57
- "schema_sha256": "a0fbe689cb309acaadf8ae432890fc572b4db37763e8cdcf00c06e7307d08e97"
58
- },
59
- {
60
- "schema_id": "https://schemas.usher.so/market-data-source-qualification-record/v1",
61
- "path": "schemas/source-qualification-record-v1.schema.json",
62
- "schema_sha256": "2a9fa7c0b005bcfa79bc03714e0b7dc145cde7ebf071b8ed4ce48bb2ad53abd5"
63
- }
64
- ],
65
- "manifest_sha256": "00fda4a5f67dff1e142af7cf7e37f641a3a960acd6e995530aaf99f8b2f5c7bb"
66
- }
@@ -1,224 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.usher.so/market-data-vendor-backfill-archive-selection/v1",
4
- "title": "Market data vendor backfill archive selection v1",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "required": [
8
- "schema_id",
9
- "selection_sha256",
10
- "scope",
11
- "required_clock",
12
- "coverage_policy",
13
- "source_policy",
14
- "coverage_class",
15
- "requested_intervals",
16
- "selected_intervals",
17
- "precedence",
18
- "bundles",
19
- "support_anchors",
20
- "receipt_ids",
21
- "qualification_event_ids",
22
- "resolved_at"
23
- ],
24
- "properties": {
25
- "schema_id": {
26
- "const": "https://schemas.usher.so/market-data-vendor-backfill-archive-selection/v1"
27
- },
28
- "selection_sha256": { "$ref": "#/$defs/sha256" },
29
- "scope": { "$ref": "#/$defs/scope" },
30
- "required_clock": { "$ref": "#/$defs/clockReference" },
31
- "coverage_policy": { "$ref": "#/$defs/coveragePolicy" },
32
- "source_policy": { "enum": ["authoritative_window", "fill_gaps"] },
33
- "coverage_class": { "enum": ["complete", "partial", "missing"] },
34
- "requested_intervals": {
35
- "type": "array",
36
- "minItems": 1,
37
- "items": { "$ref": "#/$defs/interval" }
38
- },
39
- "selected_intervals": {
40
- "type": "array",
41
- "items": {
42
- "type": "object",
43
- "additionalProperties": false,
44
- "required": [
45
- "start_at",
46
- "end_at",
47
- "capture_bundle_id",
48
- "capture_origin"
49
- ],
50
- "properties": {
51
- "start_at": { "$ref": "#/$defs/timestamp" },
52
- "end_at": { "$ref": "#/$defs/timestamp" },
53
- "capture_bundle_id": { "$ref": "#/$defs/sha256" },
54
- "capture_origin": { "$ref": "#/$defs/captureOrigin" }
55
- }
56
- }
57
- },
58
- "precedence": {
59
- "type": "array",
60
- "minItems": 1,
61
- "maxItems": 2,
62
- "uniqueItems": true,
63
- "items": { "enum": ["archive", "vendor"] }
64
- },
65
- "bundles": {
66
- "type": "array",
67
- "items": {
68
- "type": "object",
69
- "additionalProperties": false,
70
- "required": [
71
- "capture_bundle_id",
72
- "capture_origin",
73
- "interval",
74
- "qualification"
75
- ],
76
- "properties": {
77
- "capture_bundle_id": { "$ref": "#/$defs/sha256" },
78
- "capture_origin": { "$ref": "#/$defs/captureOrigin" },
79
- "interval": { "$ref": "#/$defs/interval" },
80
- "qualification": {
81
- "oneOf": [
82
- { "type": "null" },
83
- {
84
- "type": "object",
85
- "additionalProperties": false,
86
- "required": [
87
- "qualification_event_id",
88
- "state",
89
- "receipt_id",
90
- "promotion_identity_sha256"
91
- ],
92
- "properties": {
93
- "qualification_event_id": { "$ref": "#/$defs/uuid" },
94
- "state": { "const": "qualified" },
95
- "receipt_id": { "$ref": "#/$defs/sha256" },
96
- "promotion_identity_sha256": { "$ref": "#/$defs/sha256" }
97
- }
98
- }
99
- ]
100
- }
101
- }
102
- }
103
- },
104
- "support_anchors": {
105
- "type": "array",
106
- "items": {
107
- "type": "object",
108
- "additionalProperties": false,
109
- "required": [
110
- "capture_bundle_id",
111
- "raw_capture_id",
112
- "snapshot_id",
113
- "source_time",
114
- "normalized_summary_checksum",
115
- "metadata_ref"
116
- ],
117
- "properties": {
118
- "capture_bundle_id": { "$ref": "#/$defs/sha256" },
119
- "raw_capture_id": { "$ref": "#/$defs/sha256" },
120
- "snapshot_id": { "$ref": "#/$defs/sha256" },
121
- "source_time": { "$ref": "#/$defs/timestamp" },
122
- "normalized_summary_checksum": { "$ref": "#/$defs/sha256" },
123
- "metadata_ref": {
124
- "type": "object",
125
- "additionalProperties": false,
126
- "required": [
127
- "capture_origin",
128
- "qualification_event_id",
129
- "receipt_id"
130
- ],
131
- "properties": {
132
- "capture_origin": { "$ref": "#/$defs/captureOrigin" },
133
- "qualification_event_id": {
134
- "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/uuid" }]
135
- },
136
- "receipt_id": {
137
- "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/sha256" }]
138
- }
139
- }
140
- }
141
- }
142
- }
143
- },
144
- "receipt_ids": {
145
- "type": "array",
146
- "uniqueItems": true,
147
- "items": { "$ref": "#/$defs/sha256" }
148
- },
149
- "qualification_event_ids": {
150
- "type": "array",
151
- "uniqueItems": true,
152
- "items": { "$ref": "#/$defs/uuid" }
153
- },
154
- "resolved_at": { "$ref": "#/$defs/timestamp" }
155
- },
156
- "$defs": {
157
- "uuid": {
158
- "type": "string",
159
- "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
160
- },
161
- "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
162
- "timestamp": {
163
- "type": "string",
164
- "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-([0-2][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}Z$"
165
- },
166
- "safeInteger": {
167
- "type": "integer",
168
- "minimum": 0,
169
- "maximum": 9007199254740991
170
- },
171
- "captureOrigin": {
172
- "enum": ["production_capture", "vendor_historical_backfill"]
173
- },
174
- "scope": {
175
- "type": "object",
176
- "additionalProperties": false,
177
- "required": ["exchange", "trading_pair", "market_type", "feed"],
178
- "properties": {
179
- "exchange": {
180
- "type": "string",
181
- "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
182
- },
183
- "trading_pair": { "type": "string", "minLength": 3, "maxLength": 128 },
184
- "market_type": { "enum": ["spot", "swap", "future"] },
185
- "feed": { "const": "ORDERBOOK" }
186
- }
187
- },
188
- "clockReference": {
189
- "type": "object",
190
- "additionalProperties": false,
191
- "required": ["clock_id", "clock_sha256", "event_count"],
192
- "properties": {
193
- "clock_id": { "$ref": "#/$defs/uuid" },
194
- "clock_sha256": { "$ref": "#/$defs/sha256" },
195
- "event_count": { "$ref": "#/$defs/safeInteger" }
196
- }
197
- },
198
- "coveragePolicy": {
199
- "type": "object",
200
- "additionalProperties": false,
201
- "required": [
202
- "policy_id",
203
- "max_asof_lag_ms",
204
- "future_rows",
205
- "missing_required_event"
206
- ],
207
- "properties": {
208
- "policy_id": { "const": "prior-asof-strict/v1" },
209
- "max_asof_lag_ms": { "$ref": "#/$defs/safeInteger" },
210
- "future_rows": { "const": "reject" },
211
- "missing_required_event": { "const": "fail" }
212
- }
213
- },
214
- "interval": {
215
- "type": "object",
216
- "additionalProperties": false,
217
- "required": ["start_at", "end_at"],
218
- "properties": {
219
- "start_at": { "$ref": "#/$defs/timestamp" },
220
- "end_at": { "$ref": "#/$defs/timestamp" }
221
- }
222
- }
223
- }
224
- }
@@ -1,166 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://schemas.usher.so/market-data-vendor-backfill-request/v1",
4
- "title": "Market data vendor backfill request v1",
5
- "type": "object",
6
- "additionalProperties": false,
7
- "required": [
8
- "schema_id",
9
- "request_id",
10
- "attempt_id",
11
- "idempotency_key",
12
- "scope",
13
- "window",
14
- "depth",
15
- "construction_mode",
16
- "source_policy",
17
- "target",
18
- "coverage_policy",
19
- "required_clock",
20
- "initial_selection",
21
- "expected_canonical_schema",
22
- "product_pins",
23
- "production_authorization_id"
24
- ],
25
- "properties": {
26
- "schema_id": {
27
- "const": "https://schemas.usher.so/market-data-vendor-backfill-request/v1"
28
- },
29
- "request_id": { "$ref": "#/$defs/uuid" },
30
- "attempt_id": { "$ref": "#/$defs/uuid" },
31
- "idempotency_key": { "$ref": "#/$defs/sha256" },
32
- "scope": { "$ref": "#/$defs/scope" },
33
- "window": { "$ref": "#/$defs/interval" },
34
- "depth": { "type": "integer", "minimum": 1, "maximum": 500 },
35
- "construction_mode": {
36
- "enum": ["sampled_top_n_snapshot", "exact_l2_reconstruction"]
37
- },
38
- "source_policy": { "enum": ["authoritative_window", "fill_gaps"] },
39
- "target": {
40
- "type": "object",
41
- "additionalProperties": false,
42
- "required": ["environment", "cluster"],
43
- "properties": {
44
- "environment": {
45
- "type": "string",
46
- "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
47
- },
48
- "cluster": {
49
- "type": "string",
50
- "pattern": "^[a-z0-9][a-z0-9_-]{0,127}$"
51
- }
52
- }
53
- },
54
- "coverage_policy": { "$ref": "#/$defs/coveragePolicy" },
55
- "required_clock": {
56
- "type": "object",
57
- "additionalProperties": false,
58
- "required": [
59
- "schema_id",
60
- "clock_id",
61
- "file_name",
62
- "clock_sha256",
63
- "event_count"
64
- ],
65
- "properties": {
66
- "schema_id": {
67
- "const": "https://schemas.usher.so/market-data-vendor-backfill-required-clock/v1"
68
- },
69
- "clock_id": { "$ref": "#/$defs/uuid" },
70
- "file_name": {
71
- "type": "string",
72
- "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,254}$"
73
- },
74
- "clock_sha256": { "$ref": "#/$defs/sha256" },
75
- "event_count": { "$ref": "#/$defs/safeInteger" }
76
- }
77
- },
78
- "initial_selection": {
79
- "$ref": "https://schemas.usher.so/market-data-vendor-backfill-archive-selection/v1"
80
- },
81
- "expected_canonical_schema": { "$ref": "#/$defs/artifactPin" },
82
- "product_pins": {
83
- "type": "object",
84
- "additionalProperties": false,
85
- "required": ["capability_policy", "resource_policy"],
86
- "properties": {
87
- "capability_policy": { "$ref": "#/$defs/policyPin" },
88
- "resource_policy": { "$ref": "#/$defs/policyPin" }
89
- }
90
- },
91
- "production_authorization_id": { "$ref": "#/$defs/uuid" }
92
- },
93
- "$defs": {
94
- "uuid": {
95
- "type": "string",
96
- "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
97
- },
98
- "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
99
- "timestamp": {
100
- "type": "string",
101
- "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])-([0-2][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}Z$"
102
- },
103
- "safeInteger": {
104
- "type": "integer",
105
- "minimum": 0,
106
- "maximum": 9007199254740991
107
- },
108
- "scope": {
109
- "type": "object",
110
- "additionalProperties": false,
111
- "required": ["exchange", "trading_pair", "market_type", "feed"],
112
- "properties": {
113
- "exchange": {
114
- "type": "string",
115
- "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
116
- },
117
- "trading_pair": { "type": "string", "minLength": 3, "maxLength": 128 },
118
- "market_type": { "enum": ["spot", "swap", "future"] },
119
- "feed": { "const": "ORDERBOOK" }
120
- }
121
- },
122
- "interval": {
123
- "type": "object",
124
- "additionalProperties": false,
125
- "required": ["start_at", "end_at"],
126
- "properties": {
127
- "start_at": { "$ref": "#/$defs/timestamp" },
128
- "end_at": { "$ref": "#/$defs/timestamp" }
129
- }
130
- },
131
- "coveragePolicy": {
132
- "type": "object",
133
- "additionalProperties": false,
134
- "required": [
135
- "policy_id",
136
- "max_asof_lag_ms",
137
- "future_rows",
138
- "missing_required_event"
139
- ],
140
- "properties": {
141
- "policy_id": { "const": "prior-asof-strict/v1" },
142
- "max_asof_lag_ms": { "$ref": "#/$defs/safeInteger" },
143
- "future_rows": { "const": "reject" },
144
- "missing_required_event": { "const": "fail" }
145
- }
146
- },
147
- "artifactPin": {
148
- "type": "object",
149
- "additionalProperties": false,
150
- "required": ["schema_id", "schema_sha256"],
151
- "properties": {
152
- "schema_id": { "type": "string", "minLength": 1, "maxLength": 256 },
153
- "schema_sha256": { "$ref": "#/$defs/sha256" }
154
- }
155
- },
156
- "policyPin": {
157
- "type": "object",
158
- "additionalProperties": false,
159
- "required": ["policy_id", "policy_sha256"],
160
- "properties": {
161
- "policy_id": { "type": "string", "minLength": 1, "maxLength": 256 },
162
- "policy_sha256": { "$ref": "#/$defs/sha256" }
163
- }
164
- }
165
- }
166
- }