@usherlabs/cex-broker 0.2.46 → 0.2.48
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.d.ts +23 -0
- package/dist/commands/cex-canonical-orderbook-export.js +27731 -0
- package/dist/commands/cex-canonical-orderbook-export.js.map +247 -0
- package/dist/commands/market-data-vendor-backfill.d.ts +24 -0
- package/dist/commands/market-data-vendor-backfill.js +33316 -0
- package/dist/commands/market-data-vendor-backfill.js.map +279 -0
- package/dist/helpers/canonical-orderbook-export/exact-selection.d.ts +21 -0
- package/dist/helpers/canonical-orderbook-export/exporter.d.ts +26 -0
- package/dist/helpers/market-data-preparation/conformance-fixtures.d.ts +16 -0
- package/dist/helpers/market-data-preparation/contracts.d.ts +1690 -0
- package/dist/helpers/market-data-preparation/file-job.d.ts +38 -0
- package/dist/market-data-preparation/fixtures/conformance-v2.json +424 -0
- package/dist/market-data-preparation/policies/capability-policy.json +28 -0
- package/dist/market-data-preparation/policies/resource-policy.json +16 -0
- package/dist/market-data-preparation/schema-manifest.json +46 -0
- package/dist/market-data-preparation/schemas/archive-selection-v1.schema.json +224 -0
- package/dist/market-data-preparation/schemas/backfill-request-v1.schema.json +166 -0
- package/dist/market-data-preparation/schemas/backfill-result-v2.schema.json +212 -0
- package/dist/market-data-preparation/schemas/canonical-orderbook-export-request-v1.schema.json +57 -0
- package/dist/market-data-preparation/schemas/canonical-orderbook-export-result-v1.schema.json +238 -0
- package/dist/market-data-preparation/schemas/preparation-product-pin-v1.schema.json +126 -0
- package/dist/market-data-preparation/schemas/promotion-receipt-v1.schema.json +171 -0
- package/dist/market-data-preparation/schemas/required-clock-v1.schema.json +47 -0
- package/dist/market-data-preparation.d.ts +4 -0
- package/dist/market-data-preparation.js +27569 -0
- package/dist/market-data-preparation.js.map +249 -0
- package/dist/market-data-vendor-backfill.js +32 -1
- package/dist/market-data-vendor-backfill.js.map +3 -3
- package/package.json +15 -3
|
@@ -13169,6 +13169,37 @@ class QualifiedOrderBookArchiveReader {
|
|
|
13169
13169
|
environment: String(identityRows[0]?.environment ?? ""),
|
|
13170
13170
|
cluster: String(identityRows[0]?.cluster ?? "")
|
|
13171
13171
|
};
|
|
13172
|
+
const conflictRows = await archiveQuery(this.client, "archive_selection_conflict_query_failed", `SELECT count() AS conflicts
|
|
13173
|
+
FROM
|
|
13174
|
+
(
|
|
13175
|
+
SELECT conflict.capture_bundle_id, conflict.snapshot_id
|
|
13176
|
+
FROM market_data.cex_order_book_levels_conflicts AS conflict
|
|
13177
|
+
INNER JOIN
|
|
13178
|
+
(
|
|
13179
|
+
SELECT DISTINCT capture_bundle_id, snapshot_id
|
|
13180
|
+
FROM market_data.cex_order_book_depth_summary
|
|
13181
|
+
WHERE ${scopeFilter()}
|
|
13182
|
+
AND source_time_ms >= {start_time_ms:UInt64}
|
|
13183
|
+
AND source_time_ms < {end_time_ms:UInt64}
|
|
13184
|
+
) AS selected USING (capture_bundle_id, snapshot_id)
|
|
13185
|
+
UNION ALL
|
|
13186
|
+
SELECT conflict.capture_bundle_id, conflict.snapshot_id
|
|
13187
|
+
FROM market_data.cex_order_book_depth_summary_conflicts AS conflict
|
|
13188
|
+
INNER JOIN
|
|
13189
|
+
(
|
|
13190
|
+
SELECT DISTINCT capture_bundle_id, snapshot_id
|
|
13191
|
+
FROM market_data.cex_order_book_depth_summary
|
|
13192
|
+
WHERE ${scopeFilter()}
|
|
13193
|
+
AND source_time_ms >= {start_time_ms:UInt64}
|
|
13194
|
+
AND source_time_ms < {end_time_ms:UInt64}
|
|
13195
|
+
) AS selected USING (capture_bundle_id, snapshot_id)
|
|
13196
|
+
)`, queryParameters(request));
|
|
13197
|
+
if (conflictRows.length !== 1 || !Number.isSafeInteger(Number(conflictRows[0]?.conflicts)) || Number(conflictRows[0]?.conflicts) < 0) {
|
|
13198
|
+
throw new ArchiveReaderError("archive_selection_conflict_query_invalid");
|
|
13199
|
+
}
|
|
13200
|
+
if (Number(conflictRows[0]?.conflicts) > 0) {
|
|
13201
|
+
throw new ArchiveReaderError("archive_selection_checksum_conflict");
|
|
13202
|
+
}
|
|
13172
13203
|
const storedRows = await archiveQuery(this.client, "archive_stored_selection_query_failed", `SELECT selection_sha256, selection_json
|
|
13173
13204
|
FROM market_data.cex_order_book_archive_selections
|
|
13174
13205
|
WHERE idempotency_key = {idempotency_key:String}
|
|
@@ -18816,4 +18847,4 @@ export {
|
|
|
18816
18847
|
ACQUISITION_POLICY_ID
|
|
18817
18848
|
};
|
|
18818
18849
|
|
|
18819
|
-
//# debugId=
|
|
18850
|
+
//# debugId=75C87110D96E1B9B64756E2164756E21
|