@orangecharts/wrun-chart-host 0.11.1 → 0.14.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 (307) hide show
  1. package/README.md +1 -0
  2. package/dist/constants/feature-flags.constants.d.ts +3 -4
  3. package/dist/constants/feature-flags.constants.js +34 -52
  4. package/dist/constants/feature-limits.constants.d.ts +1 -1
  5. package/dist/constants/feature-limits.constants.js +5 -4
  6. package/dist/constants/interval.constants.d.ts +7 -0
  7. package/dist/constants/interval.constants.js +7 -0
  8. package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
  9. package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
  10. package/dist/constants/stocks-compliance.constants.d.ts +15 -0
  11. package/dist/constants/stocks-compliance.constants.js +15 -0
  12. package/dist/host-env.d.ts +55 -3
  13. package/dist/host-env.js +6 -0
  14. package/dist/host-ports.types.d.ts +36 -3
  15. package/dist/index.d.ts +17 -0
  16. package/dist/index.js +18 -0
  17. package/dist/indicators/controls/tpo-session.util.d.ts +52 -12
  18. package/dist/indicators/controls/tpo-session.util.js +113 -16
  19. package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
  20. package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
  21. package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
  22. package/dist/interfaces/cme-realtime.interface.js +2 -1
  23. package/dist/interfaces/feed.interface.d.ts +15 -1
  24. package/dist/interfaces/replay.interface.d.ts +5 -0
  25. package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
  26. package/dist/interfaces/stocks-realtime.interface.js +5 -4
  27. package/dist/interfaces/wrun-runtime.interface.d.ts +97 -19
  28. package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
  29. package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
  32. package/dist/market-data/billing.interface.d.ts +9 -1
  33. package/dist/market-data/venue.d.ts +1 -1
  34. package/dist/market-data/venues/index.d.ts +4 -4
  35. package/dist/market-data/venues/stocks.contract.copy.json +4 -4
  36. package/dist/market-data/venues/stocks.d.ts +4 -4
  37. package/dist/market-data/venues/stocks.js +15 -13
  38. package/dist/settings-templates/frvp-fields.d.ts +12 -1
  39. package/dist/settings-templates/frvp-fields.js +15 -4
  40. package/dist/settings-templates/index.js +12 -5
  41. package/dist/settings-templates/indicator-fields.js +28 -2
  42. package/dist/settings-templates/tool-rules.d.ts +17 -8
  43. package/dist/settings-templates/tool-rules.js +15 -8
  44. package/dist/settings-templates/tool-tables.generated.js +4 -2
  45. package/dist/utility/auth/server-clock.util.d.ts +3 -1
  46. package/dist/utility/auth/server-clock.util.js +3 -1
  47. package/dist/utility/chart/book-live-bucket.util.js +2 -2
  48. package/dist/utility/chart/cache-alignment.util.d.ts +15 -7
  49. package/dist/utility/chart/cache-alignment.util.js +14 -7
  50. package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
  51. package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
  52. package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
  53. package/dist/utility/chart/cme-session-bucket.util.js +25 -332
  54. package/dist/utility/chart/continuous-contracts.util.js +6 -5
  55. package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
  56. package/dist/utility/chart/display-offset.leaf.js +41 -0
  57. package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
  58. package/dist/utility/chart/effective-chart-session.util.js +13 -5
  59. package/dist/utility/chart/feed-interval.util.d.ts +6 -20
  60. package/dist/utility/chart/feed-interval.util.js +13 -22
  61. package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
  62. package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
  63. package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
  64. package/dist/utility/chart/host-bar-placement.util.js +8 -2
  65. package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
  66. package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
  67. package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
  68. package/dist/utility/chart/indicator-run-interval.util.js +21 -12
  69. package/dist/utility/chart/interval-registry.util.d.ts +1 -1
  70. package/dist/utility/chart/interval-registry.util.js +1 -1
  71. package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
  72. package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
  73. package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
  74. package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
  75. package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
  76. package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
  77. package/dist/utility/chart/live-bucket.util.d.ts +39 -17
  78. package/dist/utility/chart/live-bucket.util.js +103 -57
  79. package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
  80. package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
  81. package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
  82. package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
  83. package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
  84. package/dist/utility/chart/market-session-schedule.util.js +39 -1
  85. package/dist/utility/chart/market-session.util.d.ts +136 -0
  86. package/dist/utility/chart/market-session.util.js +341 -0
  87. package/dist/utility/chart/om-panel.util.d.ts +5 -3
  88. package/dist/utility/chart/om-panel.util.js +42 -7
  89. package/dist/utility/chart/om-target.util.d.ts +14 -1
  90. package/dist/utility/chart/om-target.util.js +22 -5
  91. package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
  92. package/dist/utility/chart/opra-read-access.leaf.js +22 -0
  93. package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
  94. package/dist/utility/chart/profile-row-height.util.js +74 -37
  95. package/dist/utility/chart/rth-session.util.d.ts +55 -20
  96. package/dist/utility/chart/rth-session.util.js +94 -46
  97. package/dist/utility/chart/session-lattice.util.d.ts +150 -0
  98. package/dist/utility/chart/session-lattice.util.js +488 -0
  99. package/dist/utility/chart/trading-day.util.d.ts +40 -2
  100. package/dist/utility/chart/trading-day.util.js +84 -7
  101. package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
  102. package/dist/utility/chart/us-equities-session.util.js +44 -15
  103. package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
  104. package/dist/utility/chart/window-geometry.leaf.js +57 -8
  105. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
  106. package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
  107. package/dist/utility/chart/wrun-run-result.util.d.ts +29 -12
  108. package/dist/utility/chart/wrun-run-result.util.js +89 -25
  109. package/dist/utility/common/time.util.js +5 -4
  110. package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
  111. package/dist/utility/market-events/earnings-scope.util.js +17 -9
  112. package/dist/utility/market-events/market-events.util.d.ts +14 -7
  113. package/dist/utility/market-events/market-events.util.js +30 -17
  114. package/dist/utility/number-format.util.d.ts +14 -21
  115. package/dist/utility/number-format.util.js +38 -24
  116. package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
  117. package/dist/utility/options/option-venue-disclosure.util.js +71 -11
  118. package/dist/utility/options/option-venue.util.d.ts +1 -1
  119. package/dist/utility/options/option-venue.util.js +1 -1
  120. package/dist/utility/pool-symbol.leaf.d.ts +7 -0
  121. package/dist/utility/pool-symbol.leaf.js +50 -5
  122. package/dist/utility/stocks/stock-display.util.d.ts +15 -0
  123. package/dist/utility/stocks/stock-display.util.js +37 -0
  124. package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
  125. package/dist/utility/v2/gate-plane.util.d.ts +6 -0
  126. package/dist/utility/v2/gate-plane.util.js +11 -1
  127. package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
  128. package/dist/utility/v2/gate-session-latch.util.js +3 -3
  129. package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
  130. package/dist/utility/v2/governed-tier.leaf.js +17 -16
  131. package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
  132. package/dist/utility/v2/stocks-governed.util.js +14 -0
  133. package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
  134. package/dist/utility/v2/v2-enums.leaf.js +458 -0
  135. package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
  136. package/dist/utility/wrun/derived-roots.leaf.js +27 -1
  137. package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
  138. package/dist/utility/wrun/derived-roots.util.js +97 -56
  139. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
  140. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
  141. package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
  142. package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
  143. package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
  144. package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
  145. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
  146. package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
  147. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
  148. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
  149. package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
  150. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
  151. package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
  152. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
  153. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
  154. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
  155. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
  156. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
  157. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
  158. package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
  159. package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
  160. package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
  161. package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
  162. package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
  163. package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
  164. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +41 -22
  165. package/dist/utility/wrun/wrun-batched-marks.util.js +255 -59
  166. package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
  167. package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
  168. package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
  169. package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
  170. package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
  171. package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
  172. package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
  173. package/dist/utility/wrun/wrun-canvases.util.js +7 -3
  174. package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
  175. package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
  176. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
  177. package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
  178. package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
  179. package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
  180. package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
  181. package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
  182. package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
  183. package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
  184. package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
  185. package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
  186. package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
  187. package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
  188. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
  189. package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
  190. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
  191. package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
  192. package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
  193. package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
  194. package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
  195. package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
  196. package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
  197. package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
  198. package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
  199. package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
  200. package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
  201. package/dist/utility/wrun/wrun-host.service.js +137 -27
  202. package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
  203. package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
  204. package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
  205. package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
  206. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
  207. package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
  208. package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
  209. package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
  210. package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
  211. package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
  212. package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
  213. package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
  214. package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
  215. package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
  216. package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
  217. package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
  218. package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
  219. package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
  220. package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
  221. package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
  222. package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
  223. package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
  224. package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
  225. package/dist/utility/wrun/wrun-live-tick.util.js +648 -97
  226. package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
  227. package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
  228. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
  229. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
  230. package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
  231. package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
  232. package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
  233. package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
  234. package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
  235. package/dist/utility/wrun/wrun-option-views.util.js +5 -2
  236. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
  237. package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
  238. package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
  239. package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
  240. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +75 -11
  241. package/dist/utility/wrun/wrun-overlay-drivers.util.js +176 -43
  242. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
  243. package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
  244. package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
  245. package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
  246. package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
  247. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +239 -24
  248. package/dist/utility/wrun/wrun-overlay-run.util.js +2204 -405
  249. package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
  250. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +2 -1
  251. package/dist/utility/wrun/wrun-panel-mount.util.js +20 -14
  252. package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
  253. package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
  254. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
  255. package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
  256. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
  257. package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
  258. package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
  259. package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
  260. package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
  261. package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
  262. package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
  263. package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
  264. package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
  265. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
  266. package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
  267. package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
  268. package/dist/utility/wrun/wrun-refusal.util.js +103 -16
  269. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
  270. package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
  271. package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
  272. package/dist/utility/wrun/wrun-run-health.util.d.ts +89 -2
  273. package/dist/utility/wrun/wrun-run-health.util.js +204 -1
  274. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
  275. package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
  276. package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
  277. package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
  278. package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
  279. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -3
  280. package/dist/utility/wrun/wrun-script-inputs.util.js +51 -13
  281. package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
  282. package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
  283. package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
  284. package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
  285. package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
  286. package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
  287. package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
  288. package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
  289. package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
  290. package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
  291. package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
  292. package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
  293. package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
  294. package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
  295. package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
  296. package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
  297. package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
  298. package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
  299. package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
  300. package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
  301. package/dist/utility/wrun/wrun-visibility-table.js +9 -0
  302. package/dist/utility/wrun/wrun-volume-profile.util.js +7 -3
  303. package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
  304. package/dist/utils/replay/replay-buffer-math.js +60 -30
  305. package/dist/workers/constants/socket-slots.d.ts +11 -7
  306. package/dist/workers/constants/socket-slots.js +6 -5
  307. package/package.json +5 -5
