@orangecharts/wrun-chart-host 0.9.0 → 0.10.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 (170) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +6 -1
  3. package/dist/constants/feature-flags.constants.js +67 -24
  4. package/dist/constants/opra-compliance.constants.d.ts +3 -2
  5. package/dist/constants/opra-compliance.constants.js +3 -2
  6. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
  7. package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
  8. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
  9. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
  10. package/dist/constants/venue-presets.constants.d.ts +20 -20
  11. package/dist/constants/venue-presets.constants.js +24 -26
  12. package/dist/host-env.d.ts +29 -5
  13. package/dist/host-env.js +6 -0
  14. package/dist/host-ports.types.d.ts +69 -15
  15. package/dist/index.d.ts +13 -0
  16. package/dist/index.js +13 -0
  17. package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
  18. package/dist/interfaces/replay.interface.d.ts +8 -0
  19. package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
  20. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +41 -4
  21. package/dist/kscript-data/controls/live-trades-merge.util.js +52 -7
  22. package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +56 -0
  23. package/dist/kscript-data/controls/live-trades-order-gate.util.js +107 -0
  24. package/dist/market-data/billing.interface.d.ts +95 -31
  25. package/dist/market-data/billing.interface.js +36 -5
  26. package/dist/market-data/venue.d.ts +88 -6
  27. package/dist/market-data/venues/cme.contract.copy.json +66 -0
  28. package/dist/market-data/venues/cme.d.ts +126 -0
  29. package/dist/market-data/venues/cme.js +133 -0
  30. package/dist/market-data/venues/index.d.ts +162 -5
  31. package/dist/market-data/venues/index.js +48 -6
  32. package/dist/settings-templates/index.js +7 -3
  33. package/dist/settings-templates/indicator-fields.d.ts +5 -4
  34. package/dist/settings-templates/indicator-fields.js +45 -6
  35. package/dist/settings-templates/tool-rules.d.ts +27 -17
  36. package/dist/settings-templates/tool-rules.js +27 -11
  37. package/dist/settings-templates/tool-tables.generated.js +91 -31
  38. package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
  39. package/dist/utility/chart/book-live-bucket.util.js +47 -0
  40. package/dist/utility/chart/index-mode-admission.util.js +15 -2
  41. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
  42. package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
  43. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +7 -2
  44. package/dist/utility/chart/kscript-live-coalesce.util.js +9 -3
  45. package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
  46. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
  47. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
  48. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
  49. package/dist/utility/chart/kscript-venue-policy.util.d.ts +54 -35
  50. package/dist/utility/chart/kscript-venue-policy.util.js +78 -42
  51. package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
  52. package/dist/utility/chart/market-session-schedule.util.js +16 -0
  53. package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
  54. package/dist/utility/chart/opra-read-access.leaf.js +5 -3
  55. package/dist/utility/chart/rth-session.util.d.ts +3 -2
  56. package/dist/utility/chart/rth-session.util.js +2 -1
  57. package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
  58. package/dist/utility/chart/window-geometry.leaf.js +22 -6
  59. package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
  60. package/dist/utility/chart/wrun-run-result.util.js +141 -6
  61. package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
  62. package/dist/utility/options/option-bar-anchor.util.js +340 -0
  63. package/dist/utility/options/option-venue.util.d.ts +18 -0
  64. package/dist/utility/options/option-venue.util.js +27 -0
  65. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
  66. package/dist/utility/wrun/derived-roots.util.d.ts +213 -0
  67. package/dist/utility/wrun/derived-roots.util.js +471 -0
  68. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +41 -6
  69. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
  70. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
  71. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
  72. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
  73. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
  74. package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
  75. package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
  76. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
  77. package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
  78. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
  79. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
  80. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
  81. package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
  82. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
  83. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
  84. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
  85. package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
  86. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
  87. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
  88. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +39 -10
  89. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +64 -0
  90. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +89 -0
  91. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
  92. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
  93. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
  94. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +174 -13
  95. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +685 -27
  96. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
  97. package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
  98. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +53 -12
  99. package/dist/utility/wrun/wrun-chart-market-facts.util.js +101 -53
  100. package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
  101. package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
  102. package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
  103. package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
  104. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
  105. package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
  106. package/dist/utility/wrun/wrun-frames.d.ts +27 -6
  107. package/dist/utility/wrun/wrun-frames.js +73 -10
  108. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
  109. package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
  110. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
  111. package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
  112. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
  113. package/dist/utility/wrun/wrun-live-intake.util.d.ts +13 -7
  114. package/dist/utility/wrun/wrun-live-intake.util.js +82 -29
  115. package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -0
  116. package/dist/utility/wrun/wrun-live-tick.util.js +158 -14
  117. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +49 -10
  118. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +65 -5
  119. package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
  120. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
  121. package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
  122. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
  123. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
  124. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
  125. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
  126. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
  127. package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
  128. package/dist/utility/wrun/wrun-option-views.util.d.ts +47 -13
  129. package/dist/utility/wrun/wrun-option-views.util.js +98 -26
  130. package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
  131. package/dist/utility/wrun/wrun-output-style.util.js +20 -2
  132. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +17 -0
  133. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
  134. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
  135. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +100 -31
  136. package/dist/utility/wrun/wrun-overlay-run.util.js +733 -114
  137. package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
  138. package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
  139. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
  140. package/dist/utility/wrun/wrun-panel-mount.util.js +63 -13
  141. package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
  142. package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
  143. package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
  144. package/dist/utility/wrun/wrun-param-map.util.js +10 -5
  145. package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
  146. package/dist/utility/wrun/wrun-param-values.util.js +4 -0
  147. package/dist/utility/wrun/wrun-pin-spelling.util.js +12 -11
  148. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
  149. package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
  150. package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
  151. package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
  152. package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
  153. package/dist/utility/wrun/wrun-run-interval.util.d.ts +4 -2
  154. package/dist/utility/wrun/wrun-run-interval.util.js +9 -6
  155. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
  156. package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
  157. package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
  158. package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
  159. package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
  160. package/dist/utility/wrun/wrun-socket-row-source.js +113 -8
  161. package/dist/utility/wrun/wrun-source-rows.util.d.ts +5 -1
  162. package/dist/utility/wrun/wrun-source-rows.util.js +16 -3
  163. package/dist/utility/wrun/wrun-style-words.util.js +6 -4
  164. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
  165. package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
  166. package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
  167. package/dist/utility/wrun/wrun-tape-per-order.util.js +26 -0
  168. package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
  169. package/dist/utils/replay/replay-buffer-math.js +227 -20
  170. package/package.json +11 -11
