@orangecharts/wrun-chart-host 0.9.0 → 0.11.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 (252) hide show
  1. package/README.md +2 -0
  2. package/dist/constants/feature-flags.constants.d.ts +15 -1
  3. package/dist/constants/feature-flags.constants.js +130 -24
  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/opra-compliance.constants.d.ts +3 -2
  7. package/dist/constants/opra-compliance.constants.js +3 -2
  8. package/dist/constants/option-venues.constants.d.ts +2 -2
  9. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
  10. package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
  11. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
  12. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
  13. package/dist/constants/venue-presets.constants.d.ts +20 -20
  14. package/dist/constants/venue-presets.constants.js +24 -26
  15. package/dist/host-env.d.ts +21 -5
  16. package/dist/host-env.js +6 -0
  17. package/dist/host-ports.types.d.ts +102 -19
  18. package/dist/index.d.ts +18 -0
  19. package/dist/index.js +18 -0
  20. package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
  21. package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
  22. package/dist/interfaces/cme-realtime.interface.js +6 -3
  23. package/dist/interfaces/kscript-diagnostics.interface.d.ts +12 -0
  24. package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
  25. package/dist/interfaces/prediction-market.interface.d.ts +7 -0
  26. package/dist/interfaces/replay.interface.d.ts +8 -0
  27. package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
  28. package/dist/interfaces/stocks-realtime.interface.js +32 -0
  29. package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +62 -94
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +106 -171
  32. package/dist/market-data/billing.interface.d.ts +174 -36
  33. package/dist/market-data/billing.interface.js +58 -8
  34. package/dist/market-data/venue.d.ts +152 -7
  35. package/dist/market-data/venues/cme.contract.copy.json +66 -0
  36. package/dist/market-data/venues/cme.d.ts +126 -0
  37. package/dist/market-data/venues/cme.js +133 -0
  38. package/dist/market-data/venues/index.d.ts +294 -7
  39. package/dist/market-data/venues/index.js +49 -6
  40. package/dist/market-data/venues/opra.contract.copy.json +3 -2
  41. package/dist/market-data/venues/opra.d.ts +2 -2
  42. package/dist/market-data/venues/opra.js +5 -2
  43. package/dist/market-data/venues/stocks.contract.copy.json +64 -0
  44. package/dist/market-data/venues/stocks.d.ts +130 -0
  45. package/dist/market-data/venues/stocks.js +117 -0
  46. package/dist/settings-templates/footprint-rows.js +35 -2
  47. package/dist/settings-templates/form-rows.d.ts +2 -1
  48. package/dist/settings-templates/index.js +7 -3
  49. package/dist/settings-templates/indicator-fields.d.ts +5 -4
  50. package/dist/settings-templates/indicator-fields.js +79 -10
  51. package/dist/settings-templates/tool-rules.d.ts +32 -15
  52. package/dist/settings-templates/tool-rules.js +33 -11
  53. package/dist/settings-templates/tool-tables.generated.js +95 -31
  54. package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
  55. package/dist/utility/chart/book-live-bucket.util.js +47 -0
  56. package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
  57. package/dist/utility/chart/cme-cache-context.util.js +10 -6
  58. package/dist/utility/chart/cme-realtime.util.js +10 -0
  59. package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
  60. package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
  61. package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
  62. package/dist/utility/chart/effective-chart-session.util.js +39 -0
  63. package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
  64. package/dist/utility/chart/host-bar-placement.util.js +170 -30
  65. package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
  66. package/dist/utility/chart/index-host-tier.util.js +7 -2
  67. package/dist/utility/chart/index-mode-admission.util.js +30 -3
  68. package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
  69. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
  70. package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
  71. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +9 -7
  72. package/dist/utility/chart/kscript-live-coalesce.util.js +13 -8
  73. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
  74. package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
  75. package/dist/utility/chart/kscript-provenance-keys.util.js +13 -0
  76. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +5 -1
  77. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
  78. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
  79. package/dist/utility/chart/kscript-venue-policy.util.d.ts +156 -43
  80. package/dist/utility/chart/kscript-venue-policy.util.js +249 -59
  81. package/dist/utility/chart/live-bucket.util.d.ts +24 -8
  82. package/dist/utility/chart/live-bucket.util.js +85 -27
  83. package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
  84. package/dist/utility/chart/market-session-schedule.util.js +16 -0
  85. package/dist/utility/chart/marketKind.util.js +5 -0
  86. package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
  87. package/dist/utility/chart/mixed-mode.util.js +14 -0
  88. package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
  89. package/dist/utility/chart/opra-read-access.leaf.js +5 -3
  90. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
  91. package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
  92. package/dist/utility/chart/rth-session.util.d.ts +12 -10
  93. package/dist/utility/chart/rth-session.util.js +25 -21
  94. package/dist/utility/chart/trading-day.util.d.ts +17 -0
  95. package/dist/utility/chart/trading-day.util.js +59 -0
  96. package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
  97. package/dist/utility/chart/window-geometry.leaf.js +22 -6
  98. package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
  99. package/dist/utility/chart/window-owner.leaf.js +45 -3
  100. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
  101. package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
  102. package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
  103. package/dist/utility/chart/wrun-run-result.util.js +141 -6
  104. package/dist/utility/intl-locale.util.js +5 -0
  105. package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
  106. package/dist/utility/options/option-bar-anchor.util.js +340 -0
  107. package/dist/utility/options/option-venue.util.d.ts +18 -0
  108. package/dist/utility/options/option-venue.util.js +27 -0
  109. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +4 -0
  110. package/dist/utility/v2/gate-plane.util.d.ts +12 -3
  111. package/dist/utility/v2/gate-plane.util.js +30 -4
  112. package/dist/utility/v2/gate-session-latch.util.js +1 -1
  113. package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
  114. package/dist/utility/v2/stocks-governed.util.js +34 -0
  115. package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
  116. package/dist/utility/wrun/derived-roots.leaf.js +27 -0
  117. package/dist/utility/wrun/derived-roots.util.d.ts +205 -0
  118. package/dist/utility/wrun/derived-roots.util.js +451 -0
  119. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +43 -7
  120. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
  121. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
  122. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
  123. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
  124. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
  125. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
  126. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
  127. package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
  128. package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
  129. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
  130. package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
  131. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
  132. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
  133. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
  134. package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
  135. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
  136. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
  137. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
  138. package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
  139. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
  140. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
  141. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +41 -10
  142. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +111 -0
  143. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +133 -0
  144. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
  145. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
  146. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
  147. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +197 -13
  148. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +761 -27
  149. package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
  150. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
  151. package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
  152. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +60 -16
  153. package/dist/utility/wrun/wrun-chart-market-facts.util.js +113 -61
  154. package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
  155. package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
  156. package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
  157. package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
  158. package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
  159. package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
  160. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
  161. package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
  162. package/dist/utility/wrun/wrun-frames.d.ts +27 -6
  163. package/dist/utility/wrun/wrun-frames.js +73 -10
  164. package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
  165. package/dist/utility/wrun/wrun-handles.util.js +9 -8
  166. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
  167. package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
  168. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
  169. package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
  170. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
  171. package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
  172. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
  173. package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
  174. package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
  175. package/dist/utility/wrun/wrun-live-intake.util.d.ts +35 -15
  176. package/dist/utility/wrun/wrun-live-intake.util.js +243 -126
  177. package/dist/utility/wrun/wrun-live-tick.util.d.ts +13 -5
  178. package/dist/utility/wrun/wrun-live-tick.util.js +279 -99
  179. package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
  180. package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
  181. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +60 -11
  182. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +70 -5
  183. package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
  184. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
  185. package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
  186. package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
  187. package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
  188. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
  189. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
  190. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
  191. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
  192. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
  193. package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
  194. package/dist/utility/wrun/wrun-option-views.util.d.ts +323 -28
  195. package/dist/utility/wrun/wrun-option-views.util.js +484 -71
  196. package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
  197. package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
  198. package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
  199. package/dist/utility/wrun/wrun-output-style.util.js +20 -2
  200. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +32 -2
  201. package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
  202. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
  203. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
  204. package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
  205. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +160 -42
  206. package/dist/utility/wrun/wrun-overlay-run.util.js +1244 -209
  207. package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
  208. package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
  209. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
  210. package/dist/utility/wrun/wrun-panel-mount.util.js +114 -19
  211. package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
  212. package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
  213. package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
  214. package/dist/utility/wrun/wrun-param-map.util.js +10 -5
  215. package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
  216. package/dist/utility/wrun/wrun-param-values.util.js +4 -0
  217. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
  218. package/dist/utility/wrun/wrun-pin-spelling.util.js +39 -14
  219. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
  220. package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
  221. package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
  222. package/dist/utility/wrun/wrun-refusal.util.js +22 -0
  223. package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
  224. package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
  225. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
  226. package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
  227. package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
  228. package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
  229. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
  230. package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
  231. package/dist/utility/wrun/wrun-run-interval.util.d.ts +43 -9
  232. package/dist/utility/wrun/wrun-run-interval.util.js +58 -15
  233. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
  234. package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
  235. package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
  236. package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
  237. package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
  238. package/dist/utility/wrun/wrun-socket-row-source.js +118 -8
  239. package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -18
  240. package/dist/utility/wrun/wrun-source-rows.util.js +61 -27
  241. package/dist/utility/wrun/wrun-style-words.util.js +6 -4
  242. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
  243. package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
  244. package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
  245. package/dist/utility/wrun/wrun-tape-per-order.util.js +7 -0
  246. package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
  247. package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
  248. package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
  249. package/dist/utils/replay/replay-buffer-math.js +227 -20
  250. package/dist/workers/constants/socket-slots.d.ts +91 -6
  251. package/dist/workers/constants/socket-slots.js +85 -6
  252. package/package.json +5 -5