@@ -48,9 +48,10 @@ export declare const STOCKS_DELAY_MINUTES = 15;
48
48
  * The ONE compliance switch for user scripting on the tape: the tapes a user-authored indicator may read, in the
49
49
  * browser and on the cloud lane (Kyle 2026-10-29, like OPRA since its launch), at the viewer's tier. The kScript venue
50
50
  * policy (kscript-venue-policy.util) reads it for every wall: a tape listed here is open to user runs, a tape left out
51
- * stays first-party only, as CME is. Nasdaq-listed names (Tape C, `NASDAQ_TAPE`) wait for the UTP derived-data
52
- * confirmation (RELEASE-CHECKLIST §4, the UTP Derived Data answer): add `NASDAQ_TAPE` here the day it lands, nothing
53
- * else gates it. A listing venue's plain code (`NASDAQ`) is the free lane and never reads this.
51
+ * stays first-party only, as CME is. Every tape is open (Kyle 2026-11-06: every wrun Indicator works on US equities,
52
+ * Nasdaq-listed names on Tape C included), so the list is the governed list itself and a tape the gate adds opens with
53
+ * it. To close a tape again, list the open ones here; nothing else gates it. A listing venue's plain code (`NASDAQ`) is
54
+ * the free lane and never reads this.
54
55
  */