@@ -150,7 +150,11 @@ export interface WrunChartStoreView {
150
150
  notify?: boolean;
151
151
  hasVisibleDrawings?: boolean;
152
152
  }): void;
153
- setIndicatorPrintOutputs(chartIndex: number, indicatorId: string, printOutputsInput: unknown): void;
153
+ /** CHANGED: the lines with the provenance of the run that printed them (web: console-run-output.leaf
154
+ * `IndicatorOutputProvenance`): `opra` when the run read OPRA, its own fact from before it computed. Required. */
155
+ setIndicatorPrintOutputs(chartIndex: number, indicatorId: string, printOutputsInput: unknown, provenance: {
156
+ opra: boolean;
157
+ }): void;
154
158
  setIndicatorRunOutputSummary(chartIndex: number, indicatorId: string, runResult: WrunKScriptRunResultLike | null): void;
155
159
  setKScriptLoadingIndicator(chartIndex: number, indicatorId: string, loading: boolean): void;
156
160
  indicatorSettingsSync(chartIndex: number, indicatorId: string): {
@@ -195,6 +199,10 @@ export interface WrunOffchartGridHeightsModule {
195
199
  export interface WrunOptionsOverlayProvenanceModule {
196
200
  admittedOpraSources(chartIndex: number, overlayId: string): number;
197
201
  setOptionsOverlayOpraProvenance(chartIndex: number, overlayId: string, opra: boolean): void;
202
+ /** CHANGED (next release, optional): this account reads options on a gate plane in this browser, the stamp the
203
+ * next chart load reads to prepare the plane's access before an add asks (web: `noteGatePlaneOptionsRead`). Read by
204
+ * the add's own door (run-schedule/wrun-gate-reader-warm.util); a host that binds none keeps no stamp. */
205
+ noteGatePlaneOptionsRead?(): void;
198
206
  }
199
207
  /** Loader view of the indicator registry: a control by its type, for its live subscription (web:
200
208
  * indicators/indicator-registry.ts, a Map of `IIndicatorControl`). */
@@ -349,8 +357,12 @@ export interface WrunMainCandleFetchOptions {
349
357
  /** What suspects an options add is coming and warms the chart's gate reader for it, with no add asked yet (OPTLOAD g1
350
358
  * round 2): a surface's open (`indicators-dialog`, `options-panel`: run-schedule/wrun-chart-gate-reader.util
351
359
  * `warmWrunChartGateReaderOnIntent`), or a row's settled intent (`add-intent`: a hover's dwell, a detail panel; the
352
- * loader's intent warm through wrun-gate-reader-warm.util `warmWrunSheetGateReaders`). */
353
- export type WrunGateReaderIntentSurface = 'indicators-dialog' | 'options-panel' | 'add-intent';
360
+ * loader's intent warm through wrun-gate-reader-warm.util `warmWrunSheetGateReaders`, and a native options row's, web:
361
+ * utility/options/gate-reader-intent-warm.util). OPTLOAD W3: the chart's load and each switch of its market, for an
362
+ * account that reads options (`chart-load`, web: utility/options/chart-options-access.util). CHANGED (next release):
363
+ * an add's click before its admission (`add-click`, web: the chart store's add wrapper; the add may still be refused,
364
+ * so the warm asks the lease). */
365
+ export type WrunGateReaderIntentSurface = 'indicators-dialog' | 'options-panel' | 'add-intent' | 'chart-load' | 'add-click';
354
366
  /** What an intent warm did: `dialed` (this tab dials the reader and holds its lease), `already` (this tab's reader was
355
367
  * dialing or open), `held-elsewhere` (another tab holds that reader for this identity and tier), `busy` (another tab is
356
368
  * deciding its warm now), `unknown` (the browser cannot say who holds it: never dialed), `no-plane` (the chart's options
@@ -358,6 +370,12 @@ export type WrunGateReaderIntentSurface = 'indicators-dialog' | 'options-panel'
358
370
  * `not-entitled` (the gate refused this identity there, or the dial's own guards stopped it), `failed` (a load or a
359
371
  * port failed). */
360
372
  export type WrunGateReaderIntentWarm = 'dialed' | 'already' | 'held-elsewhere' | 'busy' | 'unknown' | 'no-plane' | 'not-served' | 'not-entitled' | 'failed';
373
+ /** Which reads of the plane an intent warm readies the reader for, so it dials the slot those reads ride: `candles`
374
+ * (market data, StreamPoints: the reader tier the account's served access picks, real-time once the gate confirmed
375
+ * it) or `metadata` (the one-shot reference reads, a chain's expiry list among them: always the delayed reader,
376
+ * utility/v2/governed-tier.leaf `resolveGovernedSlot`). A native options add's first read is `metadata` (its chain's
377
+ * expiries), its data reads `candles`, so the two can need two readers. Absent: `candles`. */
378
+ export type WrunGateReaderReadKind = 'candles' | 'metadata';
361
379
  /** Loader view of the V2 transport the main candles ride (web: services/v2.service.ts default `fetchData`, generic on
362
380
  * web; the payload is the transport's own type, `never` here), the gate reader warm a door asks of it
363
381
  * (`warmGateReaderFor`: dial the reader a read naming the exchange rides, under the on-demand guards; a hint,
@@ -367,7 +385,9 @@ export interface WrunV2ServiceModule {
367
385
  readonly default: {
368
386
  fetchData(indicator: string, payload: never, chartIndex: number, options: WrunMainCandleFetchOptions): Promise<void>;
369
387
  warmGateReaderFor(exchange: string): void;
370
- warmGateReaderOnIntent(exchange: string, surface: WrunGateReaderIntentSurface): Promise<WrunGateReaderIntentWarm>;
388
+ /** CHANGED (next release, optional `kind`): the reads the warm readies the reader for (WrunGateReaderReadKind); a
389
+ * host that takes two arguments warms the `candles` reader, as before. */
390
+ warmGateReaderOnIntent(exchange: string, surface: WrunGateReaderIntentSurface, kind?: WrunGateReaderReadKind): Promise<WrunGateReaderIntentWarm>;
371
391
  /** CHANGED (next release, optional): one series read answered whole (web: v2.service `sendSeriesOneShot`, the
372
392
  * worker's `readSeries` over the app's series descriptor, a typed `never` here as `fetchData`'s payload is: the
373
393
  * descriptor is the app's). Read by the C-DOLLAR stored unit (wrun-chart-market-facts.util
@@ -449,24 +469,50 @@ export type WrunOptionsChartSource = {
449
469
  };
450
470
  /** Loader view of the options chart source. */
451
471
  export interface WrunOptionsChartSourceModule {
452
- resolveOptionsChartSource(metadata: WrunOptionsChartMetadata): Promise<WrunOptionsChartSource>;
472
+ /** `plane`: a run's frozen decision (the plane its head decided), so no lane of the run decides again. */
473
+ resolveOptionsChartSource(metadata: WrunOptionsChartMetadata, plane?: WrunGateProvider | null): Promise<WrunOptionsChartSource>;
453
474
  }
454
475
  /** Why a chart whose options list on OPRA reads none: the reason the gate folds into `governedOptionPlane`'s null
455
476
  * (web: utility/options/opra-options-gate.util.ts `OpraOptionPlaneStop`). */
456
477
  export type OpraOptionPlaneStop = 'flag-off' | 'chart-kind';
457
- /** CHANGED 0.5.0: loader view of the OPRA options gate (sync after the load), and its flag reads and hydration waits. */
478
+ /** CHANGED (next release): the chart market the OPRA plane decisions read (web: utility/options/opra-options-gate.util.ts
479
+ * `ChartOptionsMarketRef`). The `symbol` key is required, its value may be missing: a stock twin is one market of a
480
+ * venue (BINANCE_FUTURES NVDAUSDT, never BINANCE_FUTURES), so a decision always sees which market it judges. */
481
+ export interface WrunChartOptionsMarketRef {
482
+ exchange?: string | null;
483
+ symbol: string | null | undefined;
484
+ coin?: string | null;
485
+ /** The protocol's Category value or its name, unknown here: an option contract is never a stock twin. */
486
+ category?: unknown;
487
+ }
488
+ /** The market whose options a chart reads (web: `ChartOptionsMarket`): the chart's own, or, for a stock twin while the
489
+ * opra flag is lit, its US stock's market (POLYGON `NVDA/USD`) with `twinOf` naming the chart market. */
490
+ export interface WrunChartOptionsMarket extends WrunChartOptionsMarketRef {
491
+ twinOf?: {
492
+ exchange: string;
493
+ symbol: string;
494
+ };
495
+ }
496
+ /** CHANGED 0.5.0: loader view of the OPRA options gate (sync after the load), and its flag reads and hydration waits.
497
+ * CHANGED (next release): the plane decisions take `WrunChartOptionsMarketRef` (the `symbol` key required), and two
498
+ * optional ports read the stock twin seam; a host that binds neither reads every chart's options off its own market. */
458
499
  export interface WrunOptionsGateModule {
459
- governedOptionPlane(metadata: {
460
- exchange?: string | null;
461
- } | null | undefined): WrunGateProvider | null;
462
- opraOptionPlaneStop(metadata: {
463
- exchange?: string | null;
464
- } | null | undefined): OpraOptionPlaneStop | undefined;
465
- opraFlagDecidesChartOptions(metadata: {
466
- exchange?: string | null;
467
- } | null | undefined): boolean;
500
+ governedOptionPlane(metadata: WrunChartOptionsMarketRef | null | undefined): WrunGateProvider | null;
501
+ opraOptionPlaneStop(metadata: WrunChartOptionsMarketRef | null | undefined): OpraOptionPlaneStop | undefined;
502
+ opraFlagDecidesChartOptions(metadata: WrunChartOptionsMarketRef | null | undefined): boolean;
468
503
  awaitOpraFlagHydration(timeoutMs?: number): Promise<void>;
469
504
  awaitOpraUserScriptsFlagHydration(timeoutMs?: number): Promise<void>;
505
+ /** NEW (optional): arm the late re-judgment of the user-script overlays an OPRA wall judged closed, called by a run
506
+ * head whose bounded `opra-user-scripts` wait ran out with the flag dark (web: opra-options-gate.util
507
+ * `armOpraUserScriptsRejudge`: the first time the flag turns on, every chart's walled user-script overlays are
508
+ * judged again). A host that binds none leaves such a run walled until its next run. */
509
+ armOpraUserScriptsRejudge?(): void;
510
+ /** NEW (next release, optional): the market whose options a chart reads (web: `chartOptionsMarket`, the input itself
511
+ * for every market but a known stock twin under a lit opra flag). */
512
+ chartOptionsMarket?(market: WrunChartOptionsMarketRef): WrunChartOptionsMarket;
513
+ /** NEW (next release, optional): a market's stock twin answer, awaited and bounded (web: stock-twin-probe.util
514
+ * `awaitStockTwin`): its US stock's ticker, or null for no twin or no answer in time. */
515
+ awaitStockTwin?(market: WrunChartOptionsMarketRef, timeoutMs?: number): Promise<string | null>;
470
516
  }
471
517
  /** The crypto venue words of the `options_chain` venue knob and the words as the chart reads them
472
518
  * (utility/wrun/wrun-options-chain.util.ts, moved in phase 1a). */
@@ -519,6 +565,11 @@ export interface WrunOptionChainServiceModule {
519
565
  readonly default: {
520
566
  resolveChainContract(exchangeName: string, underlying: string): Promise<string | null>;
521
567
  forVenue(venueId: OptionVenue['id']): WrunOptionChainDirectory;
568
+ /** CHANGED (next release, optional): start the CME optionable directory read a chain lane's identity awaits, ahead
569
+ * of the plan (web: option-chain.service `prewarmOptionableDirectory`: a fresh snapshot reads nothing, a failure
570
+ * leaves the read to the plan). Read by the add door on a CME chart (run-schedule/wrun-gate-reader-warm.util); a
571
+ * host that binds none leaves the directory to the plan. */
572
+ prewarmOptionableDirectory?(): void;
522
573
  };
523
574
  }
524
575
  /** Loader view of the continuous contracts service: a continuous symbol's lead contract (web:
@@ -1036,6 +1087,9 @@ export interface WrunStandInWriteArgs {
1036
1087
  chartIntervalMs: number;
1037
1088
  runInterval: WrunOverlayRunInterval | null | undefined;
1038
1089
  nowMs?: number;
1090
+ /** Who asks (web: `KScriptStandInWriteSite`): the run's accepted integration (`run`, the default), or web's workspace
1091
+ * switch teardown storing the shown picture (`switch-teardown`). */
1092
+ site?: 'run' | 'switch-teardown';
1039
1093
  }
