@orangecharts/wrun-chart-host 0.10.0 → 0.11.1

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 (152) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +9 -0
  3. package/dist/constants/feature-flags.constants.js +67 -4
  4. package/dist/constants/governed-exchanges.constants.d.ts +12 -0
  5. package/dist/constants/governed-exchanges.constants.js +16 -0
  6. package/dist/constants/option-venues.constants.d.ts +2 -2
  7. package/dist/host-env.d.ts +1 -9
  8. package/dist/host-ports.types.d.ts +36 -7
  9. package/dist/index.d.ts +7 -1
  10. package/dist/index.js +7 -1
  11. package/dist/indicators/controls/tpo-session.util.d.ts +36 -13
  12. package/dist/indicators/controls/tpo-session.util.js +217 -236
  13. package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
  14. package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
  15. package/dist/interfaces/cme-realtime.interface.js +6 -3
  16. package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
  17. package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
  18. package/dist/interfaces/prediction-market.interface.d.ts +7 -0
  19. package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
  20. package/dist/interfaces/stocks-realtime.interface.js +32 -0
  21. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +48 -117
  22. package/dist/kscript-data/controls/live-trades-merge.util.js +97 -207
  23. package/dist/market-data/billing.interface.d.ts +86 -12
  24. package/dist/market-data/billing.interface.js +23 -4
  25. package/dist/market-data/venue.d.ts +65 -2
  26. package/dist/market-data/venues/index.d.ts +135 -5
  27. package/dist/market-data/venues/index.js +2 -1
  28. package/dist/market-data/venues/opra.contract.copy.json +3 -2
  29. package/dist/market-data/venues/opra.d.ts +2 -2
  30. package/dist/market-data/venues/opra.js +5 -2
  31. package/dist/market-data/venues/stocks.contract.copy.json +64 -0
  32. package/dist/market-data/venues/stocks.d.ts +130 -0
  33. package/dist/market-data/venues/stocks.js +117 -0
  34. package/dist/settings-templates/footprint-rows.js +35 -2
  35. package/dist/settings-templates/form-rows.d.ts +2 -1
  36. package/dist/settings-templates/indicator-fields.js +34 -4
  37. package/dist/settings-templates/tool-rules.d.ts +12 -5
  38. package/dist/settings-templates/tool-rules.js +11 -5
  39. package/dist/settings-templates/tool-tables.generated.js +4 -0
  40. package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
  41. package/dist/utility/chart/cme-cache-context.util.js +10 -6
  42. package/dist/utility/chart/cme-realtime.util.js +10 -0
  43. package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
  44. package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
  45. package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
  46. package/dist/utility/chart/effective-chart-session.util.js +39 -0
  47. package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
  48. package/dist/utility/chart/host-bar-placement.util.js +170 -30
  49. package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
  50. package/dist/utility/chart/index-host-tier.util.js +7 -2
  51. package/dist/utility/chart/index-mode-admission.util.js +25 -11
  52. package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
  53. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +6 -9
  54. package/dist/utility/chart/kscript-live-coalesce.util.js +8 -9
  55. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
  56. package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
  57. package/dist/utility/chart/kscript-provenance-keys.util.js +7 -0
  58. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
  59. package/dist/utility/chart/kscript-venue-policy.util.d.ts +115 -21
  60. package/dist/utility/chart/kscript-venue-policy.util.js +194 -40
  61. package/dist/utility/chart/live-bucket.util.d.ts +24 -8
  62. package/dist/utility/chart/live-bucket.util.js +85 -27
  63. package/dist/utility/chart/market-sessions.util.d.ts +83 -0
  64. package/dist/utility/chart/market-sessions.util.js +220 -0
  65. package/dist/utility/chart/marketKind.util.js +5 -0
  66. package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
  67. package/dist/utility/chart/mixed-mode.util.js +14 -0
  68. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
  69. package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
  70. package/dist/utility/chart/rth-session.util.d.ts +9 -8
  71. package/dist/utility/chart/rth-session.util.js +23 -20
  72. package/dist/utility/chart/session-interval.util.d.ts +2 -1
  73. package/dist/utility/chart/session-interval.util.js +1 -3
  74. package/dist/utility/chart/trading-day.util.d.ts +17 -0
  75. package/dist/utility/chart/trading-day.util.js +59 -0
  76. package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
  77. package/dist/utility/chart/window-owner.leaf.js +45 -3
  78. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
  79. package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
  80. package/dist/utility/intl-locale.util.js +5 -0
  81. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
  82. package/dist/utility/v2/gate-plane.util.d.ts +12 -3
  83. package/dist/utility/v2/gate-plane.util.js +30 -4
  84. package/dist/utility/v2/gate-session-latch.util.js +1 -1
  85. package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
  86. package/dist/utility/v2/stocks-governed.util.js +34 -0
  87. package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
  88. package/dist/utility/wrun/derived-roots.leaf.js +27 -0
  89. package/dist/utility/wrun/derived-roots.util.d.ts +1 -9
  90. package/dist/utility/wrun/derived-roots.util.js +3 -23
  91. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +4 -3
  92. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
  93. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
  94. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +2 -0
  95. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +63 -16
  96. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +58 -14
  97. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +34 -11
  98. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +106 -30
  99. package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
  100. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +7 -4
  101. package/dist/utility/wrun/wrun-chart-market-facts.util.js +12 -8
  102. package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
  103. package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
  104. package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
  105. package/dist/utility/wrun/wrun-handles.util.js +9 -8
  106. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
  107. package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
  108. package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
  109. package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
  110. package/dist/utility/wrun/wrun-live-intake.util.d.ts +26 -12
  111. package/dist/utility/wrun/wrun-live-intake.util.js +219 -155
  112. package/dist/utility/wrun/wrun-live-tick.util.d.ts +9 -5
  113. package/dist/utility/wrun/wrun-live-tick.util.js +130 -94
  114. package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
  115. package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
  116. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +20 -10
  117. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +10 -5
  118. package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
  119. package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
  120. package/dist/utility/wrun/wrun-option-views.util.d.ts +281 -20
  121. package/dist/utility/wrun/wrun-option-views.util.js +391 -50
  122. package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
  123. package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
  124. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +15 -2
  125. package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
  126. package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
  127. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +60 -11
  128. package/dist/utility/wrun/wrun-overlay-run.util.js +529 -113
  129. package/dist/utility/wrun/wrun-panel-mount.util.js +51 -6
  130. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
  131. package/dist/utility/wrun/wrun-pin-spelling.util.js +27 -3
  132. package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
  133. package/dist/utility/wrun/wrun-refusal.util.js +22 -0
  134. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
  135. package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
  136. package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
  137. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
  138. package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
  139. package/dist/utility/wrun/wrun-run-interval.util.d.ts +39 -7
  140. package/dist/utility/wrun/wrun-run-interval.util.js +49 -9
  141. package/dist/utility/wrun/wrun-socket-row-source.js +7 -2
  142. package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -22
  143. package/dist/utility/wrun/wrun-source-rows.util.js +62 -41
  144. package/dist/utility/wrun/wrun-tape-per-order.util.js +1 -20
  145. package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
  146. package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
  147. package/dist/utility/wrun/wrun-volume-profile.util.js +37 -29
  148. package/dist/workers/constants/socket-slots.d.ts +91 -6
  149. package/dist/workers/constants/socket-slots.js +85 -6
  150. package/package.json +5 -5
  151. package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +0 -56
  152. package/dist/kscript-data/controls/live-trades-order-gate.util.js +0 -107