@@ -8,6 +8,30 @@
8
8
  * closed-candle cut and intrabar head, the live tick's cuts, revision checks, wake and coverage.
9
9
  * Each wrapper composes the package's exports and holds no calendar of its own:
10
10
  *
11
+ * - The chart's RTH session, read first (`isChartRthActive`: a chart in its regular session, at an
12
+ * intraday interval, on a root with an RTH window; the chart's symbol and its raw `sessionType`,
13
+ * unset being the full session on a future): the chart's rows, and every CME leg it fetches at an
14
+ * intraday interval whose own market has an RTH window (the fetch's rule, chart-rth.util
15
+ * `kOhlcvSessionPayloadFields`: the chart's own market on the chart's session, a foreign CME
16
+ * token while the chart rides RTH), sit on the chart's RTH grid (`liveBucketStartMs` on that
17
+ * market in the regular session: above 30m the bars anchored at the root's RTH open, 09:30 New
18
+ * York, 09:00 on NYMEX; at 30m and finer the UTC floor whose start the window holds). Each bar
19
+ * ends at `rthAnchoredBucketEndMs`: its open plus the span, the session's last bar a stub to the
20
+ * session close (16:15 New York, 14:30 on NYMEX). A primary row there runs [its bar's open, that
21
+ * end) (`wrunPrimaryRowBounds`, read on the root's window alone, the rule the shared host's venue
22
+ * layer gives the row builder for the same chart), the row holding an instant is that bar
23
+ * (`wrunPrimaryRowHoldingMs`), and the pinned-close timer wakes at the end of the leg's bar
24
+ * holding now, off the session at the end of the next session's first bar (`wrunLegBarCloseAt`).
25
+ * The lattice answers below never apply there: an RTH stamp (13:30Z) is no lattice stamp, and
26
+ * the lattice's bar holding now (14:00Z to 18:00Z at 4h) is not the chart's (13:30Z to 17:30Z).
27
+ * A leg candle stamped at an RTH bar's open closes at that bar's end (`wrunLegCandleClose`, the
28
+ * chart handed: the 4h stub opening 17:30Z closes at the 20:15Z session close, never 21:30Z) and
29
+ * trades from its stamp (`wrunLegCandleOpen`); a stamp off the RTH grid keeps the readings below.
30
+ * That close and the pinned-close timer, like the row builder's session (`wrunChartSession`),
31
+ * read the session the chart RIDES (`effectiveChartSessionType` at the chart's interval), never
32
+ * the persisted word: a daily chart that keeps a 'regular' rides the full session, and the fetch
33
+ * serves its intraday legs the full session too, whose bars an RTH stub end would close early
34
+ * and an RTH timer would wake for at the wrong ends.
11
35
  * - The CME session lattice (`isCmeSessionLatticeExchange`, `isCmeSessionLatticeIntervalMs`): a
12
36
  * leg whose venue (its pinned exchange, else the chart's) the gateway builds on it closes each
13
37
  * candle at `cmeSessionBarEndMs` (a 3d group at the 17:00 Chicago open after its last trade date,
@@ -23,9 +47,10 @@
23
47
  * extended-hours chart fetches every print, so every leg there keeps open plus the span.
24
48
  * - Every other leg (US_STOCKS among them, for now) keeps the leg core's open plus the span.
25
49
  *
26
- * What the browser still owns: the chart's session word (`wrunChartSessionType`: regular unless the
27
- * chart runs its extended session, never unstated), a calendar row's bounds on every market (1M 3M
28
- * 6M 1Y, `wrunCalendarRowBounds`, and the calendar bar holding an instant), and the live tick's
50
+ * What the browser still owns: the chart's session words (`wrunChartSession`: the session the chart
51
+ * rides on a market with an RTH window, else `wrunChartSessionType`, regular unless the chart runs its
52
+ * extended session, never unstated), a calendar row's bounds on every market (1M 3M 6M 1Y,
53
+ * `wrunCalendarRowBounds`, and the calendar bar holding an instant), and the live tick's
29
54
  * timing: the gateway's rows hold a stock candle whole only minutes after its close (Polygon's