1040
1094
  /** Why the chart's end-of-data marker shows (web: utility/chart/end-of-data-marker.util.ts `EndOfDataMarkerReason`). */
1041
1095
  export type WrunEndOfDataMarkerReason = HistoryWallKind | 'layout-cap';
package/dist/index.d.ts CHANGED
@@ -46,9 +46,11 @@ export * from './interfaces/replay.interface.js';
46
46
  export * from './interfaces/wrun-runtime.interface.js';
47
47
  export * from './kscript-data/controls/live-ohlcv-merge.util.js';
48
48
  export * from './kscript-data/controls/live-trades-merge.util.js';
49
+ export * from './kscript-data/controls/live-trades-order-gate.util.js';
49
50
  export * from './market-data/billing.interface.js';
50
51
  export * from './market-data/venue.js';
51
52
  export * from './market-data/venue-governed.util.js';
53
+ export * from './market-data/venues/cme.js';
52
54
  export * from './market-data/venues/index.js';
53
55
  export * from './market-data/venues/opra.js';
54
56
  export * from './replay/replayIndicatorRows.js';
@@ -61,6 +63,7 @@ export * from './settings-templates/tool-rules.js';
61
63
  export * from './settings-templates/tool-tables.generated.js';
62
64
  export * from './utility/auth/server-clock.util.js';