@@ -149,11 +149,7 @@ export declare function isOpraAgreementCurrent(current: {
149
149
  * 'busy' = a checkout is already in flight, or the guest wall took the click.
150
150
  */
151
151
  export type OpraCheckoutResult = MarketDataCheckoutResult;
152
- /**
153
- * Transport-free failure surface for the OPRA billing calls. Unlike CME, a 403 is NOT an attestation
154
- * gate (refusals ride the 200 checkout body), so it never routes back into the declaration.
155
- * 'invoice_owed' is the tagged 409 while Stripe still collects an invoice on the line.
156
- */
152
+ /** The OPRA billing calls' failure kinds: the venue-generic ones (market-data/billing.interface.ts). */
157
153
  export type OpraBillingErrorKind = MarketDataBillingErrorKind;
158
154
  /** The venue-generic billing error (market-data/billing.interface.ts): one class for every venue's calls. */
159
155
  export declare const OpraBillingError: typeof MarketDataBillingError;
@@ -71,6 +71,13 @@ export interface PolymarketMetadata {
71
71
  line?: number;
72
72
  sourceEventSlug?: string;
73
73
  }>;
74
+ /**
75
+ * Set on an event the symbol dialog's Predict tab listed from the gateway's preview page
76
+ * (`MARKETS_PROJECTION_GROUPS_PREVIEW`): `predictionMarkets` holds the event's leading sub-markets only. The pick
77
+ * reads the full event before the metadata leaves the dialog and clears it (`hydratePredictionPreview`); a failed
78
+ * read keeps it, so the list is never stored as the whole event without saying so.
79
+ */
80
+ predictionMarketsPreview?: true;
74
81
  fetchedAt?: string;
75
82
  lastUpdated?: string;
76
83
  parentEventId?: string;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The US stocks governed plane: the consolidated tape (every US stock trade, licensed by CTA for Tapes A and B and by
3
+ * UTP for Tape C), served by the stocks release of the entitlement gate on its own host. The plane keys markets by the
4
+ * SIP tape a ticker lists on, and the frontend names each tape by its listing venue plus a suffix: `NYSE_TAPE` (Tape A),
5
+ * `NYSE_ARCA_TAPE` (Tape B: Arca-, NYSE American- and Cboe-listed stocks, most ETFs) and `NASDAQ_TAPE` (Tape C). Each
6
+ * ticker lives on exactly one tape; its raw symbol is `<TICKER>/USD`.
7
+ *
8
+ * Why the suffix: the gate's wire names are the listing venues themselves (`NYSE`, `NYSE_ARCA`, `NASDAQ`, the `Exchange`
9
+ * enum's 70, 71, 72), but in this app those plain codes already mean the FREE lane: a Polygon-fed stock chart (exchange
10
+ * 92, `POLYGON`) carries `NASDAQ` as its listing venue, as its exchange on a record the lazy migration has not healed,
11
+ * and in `POLYGON_VENUES`, `EXCHANGE_TO_KIND` and `LEGACY_VENUE_TO_QUERY_EXCHANGE`. One string cannot mean the live
12
+ * free lane and the delayed tape at once (it made every stock chart ride the gate: delayed cache keys, blocked scripts,
13
+ * misrouted TRADE channels), so the tape has its own codes everywhere in the app, and `STOCKS_TAPE_WIRE_EXCHANGE`
14
+ * translates them at the wire alone (`stocksTapeWireExchange` on a request leaving a stocks slot, `stocksTapeCodeOfWire`
15
+ * on a frame or registry row arriving on one).
16
+ *
17
+ * Deliberately separate from the CME and OPRA catalogs: no Stripe bundle rides this plane yet (the add-on and its two
18
+ * subscriber agreements ship on their own release; until then every real-time connect is refused and every account,
19
+ * logged-out visitors included, reads the tape delayed), no guest snapshot, no books, no /v3 tiers.
20
+ *
21
+ * Rules (product-ecosystem `data-integration/us-equities/ENTITLEMENT.md`): a tape print is eligible for a user without
22
+ * the add-on 15 minutes plus 5 seconds after its SIP timestamp (§3.1); every delayed surface carries the delay
23
+ * statement (§3.4); one live session per user ID across devices, the takeover closing the other session's real-time
24
+ * sockets with code 4001 (§4); no machine path (API keys, MCP, alerts, screeners) carries any tape data, delayed and
25
+ * history included (§1). User-authored indicators read the tape in the browser and on the cloud lane (Kyle 2026-10-29,
26
+ * the tapes `STOCKS_TAPE_SCRIPTING_VENUES` names), with no alerts on them.
27
+ */
28
+ export type StocksGovernedExchange = 'NYSE_TAPE' | 'NYSE_ARCA_TAPE' | 'NASDAQ_TAPE';
29
+ /** The listing venue a tape code stands for: the gate's wire name, and the display venue of the Polygon twin. */
30
+ export type StocksTapeListingVenue = 'NYSE' | 'NYSE_ARCA' | 'NASDAQ';
31
+ /** Every stocks-governed exchange code, in the gate release's order. The package constant is the byte copy. */
32
+ export declare const STOCKS_GOVERNED_EXCHANGES: readonly StocksGovernedExchange[];
33
+ /** The wire name (listing venue, an `Exchange` enum member) the gate keys each tape by. */
34
+ export declare const STOCKS_TAPE_WIRE_EXCHANGE: Readonly<Record<StocksGovernedExchange, StocksTapeListingVenue>>;
35
+ /**
36
+ * The same table under the name the chrome reads it by: a tape overlay's display venue (its logo, its name, the
37
+ * `displayExchange` the seam stamps) is its listing venue, which is also the Polygon twin's display exchange.
38
+ */
39
+ export declare const STOCKS_TAPE_LISTING_VENUE: Readonly<Record<StocksGovernedExchange, StocksTapeListingVenue>>;
40
+ /**
41
+ * The gate's delayed window: 15 minutes plus the 5 s margin after the SIP timestamp (`delayed_window: 15m5s`, the
42
+ * tier frame's `delay_seconds: 905`). Routing reads the seconds; the disclosure copy says 15 minutes (CTA and UTP
43
+ * define delayed data as 15 minutes after publication; the margin is ours).
44
+ */
45
+ export declare const STOCKS_DELAY_SECONDS = 905;
46
+ export declare const STOCKS_DELAY_MINUTES = 15;
47
+ /**
48
+ * The ONE compliance switch for user scripting on the tape: the tapes a user-authored indicator may read, in the
49
+ * browser and on the cloud lane (Kyle 2026-10-29, like OPRA since its launch), at the viewer's tier. The kScript venue
50
+ * policy (kscript-venue-policy.util) reads it for every wall: a tape listed here is open to user runs, a tape left out
51
+ * stays first-party only, as CME is. Nasdaq-listed names (Tape C, `NASDAQ_TAPE`) wait for the UTP derived-data
52
+ * confirmation (RELEASE-CHECKLIST §4, the UTP Derived Data answer): add `NASDAQ_TAPE` here the day it lands, nothing
53
+ * else gates it. A listing venue's plain code (`NASDAQ`) is the free lane and never reads this.
54
+ */
55
+ export declare const STOCKS_TAPE_SCRIPTING_VENUES: readonly StocksGovernedExchange[];
56
+ /** The SIP tape letter each governed venue carries, for copy that names the tape (reports and the badge card). */
57
+ export declare const STOCKS_TAPE_OF_EXCHANGE: Readonly<Record<StocksGovernedExchange, 'A' | 'B' | 'C'>>;
@@ -0,0 +1,32 @@
1
+ import { STOCKS_GOVERNED_EXCHANGES as GOVERNED, STOCKS_TAPE_WIRE_EXCHANGE as WIRE, } from '../constants/governed-exchanges.constants.js';
2
+ /** Every stocks-governed exchange code, in the gate release's order. The package constant is the byte copy. */
3
+ export const STOCKS_GOVERNED_EXCHANGES = GOVERNED;
4
+ /** The wire name (listing venue, an `Exchange` enum member) the gate keys each tape by. */
5
+ export const STOCKS_TAPE_WIRE_EXCHANGE = WIRE;
6
+ /**
7
+ * The same table under the name the chrome reads it by: a tape overlay's display venue (its logo, its name, the
8
+ * `displayExchange` the seam stamps) is its listing venue, which is also the Polygon twin's display exchange.
9
+ */
10
+ export const STOCKS_TAPE_LISTING_VENUE = STOCKS_TAPE_WIRE_EXCHANGE;
11
+ /**
12
+ * The gate's delayed window: 15 minutes plus the 5 s margin after the SIP timestamp (`delayed_window: 15m5s`, the
13
+ * tier frame's `delay_seconds: 905`). Routing reads the seconds; the disclosure copy says 15 minutes (CTA and UTP
14
+ * define delayed data as 15 minutes after publication; the margin is ours).
15
+ */
16
+ export const STOCKS_DELAY_SECONDS = 905;
17
+ export const STOCKS_DELAY_MINUTES = 15;
18
+ /**
19
+ * The ONE compliance switch for user scripting on the tape: the tapes a user-authored indicator may read, in the
20
+ * browser and on the cloud lane (Kyle 2026-10-29, like OPRA since its launch), at the viewer's tier. The kScript venue
21
+ * policy (kscript-venue-policy.util) reads it for every wall: a tape listed here is open to user runs, a tape left out
22
+ * stays first-party only, as CME is. Nasdaq-listed names (Tape C, `NASDAQ_TAPE`) wait for the UTP derived-data
23
+ * confirmation (RELEASE-CHECKLIST §4, the UTP Derived Data answer): add `NASDAQ_TAPE` here the day it lands, nothing
24
+ * else gates it. A listing venue's plain code (`NASDAQ`) is the free lane and never reads this.
25
+ */
26
+ export const STOCKS_TAPE_SCRIPTING_VENUES = ['NYSE_TAPE', 'NYSE_ARCA_TAPE'];
27
+ /** The SIP tape letter each governed venue carries, for copy that names the tape (reports and the badge card). */
28
+ export const STOCKS_TAPE_OF_EXCHANGE = {
29
+ NYSE_TAPE: 'A',
30
+ NYSE_ARCA_TAPE: 'B',
31
+ NASDAQ_TAPE: 'C',
32
+ };
@@ -7,53 +7,37 @@ export declare const TRADES_HISTORY_MAX_CELLS = 300000;
7
7
  /** The raw TRADE table's retention (about two days): a seeded history ask never reaches behind
8
8
  * it (older windows answer nothing and cost the gateway a scan over cold chunks). */
9
9
  export declare const TRADES_RETENTION_SEC: number;
10
- /** The `trade_large` table's retention (tsdb-gateway: the prints of at least $10k quote on
11
- * USD-quoted markets, copied from TRADE and kept 90 days): the large lane's horizon. */
10
+ /** The `trade_large` table's retention: the large lane's horizon. */
12
11
  export declare const TRADES_LARGE_RETENTION_SEC: number;
13
12
  /** tsdb-gateway's bar limit on the large lane (validateKiyoPlusBar, kiyo_plus_validation.go): an
14
13
  * unaggregated read (TRADE_LARGE included) is estimated at one point per minute, and a tier user's
15
14
  * window opening before now minus the tier's default max_bar_limit (15,000 on every tier of ore
16
15
  * and cme) is trimmed to it without a word. About 10.4 days: the lane's real history horizon. */
17
16
  export declare const TRADES_LARGE_BAR_LIMIT_SEC: number;
18
- /** tsdb-gateway's trade_large floor (`write.large_trade_min_quote_amount`, default 10,000): a print
19
- * is copied into the table when its quote amount reaches it. */
20
- export declare const TRADES_LARGE_MIN_QUOTE_AMOUNT = 10000;
21
- /** tsdb-gateway's trade_large floors on the CME Group venues (`write.large_trade_cme_contract_floors`
22
- * in charts/tsdb-gateway/values.cme.yaml since !2239, 2026-10-14, which replaces the writer's code
23
- * defaults wholesale): contracts per product root, the copy's quote amount priced with the root's
24
- * point value. A root the list lacks is never copied: the writer skips it, and its large acquisition
25
- * reads the raw tape's two hours instead (tradesLaneLimits). So a root the server floors and this
26
- * map lacks draws two hours where the table holds days (Discord #557-saturn: 6E after !2239). A copy
27
- * of the server's list until the floor rides the symbol metadata the chart already loads; then this
28
- * map goes. Until then it changes in the same round as the values file. */
29
- export declare const TRADES_LARGE_CME_CONTRACT_FLOORS: Readonly<Record<string, number>>;
30
17
  /** A raw-tape acquisition's seed cap: a longer window over the raw TRADE table costs the gateway a
31
18
  * scan over cold chunks (measured 18-30 s, or a server-side internal error, for ten days). */
32
19
  export declare const TRADES_MAX_HISTORY_SEC: number;
33
- /** The market a large-lane rule judges: the venue (the series envelope's, else the chart's), the
34
- * normalized symbol (`ES-USD`, `BTC-USDT`) and, failing one, the raw symbol (`6AZ6`, `ES1!`). */
20
+ /**
21
+ * The CME Group product roots the collector copies into the large-print table (TRADE_LARGE): the keys of its contracts
22
+ * floor list (streamd charts/streamd/values.cme.yaml `large_trade.contract_floors`, the 33 roots tsdb-gateway's
23
+ * values.cme.yaml listed as `write.large_trade_cme_contract_floors` before the rule moved to the collector). The
24
+ * collector copies no print of a root off the list (it only counts them, `streamd_large_trade_skipped_points_total`),
25
+ * so the table answers such a market empty, history and live:
26
+ * COMEX:MGC1! 1m on 2026-10-29 read 0 prints of any size over six hours of the table while the raw tape held 79 prints
27
+ * of 10 contracts or more in two hours (#feedback-stream 2149). A copy of the collector's list until the instrument
28
+ * registry names the served floor per root; recorded with each root's newest TRADE_LARGE row in
29
+ * tests/fixtures/wrun/tape-dollar-units.json, whose spec holds the two equal: they change in the same round as the
30
+ * collector's list.
31
+ */
32
+ export declare const TRADES_LARGE_CME_ROOTS: ReadonlySet<string>;
33
+ /** A tape's market: the frame's venue else the chart's, and the normalized symbol, else the raw one (`ES1!`). */
35
34
  export interface TradesLargeMarket {
36
35
  exchange?: unknown;
37
36
  normalizedSymbol?: unknown;
38
37
  symbol?: unknown;
39
- /** An option book's registry trade units (`optionTradeUnitsOf` of its registry record): its live
40
- * prints are floored on the premium the resolver's live-print rule reads (`tradePrintNotional`),
41
- * never on price x size. */
42
- optionUnits?: OptionTradeUnits | null;
43
38
  }
44
- /** The large-print table's floor on a market: contracts per product root on a CME Group venue (the
45
- * writer's `largeCMEPoints`), notional on a market quoted in dollars (`largeDollarPoints`). */
46
- export type TradesLargeFloor = {
47
- kind: 'contracts';
48
- min: number;
49
- } | {
50
- kind: 'notional';
51
- min: number;
52
- };
53
- /** The tape lane an acquisition rides on a market (`tradesLaneLimits`). */
39
+ /** The tape lane an acquisition rides (`tradesLaneLimits`). */
54
40
  export interface TradesLaneLimits {
55
- /** The history reads the TRADE_LARGE table: a `large` acquisition on a market the table holds. */
56
- readsLargeTable: boolean;
57
41
  /** The seed cap: the table's retention on the large lane, two hours on the raw tape, and 0 (the live edge only)
58
42
  * for a dollar floor on the raw tape, whose rows no writer priced in dollars. Every reader of the tape's served
59
43
  * history reads this cap: the request builder, the reconcile's served start and the queue loss's repair. */
@@ -80,18 +64,10 @@ export interface TradesTapeFloor {
80
64
  valuePerUnit?: unknown;
81
65
  /** An option book's registry trade units: its prints are valued by their USD premium. */
82
66
  optionUnits?: OptionTradeUnits | null;
83
- /** The tape is judged per aggressor ORDER (wrun-tape-per-order.util `wrunTapePerOrder`): its live prints were
84
- * admitted by the order gate (live-trades-order-gate.util), every fill of an order at or above the floor, the
85
- * fills below it included. No per-fill floor applies to them (neither the tape's nor the large-print table's): the
86
- * package or the template adds the fills back into one trade. A cell still carries the print's size, or its dollar
87
- * value under a dollar floor, and a print that cannot be valued still never folds. */
88
- perOrder?: boolean;
89
67
  }
90
68
  export interface LiveTradesMergeOptions extends TradesTapeFloor {
91
- /** The large lane's table floor (the `large` acquisition): a print the large-print table never
92
- * holds (`tradesBelowLargeFloor`; the print's envelope names the market, else this one) never
93
- * folds, so no live print appears that the next reconcile cannot answer. */
94
- largeFloor?: TradesLargeMarket;
69
+ /** Fold only TRADE_LARGE rows (the large lane), else only raw TRADE prints: the router hands every trades source both. */
70
+ large?: boolean;
95
71
  /** Called when the fold trimmed the live bar to the cap (the oldest prints dropped), so the
96
72
  * caller can warn once (the kScript lane) or refuse the bar by name (the wrun lane). */
97
73
  onCapped?: (cap: number) => void;
@@ -100,7 +76,7 @@ export interface LiveTradesMergeOptions extends TradesTapeFloor {
100
76
  * (`tradesBarStartMs`); the cell's offset is measured from its open. Absent: the lane's own bar. */
101
77
  barTs?: number;
102
78
  }
103
- /** One raw TRADE print as the fold reads it. */
79
+ /** One live print as the fold reads it: a raw TRADE fill, or a TRADE_LARGE row (one order). */
104
80
  export interface LiveTradePrint {
105
81
  tsMs: number;
106
82
  price: number;
@@ -123,10 +99,8 @@ interface LiveTradeWire {
123
99
  nanos?: unknown;
124
100
  };
125
101
  }
126
- /** A live point's trade, whichever case carries it: the raw TRADE channel's `trade` or the large-print channel's
127
- * `tradeLarge` (the history adapter reads the two the same way). Every reader of a live print's amount reads it here,
128
- * so a floor never reads one case while the fold reads the other. */
129
- export declare function liveTradeOfPoint(point: unknown): LiveTradeWire | undefined;
102
+ /** Every reader of a live amount reads here, so a floor never reads one channel's case while the fold reads the other. */
103
+ export declare function liveTradeOfPoint(point: unknown, large?: boolean): LiveTradeWire | undefined;
130
104
  /**
131
105
  * The chart bar a print at `tsMs` lands in, keyed the way the chart's candles of that market are:
132
106
  * the CME Group session lattice at 4h, 1d and 1w on a CME venue (the gateway's
@@ -172,17 +146,9 @@ export declare function tradesServedStartMs(nowMs: number, historySec: number, i
172
146
  barLimitSec?: number;
173
147
  exchange?: unknown;
174
148
  }): number;
175
- /** One raw TRADE point (or a TRADE_LARGE one, its `tradeLarge` case) read the way the fold reads it:
176
- * the print's stamp in ms, its price, size, signed side and envelope exchange; null for a point the
177
- * fold rejects (no side, a non-positive or non-finite size, a bad price or stamp). */
178
- export declare function readLiveTradePrint(newPoint: unknown): LiveTradePrint | null;
179
- /** Whether the large-print table floors a market's prints by notional: its normalized symbol's
180
- * quote (the second field, the gateway writer's `quoteAsset`: `BTC-USDT` quotes USDT) is USD or a
181
- * dollar stablecoin. Any other quote (KRW, a coin) is never copied: the table holds none of its
182
- * prints at all. */
183
- export declare function tradesLargeQuotedInDollars(normalizedSymbol: unknown): boolean;
184
- /** Whether a quote asset's amounts are US dollars: USD or a dollar stablecoin (the gateway writer's
185
- * `peggedUSDQuotes`, the list the large-print table copies by). */
149
+ /** Null for a point the fold rejects, another channel's included; without `large`, either channel (stamp readers). */
150
+ export declare function readLiveTradePrint(newPoint: unknown, large?: boolean): LiveTradePrint | null;
151
+ /** Whether a quote asset's amounts are US dollars (`TRADES_LARGE_USD_QUOTES`). */
186
152
  export declare function isTradesDollarQuoteAsset(asset: unknown): boolean;
187
153
  /**
188
154
  * The size a live print's cell carries on a tape, or null when the print does not reach the tape's floor: the ONE
@@ -196,78 +162,43 @@ export declare function isTradesDollarQuoteAsset(asset: unknown): boolean;
196
162
  * point value `valuePerUnit` carries. A print that cannot be valued (no `valuePerUnit`, units that cannot say) is
197
163
  * null: it never folds, whatever its size.
198
164
  * - Otherwise the raw size, below a finite positive `minSize` null.
199
- * - On a tape whose prints arrive judged per order (`floor.perOrder`), no floor: the dollar value (above zero), or the
200
- * raw size, whatever the floor (the fills below it belong to an order that reached it).
201
165
  */
202
166
  export declare function tradesTapeCellSize(print: Pick<LiveTradePrint, 'price' | 'size'>, floor: TradesTapeFloor): number | null;
203
167
  /** Whether a tape floor can value a live print at all: a raw floor always can; a dollar floor needs the market's
204
168
  * `valuePerUnit` or an option book's units. The live intake records a dollar tape that cannot, by name. */
205
169
  export declare function tradesTapeFloorValuesPrints(floor: TradesTapeFloor): boolean;
206
- /** A live print's notional: its quote amount when the frame carries one, else price x size. On an option
207
- * book (`optionUnits`) the premium in the book's own currency by the resolver's live-print rule
208
- * (option-trade-units.util `liveOptionPrintPremium`): a live print's size arrives in coin, live-feed having
209
- * applied the contract multiplier, so the premium is price x size x point value / multiplier on a USD book
210
- * and price x size on a coin book, the value the writer's floor reads once quote amounts follow the same
211
- * rule; NaN when the units cannot say, which never reaches a floor. An option price is a premium, so
212
- * neither price x size nor a frame's quote amount (a contract-multiplied figure on Binance and OKX coin
213
- * books before that rule) is the notional there. Live prints only: a history row (the gateway's raw
214
- * TRADE, stored units) never floors here. */
215
- export declare function tradePrintNotional(print: Pick<LiveTradePrint, 'price' | 'size' | 'quoteAmount'>, optionUnits?: OptionTradeUnits | null): number;
216
170
  /** A CME Group market's product root: the normalized symbol's first field (the gateway normalizer
217
171
  * builds `<root>-USD`), else the raw symbol's root (`6AZ6` is 6A, the continuous `ES1!` is ES, a
218
172
  * bare root is itself); undefined without either. */
219
173
  export declare function tradesCmeProductRoot(market: TradesLargeMarket): string | undefined;
220
- /** The large-print table's floor on a market, the writer's rule: on a CME Group venue (the session
221
- * lattice venues) the product root's contracts floor, null for a root the list lacks (the writer
222
- * skips it); elsewhere the notional floor on a market quoted in dollars, null on any other quote
223
- * (KRW, a coin): the table holds none of its prints. */
224
- export declare function tradesLargeFloorOfMarket(market: TradesLargeMarket): TradesLargeFloor | null;
174
+ /** Whether the collector copies a CME Group product root into the large-print table (`TRADES_LARGE_CME_ROOTS`); false
175
+ * for an unknown root. */
176
+ export declare function tradesLargeServesCmeRoot(root: unknown): boolean;
225
177
  /**
226
- * Whether the gateway floors a tape read on `exchange` per aggressor ORDER (tsdb-gateway `minAmountPerOrder`, on the
227
- * TRADE and TRADE_LARGE reads): it sums the fills that share an order (the timestamp, exchange, category, coin, symbol,
228
- * normalized symbol and side), keeps each order whose total reaches the read's floor (`minAmount`, or `minQuoteAmount`
229
- * on a dollar tape) and answers EVERY fill of it, the fills below the floor included, rows and columns unchanged. The
230
- * CME Group venues (the session lattice venues, the gateway's `isCMEGroupExchange`) honor it: one aggressor order there
231
- * fills as many small fills on one exchange timestamp, and a floor of 10 judged per fill kept 2 of the 45 fills of a
232
- * 147-contract NQZ6 buy (2026-10-23 14:31:54Z). Every other venue keeps the floor per fill and its read never names the
233
- * field (a v2-only field moves a read off /v3). The per-order switch (wrun-tape-per-order.util `wrunTapePerOrder`) can
234
- * hold on these venues alone, and the history worker checks this rule beside the ask's `perOrder` (k-trades.worker).
178
+ * Whether the large-print table holds a market's big trades, the ONE rule of the tape lane a market rides
179
+ * (`tradesLaneLimits`): on a CME Group venue only a product root the collector copies (`tradesLargeServesCmeRoot`, the
180
+ * root `tradesCmeProductRoot` reads: `MGC1!`, `MGCZ6` and `MGC-USD` are MGC, which it does not); every other market
181
+ * is the collector's dollar rule's, which copies every print of at least $10k quote on a dollar-quoted market (a
182
+ * dollar tape on any other quote is refused by name before any fetch, `wrun_tape_value_unproven`). A tape on a market
183
+ * the table does not hold rides the raw tape, never the empty table.
235
184
  */
185
+ export declare function tradesLargeServesMarket(market: TradesLargeMarket): boolean;
186
+ /** The venues whose TRADE_LARGE read honors `minAmountPerOrder`; no other read may name it (a v2-only field leaves /v3). */
236
187
  export declare function tradesFloorPerOrder(exchange: unknown): boolean;
237
188
  /** Whether a tape floor is a dollar floor (C-DOLLAR's `minValue`, finite and above zero). */
238
189
  export declare function tradesTapeFloorIsDollars(floor: Pick<TradesTapeFloor, 'minValue'>): boolean;
239
- /** The tape lane an acquisition rides on a market: the large lane (the table's retention, the
240
- * gateway's bar limit, the declared history) when it asks `large` and the large-print table holds
241
- * the market, else the raw tape (a two-hour seed inside the raw table's retention). On a CME Group
242
- * venue a product root the writer lists no floor for is never copied, so a large acquisition on it
243
- * reads the raw tape in place of an empty table and its live prints fold unfloored, the same rows
244
- * either way, until the server lists the root. A dollar floor (`floor.minValue`) on that raw tape
245
- * reads no history at all (`historyCapSec` 0, the live edge): the raw tape's quote amounts are priced
246
- * by no writer rule (a backfill gap is NULL), so its rows are no proven dollars. A market quoted
247
- * outside dollars keeps the table (the control cannot tell its quote: the table answers it empty, by
248
- * its own rule). The ONE rule of a tape's served history: the request builder, the reconcile's served
249
- * start and the queue loss's repair all read it with the acquisition's floor. */
250
- export declare function tradesLaneLimits(large: boolean, market?: TradesLargeMarket, floor?: Pick<TradesTapeFloor, 'minValue'>): TradesLaneLimits;
251
- /** Whether a history re-ask on a large acquisition answers a market's prints (the tape reconcile
252
- * restoring what the queue cap dropped): the table on a market it holds, the raw tape on a CME
253
- * Group root it skips under a size floor; never a lane that serves no history under the floor
254
- * (`tradesLaneLimits`: a dollar floor on the raw tape), never a market quoted outside dollars. A
255
- * market naming no normalized symbol is assumed held. */
256
- export declare function tradesLargeHistoryAnswers(market: TradesLargeMarket, floor?: Pick<TradesTapeFloor, 'minValue'>): boolean;
257
- /** True for a live print the large-print table never holds on a market it floors: a dollar-quoted
258
- * print whose notional is under TRADES_LARGE_MIN_QUOTE_AMOUNT (the gateway copies a print whose
259
- * quote amount reaches the floor), a CME Group print of fewer contracts than its root's floor (the
260
- * frame's quote amount is price x contracts, no point value, so it never counts there). On an option
261
- * book (`market.optionUnits`) the notional is the premium the resolver reads (`tradePrintNotional`),
262
- * and a print it cannot price is under the floor. The print's
263
- * envelope names the market, else `market`. A market the table never holds is never floored here:
264
- * its lane reads the raw tape (a CME root without a floor) or the table answers it empty (a KRW or
265
- * coin quote), and in both the live prints fold. */
266
- export declare function tradesBelowLargeFloor(print: LiveTradePrint, market?: TradesLargeMarket): boolean;
267
- /** Fold one raw TRADE point onto the tape rows: the NEW rows array (the touched row a new array,
268
- * every other row shared by reference), or null when the point is rejected (the caller keeps
269
- * its rows). The print lands in the bar `options.barTs` names, else in its own bar on the lane's grid.
270
- * A per-order tape (`options.perOrder`) folds its prints under no floor, the large-print table's
271
- * included. */
190
+ /** The tape lane an acquisition rides: the large lane (the table's retention, the gateway's bar
191
+ * limit, the declared history) when it asks `large`, else the raw tape (a two-hour seed inside the
192
+ * raw table's retention). Big trades read the large-print table wherever it holds the market
193
+ * (`tradesLargeServesMarket`, which decides `large` where the acquisition is built): raw trade is kept
194
+ * about two days, so a longer chart would show its small prints on the newest bars alone. A CME root
195
+ * the collector does not copy rides the raw tape (its two hours and the raw live channel, every fill
196
+ * judged on its own) instead of an empty table that draws nothing. A dollar floor (`floor.minValue`)
197
+ * on the raw tape reads no history at all (`historyCapSec` 0, the live edge): the raw tape's quote
198
+ * amounts are priced by no writer rule (a backfill gap is NULL), so its rows are no proven dollars.
199
+ * The ONE rule of a tape's served history: the request builder, the reconcile's served start and the
200
+ * queue loss's repair all read it with the acquisition's floor. */
201
+ export declare function tradesLaneLimits(large: boolean, floor?: Pick<TradesTapeFloor, 'minValue'>): TradesLaneLimits;
202
+ /** Answers NEW rows (the touched row new, the rest shared), or null to keep them: the handed rows are shared snapshots. */
272
203
  export declare function mergeLiveTradesDataPoint(lastDataPoint: ReadonlyArray<ArrayLike<unknown>>, newPoint: unknown, intervalMs: number, options?: LiveTradesMergeOptions): LiveTradesRow[] | null;
273
204
  export {};