55
56
  export declare const STOCKS_TAPE_SCRIPTING_VENUES: readonly StocksGovernedExchange[];
56
57
  /** The SIP tape letter each governed venue carries, for copy that names the tape (reports and the badge card). */
@@ -19,11 +19,12 @@ export const STOCKS_DELAY_MINUTES = 15;
19
19
  * The ONE compliance switch for user scripting on the tape: the tapes a user-authored indicator may read, in the
20
20
  * browser and on the cloud lane (Kyle 2026-10-29, like OPRA since its launch), at the viewer's tier. The kScript venue
21
21
  * policy (kscript-venue-policy.util) reads it for every wall: a tape listed here is open to user runs, a tape left out
22
- * stays first-party only, as CME is. Nasdaq-listed names (Tape C, `NASDAQ_TAPE`) wait for the UTP derived-data
23
- * confirmation (RELEASE-CHECKLIST §4, the UTP Derived Data answer): add `NASDAQ_TAPE` here the day it lands, nothing
24
- * else gates it. A listing venue's plain code (`NASDAQ`) is the free lane and never reads this.
22
+ * stays first-party only, as CME is. Every tape is open (Kyle 2026-11-06: every wrun Indicator works on US equities,
23
+ * Nasdaq-listed names on Tape C included), so the list is the governed list itself and a tape the gate adds opens with
24
+ * it. To close a tape again, list the open ones here; nothing else gates it. A listing venue's plain code (`NASDAQ`) is
25
+ * the free lane and never reads this.
25
26
  */
26
- export const STOCKS_TAPE_SCRIPTING_VENUES = ['NYSE_TAPE', 'NYSE_ARCA_TAPE'];
27
+ export const STOCKS_TAPE_SCRIPTING_VENUES = STOCKS_GOVERNED_EXCHANGES;
27
28
  /** The SIP tape letter each governed venue carries, for copy that names the tape (reports and the badge card). */