63
65
  export * from './utility/blk-market.util.js';
66
+ export * from './utility/chart/book-live-bucket.util.js';
64
67
  export * from './utility/chart/builtin-identity.util.js';
65
68
  export * from './utility/chart/cache-alignment.util.js';
66
69
  export * from './utility/chart/calendar-interval.util.js';
@@ -161,6 +164,7 @@ export * from './utility/chart/profile-block-size.util.js';
161
164
  export * from './utility/chart/profile-row-height.util.js';
162
165
  export * from './utility/chart/protected-kscript-degenerate-rows.leaf.js';
163
166
  export * from './utility/chart/protected-kscript-empty-output.util.js';
167
+ export * from './utility/chart/quote-perp.leaf.js';
164
168
  export * from './utility/chart/rth-session.util.js';
165
169
  export * from './utility/chart/run-interval-unservable.leaf.js';
166
170
  export * from './utility/chart/run-interval-warmup.leaf.js';
@@ -211,6 +215,7 @@ export * from './utility/watchlist/import/import-request.leaf.js';
211
215
  export * from './utility/watchlist/import/tradingview-symbols.leaf.js';
212
216
  export * from './utility/wrun-alert-params.leaf.js';
213
217
  export * from './utility/wrun-display-name.util.js';
218
+ export * from './utility/wrun/derived-roots.util.js';
214
219
  export * from './utility/wrun/run-schedule/wrun-chart-gate-reader.util.js';
215
220
  export * from './utility/wrun/run-schedule/wrun-gate-reader-warm.util.js';
216
221
  export * from './utility/wrun/run-schedule/wrun-lane-groups.util.js';
@@ -228,6 +233,7 @@ export * from './utility/wrun/sources/row-lanes/index.js';
228
233
  export * from './utility/wrun/sources/row-lanes/option_contract_flow.js';
229
234
  export * from './utility/wrun/sources/wrun-poll-lane.types.js';
230
235
  export * from './utility/wrun/sources/wrun-poll-lanes.util.js';
236
+ export * from './utility/wrun/sources/wrun-row-lane-add-memo.util.js';
231
237
  export * from './utility/wrun/sources/wrun-row-lane-first-paint.util.js';
232
238
  export * from './utility/wrun/sources/wrun-row-lane.types.js';
233
239
  export * from './utility/wrun/sources/wrun-row-lanes.util.js';
@@ -246,6 +252,7 @@ export * from './utility/wrun/wrun-canvas-readout.util.js';
246
252
  export * from './utility/wrun/wrun-canvases.util.js';
247
253
  export * from './utility/wrun/wrun-cap-notice.util.js';
248
254
  export * from './utility/wrun/wrun-card-style.util.js';
255
+ export * from './utility/wrun/wrun-cell-capacity.leaf.js';
249
256
  export * from './utility/wrun/wrun-chart-context-names.util.js';
250
257
  export * from './utility/wrun/wrun-chart-context.util.js';
251
258
  export * from './utility/wrun/wrun-chart-market-facts.util.js';
@@ -263,7 +270,9 @@ export * from './utility/wrun/wrun-daily-lane.util.js';
263
270
  export * from './utility/wrun/wrun-deadline.util.js';
264
271
  export * from './utility/wrun/wrun-debug-output.util.js';
265
272
  export * from './utility/wrun/wrun-declared-warmup.util.js';
273
+ export * from './utility/wrun/wrun-dollar-unit-port.leaf.js';
266
274
  export * from './utility/wrun/wrun-download-meter.util.js';
275
+ export * from './utility/wrun/wrun-download-plan.util.js';
267
276
  export * from './utility/wrun/wrun-draft-legend-note.util.js';
268
277
  export * from './utility/wrun/wrun-draft-overlay.util.js';
269
278
  export * from './utility/wrun/wrun-draw-skipped.leaf.js';
@@ -305,6 +314,7 @@ export * from './utility/wrun/wrun-live-patch.util.js';
305
314
  export * from './utility/wrun/wrun-live-tick.util.js';
306
315
  export * from './utility/wrun/wrun-loading-owner.util.js';
307
316
  export * from './utility/wrun/wrun-market-facts.util.js';
317
+ export * from './utility/wrun/wrun-market-size-contract-carry.leaf.js';
308
318
  export * from './utility/wrun/wrun-market-size-defaults.leaf.js';
309
319
  export * from './utility/wrun/wrun-market-size-defaults.util.js';
310
320
  export * from './utility/wrun/wrun-memory-clamp.util.js';
@@ -317,6 +327,7 @@ export * from './utility/wrun/wrun-opra-stats.leaf.js';
317
327
  export * from './utility/wrun/wrun-option-contract-flow.util.js';
318
328
  export * from './utility/wrun/wrun-option-knobs.util.js';
319
329
  export * from './utility/wrun/wrun-option-prints.util.js';
330
+ export * from './utility/wrun/wrun-option-strike-flow-forecast.util.js';
320
331
  export * from './utility/wrun/wrun-option-strike-flow-lane.util.js';
321
332
  export * from './utility/wrun/wrun-option-strike-flow.util.js';
322
333
  export * from './utility/wrun/wrun-option-summary-lane.util.js';
@@ -348,6 +359,7 @@ export * from './utility/wrun/wrun-protocol-pending.util.js';
348
359
  export * from './utility/wrun/wrun-refusal-surface.util.js';
349
360
  export * from './utility/wrun/wrun-refusal-text.util.js';
350
361
  export * from './utility/wrun/wrun-refusal.util.js';
362
+ export * from './utility/wrun/wrun-refused-latest.util.js';
351
363
  export * from './utility/wrun/wrun-registry-errors.util.js';
352
364
  export * from './utility/wrun/wrun-render-select.util.js';
353
365
  export * from './utility/wrun/wrun-replay-lane.util.js';