30
55
  * minute bars land after their minute, the closing auction joins the session's last minute once
31
56
  * the 16:00 bar has landed), so the live tick re-asks a stock leg `WRUN_US_EQUITIES_CLOSE_SETTLE_MS`
@@ -36,7 +61,9 @@
36
61
  * entry loads before its first use.
37
62
  */
38
63
  import { barStartMs, isCalendarIntervalMs } from '../chart/calendar-interval.util.js';
39
- import { liveBucketStartMs } from '../chart/live-bucket.util.js';
64
+ import { effectiveChartSessionType } from '../chart/effective-chart-session.util.js';
65
+ import { liveBucketStartMs, liveBucketStartsInRange } from '../chart/live-bucket.util.js';
66
+ import { hasRthWindow, isChartRthActive, isRthBucketExactIntervalMs, nextRthSessionOpenMs, rthAnchoredBucketEndMs, rthAnchoredBucketStartMs, } from '../chart/rth-session.util.js';
40
67
  import { isEquityExtendedSession } from '../chart/us-equities-session.util.js';
41
68
  import { wrunChartHostEnv } from '../../host-env.js';
42
69
  import { wrunCalendarRowBounds } from './wrun-source-rows.util.js';
@@ -51,6 +78,10 @@ export const WRUN_US_EQUITIES_CLOSE_SETTLE_MS = 180_000;
51
78
  function legExchangeOf(leg, chartExchange) {
52
79
  return leg.market?.exchange ?? chartExchange;
53
80
  }
