@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.
Files changed (55) hide show
  1. package/dist/commands/cex-canonical-orderbook-export.js +7747 -883
  2. package/dist/commands/cex-canonical-orderbook-export.js.map +41 -10
  3. package/dist/commands/cli.js +127 -34
  4. package/dist/commands/market-data-vendor-backfill.js +8284 -6391
  5. package/dist/commands/market-data-vendor-backfill.js.map +16 -15
  6. package/dist/helpers/canonical-orderbook-export/parquet-projection.d.ts +19 -0
  7. package/dist/helpers/market-data-archive/canonical-orderbook.d.ts +1 -1
  8. package/dist/helpers/market-data-preparation/conformance-fixtures.d.ts +114 -2
  9. package/dist/helpers/market-data-preparation/contracts.d.ts +1298 -18
  10. package/dist/helpers/market-data-preparation/required-clock-qualification.d.ts +43 -0
  11. package/dist/helpers/market-data-preparation/source-tape-dependencies.d.ts +19 -0
  12. package/dist/helpers/market-data-preparation/source-tape-operation.d.ts +109 -0
  13. package/dist/helpers/market-data-source-forensics.d.ts +400 -0
  14. package/dist/helpers/market-data-vendor-backfill/conformance-fixtures.d.ts +3 -5
  15. package/dist/helpers/market-data-vendor-backfill/contracts.d.ts +21 -56
  16. package/dist/helpers/market-data-vendor-backfill/core.d.ts +1 -0
  17. package/dist/helpers/market-data-vendor-backfill/cryptohftdata.d.ts +45 -5
  18. package/dist/helpers/market-data-vendor-backfill/manifests.d.ts +31 -1083
  19. package/dist/helpers/market-data-vendor-backfill/promotion.d.ts +1 -0
  20. package/dist/helpers/source-tape-sandbox.d.ts +82 -0
  21. package/dist/helpers/source-tape.d.ts +165 -0
  22. package/dist/helpers/trace-context.d.ts +8 -0
  23. package/dist/index.js +128 -35
  24. package/dist/index.js.map +7 -6
  25. package/dist/market-data-preparation/fixtures/{conformance-v2.json → conformance-v3.json} +257 -60
  26. package/dist/market-data-preparation/policies/capability-policy.json +15 -4
  27. package/dist/market-data-preparation/policies/resource-policy.json +3 -3
  28. package/dist/market-data-preparation/policies/source-tape-capability-v1.json +35 -0
  29. package/dist/market-data-preparation/schema-manifest.json +30 -10
  30. package/dist/market-data-preparation/schemas/canonical-orderbook-export-request-v1.schema.json +5 -1
  31. package/dist/market-data-preparation/schemas/{canonical-orderbook-export-result-v1.schema.json → canonical-orderbook-export-result-v2.schema.json} +20 -6
  32. package/dist/market-data-preparation/schemas/order-book-depth-summary-parquet-projection-v1.schema.json +256 -0
  33. package/dist/market-data-preparation/schemas/order-book-levels-parquet-projection-v1.schema.json +220 -0
  34. package/dist/market-data-preparation/schemas/{preparation-product-pin-v1.schema.json → preparation-product-pin-v2.schema.json} +59 -9
  35. package/dist/market-data-preparation/schemas/promotion-receipt-v1.schema.json +5 -1
  36. package/dist/market-data-preparation/schemas/source-forensics-ledger-v1.schema.json +463 -0
  37. package/dist/market-data-preparation/schemas/source-qualification-record-v1.schema.json +394 -0
  38. package/dist/market-data-preparation.d.ts +7 -0
  39. package/dist/market-data-preparation.js +35443 -25203
  40. package/dist/market-data-preparation.js.map +118 -78
  41. package/dist/market-data-vendor-backfill.d.ts +8 -5
  42. package/dist/market-data-vendor-backfill.js +19444 -15553
  43. package/dist/market-data-vendor-backfill.js.map +65 -60
  44. package/package.json +1 -5
  45. package/dist/market-data-preparation/policies/capability-policy-v1.json +0 -28
  46. package/dist/market-data-vendor-backfill/fixtures/conformance-v1.json +0 -448
  47. package/dist/market-data-vendor-backfill/policies/capability-policy-v2.json +0 -28
  48. package/dist/market-data-vendor-backfill/policies/capability-policy.json +0 -28
  49. package/dist/market-data-vendor-backfill/policies/resource-policy.json +0 -16
  50. package/dist/market-data-vendor-backfill/schema-manifest.json +0 -31
  51. package/dist/market-data-vendor-backfill/schemas/archive-selection.schema.json +0 -224
  52. package/dist/market-data-vendor-backfill/schemas/promotion-receipt.schema.json +0 -171
  53. package/dist/market-data-vendor-backfill/schemas/request.schema.json +0 -166
  54. package/dist/market-data-vendor-backfill/schemas/required-clock.schema.json +0 -47
  55. package/dist/market-data-vendor-backfill/schemas/result.schema.json +0 -198
@@ -1,16 +1,20 @@
1
- import type { ArchiveSelectionWire, BackfillJobResultWire, FixedUtcTimestamp, LowercaseUuid, Sha256Hex } from "../market-data-vendor-backfill/contracts";
1
+ import type { ArchiveSelectionWire, BackfillOutcomeWire, FixedUtcTimestamp, LowercaseUuid, Sha256Hex } from "../market-data-vendor-backfill/contracts";
2
2
  export declare const BACKFILL_RESULT_V2_SCHEMA_ID: string;
3
3
  export declare const CANONICAL_ORDERBOOK_EXPORT_REQUEST_SCHEMA_ID: string;
4
4
  export declare const CANONICAL_ORDERBOOK_EXPORT_RESULT_SCHEMA_ID: string;
5
5
  export declare const PREPARATION_PRODUCT_PIN_SCHEMA_ID: string;
6
- export declare const PREPARATION_SCHEMA_MANIFEST_V2_ID: "https://schemas.usher.so/market-data-vendor-backfill-schema-manifest/v2";
6
+ export declare const ORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_ID: string;
7
+ export declare const ORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_ID: string;
8
+ export declare const SOURCE_FORENSICS_LEDGER_SCHEMA_ID: string;
9
+ export declare const SOURCE_QUALIFICATION_RECORD_SCHEMA_ID: string;
10
+ export declare const PREPARATION_SCHEMA_MANIFEST_V3_ID: "https://schemas.usher.so/market-data-vendor-backfill-schema-manifest/v3";
7
11
  export type PreparationTarget = {
8
12
  environment: string;
9
13
  cluster: string;
10
14
  };