@@ -378,6 +390,7 @@ export * from './utility/wrun/wrun-style-flags.util.js';
378
390
  export * from './utility/wrun/wrun-symbol-code.util.js';
379
391
  export * from './utility/wrun/wrun-table-chrome.util.js';
380
392
  export * from './utility/wrun/wrun-table-look.util.js';
393
+ export * from './utility/wrun/wrun-tape-per-order.util.js';
381
394
  export * from './utility/wrun/wrun-tape-source.util.js';
382
395
  export * from './utility/wrun/wrun-text-look.util.js';
383
396
  export * from './utility/wrun/wrun-text-params.util.js';
package/dist/index.js CHANGED
@@ -49,9 +49,11 @@ export * from './interfaces/replay.interface.js';
49
49
  export * from './interfaces/wrun-runtime.interface.js';
50
50
  export * from './kscript-data/controls/live-ohlcv-merge.util.js';
51
51
  export * from './kscript-data/controls/live-trades-merge.util.js';
52
+ export * from './kscript-data/controls/live-trades-order-gate.util.js';
52
53
  export * from './market-data/billing.interface.js';
53
54
  export * from './market-data/venue.js';
54
55
  export * from './market-data/venue-governed.util.js';
56
+ export * from './market-data/venues/cme.js';
55
57
  export * from './market-data/venues/index.js';
56
58
  export * from './market-data/venues/opra.js';
57
59
  export * from './replay/replayIndicatorRows.js';
@@ -64,6 +66,7 @@ export * from './settings-templates/tool-rules.js';
64
66
  export * from './settings-templates/tool-tables.generated.js';
65
67
  export * from './utility/auth/server-clock.util.js';
66
68
  export * from './utility/blk-market.util.js';
69
+ export * from './utility/chart/book-live-bucket.util.js';
67
70
  export * from './utility/chart/builtin-identity.util.js';
68
71
  export * from './utility/chart/cache-alignment.util.js';
69
72
  export * from './utility/chart/calendar-interval.util.js';
@@ -164,6 +167,7 @@ export * from './utility/chart/profile-block-size.util.js';
164
167
  export * from './utility/chart/profile-row-height.util.js';
165
168
  export * from './utility/chart/protected-kscript-degenerate-rows.leaf.js';
166
169
  export * from './utility/chart/protected-kscript-empty-output.util.js';
170
+ export * from './utility/chart/quote-perp.leaf.js';
167
171
  export * from './utility/chart/rth-session.util.js';
168
172
  export * from './utility/chart/run-interval-unservable.leaf.js';
169
173
  export * from './utility/chart/run-interval-warmup.leaf.js';
@@ -214,6 +218,7 @@ export * from './utility/watchlist/import/import-request.leaf.js';
214
218
  export * from './utility/watchlist/import/tradingview-symbols.leaf.js';
215
219
  export * from './utility/wrun-alert-params.leaf.js';
216
220
  export * from './utility/wrun-display-name.util.js';
221
+ export * from './utility/wrun/derived-roots.util.js';
217
222
  export * from './utility/wrun/run-schedule/wrun-chart-gate-reader.util.js';
218
223
  export * from './utility/wrun/run-schedule/wrun-gate-reader-warm.util.js';
219
224
  export * from './utility/wrun/run-schedule/wrun-lane-groups.util.js';
@@ -231,6 +236,7 @@ export * from './utility/wrun/sources/row-lanes/index.js';
231
236
  export * from './utility/wrun/sources/row-lanes/option_contract_flow.js';
232
237
  export * from './utility/wrun/sources/wrun-poll-lane.types.js';
233
238
  export * from './utility/wrun/sources/wrun-poll-lanes.util.js';
239
+ export * from './utility/wrun/sources/wrun-row-lane-add-memo.util.js';
234
240
  export * from './utility/wrun/sources/wrun-row-lane-first-paint.util.js';
235
241
  export * from './utility/wrun/sources/wrun-row-lane.types.js';
236
242
  export * from './utility/wrun/sources/wrun-row-lanes.util.js';
@@ -249,6 +255,7 @@ export * from './utility/wrun/wrun-canvas-readout.util.js';
249
255
  export * from './utility/wrun/wrun-canvases.util.js';
250
256
  export * from './utility/wrun/wrun-cap-notice.util.js';
251
257
  export * from './utility/wrun/wrun-card-style.util.js';
258
+ export * from './utility/wrun/wrun-cell-capacity.leaf.js';
252
259
  export * from './utility/wrun/wrun-chart-context-names.util.js';
253
260
  export * from './utility/wrun/wrun-chart-context.util.js';
254
261
  export * from './utility/wrun/wrun-chart-market-facts.util.js';
@@ -266,7 +273,9 @@ export * from './utility/wrun/wrun-daily-lane.util.js';
266
273
  export * from './utility/wrun/wrun-deadline.util.js';
267
274
  export * from './utility/wrun/wrun-debug-output.util.js';
268
275
  export * from './utility/wrun/wrun-declared-warmup.util.js';
276
+ export * from './utility/wrun/wrun-dollar-unit-port.leaf.js';
269
277
  export * from './utility/wrun/wrun-download-meter.util.js';
278
+ export * from './utility/wrun/wrun-download-plan.util.js';
270
279
  export * from './utility/wrun/wrun-draft-legend-note.util.js';
271
280
  export * from './utility/wrun/wrun-draft-overlay.util.js';
272
281
  export * from './utility/wrun/wrun-draw-skipped.leaf.js';
@@ -308,6 +317,7 @@ export * from './utility/wrun/wrun-live-patch.util.js';
308
317
  export * from './utility/wrun/wrun-live-tick.util.js';
309
318
  export * from './utility/wrun/wrun-loading-owner.util.js';
310
319
  export * from './utility/wrun/wrun-market-facts.util.js';
320
+ export * from './utility/wrun/wrun-market-size-contract-carry.leaf.js';
311
321
  export * from './utility/wrun/wrun-market-size-defaults.leaf.js';
312
322
  export * from './utility/wrun/wrun-market-size-defaults.util.js';
313
323
  export * from './utility/wrun/wrun-memory-clamp.util.js';
@@ -320,6 +330,7 @@ export * from './utility/wrun/wrun-opra-stats.leaf.js';
320
330
  export * from './utility/wrun/wrun-option-contract-flow.util.js';
321
331
  export * from './utility/wrun/wrun-option-knobs.util.js';
322
332
  export * from './utility/wrun/wrun-option-prints.util.js';
333
+ export * from './utility/wrun/wrun-option-strike-flow-forecast.util.js';
323
334
  export * from './utility/wrun/wrun-option-strike-flow-lane.util.js';