81
+ /** The symbol a leg's bars come from: its pinned symbol, else the chart's (the fetch placeholders). */
82
+ function legSymbolOf(leg, chartSymbol) {
83
+ return leg.market?.symbol ?? chartSymbol;
84
+ }
54
85
  /** The session the chart fetches a US listing's candles on, as the shared host's session calendar
55
86
  * reads it: 'extended' only while the chart runs its extended session (`isEquityExtendedSession`,
56
87
  * the fetch's own decider), else 'regular', an unset session included (the browser never leaves it
@@ -58,16 +89,102 @@ function legExchangeOf(leg, chartExchange) {
58
89
  export function wrunChartSessionType(sessionType) {
59
90
  return isEquityExtendedSession(sessionType) ? 'extended' : 'regular';
60
91
  }
61
- /** The chart's session as the row builder reads it (`WrunChartSourceRows.session`): the chart's
62
- * exchange and the session word of its `sessionType`. */
63
- export function wrunChartSession(exchange, sessionType) {
64
- return { ...(exchange !== undefined ? { exchange } : {}), sessionType: wrunChartSessionType(sessionType) };
92
+ /** The chart's session as the row builder reads it (`WrunChartSourceRows.session`): the chart's exchange, its
93
+ * symbol (`chart`, when the caller has it) and the session the chart rides. On a market with an RTH window (a
94
+ * future, found by the symbol) that is the effective word at the chart's interval (`effectiveChartSessionType`):
95
+ * 'regular' only while the chart rides RTH there, an unset word the full session, so the shared host's session
96
+ * calendar reads RTH rows and RTH legs only on a chart that rides RTH. Such a chart still fetches a pinned US
97
+ * listing on its persisted word (`kOhlcvSessionPayloadFields` reads it for a Polygon source: unset or 'regular'
98
+ * is the listing's regular hours), so where the two words differ the session carries that one too
99
+ * (`listingSessionType`, `wrunChartSessionType`). Every other market, and a call without a symbol, keeps
100
+ * `wrunChartSessionType`: on a stock the word is the extended-hours flag. */
101
+ export function wrunChartSession(exchange, sessionType, chart) {
102
+ const symbol = typeof chart?.symbol === 'string' && chart.symbol !== '' ? chart.symbol : undefined;
103
+ const listing = wrunChartSessionType(sessionType);
104
+ const rides = symbol !== undefined && hasRthWindow(symbol, exchange)
105
+ ? effectiveChartSessionType(exchange, symbol, chart?.interval, sessionType)
106
+ : listing;
107
+ return {
108
+ ...(exchange !== undefined ? { exchange } : {}),
109
+ ...(symbol !== undefined ? { symbol } : {}),
110
+ sessionType: rides,
111
+ ...(rides !== listing ? { listingSessionType: listing } : {}),
112
+ };
65
113
  }
66
114
  /** Whether the gateway builds this leg's bars on the CME session lattice. */
67
115
  export function wrunLegRidesCmeSession(leg, chartExchange) {
68
116
  const host = wrunChartHostEnv().sharedHost();
69
117
  return (host.isCmeSessionLatticeExchange(legExchangeOf(leg, chartExchange)) && host.isCmeSessionLatticeIntervalMs(leg.legMs));
70
118
  }
119
+ /** The chart's RTH grid on `exchange` and `symbol` at `intervalMs` (the module doc): that market in the regular
120
+ * session while the chart rides RTH there (`isChartRthActive` on the chart's raw `sessionType`), else undefined. */
121
+ function rthVenueOf(exchange, symbol, sessionType, intervalMs) {
122
+ return isChartRthActive(exchange, symbol, sessionType, intervalMs)
123
+ ? { exchange, symbol, sessionType: 'regular' }
124
+ : undefined;
125
+ }
126
+ /** The RTH grid a leg's bars ride, the fetch's rule (the module doc): the chart rides RTH at the leg's interval
127
+ * and the leg's own market has an RTH window there (the chart's market, or a foreign CME token), else
128
+ * undefined. */
129
+ function legRthVenueOf(leg, chartExchange, sessionType, chartSymbol) {
130
+ if (!(Number.isFinite(leg.legMs) && leg.legMs > 0))
131
+ return undefined;
132
+ if (rthVenueOf(chartExchange, chartSymbol, sessionType, leg.legMs) === undefined)
133
+ return undefined;
134
+ return rthVenueOf(legExchangeOf(leg, chartExchange), legSymbolOf(leg, chartSymbol), 'regular', leg.legMs);
135
+ }
136
+ /** The RTH grid a leg's bars ride on the session the chart RIDES (`wrunChartSession` on `chart`, its symbol and
137
+ * interval, the fetch's rule: a daily chart that keeps 'regular' rides, and fetches its intraday legs on, the full
138
+ * session), else undefined. */
139
+ function legRidesChartRthVenueOf(leg, chartExchange, sessionType, chart) {
140
+ const rides = wrunChartSession(chartExchange, sessionType, chart);
141
+ return legRthVenueOf(leg, chartExchange, rides.sessionType, rides.symbol);
142
+ }
143
+ /** Whether a leg's bars ride the chart's RTH grid (the module doc), read on the session the chart rides at
144
+ * `chartInterval` (the chart's interval label or milliseconds; absent, the leg's own interval stands for it): its
145
+ * pinned-close timer reads the RTH bars, never the lattice's or the plain grid's. */
146
+ export function wrunLegRidesRth(leg, chartExchange, sessionType, chartSymbol, chartInterval) {
147
+ const chart = { symbol: chartSymbol, interval: chartInterval ?? leg.legMs };
148
+ return legRidesChartRthVenueOf(leg, chartExchange, sessionType, chart) !== undefined;
149
+ }
150
+ /** The span of an RTH bar opening at `openMs`: to `rthAnchoredBucketEndMs` (open plus the span, the session's
151
+ * stub at the session close), null when the open is off the session. */
152
+ function rthBarSpan(symbol, openMs, intervalMs) {
153
+ const closeMs = openMs === null ? null : rthAnchoredBucketEndMs(symbol, openMs, intervalMs);
154
+ return openMs === null || closeMs === null ? null : { openMs, closeMs };
155
+ }
156
+ /** The RTH bar holding `instantMs` on `venue`'s grid, the chart's own bar rule (`liveBucketStartMs`): null off
157
+ * the session or on a day the product does not trade (the leg close and the row holding an instant). */
158
+ function rthBarHolding(venue, instantMs, intervalMs) {
159
+ return rthBarSpan(venue.symbol, liveBucketStartMs(instantMs, intervalMs, venue), intervalMs);
160
+ }
161
+ /** The bounds of a primary row labelled `rowOpenMs` on a chart riding RTH, on the root's window alone (the rule
162
+ * the shared host's venue layer reads for the row builder, so both read one answer): above 30m the bar
163
+ * anchored at the session open that holds the label (`rthAnchoredBucketStartMs`), at 30m and finer the UTC
164
+ * floor's bar; null when that bar opens off the session. */
165
+ function rthRowSpan(symbol, rowOpenMs, intervalMs) {
166
+ const openMs = isRthBucketExactIntervalMs(intervalMs)
167
+ ? rowOpenMs - (rowOpenMs % intervalMs)
168
+ : rthAnchoredBucketStartMs(symbol, rowOpenMs, intervalMs);
169
+ return rthBarSpan(symbol, openMs, intervalMs);
170
+ }
171
+ /** How many sessions ahead the next RTH bar is looked for: a week holds a traded session. */
172
+ const RTH_NEXT_SESSION_DAYS = 7;
173
+ /** The first RTH bar of the first session after `instantMs` the product trades (the window has bounds on every
174
+ * calendar day; the grid holds bars only on the product's schedule), null when none opens within a week. */
175
+ function nextRthBar(venue, instantMs, intervalMs) {
176
+ let cursorMs = instantMs;
177
+ for (let day = 0; day <= RTH_NEXT_SESSION_DAYS; day += 1) {
178
+ const openMs = nextRthSessionOpenMs(venue.symbol, cursorMs);
179
+ if (openMs === null)
180
+ return null;
181
+ const [firstMs] = liveBucketStartsInRange(openMs, openMs + intervalMs, intervalMs, venue);
182
+ if (firstMs !== undefined)
183
+ return rthBarHolding(venue, firstMs, intervalMs);
184
+ cursorMs = openMs;
185
+ }
186
+ return null;
187
+ }
71
188
  /** A US listing's candle close on a regular-session chart (the module doc): undefined on an
72
189
  * extended-hours chart and on every other venue. */
73
190
  function stockLegCandleClose(leg, chartExchange, sessionType) {
@@ -87,10 +204,29 @@ function stockLegCandleClose(leg, chartExchange, sessionType) {
87
204
  export function wrunLegCloseSettleMs(leg, chartExchange, sessionType) {
88
205
  return stockLegCandleClose(leg, chartExchange, sessionType) === undefined ? 0 : WRUN_US_EQUITIES_CLOSE_SETTLE_MS;
89
206
  }
90
- /** The leg's candle closes for the leg core (`closeMs`): the CME session lattice's, else a US
91
- * listing's session closes on a regular-session chart (the chart's `sessionType`); undefined where
92
- * they are open plus the span. */
93
- export function wrunLegCandleClose(leg, chartExchange, sessionType) {
207
+ /** The leg's candle closes for the leg core (`closeMs`): on a leg riding the chart's RTH grid (`chart`, its symbol
208
+ * and interval: the session the chart rides, `wrunChartSession`, the module doc) a candle stamped at an RTH bar's
209
+ * open closes at that bar's end, the session's stub at the session close (a 4h candle opening 17:30Z closes 20:15Z,
210
+ * an hourly one opening 19:30Z at 20:15Z); every other stamp, and every other leg, the CME session lattice's,
211
+ * else a US listing's session closes on a regular-session chart (the chart's `sessionType`); undefined where they
212
+ * are open plus the span. */
213
+ export function wrunLegCandleClose(leg, chartExchange, sessionType, chart) {
214
+ const close = legOwnCandleClose(leg, chartExchange, sessionType);
215
+ if (chart === undefined)
216
+ return close;
217
+ const rth = legRidesChartRthVenueOf(leg, chartExchange, sessionType, chart);
218
+ if (rth === undefined)
219
+ return close;
220
+ const { legMs } = leg;
221
+ const legSymbol = rth.symbol;
222
+ return (openMs) => {
223
+ const bar = rthRowSpan(legSymbol, openMs, legMs);
224
+ return bar !== null && bar.openMs === openMs ? bar.closeMs : (close?.(openMs) ?? openMs + legMs);
225
+ };
226
+ }
227
+ /** A leg's candle closes off the chart's RTH grid: the CME session lattice's, else a US listing's session closes on a
228
+ * regular-session chart; undefined where they are open plus the span. */
229
+ function legOwnCandleClose(leg, chartExchange, sessionType) {
94
230
  if (!wrunLegRidesCmeSession(leg, chartExchange))
95
231
  return stockLegCandleClose(leg, chartExchange, sessionType);
96
232
  const { legMs } = leg;
@@ -106,7 +242,7 @@ function sessionOpenMs(host, stampMs, intervalMs) {
106
242
  }
107
243
  /** The leg's candle opens for the leg core (`candleOpenMs`), undefined where a candle trades from
108
244
  * its stamp: a CME daily, 3d or weekly candle stamped at its trade date trades from the session
109
- * open before it. */
245
+ * open before it. Every intraday candle, an RTH leg's among them, trades from its stamp. */
110
246
  export function wrunLegCandleOpen(leg, chartExchange) {
111
247
  if (!wrunLegRidesCmeSession(leg, chartExchange))
112
248
  return undefined;
@@ -116,15 +252,21 @@ export function wrunLegCandleOpen(leg, chartExchange) {
116
252
  }
117
253
  /** The chart's primary row bounds for the leg core (`rowBounds`), undefined where a row spans
118
254
  * [label, label + P): a calendar row (1M 3M 6M 1Y, any market) runs from its label to its calendar
119
- * end (`wrunCalendarRowBounds`); a row of a market the gateway builds on the CME session lattice,
120
- * at a lattice interval, runs from its session open to its bar end (a daily row labelled Sep 30
121
- * runs from Sep 29 22:00Z to Sep 30 22:00Z under daylight time; the Tuesday after Labor Day from
122
- * the Sunday open). A label the lattice does not book keeps [label, label + P). The row builder
123
- * reads the same answer through `wrunSessionClock`. */
124
- export function wrunPrimaryRowBounds(chartExchange, intervalMs) {
255
+ * end (`wrunCalendarRowBounds`); a row of a chart riding RTH (`chart`: its symbol and raw session)
256
+ * runs from its RTH bar's open to that bar's end, the session's stub to the session close (a 6h row
257
+ * opening 19:30Z ends 20:15Z, not 01:30Z; a 15m row opening 13:30Z ends 13:45Z); a row of a market
258
+ * the gateway builds on the CME session lattice, at a lattice interval, runs from its session open
259
+ * to its bar end (a daily row labelled Sep 30 runs from Sep 29 22:00Z to Sep 30 22:00Z under
260
+ * daylight time; the Tuesday after Labor Day from the Sunday open). A label neither grid books keeps
261
+ * [label, label + P). The row builder reads the same answer through `wrunSessionClock`. */
262
+ export function wrunPrimaryRowBounds(chartExchange, intervalMs, chart) {
125
263
  const calendar = wrunCalendarRowBounds(intervalMs);
126
264
  if (calendar !== undefined)
127
265
  return calendar;
266
+ if (rthVenueOf(chartExchange, chart?.symbol, chart?.sessionType, intervalMs) !== undefined) {
267
+ const symbol = chart?.symbol;
268
+ return (rowOpenMs) => rthRowSpan(symbol, rowOpenMs, intervalMs) ?? { openMs: rowOpenMs, closeMs: rowOpenMs + intervalMs };
269
+ }
128
270
  if (!wrunLegRidesCmeSession({ legMs: intervalMs }, chartExchange))
129
271
  return undefined;
130
272
  const host = wrunChartHostEnv().sharedHost();
@@ -136,11 +278,16 @@ export function wrunPrimaryRowBounds(chartExchange, intervalMs) {
136
278
  };
137
279
  }
138
280
  /** The label of the primary row holding `instantMs` where a calendar labels the rows: its calendar
139
- * bar on a calendar chart (March 10 is the March 1 row), the row whose session holds it on the CME
140
- * session lattice; undefined elsewhere, where the caller keeps its own grid. */
141
- export function wrunPrimaryRowHoldingMs(chartExchange, intervalMs, instantMs) {
281
+ * bar on a calendar chart (March 10 is the March 1 row), the RTH bar holding it on a chart riding
282
+ * RTH (`chart`; 14:10Z is the 13:30Z hourly row, never the 14:00Z UTC hour), the row whose session
283
+ * holds it on the CME session lattice; undefined elsewhere and off an RTH session, where the caller
284
+ * keeps its own grid. */
285
+ export function wrunPrimaryRowHoldingMs(chartExchange, intervalMs, instantMs, chart) {
142
286
  if (isCalendarIntervalMs(intervalMs))
143
287
  return barStartMs(instantMs, intervalMs);
288
+ const rth = rthVenueOf(chartExchange, chart?.symbol, chart?.sessionType, intervalMs);
289
+ if (rth !== undefined)
290
+ return liveBucketStartMs(instantMs, intervalMs, rth) ?? undefined;
144
291
  if (!wrunLegRidesCmeSession({ legMs: intervalMs }, chartExchange))
145
292
  return undefined;
146
293
  return wrunChartHostEnv().sharedHost().cmeSessionBucketMs(instantMs, intervalMs) ?? undefined;
@@ -159,13 +306,24 @@ function nextUsEquitiesOpenMs(instantMs) {
159
306
  }
160
307
  /** The close of the leg's bar holding `nowMs` where its venue closes bars off the plain grid,
161
308
  * undefined elsewhere or once that bar has closed (the caller keeps its own grid, a wake no later
162
- * than the next close): on the CME session lattice the lattice bar's end; on a US listing on a
163
- * regular-session chart (the chart's `sessionType`) the stock's close (`wrunLegCandleClose`) of
164
- * the candle the chart's live boundary rule keys now to (`liveBucketStartMs`: the trade date for a
165
- * day, the Monday for a week, the 09:30 New York lattice from 45m to 12h), and off the session on
166
- * that lattice the first candle of the next session. */
167
- export function wrunLegBarCloseAt(leg, chartExchange, nowMs, sessionType) {
309
+ * than the next close): on a leg riding the chart's RTH grid (the session the chart rides, read on
310
+ * its `sessionType`, `chartSymbol` and `chartInterval` as `wrunLegRidesRth` reads them: a daily
311
+ * chart that keeps 'regular' rides the full session, so its intraday legs keep their own closes;
312
+ * the module doc) the RTH bar's end (a 4h leg at 15:00Z closes 17:30Z, at 18:00Z
313
+ * the stub's 20:15Z; an hourly leg at 14:10Z closes 14:30Z), and off the session the end of the
314
+ * next session's first bar; on the CME session lattice the lattice bar's end; on a US listing on a
315
+ * regular-session chart the stock's close (`wrunLegCandleClose`) of the candle the chart's live
316
+ * boundary rule keys now to (`liveBucketStartMs`: the trade date for a day, the Monday for a week,
317
+ * the 09:30 New York lattice from 45m to 12h), and off the session on that lattice the first candle
318
+ * of the next session. */
319
+ export function wrunLegBarCloseAt(leg, chartExchange, nowMs, sessionType, chartSymbol, chartInterval) {
168
320
  const host = wrunChartHostEnv().sharedHost();
321
+ const chart = { symbol: chartSymbol, interval: chartInterval ?? leg.legMs };
322
+ const rth = legRidesChartRthVenueOf(leg, chartExchange, sessionType, chart);
323
+ if (rth !== undefined) {
324
+ const bar = rthBarHolding(rth, nowMs, leg.legMs) ?? nextRthBar(rth, nowMs, leg.legMs);
325
+ return bar !== null && bar.closeMs > nowMs ? bar.closeMs : undefined;
326
+ }
169
327
  if (wrunLegRidesCmeSession(leg, chartExchange)) {
170
328
  const barMs = host.cmeSessionBucketMs(nowMs, leg.legMs);
171
329
  const endMs = barMs === null ? null : host.cmeSessionBarEndMs(barMs, leg.legMs);
@@ -12,17 +12,14 @@ export type WrunBuiltinLiveLane = 'book' | 'trades'
12
12
  * wrunSourceLane): the same TRADE_AGG frames as `trades`, folded as
13
13
  * volume x close by its acquisition's quote. */
14
14
  | 'trades_usd' | 'oi' | 'funding' | 'liquidations' | 'volume_profile' | 'trade_volume_by_size' | 'implied_volatility' | 'skew' | 'options_chain' | 'etf_flow'
15
- /** The raw prints per bar (a `tape` input): the K_TRADES large lane's history, fed per print by
16
- * the raw TRADE channel (the `trades` script source, K_TRADES). */
15
+ /** The big trades per bar (a `tape` input), fed per order by the TRADE_LARGE channel of the `trades` source. */
17
16
  | 'tape';
18
17
  /** A live lane: one of the row builder's own, a registry poll lane instance by its id
19
18
  * (`poll:*`, `utility/wrun/sources/`; its buffer is `context.pollLaneRows[id]`), a row lane
20
19
  * instance (`row:*`, `context.rowLaneRows[id]`), or a trades leg lane (`context.tradeLegRows[id]`,
21
20
  * kit 0.77.0). */
22
21
  export type WrunLiveLane = WrunBuiltinLiveLane | WrunPollLaneId | WrunRowLaneId | WrunTradesLegLane;
23
- /** The fan-out's script source name of a frame -> the lane it feeds. The `trades` SOURCE (K_TRADES,
24
- * the raw TRADE channel) feeds the `tape` lane; the `trades` LANE (the package's per-bar volume
25
- * by side) is fed by the `buy_sell_volume` source (K_BUY_SELL_VOLUME, TRADE_AGG). */
22
+ /** The `trades` SOURCE (K_TRADES) feeds the `tape` lane; the `trades` LANE is fed by `buy_sell_volume` (TRADE_AGG). */
26
23
  export declare const WRUN_LIVE_LANE_OF_SCRIPT_SOURCE: Readonly<Record<string, WrunLiveLane | 'ohlcv'>>;
27
24
  export declare const WRUN_PUSH_LANES: ReadonlySet<WrunLiveLane>;
28
25
  /** Lanes with no push channel: the poll-due reconcile re-asks them (`trade_volume_by_size` is
@@ -43,7 +40,7 @@ export interface WrunLiveFrame {
43
40
  /** The frame's coin (its series' underlying), when the fan-out names it: a row lane fed by coin admits by it
44
41
  * (else the point's own `series.coin`). */
45
42
  incomingCoin?: string;
46
- /** Rider rows already floored by roundObTimestamp: never re-bucket. */
43
+ /** Rider rows already keyed on their bar (`bookLiveBucketRows`): never re-bucket. */
47
44
  bucketed?: boolean;
48
45
  }
49
46
  export type WrunLiveIntakeVerdict = 'queued' | 'ignored:no-context' | 'ignored:foreign' | 'ignored:undeclared' | 'ignored:replaying' | 'ignored:ineligible' | 'ignored:generation'
@@ -54,6 +51,8 @@ export type WrunLiveIntakeVerdict = 'queued' | 'ignored:no-context' | 'ignored:f
54
51
  * prove: no live print is valued by a guess, so none folds (the history still serves the gateway's
55
52
  * own dollar values). */
56
53
  | 'ignored:value-unproven'
54
+ /** A print of the other trades channel: the router hands both to every `trades` source of the market. */
55
+ | 'ignored:other-channel'
57
56
  /** The tick's own verdict: the overlay is paused or its execution guard tripped. */
58
57
  | 'ignored:paused';
59
58
  /** `pinned-close`: a pinned coarser leg's candle closed (armed by the tick
@@ -174,7 +173,8 @@ export type WrunLiveBucketMarket = {
174
173
  * open (a week bucket is its Monday, the main path's `findMonday`; a month,
175
174
  * quarter, half or year bucket its UTC calendar boundary), except
176
175
  * the book, whose snapshots are stamped at the observation and an exact
177
- * boundary belongs to the PREVIOUS bar (`roundObTimestamp`, the rule the
176
+ * boundary belongs to the PREVIOUS bar, on the CME session lattice its
177
+ * history rides on a CME Group `market` (`bookLiveBucketMs`, the rule the
178
178
  * K_ORDERBOOK lane and the rider projection apply), and a session-lattice
179
179
  * lane on a `market`, which keys the bar its fetched rows have through the
180
180
  * chart's one live boundary rule (`liveBucketStartMs`: the Chicago session
@@ -217,21 +217,41 @@ export declare function wrunLiveOhlcvPoint(point: unknown): {
217
217
  * leg on the session lattice). Never mutates its inputs.
218
218
  */
219
219
  export declare function foldWrunLegCandleRows(base: ReadonlyArray<ArrayLike<number>>, points: readonly unknown[], intervalMs: number, market?: WrunLiveBucketMarket | null): FoldResult | null;
220
- /** K_ORDERBOOK.buildLiveDataRows over a raw frame: replay bursts floor
221
- * every row (copied), a live snapshot floors its one row (copied); a
222
- * bucketed row (`ArrayLike<number>`) is taken as-is. Frames without a
223
- * book payload yield nothing. */
224
- export declare function wrunLiveBookRows(point: WrunLiveBookPoint, intervalMs: number): ArrayLike<number>[];
220
+ /**
221
+ * The host bar a keyed book row lands on (`wrunLiveBookRows`' key: the snapshot's own bar, its row's open), judged
222
+ * at `nowMs`: the bar the chart's history puts that row in, through the live doors' resolver
223
+ * (`sourceRowHostBarResolverFor`: the bar holding the row's last instant once the chart printed it, before that the
224
+ * forming bar holding its open; none, null, for a row closing past the session's close). On ES1! in RTH at 1h a
225
+ * 14:10Z snapshot (the 14:00Z row) lands in the forming 13:30Z bar and a 15:05Z one (the 15:00Z row) in the 14:30Z
226
+ * bar. Undefined where the history keeps the book's own bars (`wrunLaneHostGridsOf`: 30m and finer, ETH, a day and
227
+ * longer, a 24/7 market, a market served no book): every key is its own bar.
228
+ */
229
+ export declare function wrunBookRowHostBarResolver(intervalMs: number, market: WrunLiveBucketMarket | null | undefined): ((rowTs: number, nowMs: number) => number | null) | undefined;
230
+ /**
231
+ * The host bar a tape print lands in: the bar holding its own instant (the cell placement its history gets,
232
+ * `placeRowsInHostBars` with `cells`), null where no chart bar holds it. Undefined where the chart's bars are the
233
+ * tape's own (`wrunLaneHostGridsOf`): the print keeps the bar its own grid names (`tradesBarStartMs`).
234
+ */
235
+ export declare function wrunTapeHostBarResolver(intervalMs: number, market: WrunLiveBucketMarket | null | undefined, rowMarket?: WrunLiveBucketMarket | null | undefined): ((instantMs: number) => number | null) | undefined;
236
+ /** K_ORDERBOOK.buildLiveDataRows over a raw frame: replay bursts key
237
+ * every row (copied), a live snapshot keys its one row (copied), each on
238
+ * `market`'s bar (`bookLiveBucketMs`: the session lattice on a CME Group
239
+ * market); a bucketed row (`ArrayLike<number>`) is taken as-is. Frames
240
+ * without a book payload yield nothing. */
241
+ export declare function wrunLiveBookRows(point: WrunLiveBookPoint, intervalMs: number, market: WrunLiveBucketMarket | null | undefined): ArrayLike<number>[];
225
242
  /**
226
243
  * Fold queued points into a lane's rows under the lane's kScript fold rule.
227
244
  * Returns the NEW rows array (untouched rows shared, touched rows new), the
228
245
  * touched buckets and the earliest of them, or null when nothing folded.
229
246
  * Never mutates `rows` or any point. `acquisition` is the SAME payload the
230
247
  * history fetch used for the lane, so the fold's units equal the lane's;
231
- * `market` is the market that fetch resolved to (the chart's own), so the
232
- * fold keys the bars its rows have (wrunLiveBucketTs).
248
+ * `market` is the market that fetch resolved to (the chart's own, with the
249
+ * chart's session), so the fold keys the bars its rows have (wrunLiveBucketTs),
250
+ * and lands the book and the tape on the chart's bars where their history is
251
+ * placed there (`wrunBookRowHostBarResolver`, judged at the server clock's now,
252
+ * and `wrunTapeHostBarResolver`).
233
253
  */
234
- export declare function foldWrunLaneRows(lane: WrunLiveLane, rows: readonly ArrayLike<number>[] | undefined, points: readonly unknown[], intervalMs: number, acquisition: WrunLaneAcquisition, market?: WrunLiveBucketMarket | null): FoldResult | null;
254
+ export declare function foldWrunLaneRows(lane: WrunLiveLane, rows: readonly ArrayLike<number>[] | undefined, points: readonly unknown[], intervalMs: number, acquisition: WrunLaneAcquisition, market?: WrunLiveBucketMarket | null, rowMarket?: WrunLiveBucketMarket | null): FoldResult | null;
235
255
  /** Whether an overlay's longest capped queue (an additive lane, a leg's candle frames) reached the
236
256
  * hidden hold's backlog bound: the live tick then runs one drain while hidden. */
237
257
  export declare function wrunLiveIntakeBacklogDue(indicatorId: string): boolean;