11
15
  export type PreparationProducerIdentity = {
12
16
  product_id: "market-data-vendor-backfill" | "cex-canonical-orderbook-export";
13
- product_version: "market-data-vendor-backfill/v1" | "cex-canonical-orderbook-export/v1";
17
+ product_version: "market-data-vendor-backfill/v1" | "cex-canonical-orderbook-export/v2";
14
18
  package: {
15
19
  name: "@usherlabs/cex-broker";
16
20
  version: string;
@@ -42,7 +46,7 @@ export type BackfillJobResultV2Wire = {
42
46
  };
43
47
  started_at: FixedUtcTimestamp;
44
48
  completed_at: FixedUtcTimestamp;
45
- outcome: BackfillJobResultWire["outcome"];
49
+ outcome: BackfillOutcomeWire;
46
50
  };
47
51
  export type CanonicalOrderBookExportRequestWire = {
48
52
  schema_id: typeof CANONICAL_ORDERBOOK_EXPORT_REQUEST_SCHEMA_ID;
@@ -50,7 +54,7 @@ export type CanonicalOrderBookExportRequestWire = {
50
54
  target: PreparationTarget;
51
55
  selection: ArchiveSelectionWire;
52
56
  depth: number;
53
- construction_mode: "sampled_top_n_snapshot" | "exact_l2_reconstruction";
57
+ construction_mode: "sampled_top_n_snapshot" | "exact_l2_reconstruction" | "policy_neutral_top_n_state_change_tape/v1";
54
58
  canonical_schema_version: string;
55
59
  checksum_algorithm: "sha256-canonical-json-v1";
56
60
  };
@@ -62,6 +66,8 @@ export type CanonicalOrderBookExportArtifact = {
62
66
  rows: number;
63
67
  bytes: number;
64
68
  sha256: Sha256Hex;
69
+ projection_schema_id: typeof ORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_ID | typeof ORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_ID;
70
+ projection_schema_sha256: Sha256Hex;
65
71
  };
66
72
  export type CanonicalOrderBookExportResultWire = {
67
73
  schema_id: typeof CANONICAL_ORDERBOOK_EXPORT_RESULT_SCHEMA_ID;
@@ -70,7 +76,7 @@ export type CanonicalOrderBookExportResultWire = {
70
76
  request_file_sha256: Sha256Hex | null;
71
77
  producer: PreparationProducerIdentity & {
72
78
  product_id: "cex-canonical-orderbook-export";
73
- product_version: "cex-canonical-orderbook-export/v1";
79
+ product_version: "cex-canonical-orderbook-export/v2";
74
80
  };
75
81
  started_at: FixedUtcTimestamp;
76
82
  completed_at: FixedUtcTimestamp;
@@ -108,7 +114,7 @@ export type PreparationProductPinWire = {
108
114
  executable_sha256: Sha256Hex;
109
115
  }>;
110
116
  schema_manifest: {
111
- schema_id: typeof PREPARATION_SCHEMA_MANIFEST_V2_ID;
117
+ schema_id: typeof PREPARATION_SCHEMA_MANIFEST_V3_ID;
112
118
  manifest_sha256: Sha256Hex;
113
119
  relative_path: "dist/market-data-preparation/schema-manifest.json";
114
120
  };
@@ -120,10 +126,29 @@ export type PreparationProductPinWire = {
120
126
  policy_id: string;
121
127
  policy_sha256: Sha256Hex;
122
128
  };
129
+ source_tape_capability: {
130
+ policy_id: string;
131
+ policy_sha256: Sha256Hex;
132
+ };
123
133
  resource_policy: {
124
134
  policy_id: string;
125
135
  policy_sha256: Sha256Hex;
126
136
  };
137
+ preparation_library: {
138
+ exported_subpath: "@usherlabs/cex-broker/market-data-preparation";
139
+ runtime_entry_sha256: Sha256Hex;
140
+ declaration_sha256: Sha256Hex;
141
+ operations: [
142
+ {
143
+ symbol: "runMarketDataSourceTape";
144
+ operation_id: "market-data-source-tape/v1";
145
+ },
146
+ {
147
+ symbol: "runMarketDataRequiredClockQualification";
148
+ operation_id: "market-data-required-clock-qualification/v1";
149
+ }
150
+ ];
151
+ };
127
152
  };
128
153
  type Codec<T> = {
129
154
  decode(value: unknown): T;
@@ -137,7 +162,7 @@ export declare function finalizeBackfillResultV2(content: Omit<BackfillJobResult
137
162
  export declare function finalizeCanonicalOrderBookExportResult(content: Omit<CanonicalOrderBookExportResultWire, "result_sha256">): CanonicalOrderBookExportResultWire;
138
163
  export declare const PREPARATION_SCHEMA_ARTIFACTS: readonly Readonly<{
139
164
  schema_id: string;
140
- path: "schemas/backfill-request-v1.schema.json" | "schemas/backfill-result-v2.schema.json" | "schemas/required-clock-v1.schema.json" | "schemas/archive-selection-v1.schema.json" | "schemas/promotion-receipt-v1.schema.json" | "schemas/canonical-orderbook-export-request-v1.schema.json" | "schemas/canonical-orderbook-export-result-v1.schema.json" | "schemas/preparation-product-pin-v1.schema.json";
165
+ path: "schemas/backfill-request-v1.schema.json" | "schemas/backfill-result-v2.schema.json" | "schemas/required-clock-v1.schema.json" | "schemas/archive-selection-v1.schema.json" | "schemas/promotion-receipt-v1.schema.json" | "schemas/canonical-orderbook-export-request-v1.schema.json" | "schemas/canonical-orderbook-export-result-v2.schema.json" | "schemas/preparation-product-pin-v2.schema.json" | "schemas/order-book-levels-parquet-projection-v1.schema.json" | "schemas/order-book-depth-summary-parquet-projection-v1.schema.json" | "schemas/source-forensics-ledger-v1.schema.json" | "schemas/source-qualification-record-v1.schema.json";
141
166
  schema_sha256: string;
142
167
  schema: {
143
168
  $schema: string;
@@ -1540,9 +1565,63 @@ export declare const PREPARATION_SCHEMA_ARTIFACTS: readonly Readonly<{
1540
1565
  sha256: {
1541
1566
  $ref: string;
1542
1567
  };
1568
+ projection_schema_id: {
1569
+ enum: string[];
1570
+ };
1571
+ projection_schema_sha256: {
1572
+ $ref: string;
1573
+ };
1543
1574
  };
1544
1575
  };
1545
1576
  };
1577
+ } | {
1578
+ $schema: string;
1579
+ $id: string;
1580
+ title: string;
1581
+ canonical_schema_id: string;
1582
+ file_name: string;
1583
+ parquet_metadata: {
1584
+ key_value_metadata: never[];
1585
+ };
1586
+ columns: ({
1587
+ name: string;
1588
+ physical_type: string;
1589
+ logical_type: string;
1590
+ nullable: boolean;
1591
+ } | {
1592
+ name: string;
1593
+ physical_type: string;
1594
+ logical_type: null;
1595
+ nullable: boolean;
1596
+ })[];
1597
+ metadata: {
1598
+ "cex.canonical_schema_id": string;
1599
+ "cex.projection_schema_id": string;
1600
+ };
1601
+ } | {
1602
+ $schema: string;
1603
+ $id: string;
1604
+ title: string;
1605
+ canonical_schema_id: string;
1606
+ file_name: string;
1607
+ parquet_metadata: {
1608
+ key_value_metadata: never[];
1609
+ };
1610
+ columns: ({
1611
+ name: string;
1612
+ physical_type: string;
1613
+ logical_type: string;
1614
+ nullable: boolean;
1615
+ } | {
1616
+ name: string;
1617
+ physical_type: string;
1618
+ logical_type: null;
1619
+ nullable: boolean;
1620
+ })[];
1621
+ metadata: {
1622
+ "cex.canonical_schema_id": string;
1623
+ "cex.projection_schema_id": string;
1624
+ };
1546
1625
  } | {
1547
1626
  $schema: string;
1548
1627
  $id: string;
@@ -1647,9 +1726,47 @@ export declare const PREPARATION_SCHEMA_ARTIFACTS: readonly Readonly<{
1647
1726
  capability_policy: {
1648
1727
  $ref: string;
1649
1728
  };
1729
+ source_tape_capability: {
1730
+ $ref: string;
1731
+ };
1650
1732
  resource_policy: {
1651
1733
  $ref: string;
1652
1734
  };
1735
+ preparation_library: {
1736
+ type: string;
1737
+ additionalProperties: boolean;
1738
+ required: string[];
1739
+ properties: {
1740
+ exported_subpath: {
1741
+ const: string;
1742
+ };
1743
+ runtime_entry_sha256: {
1744
+ $ref: string;
1745
+ };
1746
+ declaration_sha256: {
1747
+ $ref: string;
1748
+ };
1749
+ operations: {
1750
+ type: string;
1751
+ prefixItems: {
1752
+ type: string;
1753
+ additionalProperties: boolean;
1754
+ required: string[];
1755
+ properties: {
1756
+ symbol: {
1757
+ const: string;
1758
+ };
1759
+ operation_id: {
1760
+ const: string;
1761
+ };
1762
+ };
1763
+ }[];
1764
+ items: boolean;
1765
+ minItems: number;
1766
+ maxItems: number;
1767
+ };
1768
+ };
1769
+ };
1653
1770
  };
1654
1771
  $defs: {
1655
1772
  sha256: {
@@ -1676,15 +1793,1178 @@ export declare const PREPARATION_SCHEMA_ARTIFACTS: readonly Readonly<{
1676
1793
  };
1677
1794
  };
1678
1795
  };
1679
- };
1680
- }>[];
1681
- export declare const PREPARATION_SCHEMA_MANIFEST_V2: Readonly<{
1682
- manifest_sha256: string;
1683
- schema_id: "https://schemas.usher.so/market-data-vendor-backfill-schema-manifest/v2";
1684
- artifacts: {
1685
- schema_id: string;
1686
- path: "schemas/backfill-request-v1.schema.json" | "schemas/backfill-result-v2.schema.json" | "schemas/required-clock-v1.schema.json" | "schemas/archive-selection-v1.schema.json" | "schemas/promotion-receipt-v1.schema.json" | "schemas/canonical-orderbook-export-request-v1.schema.json" | "schemas/canonical-orderbook-export-result-v1.schema.json" | "schemas/preparation-product-pin-v1.schema.json";
1687
- schema_sha256: string;
1688
- }[];
1796
+ } | {
1797
+ $schema: string;
1798
+ $id: string;
1799
+ title: string;
1800
+ type: string;
1801
+ additionalProperties: boolean;
1802
+ required: string[];
1803
+ properties: {
1804
+ schema_id: {
1805
+ const: string;
1806
+ };
1807
+ ledger_sha256: {
1808
+ $ref: string;
1809
+ };
1810
+ operation_kind: {
1811
+ enum: string[];
1812
+ };
1813
+ normalized_invocation_sha256: {
1814
+ $ref: string;
1815
+ };
1816
+ request_id: {
1817
+ $ref: string;
1818
+ };
1819
+ scope: {
1820
+ $ref: string;
1821
+ };
1822
+ window: {
1823
+ $ref: string;
1824
+ };
1825
+ required_clock: {
1826
+ $ref: string;
1827
+ };
1828
+ source_tape: {
1829
+ $ref: string;
1830
+ };
1831
+ effective_policies: {
1832
+ $ref: string;
1833
+ };
1834
+ provider_object_inventory: {
1835
+ $ref: string;
1836
+ };
1837
+ provider_objects: {
1838
+ type: string;
1839
+ items: {
1840
+ $ref: string;
1841
+ };
1842
+ };
1843
+ records: {
1844
+ type: string;
1845
+ maxItems: number;
1846
+ items: {
1847
+ $ref: string;
1848
+ };
1849
+ };
1850
+ target_dispositions: {
1851
+ type: string;
1852
+ maxItems: number;
1853
+ items: {
1854
+ $ref: string;
1855
+ };
1856
+ };
1857
+ summary: {
1858
+ type: string;
1859
+ };
1860
+ limits: {
1861
+ type: string;
1862
+ additionalProperties: boolean;
1863
+ required: string[];
1864
+ properties: {
1865
+ max_records: {
1866
+ const: number;
1867
+ };
1868
+ max_canonical_json_bytes: {
1869
+ const: number;
1870
+ };
1871
+ };
1872
+ };
1873
+ complete: {
1874
+ type: string;
1875
+ };
1876
+ incomplete_reason: {
1877
+ oneOf: ({
1878
+ type: string;
1879
+ const?: undefined;
1880
+ } | {
1881
+ const: string;
1882
+ type?: undefined;
1883
+ })[];
1884
+ };
1885
+ };
1886
+ oneOf: ({
1887
+ properties: {
1888
+ operation_kind: {
1889
+ const: string;
1890
+ };
1891
+ summary: {
1892
+ $ref: string;
1893
+ };
1894
+ required_clock: {
1895
+ $ref: string;
1896
+ };
1897
+ target_dispositions: {
1898
+ type: string;
1899
+ maxItems: number;
1900
+ items: {
1901
+ $ref: string;
1902
+ };
1903
+ };
1904
+ source_tape: {
1905
+ $ref?: undefined;
1906
+ };
1907
+ };
1908
+ required: string[];
1909
+ not: {
1910
+ properties: {
1911
+ source_tape: {};
1912
+ };
1913
+ required: string[];
1914
+ anyOf?: undefined;
1915
+ };
1916
+ } | {
1917
+ properties: {
1918
+ operation_kind: {
1919
+ const: string;
1920
+ };
1921
+ summary: {
1922
+ $ref: string;
1923
+ };
1924
+ source_tape: {
1925
+ $ref: string;
1926
+ };
1927
+ required_clock: {
1928
+ $ref?: undefined;
1929
+ };
1930
+ target_dispositions: {
1931
+ type?: undefined;
1932
+ maxItems?: undefined;
1933
+ items?: undefined;
1934
+ };
1935
+ };
1936
+ required: string[];
1937
+ not: {
1938
+ anyOf: ({
1939
+ properties: {
1940
+ required_clock: {};
1941
+ target_dispositions?: undefined;
1942
+ };
1943
+ required: string[];
1944
+ } | {
1945
+ properties: {
1946
+ target_dispositions: {};
1947
+ required_clock?: undefined;
1948
+ };
1949
+ required: string[];
1950
+ })[];
1951
+ properties?: undefined;
1952
+ required?: undefined;
1953
+ };
1954
+ })[];
1955
+ $defs: {
1956
+ sha256: {
1957
+ type: string;
1958
+ pattern: string;
1959
+ };
1960
+ uuid: {
1961
+ type: string;
1962
+ pattern: string;
1963
+ };
1964
+ uint: {
1965
+ type: string;
1966
+ minimum: number;
1967
+ maximum: number;
1968
+ };
1969
+ pin: {
1970
+ type: string;
1971
+ additionalProperties: boolean;
1972
+ required: string[];
1973
+ properties: {
1974
+ policy_id: {
1975
+ type: string;
1976
+ minLength: number;
1977
+ maxLength: number;
1978
+ };
1979
+ policy_sha256: {
1980
+ $ref: string;
1981
+ };
1982
+ };
1983
+ };
1984
+ scope: {
1985
+ type: string;
1986
+ additionalProperties: boolean;
1987
+ required: string[];
1988
+ properties: {
1989
+ exchange: {
1990
+ type: string;
1991
+ pattern: string;
1992
+ };
1993
+ trading_pair: {
1994
+ type: string;
1995
+ pattern: string;
1996
+ };
1997
+ market_type: {
1998
+ enum: string[];
1999
+ };
2000
+ feed: {
2001
+ const: string;
2002
+ };
2003
+ };
2004
+ };
2005
+ interval: {
2006
+ type: string;
2007
+ additionalProperties: boolean;
2008
+ required: string[];
2009
+ properties: {
2010
+ start_time_ms: {
2011
+ $ref: string;
2012
+ };
2013
+ end_time_ms_exclusive: {
2014
+ $ref: string;
2015
+ };
2016
+ };
2017
+ };
2018
+ clock: {
2019
+ type: string;
2020
+ additionalProperties: boolean;
2021
+ required: string[];
2022
+ properties: {
2023
+ clock_id: {
2024
+ $ref: string;
2025
+ };
2026
+ clock_sha256: {
2027
+ $ref: string;
2028
+ };
2029
+ event_count: {
2030
+ $ref: string;
2031
+ };
2032
+ };
2033
+ };
2034
+ sourceTape: {
2035
+ type: string;
2036
+ additionalProperties: boolean;
2037
+ required: string[];
2038
+ properties: {
2039
+ product_id: {
2040
+ const: string;
2041
+ };
2042
+ product_version: {
2043
+ const: string;
2044
+ };
2045
+ state_count: {
2046
+ $ref: string;
2047
+ };
2048
+ };
2049
+ };
2050
+ policies: {
2051
+ type: string;
2052
+ additionalProperties: boolean;
2053
+ required: string[];
2054
+ properties: {
2055
+ capability_policy: {
2056
+ $ref: string;
2057
+ };
2058
+ resource_policy: {
2059
+ $ref: string;
2060
+ };
2061
+ adapter_policy: {
2062
+ $ref: string;
2063
+ };
2064
+ acquisition_policy: {
2065
+ $ref: string;
2066
+ };
2067
+ };
2068
+ };
2069
+ inventory: {
2070
+ type: string;
2071
+ additionalProperties: boolean;
2072
+ required: string[];
2073
+ properties: {
2074
+ expected_identities: {
2075
+ type: string;
2076
+ maxItems: number;
2077
+ uniqueItems: boolean;
2078
+ items: {
2079
+ type: string;
2080
+ minLength: number;
2081
+ maxLength: number;
2082
+ };
2083
+ };
2084
+ observed_identities: {
2085
+ type: string;
2086
+ maxItems: number;
2087
+ uniqueItems: boolean;
2088
+ items: {
2089
+ type: string;
2090
+ minLength: number;
2091
+ maxLength: number;
2092
+ };
2093
+ };
2094
+ expected_selected_intervals: {
2095
+ type: string;
2096
+ maxItems: number;
2097
+ uniqueItems: boolean;
2098
+ items: {
2099
+ $ref: string;
2100
+ };
2101
+ };
2102
+ observed_selected_intervals: {
2103
+ type: string;
2104
+ maxItems: number;
2105
+ uniqueItems: boolean;
2106
+ items: {
2107
+ $ref: string;
2108
+ };
2109
+ };
2110
+ complete: {
2111
+ type: string;
2112
+ };
2113
+ };
2114
+ };
2115
+ object: {
2116
+ type: string;
2117
+ additionalProperties: boolean;
2118
+ required: string[];
2119
+ properties: {
2120
+ identity: {
2121
+ type: string;
2122
+ minLength: number;
2123
+ maxLength: number;
2124
+ };
2125
+ checksums: {
2126
+ type: string;
2127
+ minItems: number;
2128
+ uniqueItems: boolean;
2129
+ items: {
2130
+ $ref: string;
2131
+ };
2132
+ };
2133
+ attempt_count: {
2134
+ type: string;
2135
+ minimum: number;
2136
+ maximum: number;
2137
+ };
2138
+ quarantined: {
2139
+ type: string;
2140
+ };
2141
+ };
2142
+ };
2143
+ anchor: {
2144
+ type: string;
2145
+ additionalProperties: boolean;
2146
+ required: string[];
2147
+ properties: {
2148
+ event_time_ms: {
2149
+ $ref: string;
2150
+ };
2151
+ sequence: {
2152
+ type: string;
2153
+ pattern: string;
2154
+ };
2155
+ object_identity: {
2156
+ type: string;
2157
+ minLength: number;
2158
+ maxLength: number;
2159
+ };
2160
+ object_checksum: {
2161
+ $ref: string;
2162
+ };
2163
+ };
2164
+ };
2165
+ targetInterval: {
2166
+ type: string;
2167
+ additionalProperties: boolean;
2168
+ required: string[];
2169
+ properties: {
2170
+ start_target_time_ms: {
2171
+ $ref: string;
2172
+ };
2173
+ end_target_time_ms_exclusive: {
2174
+ $ref: string;
2175
+ };
2176
+ target_count: {
2177
+ $ref: string;
2178
+ };
2179
+ };
2180
+ };
2181
+ lagDistribution: {
2182
+ type: string;
2183
+ additionalProperties: boolean;
2184
+ required: string[];
2185
+ properties: {
2186
+ lag_1000_ms: {
2187
+ $ref: string;
2188
+ };
2189
+ lag_2000_ms: {
2190
+ $ref: string;
2191
+ };
2192
+ lag_5000_ms: {
2193
+ $ref: string;
2194
+ };
2195
+ lag_10000_ms: {
2196
+ $ref: string;
2197
+ };
2198
+ lag_30000_ms: {
2199
+ $ref: string;
2200
+ };
2201
+ lag_60000_ms: {
2202
+ $ref: string;
2203
+ };
2204
+ };
2205
+ };
2206
+ sequence: {
2207
+ type: string;
2208
+ additionalProperties: boolean;
2209
+ required: string[];
2210
+ properties: {
2211
+ expected_previous: {
2212
+ type: string;
2213
+ pattern: string;
2214
+ };
2215
+ observed_previous: {
2216
+ type: string;
2217
+ pattern: string;
2218
+ };
2219
+ observed_final: {
2220
+ type: string;
2221
+ pattern: string;
2222
+ };
2223
+ event_time_ms: {
2224
+ $ref: string;
2225
+ };
2226
+ };
2227
+ };
2228
+ record: {
2229
+ type: string;
2230
+ additionalProperties: boolean;
2231
+ required: string[];
2232
+ properties: {
2233
+ record_sha256: {
2234
+ $ref: string;
2235
+ };
2236
+ kind: {
2237
+ enum: string[];
2238
+ };
2239
+ scope: {
2240
+ $ref: string;
2241
+ };
2242
+ provider_objects: {
2243
+ type: string;
2244
+ items: {
2245
+ $ref: string;
2246
+ };
2247
+ };
2248
+ previous_anchor: {
2249
+ oneOf: ({
2250
+ type: string;
2251
+ $ref?: undefined;
2252
+ } | {
2253
+ $ref: string;
2254
+ type?: undefined;
2255
+ })[];
2256
+ };
2257
+ next_anchor: {
2258
+ oneOf: ({
2259
+ type: string;
2260
+ $ref?: undefined;
2261
+ } | {
2262
+ $ref: string;
2263
+ type?: undefined;
2264
+ })[];
2265
+ };
2266
+ target_interval: {
2267
+ oneOf: ({
2268
+ type: string;
2269
+ $ref?: undefined;
2270
+ } | {
2271
+ $ref: string;
2272
+ type?: undefined;
2273
+ })[];
2274
+ };
2275
+ lag_distribution: {
2276
+ oneOf: ({
2277
+ type: string;
2278
+ $ref?: undefined;
2279
+ } | {
2280
+ $ref: string;
2281
+ type?: undefined;
2282
+ })[];
2283
+ };
2284
+ sequence: {
2285
+ oneOf: ({
2286
+ type: string;
2287
+ $ref?: undefined;
2288
+ } | {
2289
+ $ref: string;
2290
+ type?: undefined;
2291
+ })[];
2292
+ };
2293
+ classification: {
2294
+ oneOf: ({
2295
+ type: string;
2296
+ enum?: undefined;
2297
+ } | {
2298
+ enum: string[];
2299
+ type?: undefined;
2300
+ })[];
2301
+ };
2302
+ adapter_version: {
2303
+ type: string;
2304
+ minLength: number;
2305
+ maxLength: number;
2306
+ };
2307
+ };
2308
+ };
2309
+ disposition: {
2310
+ type: string;
2311
+ additionalProperties: boolean;
2312
+ required: string[];
2313
+ properties: {
2314
+ target_id: {
2315
+ $ref: string;
2316
+ };
2317
+ target_time_ms: {
2318
+ $ref: string;
2319
+ };
2320
+ disposition: {
2321
+ enum: string[];
2322
+ };
2323
+ source_time_ms: {
2324
+ oneOf: ({
2325
+ type: string;
2326
+ $ref?: undefined;
2327
+ } | {
2328
+ $ref: string;
2329
+ type?: undefined;
2330
+ })[];
2331
+ };
2332
+ asof_age_ms: {
2333
+ oneOf: ({
2334
+ type: string;
2335
+ $ref?: undefined;
2336
+ } | {
2337
+ $ref: string;
2338
+ type?: undefined;
2339
+ })[];
2340
+ };
2341
+ record_sha256s: {
2342
+ type: string;
2343
+ uniqueItems: boolean;
2344
+ items: {
2345
+ $ref: string;
2346
+ };
2347
+ };
2348
+ };
2349
+ };
2350
+ recordSummary: {
2351
+ type: string;
2352
+ additionalProperties: boolean;
2353
+ required: string[];
2354
+ properties: {
2355
+ retained_record_count: {
2356
+ $ref: string;
2357
+ };
2358
+ total_record_count: {
2359
+ $ref: string;
2360
+ };
2361
+ omitted_record_count: {
2362
+ $ref: string;
2363
+ };
2364
+ affected_target_count: {
2365
+ $ref: string;
2366
+ };
2367
+ unresolved_record_count: {
2368
+ $ref: string;
2369
+ };
2370
+ };
2371
+ };
2372
+ clockSummary: {
2373
+ type: string;
2374
+ additionalProperties: boolean;
2375
+ required: string[];
2376
+ properties: {
2377
+ retained_record_count: {
2378
+ $ref: string;
2379
+ };
2380
+ total_record_count: {
2381
+ $ref: string;
2382
+ };
2383
+ omitted_record_count: {
2384
+ $ref: string;
2385
+ };
2386
+ affected_target_count: {
2387
+ $ref: string;
2388
+ };
2389
+ unresolved_record_count: {
2390
+ $ref: string;
2391
+ };
2392
+ disposition_complete: {
2393
+ type: string;
2394
+ };
2395
+ fresh_target_count: {
2396
+ $ref: string;
2397
+ };
2398
+ inactive_target_count: {
2399
+ $ref: string;
2400
+ };
2401
+ disqualifying_target_count: {
2402
+ $ref: string;
2403
+ };
2404
+ omitted_target_disposition_count: {
2405
+ $ref: string;
2406
+ };
2407
+ };
2408
+ };
2409
+ };
2410
+ } | {
2411
+ $schema: string;
2412
+ $id: string;
2413
+ title: string;
2414
+ type: string;
2415
+ additionalProperties: boolean;
2416
+ required: string[];
2417
+ properties: {
2418
+ schema_id: {
2419
+ const: string;
2420
+ };
2421
+ record_sha256: {
2422
+ $ref: string;
2423
+ };
2424
+ created_at: {
2425
+ $ref: string;
2426
+ };
2427
+ operation_kind: {
2428
+ enum: string[];
2429
+ };
2430
+ normalized_invocation_sha256: {
2431
+ $ref: string;
2432
+ };
2433
+ request_id: {
2434
+ $ref: string;
2435
+ };
2436
+ scope: {
2437
+ $ref: string;
2438
+ };
2439
+ ledger: {
2440
+ $ref: string;
2441
+ };
2442
+ source_reconstruction_accepted: {
2443
+ type: string;
2444
+ };
2445
+ source_event_enumeration_eligible: {
2446
+ type: string;
2447
+ };
2448
+ qualified: {
2449
+ type: string;
2450
+ };
2451
+ source_partition_complete: {
2452
+ type: string;
2453
+ };
2454
+ source_tape_eligible: {
2455
+ type: string;
2456
+ };
2457
+ initializer: {
2458
+ oneOf: ({
2459
+ $ref: string;
2460
+ type?: undefined;
2461
+ } | {
2462
+ type: string;
2463
+ $ref?: undefined;
2464
+ })[];
2465
+ };
2466
+ outcome: {};
2467
+ };
2468
+ oneOf: ({
2469
+ properties: {
2470
+ operation_kind: {
2471
+ const: string;
2472
+ };
2473
+ ledger: {
2474
+ $ref: string;
2475
+ };
2476
+ qualified: {
2477
+ type: string;
2478
+ };
2479
+ source_partition_complete: {
2480
+ type: string;
2481
+ };
2482
+ source_tape_eligible: {
2483
+ type?: undefined;
2484
+ };
2485
+ initializer: {
2486
+ oneOf?: undefined;
2487
+ };
2488
+ outcome: {
2489
+ $ref: string;
2490
+ };
2491
+ };
2492
+ required: string[];
2493
+ not: {
2494
+ anyOf: ({
2495
+ properties: {
2496
+ source_tape_eligible: {};
2497
+ initializer?: undefined;
2498
+ };
2499
+ required: string[];
2500
+ } | {
2501
+ properties: {
2502
+ initializer: {};
2503
+ source_tape_eligible?: undefined;
2504
+ };
2505
+ required: string[];
2506
+ })[];
2507
+ };
2508
+ } | {
2509
+ properties: {
2510
+ operation_kind: {
2511
+ const: string;
2512
+ };
2513
+ ledger: {
2514
+ $ref: string;
2515
+ };
2516
+ source_tape_eligible: {
2517
+ type: string;
2518
+ };
2519
+ initializer: {
2520
+ oneOf: ({
2521
+ $ref: string;
2522
+ type?: undefined;
2523
+ } | {
2524
+ type: string;
2525
+ $ref?: undefined;
2526
+ })[];
2527
+ };
2528
+ outcome: {
2529
+ $ref: string;
2530
+ };
2531
+ qualified: {
2532
+ type?: undefined;
2533
+ };
2534
+ source_partition_complete: {
2535
+ type?: undefined;
2536
+ };
2537
+ };
2538
+ required: string[];
2539
+ not: {
2540
+ anyOf: ({
2541
+ properties: {
2542
+ qualified: {};
2543
+ source_partition_complete?: undefined;
2544
+ };
2545
+ required: string[];
2546
+ } | {
2547
+ properties: {
2548
+ source_partition_complete: {};
2549
+ qualified?: undefined;
2550
+ };
2551
+ required: string[];
2552
+ })[];
2553
+ };
2554
+ })[];
2555
+ $defs: {
2556
+ sha256: {
2557
+ type: string;
2558
+ pattern: string;
2559
+ };
2560
+ uuid: {
2561
+ type: string;
2562
+ pattern: string;
2563
+ };
2564
+ uint: {
2565
+ type: string;
2566
+ minimum: number;
2567
+ maximum: number;
2568
+ };
2569
+ timestamp: {
2570
+ type: string;
2571
+ pattern: string;
2572
+ };
2573
+ scope: {
2574
+ type: string;
2575
+ additionalProperties: boolean;
2576
+ required: string[];
2577
+ properties: {
2578
+ exchange: {
2579
+ type: string;
2580
+ pattern: string;
2581
+ };
2582
+ trading_pair: {
2583
+ type: string;
2584
+ pattern: string;
2585
+ };
2586
+ market_type: {
2587
+ enum: string[];
2588
+ };
2589
+ feed: {
2590
+ const: string;
2591
+ };
2592
+ };
2593
+ };
2594
+ ledger: {
2595
+ type: string;
2596
+ additionalProperties: boolean;
2597
+ required: string[];
2598
+ properties: {
2599
+ schema_id: {
2600
+ const: string;
2601
+ };
2602
+ file_name: {
2603
+ type: string;
2604
+ pattern: string;
2605
+ };
2606
+ sha256: {
2607
+ $ref: string;
2608
+ };
2609
+ bytes: {
2610
+ $ref: string;
2611
+ };
2612
+ retained_record_count: {
2613
+ $ref: string;
2614
+ };
2615
+ total_record_count: {
2616
+ $ref: string;
2617
+ };
2618
+ omitted_record_count: {
2619
+ $ref: string;
2620
+ };
2621
+ complete: {
2622
+ type: string;
2623
+ };
2624
+ disposition_complete: {
2625
+ type: string;
2626
+ };
2627
+ fresh_target_count: {
2628
+ $ref: string;
2629
+ };
2630
+ inactive_target_count: {
2631
+ $ref: string;
2632
+ };
2633
+ disqualifying_target_count: {
2634
+ $ref: string;
2635
+ };
2636
+ omitted_target_disposition_count: {
2637
+ $ref: string;
2638
+ };
2639
+ state_count: {
2640
+ $ref: string;
2641
+ };
2642
+ };
2643
+ };
2644
+ clockLedger: {
2645
+ allOf: ({
2646
+ $ref: string;
2647
+ type?: undefined;
2648
+ properties?: undefined;
2649
+ required?: undefined;
2650
+ not?: undefined;
2651
+ } | {
2652
+ type: string;
2653
+ properties: {
2654
+ disposition_complete: {};
2655
+ fresh_target_count: {};
2656
+ inactive_target_count: {};
2657
+ disqualifying_target_count: {};
2658
+ omitted_target_disposition_count: {};
2659
+ state_count: {};
2660
+ };
2661
+ required: string[];
2662
+ not: {
2663
+ type: string;
2664
+ properties: {
2665
+ state_count: {};
2666
+ };
2667
+ required: string[];
2668
+ };
2669
+ $ref?: undefined;
2670
+ })[];
2671
+ };
2672
+ tapeLedger: {
2673
+ allOf: ({
2674
+ $ref: string;
2675
+ type?: undefined;
2676
+ properties?: undefined;
2677
+ required?: undefined;
2678
+ not?: undefined;
2679
+ } | {
2680
+ type: string;
2681
+ properties: {
2682
+ state_count: {};
2683
+ disposition_complete: {};
2684
+ fresh_target_count: {};
2685
+ inactive_target_count: {};
2686
+ disqualifying_target_count: {};
2687
+ omitted_target_disposition_count: {};
2688
+ };
2689
+ required: string[];
2690
+ not: {
2691
+ type: string;
2692
+ anyOf: ({
2693
+ type: string;
2694
+ properties: {
2695
+ disposition_complete: {};
2696
+ fresh_target_count?: undefined;
2697
+ inactive_target_count?: undefined;
2698
+ disqualifying_target_count?: undefined;
2699
+ omitted_target_disposition_count?: undefined;
2700
+ };
2701
+ required: string[];
2702
+ } | {
2703
+ type: string;
2704
+ properties: {
2705
+ fresh_target_count: {};
2706
+ disposition_complete?: undefined;
2707
+ inactive_target_count?: undefined;
2708
+ disqualifying_target_count?: undefined;
2709
+ omitted_target_disposition_count?: undefined;
2710
+ };
2711
+ required: string[];
2712
+ } | {
2713
+ type: string;
2714
+ properties: {
2715
+ inactive_target_count: {};
2716
+ disposition_complete?: undefined;
2717
+ fresh_target_count?: undefined;
2718
+ disqualifying_target_count?: undefined;
2719
+ omitted_target_disposition_count?: undefined;
2720
+ };
2721
+ required: string[];
2722
+ } | {
2723
+ type: string;
2724
+ properties: {
2725
+ disqualifying_target_count: {};
2726
+ disposition_complete?: undefined;
2727
+ fresh_target_count?: undefined;
2728
+ inactive_target_count?: undefined;
2729
+ omitted_target_disposition_count?: undefined;
2730
+ };
2731
+ required: string[];
2732
+ } | {
2733
+ type: string;
2734
+ properties: {
2735
+ omitted_target_disposition_count: {};
2736
+ disposition_complete?: undefined;
2737
+ fresh_target_count?: undefined;
2738
+ inactive_target_count?: undefined;
2739
+ disqualifying_target_count?: undefined;
2740
+ };
2741
+ required: string[];
2742
+ })[];
2743
+ };
2744
+ $ref?: undefined;
2745
+ })[];
2746
+ };
2747
+ evidenceDescriptor: {
2748
+ type: string;
2749
+ additionalProperties: boolean;
2750
+ required: string[];
2751
+ properties: {
2752
+ kind: {
2753
+ enum: string[];
2754
+ };
2755
+ file_name: {
2756
+ type: string;
2757
+ pattern: string;
2758
+ };
2759
+ sha256: {
2760
+ $ref: string;
2761
+ };
2762
+ bytes: {
2763
+ $ref: string;
2764
+ };
2765
+ };
2766
+ };
2767
+ exportResultDescriptor: {
2768
+ type: string;
2769
+ additionalProperties: boolean;
2770
+ required: string[];
2771
+ properties: {
2772
+ schema_id: {
2773
+ const: string;
2774
+ };
2775
+ file_name: {
2776
+ type: string;
2777
+ pattern: string;
2778
+ };
2779
+ sha256: {
2780
+ $ref: string;
2781
+ };
2782
+ bytes: {
2783
+ $ref: string;
2784
+ };
2785
+ result_sha256: {
2786
+ $ref: string;
2787
+ };
2788
+ };
2789
+ };
2790
+ initializer: {
2791
+ type: string;
2792
+ additionalProperties: boolean;
2793
+ required: string[];
2794
+ properties: {
2795
+ canonical_snapshot_id: {
2796
+ $ref: string;
2797
+ };
2798
+ source_time_ms: {
2799
+ $ref: string;
2800
+ };
2801
+ sequence: {
2802
+ type: string;
2803
+ pattern: string;
2804
+ };
2805
+ semantic_stream_position: {
2806
+ const: number;
2807
+ };
2808
+ };
2809
+ };
2810
+ clockOutcome: {
2811
+ oneOf: ({
2812
+ type: string;
2813
+ additionalProperties: boolean;
2814
+ required: string[];
2815
+ properties: {
2816
+ status: {
2817
+ const: string;
2818
+ };
2819
+ reason: {
2820
+ const: string;
2821
+ enum?: undefined;
2822
+ };
2823
+ partial_evidence: {
2824
+ type: string;
2825
+ items: {
2826
+ $ref: string;
2827
+ };
2828
+ };
2829
+ exporter_result: {
2830
+ type: string;
2831
+ };
2832
+ };
2833
+ } | {
2834
+ type: string;
2835
+ additionalProperties: boolean;
2836
+ required: string[];
2837
+ properties: {
2838
+ status: {
2839
+ const: string;
2840
+ };
2841
+ reason: {
2842
+ enum: string[];
2843
+ const?: undefined;
2844
+ };
2845
+ partial_evidence: {
2846
+ type: string;
2847
+ items: {
2848
+ $ref: string;
2849
+ };
2850
+ };
2851
+ exporter_result: {
2852
+ type: string;
2853
+ };
2854
+ };
2855
+ })[];
2856
+ };
2857
+ tapeOutcome: {
2858
+ oneOf: ({
2859
+ type: string;
2860
+ additionalProperties: boolean;
2861
+ required: string[];
2862
+ properties: {
2863
+ status: {
2864
+ const: string;
2865
+ };
2866
+ reason: {
2867
+ const: string;
2868
+ enum?: undefined;
2869
+ };
2870
+ partial_evidence: {
2871
+ type: string;
2872
+ items: {
2873
+ $ref: string;
2874
+ };
2875
+ };
2876
+ exporter_result: {
2877
+ $ref: string;
2878
+ type?: undefined;
2879
+ };
2880
+ };
2881
+ } | {
2882
+ type: string;
2883
+ additionalProperties: boolean;
2884
+ required: string[];
2885
+ properties: {
2886
+ status: {
2887
+ const: string;
2888
+ };
2889
+ reason: {
2890
+ enum: string[];
2891
+ const?: undefined;
2892
+ };
2893
+ partial_evidence: {
2894
+ type: string;
2895
+ items: {
2896
+ $ref: string;
2897
+ };
2898
+ };
2899
+ exporter_result: {
2900
+ type: string;
2901
+ $ref?: undefined;
2902
+ };
2903
+ };
2904
+ })[];
2905
+ };
2906
+ };
2907
+ };
2908
+ }>[];
2909
+ export declare const PREPARATION_SCHEMA_MANIFEST_V3: Readonly<{
2910
+ manifest_sha256: string;
2911
+ schema_id: "https://schemas.usher.so/market-data-vendor-backfill-schema-manifest/v3";
2912
+ artifacts: {
2913
+ schema_id: string;
2914
+ path: "schemas/backfill-request-v1.schema.json" | "schemas/backfill-result-v2.schema.json" | "schemas/required-clock-v1.schema.json" | "schemas/archive-selection-v1.schema.json" | "schemas/promotion-receipt-v1.schema.json" | "schemas/canonical-orderbook-export-request-v1.schema.json" | "schemas/canonical-orderbook-export-result-v2.schema.json" | "schemas/preparation-product-pin-v2.schema.json" | "schemas/order-book-levels-parquet-projection-v1.schema.json" | "schemas/order-book-depth-summary-parquet-projection-v1.schema.json" | "schemas/source-forensics-ledger-v1.schema.json" | "schemas/source-qualification-record-v1.schema.json";
2915
+ schema_sha256: string;
2916
+ }[];
2917
+ }>;
2918
+ export declare const ORDER_BOOK_LEVELS_PARQUET_PROJECTION: Readonly<{
2919
+ $schema: string;
2920
+ $id: string;
2921
+ title: string;
2922
+ canonical_schema_id: string;
2923
+ file_name: string;
2924
+ parquet_metadata: {
2925
+ key_value_metadata: never[];
2926
+ };
2927
+ columns: ({
2928
+ name: string;
2929
+ physical_type: string;
2930
+ logical_type: string;
2931
+ nullable: boolean;
2932
+ } | {
2933
+ name: string;
2934
+ physical_type: string;
2935
+ logical_type: null;
2936
+ nullable: boolean;
2937
+ })[];
2938
+ metadata: {
2939
+ "cex.canonical_schema_id": string;
2940
+ "cex.projection_schema_id": string;
2941
+ };
2942
+ }>;
2943
+ export declare const ORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION: Readonly<{
2944
+ $schema: string;
2945
+ $id: string;
2946
+ title: string;
2947
+ canonical_schema_id: string;
2948
+ file_name: string;
2949
+ parquet_metadata: {
2950
+ key_value_metadata: never[];
2951
+ };
2952
+ columns: ({
2953
+ name: string;
2954
+ physical_type: string;
2955
+ logical_type: string;
2956
+ nullable: boolean;
2957
+ } | {
2958
+ name: string;
2959
+ physical_type: string;
2960
+ logical_type: null;
2961
+ nullable: boolean;
2962
+ })[];
2963
+ metadata: {
2964
+ "cex.canonical_schema_id": string;
2965
+ "cex.projection_schema_id": string;
2966
+ };
1689
2967
  }>;
2968
+ export declare const ORDER_BOOK_LEVELS_PARQUET_PROJECTION_SCHEMA_SHA256: string;
2969
+ export declare const ORDER_BOOK_DEPTH_SUMMARY_PARQUET_PROJECTION_SCHEMA_SHA256: string;
1690
2970
  export {};