324
335
  export * from './utility/wrun/wrun-option-strike-flow.util.js';
325
336
  export * from './utility/wrun/wrun-option-summary-lane.util.js';
@@ -351,6 +362,7 @@ export * from './utility/wrun/wrun-protocol-pending.util.js';
351
362
  export * from './utility/wrun/wrun-refusal-surface.util.js';
352
363
  export * from './utility/wrun/wrun-refusal-text.util.js';
353
364
  export * from './utility/wrun/wrun-refusal.util.js';
365
+ export * from './utility/wrun/wrun-refused-latest.util.js';
354
366
  export * from './utility/wrun/wrun-registry-errors.util.js';
355
367
  export * from './utility/wrun/wrun-render-select.util.js';
356
368
  export * from './utility/wrun/wrun-replay-lane.util.js';
@@ -381,6 +393,7 @@ export * from './utility/wrun/wrun-style-flags.util.js';
381
393
  export * from './utility/wrun/wrun-symbol-code.util.js';
382
394
  export * from './utility/wrun/wrun-table-chrome.util.js';
383
395
  export * from './utility/wrun/wrun-table-look.util.js';
396
+ export * from './utility/wrun/wrun-tape-per-order.util.js';
384
397
  export * from './utility/wrun/wrun-tape-source.util.js';
385
398
  export * from './utility/wrun/wrun-text-look.util.js';
386
399
  export * from './utility/wrun/wrun-text-params.util.js';
@@ -21,6 +21,12 @@ export interface RuntimeDiagnostic {
21
21
  * stays in `message` for author-facing surfaces.
22
22
  */
23
23
  details?: Record<string, unknown>;
24
+ /**
25
+ * The row was computed over OPRA data (the display boundary, contract K7): the run that reported it read the OPRA
26
+ * plane (its own fact from before it computed: the wrun runtime trap of such a run, the cloud's execution rows of a
27
+ * run carrying the OPRA mark). The editor console shows it, and every console export strips it.
28
+ */
29
+ opra?: true;
24
30
  }
25
31
  /** `details` of a FE_KSCRIPT_PERF_SLOW row: what the chip and the compact card show. */