28
29
  export const STOCKS_TAPE_OF_EXCHANGE = {
29
30
  NYSE_TAPE: 'A',
@@ -447,9 +447,14 @@ export interface WrunMetadataParam {
447
447
  * the setting out (its value still reaches init()) and the chart mounts
448
448
  * nothing for the output (no plot, legend entry, Style row or stats row
449
449
  * drawn from it); the module still computes every output
450
- * (wrunRowVisibleHere). */
450
+ * (wrunRowVisibleHere). A setting's word (never an output's) and an input's
451
+ * `needed_by` may also name one select param of the same sheet with the
452
+ * option values it shows on (contract C-COINS item 1, `{ size_unit: [1],
453
+ * min_unit: [1] }`): the keys combine with AND (wrunVisibleBySettingKeys
454
+ * reads them). */
451
455
  export interface WrunVisibleBy {
452
- size_unit: number[];
456
+ size_unit?: number[];
457
+ readonly [setting: string]: readonly number[] | undefined;
453
458
  }
454
459
  /** One entry of a sheet's `layout` (frozen sheet contract, plan 1.2):
455
460
  * recorded in source order together with every param declaration. */
@@ -689,6 +694,12 @@ export interface WrunInputSource {
689
694
  missing?: 'carry' | 'nan' | 'zero' | 'empty';
690
695
  block_size?: number;
691
696
  max_depth?: number;
697
+ /** `book` only (kit 0.109.0, wrun-book-bands.leaf `isWrunBandedBookSource`): the input reads the bid and ask size
698
+ * sums per band instead of the levels, its block `[bid_0, ask_0, bid_1, ask_1, ...]` (two values a tuple, max_cells
699
+ * the band count). Percents of the touch, 1 to 8 of them, each above 0 and at most 10, strictly ascending
700
+ * (`wrun_book_bands_invalid` otherwise). No part of the ask: a raw and a banded book input read one lane and one
701
+ * fetch. */
702
+ bands?: number[];
692
703
  /** `tape` only (the C1 facets, `wrun-tape-source.util.ts`): the smallest
693
704
  * print size served in the venue's raw stored unit, a number literal or
694
705
  * the name of a declared numeric param (resolved from the run's current
@@ -702,6 +713,12 @@ export interface WrunInputSource {
702
713
  * `minQuoteAmount`, and every cell's `size` is then the print's dollar
703
714
  * value. */
704
715
  min_value?: number | string;
716
+ /** `tape` only (contract C-COINS item 2): the smallest print served by its
717
+ * size in coins, spelled like `min_size`. The host asks the dollar table
718
+ * at the coins times the lowest price the request's window traded at
719
+ * times 0.9 (wrunCoinTapeFloor), and every cell's `size` is the print's
720
+ * dollar value, as on a `min_value` tape. */
721
+ min_coins?: number | string;
705
722
  history?: string;
706
723
  /** `volume_profile` only: the lane the input reads, the kScript
707
724
  * volume_profile source's `ticksPerBar` (price ticks per bucket, an
@@ -841,9 +858,7 @@ export interface WrunInputSource {
841
858
  /** The size units (`market.size_unit()` codes: 0 units, 1 coins, 2 shares, 3 contracts) of the
842
859
  * markets where the run reads this input (kit 0.72.0), the shape of an output's `visible_by`;
843
860
  * absent = every market. On any other market the run's sheet marks it `undemanded`. */
844
- needed_by?: {
845
- size_unit: number[];
846
- };
861
+ needed_by?: WrunVisibleBy;
847
862
  /** A secondary `trades` input only (kit 0.77.0, sheet-only), beside `exchange` and never beside
848
863
  * `symbol`: "coin", the venue's primary market for the chart's coin. The run resolves every
849
864
  * venue a coin leg names before anything reads the sheet (wrunSheetWithCoinLegs, the native
@@ -998,6 +1013,11 @@ export interface WrunMetadataOutput {
998
1013
  format?: string;
999
1014
  /** false: no legend entry (drawn all the same). */
1000
1015
  legend?: boolean;
1016
+ /** false: the output answers no hover card, neither over its plot (the series hover) nor over its legend
1017
+ * value; drawn, listed (unless `legend: false`) and printed all the same. Default true. On a candle
1018
+ * group any member's false silences the group's one card. The adapter also stamps it on every mount
1019
+ * that paints no ink (wrun-run-result.util wrunMountPresentationFields). */
1020
+ hover_card?: boolean;
1001
1021
  /** false: mounted hidden (the Style page's Visible row starts off). */
1002
1022
  visible?: boolean;
1003
1023
  /** The size units of the markets where the output mounts at all (kit
@@ -1159,6 +1179,10 @@ export interface WrunLevels {
1159
1179
  font_weight?: WrunFontWeight;
1160
1180
  font_family?: WrunFontFamily;
1161
1181
  label_place?: 'outside' | 'inside' | 'axis';
1182
+ /** A row labelled by the frame's `labels_text` shows its label even when the row is shorter than the font. */
1183
+ label_overflow?: boolean;
1184
+ /** Of the labels_text rows in view, only this many draw, the largest by row value first (0 or absent: all). */
1185
+ label_limit?: number;
1162
1186
  /** DL-hover: a hover card per row (a switch; the frame's `tooltips` fill it). */
1163
1187
  hover?: boolean;
1164
1188
  /** DL-poc: the POC row's ink, width (1..10 px), dash, reach and tag. */
@@ -2466,13 +2490,35 @@ export interface WrunHistoryWarmupWindow {
2466
2490
  /** The exact warm-up stamp (`history_warmup`, frozen kit contract D3): W = the sum over `windows` of
2467
2491
  * max(ceil(sum of terms + plus), min), each window evaluated with the arithmetic the chart applies to the
2468
2492
  * `warmup` declaration, plus the top-level `plus` (the dependency edges and the fixed horizons). */
2469
- export interface WrunHistoryWarmup {
2493
+ export interface WrunHistoryWarmupExact {
2470
2494
  kind: 'exact';
2471
2495
  windows: WrunHistoryWarmupWindow[];
2472
2496
  plus?: number;
2473
2497
  }
2474
- /** The three batched kinds, each a sheet key and the engine's plot type. */
2475
- export type WrunBatchedMarksKind = 'marks' | 'spans' | 'rays';
2498
+ /** The gate that certified a converging warm-up stamp (STAMPS round A): the corpus it ran (`om-history-matrix-v1`,
2499
+ * the one round A knows), W at the sheet's defaults (`bars`, at least 1), the valid split points it compared
2500
+ * (`splits`, at least 24, the gate's own minimum) and the settings it tested (`defaults`). */
2501
+ export interface WrunHistoryWarmupGate {
2502
+ corpus: 'om-history-matrix-v1';
2503
+ bars: number;
2504
+ splits: number;
2505
+ settings: 'defaults';
2506
+ }
2507
+ /** The converging warm-up stamp (`history_warmup` of kind `converges`, STAMPS round A): the exact stamp's windows and
2508
+ * `plus` (W counted in ACCEPTED inputs, the recursions skip a non-finite one), the relative `tolerance` a run
2509
+ * started W bars early agrees within (1e-6, the only one round A admits) and the gate that certified it. An
2510
+ * empirical bound the chart re-checks at every splice (the overlap proof), never an exact one. */
2511
+ export interface WrunHistoryWarmupConverges {
2512
+ kind: 'converges';
2513
+ windows: WrunHistoryWarmupWindow[];
2514
+ plus?: number;
2515
+ tolerance: number;
2516
+ gate: WrunHistoryWarmupGate;
2517
+ }
2518
+ /** The warm-up stamp of either kind (`history_warmup`): both carry the windows and `plus` W is read from. */
2519
+ export type WrunHistoryWarmup = WrunHistoryWarmupExact | WrunHistoryWarmupConverges;
2520
+ /** The four batched kinds, each a sheet key and the engine's plot type (wrun-batched-kinds.leaf lists them). */
2521
+ export type WrunBatchedMarksKind = 'marks' | 'spans' | 'rays' | 'flags';
2476
2522
  /** A colour of a batched section: a colour word (`#rrggbb`, `rgba(...)`,
2477
2523
  * `theme.<token>`) or a packed RGBA number (the colour param's own form,
2478
2524
  * `((r * 256 + g) * 256 + b) * 1024 + round(alpha * 1000)`, or a packed theme
@@ -2488,7 +2534,8 @@ interface WrunBatchedSectionCommon {
2488
2534
  first_output: number;
2489
2535
  /** A hover template, at most 200 chars (null or absent = no readout): `{{side}} {{qty}}
2490
2536
  * {{price}} {{fills}}` on marks, `{{top}} {{bottom}} {{length}} {{word}}` on spans, `{{y1}}
2491
- * {{y2}} {{length}} {{word}}` on rays (the kit's WRUN_BATCHED_TOOLTIP_TOKENS), `{{start}}` and
2537
+ * {{y2}} {{length}} {{word}}` on rays (the kit's WRUN_BATCHED_TOOLTIP_TOKENS), `{{qty}}
2538
+ * {{price}} {{count}} {{word}}` on flags (`{{word}}` the record's chip text), `{{start}}` and
2492
2539
  * `{{end}}` in place of `{{length}}` on a timed (stride-5) section (the kit's
2493
2540
  * WRUN_BATCHED_TIMED_TOOLTIP_TOKENS, printed as chart times); `{{<field>:<format>}}` picks a
2494
2541
  * number format, a word of WRUN_BATCHED_NUMBER_FORMATS (wrun-batched-readout.util:
@@ -2498,22 +2545,27 @@ interface WrunBatchedSectionCommon {
2498
2545
  label?: string;
2499
2546
  panel?: 'overlay';
2500
2547
  }
2548
+ /** The size law over a record's quantity (marks, and the marks a flags section points at): `unit` is the Min
2549
+ * size quantity (> 0), `scale` the Bubble size 1..10; on sqrt k = 0.5 + 0.1 * scale, d = round(clamp(11k *
2550
+ * sqrt(qty / unit), 11k, min(64, 50k))), then 6..64 css px. `log` grows the diameter with the quantity's
2551
+ * logarithm, and `min_px` / `max_px` bound the diameter in css px (the dark pool prints: $1M at 5 px, $100M at
2552
+ * 12 px). The engine draws `log` and the bounds from the release that draws `flags`. */
2553
+ export interface WrunMarkSize {
2554
+ law?: 'sqrt' | 'linear' | 'log';
2555
+ unit?: number;
2556
+ scale?: number;
2557
+ min_px?: number;
2558
+ max_px?: number;
2559
+ }
2501
2560
  /** One `marks[]` entry (`plot.marks`): per bar, `slots` records of `[price, qty, meta]` with
2502
2561
  * `meta = side + 4 * fills + 262144 * offset_ms` (side 0..3: 0 sell, 1 buy; fills 0..65535;
2503
2562
  * offset_ms 0..2^30); a NaN price is an empty slot. Look fields take the param-native units
2504
2563
  * (round-2 fold 1); the chart derives the pixels exactly as Big Trades 0.3.2 did. */
2505
2564
  export interface WrunMarksSection extends WrunBatchedSectionCommon {
2506
2565
  stride: 3;
2507
- /** 0 Bubble, 1 Soft dot, 2 Ring, 3 Square (default 0). */
2566
+ /** 0 Bubble, 1 Soft dot, 2 Ring, 3 Square, 4 Diamond (hollow, a 1 px edge; the word `diamond`) (default 0). */
2508
2567
  look?: number;
2509
- /** The size law over the record's quantity: `unit` is the Min size quantity (> 0), `scale`
2510
- * the Bubble size 1..10; k = 0.5 + 0.1 * scale, d = round(clamp(11k * sqrt(qty / unit), 11k,
2511
- * min(64, 50k))), then 6..64 css px. */
2512
- size?: {
2513
- law?: 'sqrt' | 'linear';
2514
- unit?: number;
2515
- scale?: number;
2516
- };
2568
+ size?: WrunMarkSize;
2517
2569
  /** 0 Candle center, 1 Trade time (the record's `offset_ms` inside the bar). */
2518
2570
  x?: number;
2519
2571
  /** Indexed by the record's side: [sell, buy, ...], 2..4 colours (default the theme's down and up). */
@@ -2569,7 +2621,32 @@ export interface WrunRaysSection extends WrunBatchedSectionCommon {
2569
2621
  opacity?: number;
2570
2622
  words?: string[];
2571
2623
  }
2572
- export type WrunBatchedSection = WrunMarksSection | WrunSpansSection | WrunRaysSection;
2624
+ /** The icon a flag's chip leads with, one per word (`icons`). */
2625
+ export type WrunFlagIcon = 'none' | 'dot' | 'diamond' | 'sprout' | 'flame';
2626
+ /** One `flags[]` entry (`plot.flags`, the dark pool round): per bar, `slots` records of `[price, qty, meta]` read and
2627
+ * copied as on marks, with `meta = word + 4 * count + 262144 * offset_ms` (word 0..3 picks the chip's template in
2628
+ * `words`, count 0..65535, offset_ms 0..2^30); a NaN price is an empty slot. The engine places the chips on every
2629
+ * paint (the largest dollars first, a chip above the highest candle under it, one that would touch a placed chip or
2630
+ * has no room dropped, at most `max_in_view`, a 1 px hairline down to the record) and never stretches the price
2631
+ * scale for them. */
2632
+ export interface WrunFlagsSection extends WrunBatchedSectionCommon {
2633
+ stride: 3;
2634
+ /** 1..4 chip templates of at most 32 chars, picked by the record's word: `{{qty}}` (`:compact`, `:usd`, `:int`),
2635
+ * `{{price}}` and `{{count}}`. */
2636
+ words?: string[];
2637
+ /** The icon each word's chip leads with, a word of `WrunFlagIcon` or its index (default none). */
2638
+ icons?: Array<WrunFlagIcon | number>;
2639
+ /** The chips in view at most, 1..16 (default 5). */
2640
+ max_in_view?: number;
2641
+ /** 0 Candle center, 1 Trade time (default 1). */
2642
+ x?: number;
2643
+ /** The size law of the marks the chips point at (as on marks). */
2644
+ size?: WrunMarkSize;
2645
+ /** Up to 3 colours by part: [chip fill, chip edge (the hairline too), text]; a part left out takes its default
2646
+ * ([theme.bg, theme.muted, theme.text]); more than 3 refuses the run. */
2647
+ colors?: WrunBatchedColor[];
2648
+ }
2649
+ export type WrunBatchedSection = WrunMarksSection | WrunSpansSection | WrunRaysSection | WrunFlagsSection;
2573
2650
  export interface WrunIndicatorMetadata {
2574
2651
  id: string;
2575
2652
  name: string;
@@ -2653,6 +2730,7 @@ export interface WrunIndicatorMetadata {
2653
2730
  marks?: WrunMarksSection[];
2654
2731
  spans?: WrunSpansSection[];
2655
2732
  rays?: WrunRaysSection[];
2733
+ flags?: WrunFlagsSection[];
2656
2734
  /** g4 DW21: false keeps the author's colours on a light chart (default true). */
2657
2735
  contrast_guard?: boolean;
2658
2736
  /** The history-independent stamp (kit 0.66.0, scaffold 66): the compiler proved that every bar's
@@ -1 +1,18 @@
1
+ /**
2
+ * Whether a bar `intervalMs` wide counts volume by the gateway's daily rule (tsdb-gateway trade_tradfi.go over
3
+ * kiyotaka-go pkg/venue: PresetTradingViewDaily keeps the volume of the prints that may not set a high or low,
4
+ * PresetTradingView below a day leaves it out).
5
+ */
6
+ export declare function barCountsDailyVolume(intervalMs: number): boolean;
7
+ /** A live candle frame's volume under each of the gateway's rules (a stocks tape print's frame carries both). */
8
+ export interface LiveVolumeByRule {
9
+ intraday: number;
10
+ daily: number;
11
+ }
12
+ /**
13
+ * The candle a source folding at `intervalMs` takes from a live frame: a stocks tape print's frame names its volume
14
+ * under both rules (`liveVolumeByRule`), and each source takes the one its own bars count, whatever the chart's
15
+ * interval (a 1D run on a 1m chart keeps the odd lots' volume the 1m bars leave out). Every other frame passes as is.
16
+ */
17
+ export declare function liveCandleAtInterval<T extends Record<string, unknown>>(point: unknown, data: T, intervalMs: number): T;
1
18
  export declare function mergeLiveOhlcvDataPoint(lastData: any[], data: any, normalizedTime: number): any[];
@@ -1,5 +1,27 @@
1
1
  const LIVE_OHLC_EXTREME_RATIO = 0.05;
2
2
  const LIVE_OHLC_RANGE_MULTIPLIER = 3;
3
+ /** From a day up the gateway counts a stocks tape print's volume by its daily rule, below a day by its intraday rule. */
4
+ const DAILY_VOLUME_RULE_MS = 86_400_000;
5
+ /**
6
+ * Whether a bar `intervalMs` wide counts volume by the gateway's daily rule (tsdb-gateway trade_tradfi.go over
7
+ * kiyotaka-go pkg/venue: PresetTradingViewDaily keeps the volume of the prints that may not set a high or low,
8
+ * PresetTradingView below a day leaves it out).
9
+ */
10
+ export function barCountsDailyVolume(intervalMs) {
11
+ return intervalMs >= DAILY_VOLUME_RULE_MS;
12
+ }
13
+ /**
14
+ * The candle a source folding at `intervalMs` takes from a live frame: a stocks tape print's frame names its volume
15
+ * under both rules (`liveVolumeByRule`), and each source takes the one its own bars count, whatever the chart's
16
+ * interval (a 1D run on a 1m chart keeps the odd lots' volume the 1m bars leave out). Every other frame passes as is.
17
+ */
18
+ export function liveCandleAtInterval(point, data, intervalMs) {
19
+ const byRule = point?.liveVolumeByRule;
20
+ if (!byRule || typeof byRule !== 'object')
21
+ return data;
22
+ const volume = barCountsDailyVolume(intervalMs) ? byRule.daily : byRule.intraday;
23
+ return typeof volume === 'number' && Number.isFinite(volume) ? { ...data, volume } : data;
24
+ }
3
25
  function finiteNumber(value) {
4
26
  if (typeof value === 'string' && value.trim() === '')
5
27
  return undefined;
@@ -11,25 +11,29 @@ export declare const TRADES_RETENTION_SEC: number;
11
11
  export declare const TRADES_LARGE_RETENTION_SEC: number;
12
12
  /** tsdb-gateway's bar limit on the large lane (validateKiyoPlusBar, kiyo_plus_validation.go): an
13
13
  * unaggregated read (TRADE_LARGE included) is estimated at one point per minute, and a tier user's
14
- * window opening before now minus the tier's default max_bar_limit (15,000 on every tier of ore
15
- * and cme) is trimmed to it without a word. About 10.4 days: the lane's real history horizon. */
14
+ * window longer than the tier's default max_bar_limit (15,000 on every tier of ore and cme) is
15
+ * trimmed to its last 15,000 minutes without a word, counted from the window's own end (a window
16
+ * ending at now counts from the gateway's clock). About 10.4 days: the lane's history horizon on
17
+ * one ask, at any date, so a replay weeks back reads its history too. */
16
18
  export declare const TRADES_LARGE_BAR_LIMIT_SEC: number;
17
19
  /** A raw-tape acquisition's seed cap: a longer window over the raw TRADE table costs the gateway a
18
20
  * scan over cold chunks (measured 18-30 s, or a server-side internal error, for ten days). */
19
21
  export declare const TRADES_MAX_HISTORY_SEC: number;
20
22
  /**
21
- * The CME Group product roots the collector copies into the large-print table (TRADE_LARGE): the keys of its contracts
22
- * floor list (streamd charts/streamd/values.cme.yaml `large_trade.contract_floors`, the 33 roots tsdb-gateway's
23
- * values.cme.yaml listed as `write.large_trade_cme_contract_floors` before the rule moved to the collector). The
24
- * collector copies no print of a root off the list (it only counts them, `streamd_large_trade_skipped_points_total`),
25
- * so the table answers such a market empty, history and live:
26
- * COMEX:MGC1! 1m on 2026-10-29 read 0 prints of any size over six hours of the table while the raw tape held 79 prints
27
- * of 10 contracts or more in two hours (#feedback-stream 2149). A copy of the collector's list until the instrument
28
- * registry names the served floor per root; recorded with each root's newest TRADE_LARGE row in
29
- * tests/fixtures/wrun/tape-dollar-units.json, whose spec holds the two equal: they change in the same round as the
30
- * collector's list.
23
+ * The payload field a run names the instant its lanes' declared history counts back from, when that instant is not
24
+ * the server's now. A market replay run names the replay's present (the close of the newest completed bar the replay
25
+ * shows, the open of the bar its playhead is in), while its lanes run on to the replay window's end (the forward
26
+ * runway), on every lane it asks (wrun-overlay-run.util `fetchLane`). A live run names its session's pin for the tape
27
+ * (wrun-history-as-of.util: the instant the session's first run counted the tape's history back from), from the
28
+ * session's second run on, while the window still ends at the server's now; its first run names none, so that ask is
29
+ * the payload it always was. Every reader of a declared history counts back from it (`sourceHistoryAsOfMs`: the
30
+ * K_TRADES seed, the wrun reconcile's served start). The table's retention and the gateway's bar limit never read it:
31
+ * the table keeps, and the gateway trims a window, by the wall clock.
31
32
  */
32
- export declare const TRADES_LARGE_CME_ROOTS: ReadonlySet<string>;
33
+ export declare const SOURCE_HISTORY_AS_OF_FIELD = "historyAsOfMs";
34
+ /** The instant a declared history counts back from: the one an ask names (`SOURCE_HISTORY_AS_OF_FIELD`, a finite
35
+ * instant above zero, never later than the server's now), else the server's now. */
36
+ export declare function sourceHistoryAsOfMs(named: unknown, serverNowMs: number): number;
33
37
  /** A tape's market: the frame's venue else the chart's, and the normalized symbol, else the raw one (`ES1!`). */
34
38
  export interface TradesLargeMarket {
35
39
  exchange?: unknown;
@@ -103,18 +107,26 @@ interface LiveTradeWire {
103
107
  export declare function liveTradeOfPoint(point: unknown, large?: boolean): LiveTradeWire | undefined;
104
108
  /**
105
109
  * The chart bar a print at `tsMs` lands in, keyed the way the chart's candles of that market are:
106
- * the CME Group session lattice at 4h, 1d and 1w on a CME venue (the gateway's
107
- * cmeSessionBucketExpression), else a week bar on its Monday (`findMonday`, the chart's week: the
108
- * epoch week opens on a Thursday no weekly candle carries), else the UTC floor (the calendar
109
- * boundary on a month-class bar).
110
+ * the market's session lattice at 4h, 1d and 1w on a session-lattice venue (the gateway's
111
+ * `sessionProfile.bucketExpression`: the CME family, forex), else a week bar on its Monday
112
+ * (`findMonday`, the chart's week: the epoch week opens on a Thursday no weekly candle carries),
113
+ * else the UTC floor (the calendar boundary on a month-class bar).
110
114
  */
111
115
  export declare function tradesBarStartMs(tsMs: number, intervalMs: number, exchange?: unknown): number;
116
+ /**
117
+ * The key of the chart bar after the one keyed `barMs` (a `tradesBarStartMs` key), for a walk over a window's bars:
118
+ * the session lattice's next bar on a lattice venue (`sessionLatticeNextBarMs`: a lattice bar can outlast its width,
119
+ * so the bucket of `barMs + intervalMs` can be the bar itself), else the bar's end (a calendar bar's next boundary, a
120
+ * fixed bar its width on). Null when no later bar can be named: a walk stops there, it never repeats `barMs`.
121
+ */
122
+ export declare function tradesNextBarStartMs(barMs: number, intervalMs: number, exchange?: unknown): number | null;
112
123
  /**
113
124
  * Where a seeded history ask opens: the open of the chart bar holding `nowMs - historySec`, so the
114
125
  * seed covers whole bars and a bar is never bought from its middle (it would be replaced by its
115
126
  * later prints on every poll). A CME session lattice bar opens where the lattice opens it (a daily
116
127
  * bar at the prior 17:00 Chicago open, ahead of its 00:00Z label); every other bar on
117
- * `tradesBarStartMs` (a Monday on a week chart). Without a history the live edge itself.
128
+ * `tradesBarStartMs` (a Monday on a week chart). Without a history the live edge itself. `nowMs` is
129
+ * the ask's as-of (`sourceHistoryAsOfMs`: a replay's present, else the server's now).
118
130
  */
119
131
  export declare function tradesSeedStartMs(nowMs: number, historySec: number, intervalMs: number, exchange?: unknown): number;
120
132
  /**
@@ -128,23 +140,31 @@ export declare function tradesBarOpenMs(tsMs: number, intervalMs: number, exchan
128
140
  * right there, else the bar after it (the lattice's next session bar, the next calendar or fixed
129
141
  * bar), so an ask that may not reach behind `tsMs` still covers whole bars only. */
130
142
  export declare function tradesFirstBarOpenFromMs(tsMs: number, intervalMs: number, exchange?: unknown): number;
131
- /** Where a large-lane ask opens at the earliest: the first bar open at or after now minus the
132
- * gateway's bar limit (TRADES_LARGE_BAR_LIMIT_SEC, kept a margin inside it), so the gateway never
133
- * trims the window it was handed and the worker's grid opens where the answer does. */
134
- export declare function tradesBarLimitStartMs(nowMs: number, barLimitSec: number, intervalMs: number, exchange?: unknown): number;
143
+ /** Where a large-lane ask opens at the earliest: the first bar open at or after the ask's window
144
+ * end minus the gateway's bar limit (TRADES_LARGE_BAR_LIMIT_SEC, kept a margin inside it), so the
145
+ * gateway never trims the window it was handed and the worker's grid opens where the answer does.
146
+ * The gateway counts a raw window's cap from the window's own end (now, for a window ending there),
147
+ * so the limit bounds the ask's length, never how far back it sits. */
148
+ export declare function tradesBarLimitStartMs(windowEndMs: number, barLimitSec: number, intervalMs: number, exchange?: unknown): number;
135
149
  /**
136
150
  * The first stamp a seeded history ask serves prints from, whichever of these is latest (K_TRADES's
137
151
  * request builder honors them all): the open of the bar holding the ask's own window start (an ask
138
152
  * never opens inside a bar: a CME daily-class bar's key runs ahead of its open), the seed start
139
153
  * (`tradesSeedStartMs`), the table's retention horizon, and on the large lane the gateway's bar
140
154
  * limit (`barLimitSec`, `tradesBarLimitStartMs`). A reader of the answer (the wrun reconcile) tells
141
- * a PARTIAL first bucket, one that opened before this stamp, from a bucket served whole.
155
+ * a PARTIAL first bucket, one that opened before this stamp, from a bucket served whole. The seed
156
+ * counts back from the ask's as-of (`historyAsOfMs`, the ask's `SOURCE_HISTORY_AS_OF_FIELD`:
157
+ * `sourceHistoryAsOfMs`, the request builder's rule), the retention from `nowMs`, and the bar limit
158
+ * from the ask's window end (`windowEndMs`, else `nowMs`: the gateway counts a raw window's cap from
159
+ * its own end).
142
160
  */
143
161
  export declare function tradesServedStartMs(nowMs: number, historySec: number, intervalMs: number, options?: {
144
162
  windowFromMs?: number;
163
+ windowEndMs?: number;
145
164
  retentionSec?: number;
146
165
  barLimitSec?: number;
147
166
  exchange?: unknown;
167
+ historyAsOfMs?: unknown;
148
168
  }): number;
149
169
  /** Null for a point the fold rejects, another channel's included; without `large`, either channel (stamp readers). */
150
170
  export declare function readLiveTradePrint(newPoint: unknown, large?: boolean): LiveTradePrint | null;
@@ -171,29 +191,15 @@ export declare function tradesTapeFloorValuesPrints(floor: TradesTapeFloor): boo
171
191
  * builds `<root>-USD`), else the raw symbol's root (`6AZ6` is 6A, the continuous `ES1!` is ES, a
172
192
  * bare root is itself); undefined without either. */
173
193
  export declare function tradesCmeProductRoot(market: TradesLargeMarket): string | undefined;
174
- /** Whether the collector copies a CME Group product root into the large-print table (`TRADES_LARGE_CME_ROOTS`); false
175
- * for an unknown root. */
176
- export declare function tradesLargeServesCmeRoot(root: unknown): boolean;
177
- /**
178
- * Whether the large-print table holds a market's big trades, the ONE rule of the tape lane a market rides
179
- * (`tradesLaneLimits`): on a CME Group venue only a product root the collector copies (`tradesLargeServesCmeRoot`, the
180
- * root `tradesCmeProductRoot` reads: `MGC1!`, `MGCZ6` and `MGC-USD` are MGC, which it does not); every other market
181
- * is the collector's dollar rule's, which copies every print of at least $10k quote on a dollar-quoted market (a
182
- * dollar tape on any other quote is refused by name before any fetch, `wrun_tape_value_unproven`). A tape on a market
183
- * the table does not hold rides the raw tape, never the empty table.
184
- */
185
- export declare function tradesLargeServesMarket(market: TradesLargeMarket): boolean;
186
194
  /** The venues whose TRADE_LARGE read honors `minAmountPerOrder`; no other read may name it (a v2-only field leaves /v3). */
187
195
  export declare function tradesFloorPerOrder(exchange: unknown): boolean;
188
196
  /** Whether a tape floor is a dollar floor (C-DOLLAR's `minValue`, finite and above zero). */
189
197
  export declare function tradesTapeFloorIsDollars(floor: Pick<TradesTapeFloor, 'minValue'>): boolean;
190
198
  /** The tape lane an acquisition rides: the large lane (the table's retention, the gateway's bar
191
199
  * limit, the declared history) when it asks `large`, else the raw tape (a two-hour seed inside the
192
- * raw table's retention). Big trades read the large-print table wherever it holds the market
193
- * (`tradesLargeServesMarket`, which decides `large` where the acquisition is built): raw trade is kept
194
- * about two days, so a longer chart would show its small prints on the newest bars alone. A CME root
195
- * the collector does not copy rides the raw tape (its two hours and the raw live channel, every fill
196
- * judged on its own) instead of an empty table that draws nothing. A dollar floor (`floor.minValue`)
200
+ * raw table's retention). Big trades read the large-print table only, never the raw tape: raw trade
201
+ * is kept about two days, so a longer chart would show its small prints on the newest bars alone. A
202
+ * market the collector never copies reads the table empty and gets no live row either. A dollar floor (`floor.minValue`)
197
203
  * on the raw tape reads no history at all (`historyCapSec` 0, the live edge): the raw tape's quote
198
204
  * amounts are priced by no writer rule (a backfill gap is NULL), so its rows are no proven dollars.
199
205
  * The ONE rule of a tape's served history: the request builder, the reconcile's served start and the