26
32
  export interface KScriptPerfSlowDetails {
@@ -1,3 +1,4 @@
1
+ import type { LiveBucketVenue } from '../utility/chart/live-bucket.util.js';
1
2
  export type RailTf = '1m' | '5m' | '15m' | '1h' | '1d';
2
3
  export type ReplayStepTf = '1m' | '5m' | '10m' | '15m' | '30m' | '1h' | '2h' | '3h' | '4h' | '1d';
3
4
  type ReplayTimestampMode = 'uniform' | 'irregular';
@@ -32,6 +33,13 @@ export interface ReplayBuffer {
32
33
  tf: ReplayResolution;
33
34
  timestampMode?: ReplayTimestampMode;
34
35
  chartIntervalMs?: number;
36
+ /**
37
+ * The chart market whose bars the buffer replays (`liveBucketVenueOf` over the chart's metadata at
38
+ * the load): every chart-bar read of the buffer (`alignChartBucketMs`, `chartBucketOpenMs`,
39
+ * `chartBucketEndMs`) keys on it, so a CME Group chart's forming bar, reveal cutoff and paint
40
+ * cutoff land on the session lattice its history rides. Absent: the plain grid.
41
+ */
42
+ barVenue?: LiveBucketVenue | null;
35
43
  availableResolutions?: ReplayResolution[];
36
44
  abortController: AbortController;
37
45
  /** Total visible X span used by replay follow range syncs. */
@@ -387,7 +387,11 @@ export interface WrunMetadataParam {
387
387
  hint?: string;
388
388
  /** Inputs sharing a `row` string render side by side. */
389
389
  row?: string;
390
- /** A param NAME: the row dims (or hides, with `hide`) while that toggle is off. */
390
+ /** The row's gate: it dims (or hides, with `hide`) while the gate is closed. One clause over another param's
391
+ * value (the om SDK's grammar, read by wrun-script-inputs.util parseWrunWhen): `name` while it is truthy (a
392
+ * toggle on, an option or a number other than 0), `!name` while it is falsy, `name=v`, `name!=v` and
393
+ * `name in v1,v2` against numbers (a toggle as 1 / 0, a select by its option's index). A gate the FE cannot
394
+ * read never closes the row. */
391
395
  when?: string;
392
396
  hide?: boolean;
393
397
  /** Render the number as a slider. */
@@ -452,7 +456,9 @@ export interface WrunVisibleBy {
452
456
  export type WrunLayoutEntry = {
453
457
  kind: 'page';
454
458
  title: string;
455
- } | {
459
+ }
460
+ /** `when`: the section's gate, the params' `when` grammar (WrunMetadataParam.when). */
461
+ | {
456
462
  kind: 'section';
457
463
  title: string;
458
464
  toggle?: string;
@@ -1037,6 +1043,11 @@ export interface WrunMetadataOutput {
1037
1043
  align?: WrunTextAlign;
1038
1044
  pill_style?: 'filled' | 'outlined';
1039
1045
  font_size?: number;
1046
+ /** A guide's axis tag look (kit scaffold 102, flag ignore), beside
1047
+ * `axis_label: true`: 'pill' (today's tag), 'quiet' (one soft capsule) or
1048
+ * 'words' (a tick, the price and the name in plain ink). Absent = 'pill'.
1049
+ * The host mounts it as the guide's run-output `axisTagLook`. */
1050
+ axis_look?: 'pill' | 'quiet' | 'words';
1040
1051
  /** OT11: horizontal-then-vertical segments on a line output. */
1041
1052
  step?: boolean;
1042
1053
  /** OT13: the stroke shaded by height, 2..8 stops from the pane top down. */
@@ -1242,6 +1253,11 @@ export interface WrunPanelHighlight {
1242
1253
  row?: string;
1243
1254
  col?: string;
1244
1255
  }
1256
+ /** A numeric-x line or bars frame's label per row (C3; frame only, `x_labels` beside `rows`, never
1257
+ * a declared word): one entry per row in row order, "" for a row without a label, each at most 24
1258
+ * characters. The pane prints a row's label where it would print the row's x number: a line's
1259
+ * hover card title, a bar's axis tick and hover card title. */
1260
+ export type WrunPanelXLabels = string[];
1245
1261
  /** The per-series style words of a panel (`panels[i].series[j]`, g1 SC24
1246
1262
  * SC25 SC29 SC30 SC35 SC40): line series take fill, style, smooth, points,
1247
1263
  * labels, width and line_style; table series take align and the column
@@ -80,6 +80,12 @@ export interface TradesTapeFloor {
80
80
  valuePerUnit?: unknown;
81
81
  /** An option book's registry trade units: its prints are valued by their USD premium. */
82
82
  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;
83
89
  }
84
90
  export interface LiveTradesMergeOptions extends TradesTapeFloor {
85
91
  /** The large lane's table floor (the `large` acquisition): a print the large-print table never
@@ -107,6 +113,20 @@ export interface LiveTradePrint {
107
113
  /** The series envelope's normalized symbol (`BTC-USDT`), when the frame names one. */
108
114
  normalizedSymbol?: string;
109
115
  }
116
+ interface LiveTradeWire {
117
+ price?: unknown;
118
+ amount?: unknown;
119
+ quoteAmount?: unknown;
120
+ timestamp?: {
121
+ seconds?: unknown;
122
+ nanoseconds?: unknown;
123
+ nanos?: unknown;
124
+ };
125
+ }
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;
110
130
  /**
111
131
  * The chart bar a print at `tsMs` lands in, keyed the way the chart's candles of that market are:
112
132
  * the CME Group session lattice at 4h, 1d and 1w on a CME venue (the gateway's
@@ -152,9 +172,9 @@ export declare function tradesServedStartMs(nowMs: number, historySec: number, i
152
172
  barLimitSec?: number;
153
173
  exchange?: unknown;
154
174
  }): number;
155
- /** One raw TRADE point read the way the fold reads it: the print's stamp in ms, its price, size,
156
- * signed side and envelope exchange; null for a point the fold rejects (no side, a non-positive
157
- * or non-finite size, a bad price or stamp). */
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). */
158
178
  export declare function readLiveTradePrint(newPoint: unknown): LiveTradePrint | null;
159
179
  /** Whether the large-print table floors a market's prints by notional: its normalized symbol's
160
180
  * quote (the second field, the gateway writer's `quoteAsset`: `BTC-USDT` quotes USDT) is USD or a
@@ -176,6 +196,8 @@ export declare function isTradesDollarQuoteAsset(asset: unknown): boolean;
176
196
  * point value `valuePerUnit` carries. A print that cannot be valued (no `valuePerUnit`, units that cannot say) is
177
197
  * null: it never folds, whatever its size.
178
198
  * - 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).
179
201
  */
180
202
  export declare function tradesTapeCellSize(print: Pick<LiveTradePrint, 'price' | 'size'>, floor: TradesTapeFloor): number | null;
181
203
  /** Whether a tape floor can value a live print at all: a raw floor always can; a dollar floor needs the market's
@@ -200,6 +222,18 @@ export declare function tradesCmeProductRoot(market: TradesLargeMarket): string
200
222
  * skips it); elsewhere the notional floor on a market quoted in dollars, null on any other quote
201
223
  * (KRW, a coin): the table holds none of its prints. */
202
224
  export declare function tradesLargeFloorOfMarket(market: TradesLargeMarket): TradesLargeFloor | null;
225
+ /**
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).
235
+ */
236
+ export declare function tradesFloorPerOrder(exchange: unknown): boolean;
203
237
  /** Whether a tape floor is a dollar floor (C-DOLLAR's `minValue`, finite and above zero). */
204
238
  export declare function tradesTapeFloorIsDollars(floor: Pick<TradesTapeFloor, 'minValue'>): boolean;
205
239
  /** The tape lane an acquisition rides on a market: the large lane (the table's retention, the
@@ -232,5 +266,8 @@ export declare function tradesLargeHistoryAnswers(market: TradesLargeMarket, flo
232
266
  export declare function tradesBelowLargeFloor(print: LiveTradePrint, market?: TradesLargeMarket): boolean;
233
267
  /** Fold one raw TRADE point onto the tape rows: the NEW rows array (the touched row a new array,
234
268
  * every other row shared by reference), or null when the point is rejected (the caller keeps
235
- * its rows). The print lands in the bar `options.barTs` names, else in its own bar on the lane's grid. */
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. */
236
272
  export declare function mergeLiveTradesDataPoint(lastDataPoint: ReadonlyArray<ArrayLike<unknown>>, newPoint: unknown, intervalMs: number, options?: LiveTradesMergeOptions): LiveTradesRow[] | null;
273
+ export {};
@@ -18,6 +18,18 @@
18
18
  // LIVE_MAX_CELLS_PER_BAR prints (the oldest are dropped and the caller is told
19
19
  // through `onCapped`); the fold never mutates the rows or the cells it is
20
20
  // handed (the touched row is a new array in a new container).
21
+ //
22
+ // The floor is an ORDER's where the plane judges it per order: one aggressor
23
+ // order on a CME Group venue fills as many small fills on one exchange stamp
24
+ // and side, which the package (Big Trades' "Combine fills") and the template
25
+ // add back into one trade. A floor applied to each fill before that drops the
26
+ // fills of a big order one by one (a 147-contract NQZ6 buy of 45 fills drew 34
27
+ // at a floor of 10). So where the per-order switch holds (wrun-tape-per-order
28
+ // .util `wrunTapePerOrder`, on the venues `tradesFloorPerOrder` names) the
29
+ // history read asks the gateway's per-order floor and keeps every fill it
30
+ // answers, and the tape's live prints, judged per order by the order gate
31
+ // before the queues (live-trades-order-gate.util), fold with no floor of
32
+ // their own (`TradesTapeFloor.perOrder`).
21
33
  import { Intervals } from '../../constants/interval.constants.js';
22
34
  import { barEndMs, barStartMs } from '../../utility/chart/calendar-interval.util.js';
23
35
  import { cmeSessionBarEndMs, cmeSessionBarOpenMs, cmeSessionBucketMs, isCmeSessionLatticeExchange, isCmeSessionLatticeIntervalMs, } from '../../utility/chart/cme-session-bucket.util.js';
@@ -118,6 +130,15 @@ export const TRADES_LARGE_CME_CONTRACT_FLOORS = {
118
130
  export const TRADES_MAX_HISTORY_SEC = 2 * 3600;
119
131
  /** A CME Group contract code: the product root, a delivery month letter, one or two year digits. */
120
132
  const CME_CONTRACT_CODE = /^([A-Z0-9]+?)[FGHJKMNQUVXZ]\d{1,2}$/;
133
+ /** A live point's trade, whichever case carries it: the raw TRADE channel's `trade` or the large-print channel's
134
+ * `tradeLarge` (the history adapter reads the two the same way). Every reader of a live print's amount reads it here,
135
+ * so a floor never reads one case while the fold reads the other. */
136
+ export function liveTradeOfPoint(point) {
137
+ if (!point || typeof point !== 'object')
138
+ return undefined;
139
+ const { trade, tradeLarge } = point;
140
+ return trade ?? tradeLarge;
141
+ }
121
142
  /**
122
143
  * The chart bar a print at `tsMs` lands in, keyed the way the chart's candles of that market are:
123
144
  * the CME Group session lattice at 4h, 1d and 1w on a CME venue (the gateway's
@@ -197,14 +218,14 @@ export function tradesServedStartMs(nowMs, historySec, intervalMs, options = {})
197
218
  ? Number.NEGATIVE_INFINITY
198
219
  : tradesBarLimitStartMs(nowMs, options.barLimitSec, intervalMs, options.exchange));
199
220
  }
200
- /** One raw TRADE point read the way the fold reads it: the print's stamp in ms, its price, size,
201
- * signed side and envelope exchange; null for a point the fold rejects (no side, a non-positive
202
- * or non-finite size, a bad price or stamp). */
221
+ /** One raw TRADE point (or a TRADE_LARGE one, its `tradeLarge` case) read the way the fold reads it:
222
+ * the print's stamp in ms, its price, size, signed side and envelope exchange; null for a point the
223
+ * fold rejects (no side, a non-positive or non-finite size, a bad price or stamp). */
203
224
  export function readLiveTradePrint(newPoint) {
204
225
  if (!newPoint || typeof newPoint !== 'object')
205
226
  return null;
206
227
  const point = newPoint;
207
- const trade = point.trade;
228
+ const trade = liveTradeOfPoint(point);
208
229
  const side = point.series?.side === 'BUY' ? 1 : point.series?.side === 'SELL' ? -1 : 0;
209
230
  const size = Number(trade?.amount);
210
231
  const price = Number(trade?.price);
@@ -256,8 +277,11 @@ export function isTradesDollarQuoteAsset(asset) {
256
277
  * point value `valuePerUnit` carries. A print that cannot be valued (no `valuePerUnit`, units that cannot say) is
257
278
  * null: it never folds, whatever its size.
258
279
  * - Otherwise the raw size, below a finite positive `minSize` null.
280
+ * - On a tape whose prints arrive judged per order (`floor.perOrder`), no floor: the dollar value (above zero), or the
281
+ * raw size, whatever the floor (the fills below it belong to an order that reached it).
259
282
  */
260
283
  export function tradesTapeCellSize(print, floor) {
284
+ const perOrder = floor.perOrder === true;
261
285
  if (tradesTapeFloorIsDollars(floor)) {
262
286
  const minValue = Number(floor.minValue);
263
287
  let value;
@@ -268,8 +292,10 @@ export function tradesTapeCellSize(print, floor) {
268
292
  const unit = Number(floor.valuePerUnit);
269
293
  value = Number.isFinite(unit) && unit > 0 ? print.price * print.size * unit : null;
270
294
  }
271
- return value !== null && Number.isFinite(value) && value >= minValue ? value : null;
295
+ return value !== null && Number.isFinite(value) && value > 0 && (perOrder || value >= minValue) ? value : null;
272
296
  }
297
+ if (perOrder)
298
+ return print.size;
273
299
  const minSize = Number(floor.minSize);
274
300
  return Number.isFinite(minSize) && minSize > 0 && print.size < minSize ? null : print.size;
275
301
  }
@@ -327,6 +353,20 @@ export function tradesLargeFloorOfMarket(market) {
327
353
  ? { kind: 'notional', min: TRADES_LARGE_MIN_QUOTE_AMOUNT }
328
354
  : null;
329
355
  }
356
+ /**
357
+ * Whether the gateway floors a tape read on `exchange` per aggressor ORDER (tsdb-gateway `minAmountPerOrder`, on the
358
+ * TRADE and TRADE_LARGE reads): it sums the fills that share an order (the timestamp, exchange, category, coin, symbol,
359
+ * normalized symbol and side), keeps each order whose total reaches the read's floor (`minAmount`, or `minQuoteAmount`
360
+ * on a dollar tape) and answers EVERY fill of it, the fills below the floor included, rows and columns unchanged. The
361
+ * CME Group venues (the session lattice venues, the gateway's `isCMEGroupExchange`) honor it: one aggressor order there
362
+ * 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
363
+ * 147-contract NQZ6 buy (2026-10-23 14:31:54Z). Every other venue keeps the floor per fill and its read never names the
364
+ * field (a v2-only field moves a read off /v3). The per-order switch (wrun-tape-per-order.util `wrunTapePerOrder`) can
365
+ * hold on these venues alone, and the history worker checks this rule beside the ask's `perOrder` (k-trades.worker).
366
+ */
367
+ export function tradesFloorPerOrder(exchange) {
368
+ return isCmeSessionLatticeExchange(exchange);
369
+ }
330
370
  /** Whether a tape floor is a dollar floor (C-DOLLAR's `minValue`, finite and above zero). */
331
371
  export function tradesTapeFloorIsDollars(floor) {
332
372
  const minValue = Number(floor.minValue);
@@ -394,7 +434,9 @@ export function tradesBelowLargeFloor(print, market) {
394
434
  }
395
435
  /** Fold one raw TRADE point onto the tape rows: the NEW rows array (the touched row a new array,
396
436
  * every other row shared by reference), or null when the point is rejected (the caller keeps
397
- * its rows). The print lands in the bar `options.barTs` names, else in its own bar on the lane's grid. */
437
+ * its rows). The print lands in the bar `options.barTs` names, else in its own bar on the lane's grid.
438
+ * A per-order tape (`options.perOrder`) folds its prints under no floor, the large-print table's
439
+ * included. */
398
440
  export function mergeLiveTradesDataPoint(lastDataPoint, newPoint, intervalMs, options = {}) {
399
441
  if (!Number.isFinite(intervalMs) || intervalMs <= 0)
400
442
  return null;
@@ -404,8 +446,11 @@ export function mergeLiveTradesDataPoint(lastDataPoint, newPoint, intervalMs, op
404
446
  const size = tradesTapeCellSize(print, options);
405
447
  if (size === null)
406
448
  return null;
407
- if (options.largeFloor !== undefined && tradesBelowLargeFloor(print, options.largeFloor))
449
+ if (options.largeFloor !== undefined &&
450
+ options.perOrder !== true &&
451
+ tradesBelowLargeFloor(print, options.largeFloor)) {
408
452
  return null;
453
+ }
409
454
  const barTs = options.barTs ?? tradesBarStartMs(print.tsMs, intervalMs, print.exchange);
410
455
  const rows = lastDataPoint;
411
456
  const last = rows.length > 0 ? rows[rows.length - 1] : undefined;