@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
@@ -73,11 +73,13 @@
73
73
  import { findMonday, getDecimalPlaces } from '../chart/titan-constants.pin.js';
74
74
  import { Intervals } from '../../constants/interval.constants.js';
75
75
  import { FUNDING_INTERVAL_MAP } from '../../constants/overlay-data.constants.js';
76
- import { mergeLiveOhlcvDataPoint } from '../../kscript-data/controls/live-ohlcv-merge.util.js';
76
+ import { liveCandleAtInterval, mergeLiveOhlcvDataPoint } from '../../kscript-data/controls/live-ohlcv-merge.util.js';
77
77
  import { liveTradeOfPoint, mergeLiveTradesDataPoint, readLiveTradePrint, tradesBarStartMs, tradesTapeCellSize, tradesTapeFloorValuesPrints, } from '../../kscript-data/controls/live-trades-merge.util.js';
78
78
  import { liveAmountUsd, peekOptionTradeUnits } from '../options/option-trade-units.util.js';
79
79
  import { parseWrunTapeHistory, wrunTapeHistoryOf } from './wrun-tape-source.util.js';
80
+ import { noteWrunCoinTapePrice } from './wrun-tape-coins.util.js';
80
81
  import { wrunDollarUnitReader } from './wrun-dollar-unit-port.leaf.js';
82
+ import { wrunCmeDollarPointValue } from './wrun-cme-root-specs.util.js';
81
83
  import { wrunChartHostEnv } from '../../host-env.js';
82
84
  import { v2LiveTradePrintBelowFloor } from '../chart/kscript-live-coalesce.util.js';
83
85
  import { bookLiveBucketMs, bookLiveBucketRows } from '../chart/book-live-bucket.util.js';
@@ -97,6 +99,8 @@ import { getProfileBucketHeight, normalizeTicksPerBar } from '../../workers/util
97
99
  import { WRUN_RUN_INTERVAL_ROWS_KEY, wrunRunIntervalSessionOf, } from './wrun-run-interval-session.util.js';
98
100
  import { isWrunLegStreamClass } from './wrun-leg-stream-classes.js';
99
101
  import { isWrunTradesLegLane, wrunTradesLegOf, } from './wrun-trades-lane.util.js';
102
+ import { WRUN_PINNED_LANE_SPECS, isWrunPinnedLaneId, wrunPinnedLaneOf, wrunPinnedLanesOfClass, } from './wrun-pinned-lanes.util.js';
103
+ import { WRUN_BROWSER_PINNED_LANE_CLASSES } from './wrun-input-requirements.leaf.js';
100
104
  /** The `trades` SOURCE (K_TRADES) feeds the `tape` lane; the `trades` LANE is fed by `buy_sell_volume` (TRADE_AGG). */
101
105
  export const WRUN_LIVE_LANE_OF_SCRIPT_SOURCE = {
102
106
  ohlcv: 'ohlcv',
@@ -184,6 +188,7 @@ function intakeFor(indicatorId, chartIndex, intervalMs, generation) {
184
188
  bookLive: new Map(),
185
189
  bookReplay: new Map(),
186
190
  funding: new Map(),
191
+ pinned: new Map(),
187
192
  legs: new Map(),
188
193
  rowLanes: new Map(),
189
194
  droppedSinceDrain: 0,
@@ -209,6 +214,7 @@ function discardQueuesForGeneration(intake, generation) {
209
214
  intake.bookLive = new Map();
210
215
  intake.bookReplay = new Map();
211
216
  intake.funding = new Map();
217
+ intake.pinned = new Map();
212
218
  intake.legs = new Map();
213
219
  intake.rowLanes = new Map();
214
220
  intake.droppedSinceDrain = 0;
@@ -277,9 +283,17 @@ function tradesLegBucketMarket(context, lane) {
277
283
  function frameLanesOf(context, lane) {
278
284
  const declared = declaredLanesOf(context);
279
285
  if (lane !== 'trades')
280
- return declared.has(lane) ? [lane] : [];
286
+ return [...(declared.has(lane) ? [lane] : []), ...pinnedPushLanesOf(context, lane)];
281
287
  return ['trades', 'trades_usd'].filter((tradesLane) => declared.has(tradesLane));
282
288
  }
289
+ /** The pinned push lanes of a class the run asked (U9e: the context holds their buffers), in declaration order: each
290
+ * takes the frames of its own market (`pinnedLaneMarketOf`, off its acquisition). An oi lane is polled, never fed. */
291
+ function pinnedPushLanesOf(context, lane) {
292
+ const spec = WRUN_PINNED_LANE_SPECS[lane];
293
+ if (spec?.live !== 'push' || context.pinnedLaneRows === undefined)
294
+ return [];
295
+ return wrunPinnedLanesOfClass(declaredLanesOf(context), lane).filter((pinned) => context.pinnedLaneRows?.[pinned] !== undefined);
296
+ }
283
297
  /** Count a refusal on the overlay's stats: a live overlay gets its record on
284
298
  * the first verdict; an id without a context is counted only when a record
285
299
  * already exists (no records for unknown ids). */
@@ -441,19 +455,24 @@ function foldSidedAdditive(base, points, intervalMs, lane, read, market) {
441
455
  }
442
456
  /** The USD of a coin-arm amount at `price` (`liveAmountUsd`): the frames are live-feed's COIN arm (the channels ask
443
457
  * no quote), so an option contract's amount arrives in coin and its USD is the premium by the resolver's live-print
444
- * rule, never amount x price; null while its units are unknown and on a coin-premium book. Every other market is
445
- * amount x price. The point's own series names the market (its units are the ones the K_* control's read answered:
446
- * `peekOptionTradeUnits`). */
458
+ * rule, never amount x price; null while its units are unknown and on a coin-premium book. A CME Group market's
459
+ * amount is contracts, worth amount x price x its root's dollar point value (`wrunCmeDollarPointValue`), null where
460
+ * none prices it. Every other market is amount x price. The point's own series names the market (its units are the
461
+ * ones the K_* control's read answered: `peekOptionTradeUnits`). */
447
462
  function coinArmUsd(point, price, amount) {
448
463
  const series = isRecord(point.series) ? point.series : undefined;
449
464
  const exchange = typeof series?.exchange === 'string' ? series.exchange : '';
450
465
  const symbol = typeof series?.symbol === 'string' ? series.symbol : '';
466
+ // The coin arm counts contracts on a CME Group market: no root point value, no dollars (never close x contracts).
467
+ const pointValue = wrunCmeDollarPointValue({ exchange, symbol });
468
+ if (pointValue !== undefined)
469
+ return pointValue === null ? null : price * amount * pointValue;
451
470
  return liveAmountUsd(price, amount, peekOptionTradeUnits({ exchange, symbol }));
452
471
  }
453
472
  /** K_BUY_SELL_VOLUME.mergeLiveDataPoint's reading of a TRADE_AGG point: the
454
473
  * volume in coins, or its USD when the acquisition asked for USD (`coinArmUsd`:
455
- * volume x close, an option's premium; skipped without a usable close or a USD,
456
- * never scaled by a bad price). */
474
+ * volume x close, x the root's point value on CME, an option's premium; skipped
475
+ * without a usable close or a USD, never scaled by a bad price). */
457
476
  function tradeReader(acquisition) {
458
477
  const usdQuoted = String(acquisition.currency ?? '').toUpperCase() === 'USD';
459
478
  return (point) => {
@@ -613,7 +632,7 @@ export function foldWrunLegCandleRows(base, points, intervalMs, market) {
613
632
  slice.push(Array.from(predecessor));
614
633
  if (existing !== undefined)
615
634
  slice.push(Array.from(existing));
616
- const merged = mergeLiveOhlcvDataPoint(slice, parsed.data, bucket);
635
+ const merged = mergeLiveOhlcvDataPoint(slice, liveCandleAtInterval(point, parsed.data, intervalMs), bucket);
617
636
  const row = merged[merged.length - 1];
618
637
  if (row === undefined || Number(row[0]) !== bucket)
619
638
  continue;
@@ -663,8 +682,10 @@ rowMarket = market) {
663
682
  * bar. Undefined where the history keeps the book's own bars (`wrunLaneHostGridsOf`: 30m and finer, ETH, a day and
664
683
  * longer, a 24/7 market, a market served no book): every key is its own bar.
665
684
  */
666
- export function wrunBookRowHostBarResolver(intervalMs, market) {
667
- const grids = wrunLaneHostGridsOf('orderbook', intervalMs, market);
685
+ export function wrunBookRowHostBarResolver(intervalMs, market,
686
+ // The market the book's rows come from when it is not the chart's (a pinned book, U9e): its own wire bars.
687
+ rowMarket = market) {
688
+ const grids = wrunLaneHostGridsOf('orderbook', intervalMs, market, rowMarket);
668
689
  return grids && sourceRowHostBarResolverFor(intervalMs, grids.hostBar, intervalMs, grids.row);
669
690
  }
670
691
  /**
@@ -712,7 +733,9 @@ export function wrunLiveBookRows(point, intervalMs, market) {
712
733
  copy[0] = bookLiveBucketMs(copy[0], intervalMs, venue);
713
734
  return [copy];
714
735
  }
715
- function foldBook(base, points, intervalMs, market) {
736
+ function foldBook(base, points, intervalMs, market,
737
+ // The market the rows come from (a pinned book's own, U9e): raw frames key its bars, the chart's bars hold them.
738
+ rowMarket = market) {
716
739
  const indexByTs = new Map();
717
740
  for (let at = 0; at < base.length; at += 1)
718
741
  indexByTs.set(Number(base[at][0]), at);
@@ -722,11 +745,11 @@ function foldBook(base, points, intervalMs, market) {
722
745
  // Each keyed row lands on the host bar the chart's history puts it in (judged now, once per fold), and a bar keeps
723
746
  // the latest snapshot it holds: a row of an earlier key never replaces a later one there, a later point of the same
724
747
  // key does (the replay-then-live order, a live snapshot of the bucket winning).
725
- const barOf = wrunBookRowHostBarResolver(intervalMs, market);
748
+ const barOf = wrunBookRowHostBarResolver(intervalMs, market, rowMarket);
726
749
  const nowMs = barOf === undefined ? 0 : serverNowMs();
727
750
  const keyOnBar = new Map();
728
751
  for (const point of points) {
729
- for (const keyed of wrunLiveBookRows(point, intervalMs, market)) {
752
+ for (const keyed of wrunLiveBookRows(point, intervalMs, rowMarket)) {
730
753
  const key = Number(keyed[0]);
731
754
  const bucket = barOf === undefined ? key : barOf(key, nowMs);
732
755
  // No chart bar holds the row (it closes past the session's close): nothing to fold.
@@ -955,13 +978,19 @@ rowMarket) {
955
978
  case 'funding':
956
979
  return foldFunding(base, points, intervalMs);
957
980
  case 'book':
958
- return foldBook(base, points, intervalMs, market);
981
+ // A pinned book's rows come from its own market (U9e): they land on the chart's bars over both grids.
982
+ return foldBook(base, points, intervalMs, market, rowMarket ?? market);
959
983
  case 'volume_profile':
960
984
  return foldVolumeProfile(base, points, intervalMs, acquisition, market);
961
985
  case 'tape':
962
986
  // The print's own envelope names its venue (the CME lattice reads it), never the chart's.
963
987
  return foldTape(base, points, intervalMs, acquisition, market, rowMarket);
964
988
  default: {
989
+ // A pinned lane (U9e) folds as its class, its rows from its own market (`rowMarket`) on the chart's bars.
990
+ const pinned = wrunPinnedLaneOf(lane);
991
+ if (pinned !== undefined) {
992
+ return foldWrunLaneRows(pinned.cls, rows, points, intervalMs, acquisition, market, rowMarket);
993
+ }
965
994
  // A trades leg folds as its quote's own lane, on its market; the poll lanes have no live fold.
966
995
  const leg = wrunTradesLegOf(lane);
967
996
  return leg === undefined
@@ -1007,8 +1036,10 @@ function isForeignToMarket(market, frame) {
1007
1036
  }
1008
1037
  /** The market a lane's acquisition names when it is not the chart's own (the run market: a Trades chart's tape). */
1009
1038
  function pinnedLaneMarketOf(context, lane) {
1010
- const exchange = context.acquisition[lane]?.exchange;
1011
- const symbol = context.acquisition[lane]?.symbol;
1039
+ // A pinned lane (U9e) names its market in its id, whatever its acquisition record holds.
1040
+ const laned = wrunPinnedLaneOf(lane);
1041
+ const exchange = laned?.exchange ?? context.acquisition[lane]?.exchange;
1042
+ const symbol = laned?.symbol ?? context.acquisition[lane]?.symbol;
1012
1043
  if (typeof exchange !== 'string' || typeof symbol !== 'string')
1013
1044
  return undefined;
1014
1045
  if (exchange === KSCRIPT_CURRENT_EXCHANGE_SENTINEL || symbol === KSCRIPT_CURRENT_SYMBOL_SENTINEL)
@@ -1017,10 +1048,12 @@ function pinnedLaneMarketOf(context, lane) {
1017
1048
  const chart = chartMarketOf(context);
1018
1049
  return chart && liveFeedSeriesMatchesChartStream(pinned, { ...chart, ...context.market }) ? undefined : pinned;
1019
1050
  }
1020
- /** Every market a push lane's acquisition names beside the chart's own, once each (the fan-out admits their frames). */
1051
+ /** Every market a push lane's acquisition names beside the chart's own, once each (the fan-out admits their frames):
1052
+ * the run market of the chart's own lanes, and each pinned push lane's market (U9e). */
1021
1053
  function pinnedLaneMarketsOf(context) {
1022
1054
  const markets = new Map();
1023
- for (const lane of WRUN_PUSH_LANES) {
1055
+ const pinnedPush = ['book', 'funding', 'liquidations'].flatMap((cls) => pinnedPushLanesOf(context, cls));
1056
+ for (const lane of [...WRUN_PUSH_LANES, ...pinnedPush]) {
1024
1057
  const pinned = pinnedLaneMarketOf(context, lane);
1025
1058
  if (pinned)
1026
1059
  markets.set(`${pinned.exchange}|${pinned.symbol}`, pinned);
@@ -1143,6 +1176,15 @@ function wrunTapeLostRestorable(context) {
1143
1176
  }
1144
1177
  return historySec > 0;
1145
1178
  }
1179
+ /** A pinned book or funding lane's slots (U9e), made on its first point. */
1180
+ function pinnedSlotOf(intake, lane) {
1181
+ let slot = intake.pinned.get(lane);
1182
+ if (slot === undefined) {
1183
+ slot = { live: new Map(), replay: new Map() };
1184
+ intake.pinned.set(lane, slot);
1185
+ }
1186
+ return slot;
1187
+ }
1146
1188
  function pushAdditive(intake, lane, point, tapeContext) {
1147
1189
  let queue = intake.additive[lane];
1148
1190
  if (!queue) {
@@ -1188,6 +1230,8 @@ function takeAdditive(intake, lane) {
1188
1230
  }
1189
1231
  function pendingCount(intake) {
1190
1232
  let count = intake.bookLive.size + intake.bookReplay.size + intake.funding.size;
1233
+ for (const slot of intake.pinned.values())
1234
+ count += slot.live.size + slot.replay.size;
1191
1235
  for (const queue of Object.values(intake.additive)) {
1192
1236
  if (queue)
1193
1237
  count += queue.points.length - queue.head;
@@ -1385,7 +1429,13 @@ export function enqueueWrunLiveFrame(a) {
1385
1429
  const candidates = lane !== undefined && lane !== 'ohlcv' && WRUN_PUSH_LANES.has(lane) ? frameLanesOf(context, lane) : [];
1386
1430
  const takers = candidates.filter((fedLane) => {
1387
1431
  const pinned = pinnedLaneMarketOf(context, fedLane);
1388
- return pinned ? !isForeignToMarket(pinned, a.frame) : !isForeignFrame(context, a.frame);
1432
+ if (pinned === undefined)
1433
+ return !isForeignFrame(context, a.frame);
1434
+ // A lane pinned to another market (U9e) takes only a frame naming that market: a rider's bucketed rows and a
1435
+ // frame without a series identity are the chart's own.
1436
+ if (isWrunPinnedLaneId(fedLane) && (!a.frame.incomingExchange || !a.frame.incomingSymbol))
1437
+ return false;
1438
+ return !isForeignToMarket(pinned, a.frame);
1389
1439
  });
1390
1440
  // A frame no lane could take is judged against the chart's market, as before.
1391
1441
  const foreign = candidates.length > 0 ? takers.length === 0 : isForeignFrame(context, a.frame);
@@ -1428,37 +1478,56 @@ export function enqueueWrunLiveFrame(a) {
1428
1478
  const intervalMs = context.intervalMs;
1429
1479
  if (lane === 'book') {
1430
1480
  const data = a.frame.data;
1431
- if (a.frame.bucketed) {
1432
- const rows = Array.isArray(data) ? data : [data];
1433
- for (const row of rows) {
1434
- const bucket = Number(row?.[0]);
1435
- if (Number.isFinite(bucket))
1436
- intake.bookLive.set(bucket, row);
1481
+ const replay = !a.frame.bucketed && isRecord(data) && isRecord(data.series) && data.series.isReplay === true;
1482
+ for (const fedLane of fed) {
1483
+ // A pinned book (U9e) keeps slots of its own, its rows keyed on its own market's bar as its history's are; the
1484
+ // drain lands them on the chart's bars (`foldBook` over the lane's market, the tape's host-bar model). The chart's
1485
+ // own book keys the chart market's bar, as the drain folds every lane (`chartMarketOf`).
1486
+ const pinnedSlot = isWrunPinnedLaneId(fedLane) ? pinnedSlotOf(intake, fedLane) : undefined;
1487
+ const liveSlot = pinnedSlot?.live ?? intake.bookLive;
1488
+ const replaySlot = pinnedSlot?.replay ?? intake.bookReplay;
1489
+ if (a.frame.bucketed) {
1490
+ const rows = Array.isArray(data) ? data : [data];
1491
+ for (const row of rows) {
1492
+ const bucket = Number(row?.[0]);
1493
+ if (Number.isFinite(bucket))
1494
+ liveSlot.set(bucket, row);
1495
+ }
1496
+ continue;
1437
1497
  }
1438
- }
1439
- else {
1440
- const replay = isRecord(data) && isRecord(data.series) && data.series.isReplay === true;
1441
- const slot = replay ? intake.bookReplay : intake.bookLive;
1442
- // Keyed on the chart market's bar, as the drain folds every lane (`chartMarketOf`).
1443
- for (const row of wrunLiveBookRows(data, intervalMs, chartMarketOf(context))) {
1444
- slot.set(Number(row[0]), row);
1498
+ const market = pinnedSlot !== undefined
1499
+ ? (pinnedLaneMarketOf(context, fedLane) ?? chartMarketOf(context))
1500
+ : chartMarketOf(context);
1501
+ for (const row of wrunLiveBookRows(data, intervalMs, market)) {
1502
+ (replay ? replaySlot : liveSlot).set(Number(row[0]), row);
1445
1503
  }
1446
1504
  }
1447
1505
  }
1448
1506
  else if (lane === 'funding') {
1449
1507
  const parsed = wrunLiveFundingValue(a.frame.data);
1450
1508
  const bucket = parsed ? wrunLiveBucketTs('funding', parsed.tsMs, intervalMs) : null;
1451
- if (bucket !== null)
1452
- intake.funding.set(bucket, a.frame.data);
1509
+ if (bucket !== null) {
1510
+ for (const fedLane of fed) {
1511
+ // A pinned funding lane (U9e) keeps its own newest point per bucket.
1512
+ if (isWrunPinnedLaneId(fedLane))
1513
+ pinnedSlotOf(intake, fedLane).live.set(bucket, a.frame.data);
1514
+ else
1515
+ intake.funding.set(bucket, a.frame.data);
1516
+ }
1517
+ }
1453
1518
  }
1454
1519
  else if (lane === 'tape') {
1455
1520
  // The router hands every trades source both channels: a print of the other one never counts or takes a slot.
1456
1521
  const large = context.acquisition.tape?.large === true;
1457
- if (liveTradeOfPoint(a.frame.data, large) === undefined && liveTradeOfPoint(a.frame.data, !large) !== undefined) {
1522
+ const trade = liveTradeOfPoint(a.frame.data, large);
1523
+ if (trade === undefined && liveTradeOfPoint(a.frame.data, !large) !== undefined) {
1458
1524
  return noteVerdict(a.indicatorId, 'ignored:other-channel', context);
1459
1525
  }
1460
1526
  // Counts rows the floor turns away too: a floor that drops most of a busy tape must not read as a dead feed.
1461
1527
  intake.stats.frames.tape = (intake.stats.frames.tape ?? 0) + 1;
1528
+ // A coins tape's live guard reads the market's prices off every print of its channel, before the floor turns any
1529
+ // away: the prints the floor passes thin out exactly as the price falls (wrun-tape-coins.util).
1530
+ noteWrunCoinTapePrice(context, Number(trade?.price));
1462
1531
  // Floors at the door as the fold does, so a row that can never fold never crowds a qualifying one out of the queue.
1463
1532
  const floor = wrunTapeLiveFloorOf(context.acquisition.tape, chartMarketOf(context));
1464
1533
  if (!tradesTapeFloorValuesPrints(floor)) {
@@ -1516,7 +1585,9 @@ function laneRowsOf(context, lane) {
1516
1585
  case 'options_chain':
1517
1586
  return undefined;
1518
1587
  default:
1519
- // A trades leg lane or a registry poll lane instance: its one record.
1588
+ // A trades leg lane, a pinned lane or a registry poll lane instance: its one record.
1589
+ if (isWrunPinnedLaneId(lane))
1590
+ return context.pinnedLaneRows?.[lane];
1520
1591
  return isWrunTradesLegLane(lane) ? context.tradeLegRows?.[lane] : context.pollLaneRows?.[lane];
1521
1592
  }
1522
1593
  }
@@ -1561,6 +1632,8 @@ function setLaneRows(context, lane, rows) {
1561
1632
  default:
1562
1633
  if (isWrunTradesLegLane(lane))
1563
1634
  context.tradeLegRows = { ...context.tradeLegRows, [lane]: rows };
1635
+ else if (isWrunPinnedLaneId(lane))
1636
+ context.pinnedLaneRows = { ...context.pinnedLaneRows, [lane]: rows };
1564
1637
  return;
1565
1638
  }
1566
1639
  }
@@ -1596,7 +1669,8 @@ export function drainWrunLiveIntake(ctx) {
1596
1669
  if (points.length > 0)
1597
1670
  batches.push([lane, points]);
1598
1671
  }
1599
- for (const lane of Object.keys(intake.additive).filter(isWrunTradesLegLane)) {
1672
+ // The trades legs and the pinned liquidations lanes (U9e), each its own additive queue.
1673
+ for (const lane of Object.keys(intake.additive).filter((key) => isWrunTradesLegLane(key) || isWrunPinnedLaneId(key))) {
1600
1674
  const points = takeAdditive(intake, lane);
1601
1675
  if (points.length > 0)
1602
1676
  batches.push([lane, points]);
@@ -1611,6 +1685,12 @@ export function drainWrunLiveIntake(ctx) {
1611
1685
  batches.push(['funding', [...intake.funding.values()]]);
1612
1686
  intake.funding = new Map();
1613
1687
  }
1688
+ // The pinned book and funding lanes (U9e): a book's replay rows first, so a live snapshot of the same bucket wins.
1689
+ for (const [lane, slot] of intake.pinned) {
1690
+ if (slot.live.size + slot.replay.size > 0)
1691
+ batches.push([lane, [...slot.replay.values(), ...slot.live.values()]]);
1692
+ }
1693
+ intake.pinned = new Map();
1614
1694
  let dirtyFromTs = null;
1615
1695
  // Every lane folds on the chart's own bars (a grid leg on its own), its rows from its acquisition's market.
1616
1696
  const chartMarket = chartMarketOf(ctx);
@@ -1843,6 +1923,27 @@ export function dropWrunLiveQueuedBuckets(indicatorId, lane, buckets) {
1843
1923
  return 0;
1844
1924
  const drop = new Set(buckets);
1845
1925
  let dropped = 0;
1926
+ const pinned = wrunPinnedLaneOf(lane);
1927
+ if (pinned !== undefined && pinned.cls !== 'liquidations') {
1928
+ // A pinned book or funding lane (U9e): a book row keyed on its own market's bar is dropped where it lands on a
1929
+ // covered chart bar (the fold's landing), a funding point by its bucket.
1930
+ const slot = intake.pinned.get(lane);
1931
+ if (slot === undefined)
1932
+ return 0;
1933
+ const pinnedContext = getWrunOverlayLiveContext(indicatorId);
1934
+ const barOf = pinned.cls === 'book' && pinnedContext
1935
+ ? wrunBookRowHostBarResolver(intake.intervalMs, chartMarketOf(pinnedContext), pinned)
1936
+ : undefined;
1937
+ const nowMs = barOf === undefined ? 0 : serverNowMs();
1938
+ for (const map of [slot.live, slot.replay]) {
1939
+ for (const key of [...map.keys()]) {
1940
+ const bar = barOf === undefined ? key : barOf(key, nowMs);
1941
+ if (bar !== null && drop.has(bar) && map.delete(key))
1942
+ dropped += 1;
1943
+ }
1944
+ }
1945
+ return dropped;
1946
+ }
1846
1947
  if (lane === 'book') {
1847
1948
  // A queued row is keyed on its own bar and folds onto the host bar the chart's history puts it in
1848
1949
  // (`wrunBookRowHostBarResolver`), the bar an answer names: the row a covered bar would take is dropped.
@@ -1901,6 +2002,7 @@ export function dropWrunLiveQueuedBuckets(indicatorId, lane, buckets) {
1901
2002
  }
1902
2003
  const leg = isWrunTradesLegLane(lane);
1903
2004
  if (!leg &&
2005
+ pinned === undefined &&
1904
2006
  lane !== 'trades' &&
1905
2007
  lane !== 'trades_usd' &&
1906
2008
  lane !== 'liquidations' &&
@@ -1911,10 +2013,11 @@ export function dropWrunLiveQueuedBuckets(indicatorId, lane, buckets) {
1911
2013
  const queue = intake.additive[lane];
1912
2014
  if (!queue)
1913
2015
  return 0;
1914
- // Bucketed exactly as the drain folds them (the chart's own market, a trades leg its own at its own tier).
2016
+ // Bucketed exactly as the drain folds them (the chart's own market, a trades leg its own at its own tier, a pinned
2017
+ // liquidations lane as its class).
1915
2018
  const context = getWrunOverlayLiveContext(indicatorId);
1916
2019
  const market = context ? (leg ? tradesLegBucketMarket(context, lane) : chartMarketOf(context)) : null;
1917
- const bucketLane = leg ? wrunTradesLegOf(lane).lane : lane;
2020
+ const bucketLane = leg ? wrunTradesLegOf(lane).lane : (pinned?.cls ?? lane);
1918
2021
  const bucketIntervalMs = context ? laneFoldIntervalMs(context, lane, intake.intervalMs) : intake.intervalMs;
1919
2022
  const tapeHostBarOf = lane === 'tape' && context ? wrunTapeLaneHostBarOf(context, intake.intervalMs) : undefined;
1920
2023
  const bucketOf = (point) => {
@@ -2075,7 +2178,10 @@ function intervalMsOf(word) {
2075
2178
  /**
2076
2179
  * Whether the push intake may feed this package on a chart of
2077
2180
  * `chartInterval`. False when any input pins something the lane cannot
2078
- * ride: a market pin on anything but a secondary `ohlcv` or `trades` input, an interval
2181
+ * ride: a market pin on a class the one table leaves out
2182
+ * (`WRUN_BROWSER_PINNED_LANE_CLASSES`, the table the row builder's refusal
2183
+ * and the run's admission read) or on the primary input, a pinned lane
2184
+ * (trades, book, oi, funding, liquidations) with an interval of its own, an interval
2079
2185
  * pin on a celled input or on a class other than `ohlcv`, `funding` or
2080
2186
  * `oi`, a finer interval, one that is not a whole multiple of the chart's,
2081
2187
  * or a word outside the vocabulary. An `ohlcv` pin COARSER than the chart
@@ -2089,7 +2195,11 @@ function intervalMsOf(word) {
2089
2195
  * An `odds` input (the odds lane) is a poll-only leg outside the push set:
2090
2196
  * its market (POLYMARKET|<condition id>) or interval pin never makes the
2091
2197
  * package ineligible, even on the primary input, so a package pairing an
2092
- * odds input with a pinned ohlcv leg keeps that leg's push feed.
2198
+ * odds input with a pinned ohlcv leg keeps that leg's push feed. A
2199
+ * secondary trades, book, oi, funding or liquidations input pinned to another
2200
+ * market is a lane of its own there (a trades leg, U9e's pinned lanes): its
2201
+ * class's channel on that market feeds it (an oi lane is polled), and the
2202
+ * chart's own push lanes stay valid.
2093
2203
  * The full run refuses the ineligible pins by name before any fetch
2094
2204
  * (`planWrunPinnedLegs`), so this only classifies.
2095
2205
  */
@@ -2111,14 +2221,23 @@ export function wrunPushEligible(m, chartInterval) {
2111
2221
  if (source.source === 'odds')
2112
2222
  continue;
2113
2223
  const marketPinned = !!(source.symbol || source.exchange);
2114
- // A secondary trades pin (kit 0.77.0) is a push lane of its own, its leg lane.
2115
- if (marketPinned && source.source === 'trades' && input.cellType !== 'array' && input.index > 0) {
2116
- if (source.interval !== undefined)
2224
+ if (marketPinned) {
2225
+ // A pin on a class the one table leaves out, or on the primary input, is no lane the intake can ride.
2226
+ if (!WRUN_BROWSER_PINNED_LANE_CLASSES.has(source.source) || input.index === 0)
2227
+ return false;
2228
+ // A secondary trades pin (kit 0.77.0) and a pinned book, oi, funding or liquidations input (U9e) are lanes of
2229
+ // their own on that market, at the chart's interval (a trades leg takes no interval word at all).
2230
+ if (source.source !== 'ohlcv') {
2231
+ if (source.interval === undefined)
2232
+ continue;
2233
+ if (source.source === 'trades' || chartMs === undefined || intervalMsOf(source.interval) !== chartMs) {
2234
+ return false;
2235
+ }
2236
+ continue;
2237
+ }
2238
+ if (input.cellType === 'array')
2117
2239
  return false;
2118
- continue;
2119
2240
  }
2120
- if (marketPinned && (source.source !== 'ohlcv' || input.cellType === 'array' || input.index === 0))
2121
- return false;
2122
2241
  if (!source.interval)
2123
2242
  continue;
2124
2243
  if (source.interval === chartInterval)
@@ -2208,6 +2327,7 @@ export function wrunLiveContextSnapshot(indicatorId) {
2208
2327
  for (const lane of [
2209
2328
  ...WRUN_LIVE_LANES,
2210
2329
  ...Object.keys(context.tradeLegRows ?? {}).filter(isWrunTradesLegLane),
2330
+ ...Object.keys(context.pinnedLaneRows ?? {}).filter(isWrunPinnedLaneId),
2211
2331
  ...(context.pollLanes ?? []).map((instance) => instance.key),
2212
2332
  ]) {
2213
2333
  const rows = laneRowsOf(context, lane);
@@ -98,7 +98,17 @@
98
98
  * its old rows), or a reconcile lane whose window held more than its read
99
99
  * takes (a refusal by name the leaf declares `over-cap`: the tape past the
100
100
  * trades worker's cap), whose window stays owed while the session is held
101
- * and hands ONE full run off (`handWrunLiveOverCapBack`). A pan-back page left to its wave
101
+ * and hands ONE full run off (`handWrunLiveOverCapBack`). A history move the
102
+ * planner reads as a verified backward extension (`extension: 'backward'`)
103
+ * waits at the settle gate while the gesture is live, the view moved less
104
+ * than WRUN_REBUILD_SETTLE_STILL_MS ago or the main candle fetch is out, so
105
+ * ONE handoff after the pan settles (or at the shared ceiling), which the
106
+ * episode's own wake decides on the motion clock, covers every page of the
107
+ * gesture and carries how long it held (WRUN-PANBACK A2); every other
108
+ * history move hands off at once. The chart's
109
+ * whole pan wave for such a page, offered by the executor while the episode
110
+ * is open or the gesture is live, is taken into it (`absorbWrunLazyWave`):
111
+ * it runs nothing, the episode's handoff rebuilds the page. A pan-back page left to its wave
102
112
  * (contract C1: a verified backward extension under an owner pending or
103
113
  * landed over it, or on a prefix-capable session within the grace its wave
104
114
  * has to stamp one) moves no history: the wave lands the page's rows into
@@ -174,6 +184,11 @@ import type { WrunIndicatorMetadata } from '../../interfaces/wrun-runtime.interf
174
184
  import type { RuntimeDiagnostic } from '../../interfaces/kscript-diagnostics.interface.js';
175
185
  import type { WrunRowFrame } from './wrun-row-source.js';
176
186
  import type { WrunLegStreamLane } from './wrun-leg-stream-classes.js';
187
+ /** The settle gate's stillness (WRUN-PANBACK A2): a backward extension's episode hands off once the chart's view has
188
+ * not moved for this long on the motion clock (pan and zoom events, titan's probe), so a pointer-up pause this long
189
+ * rebuilds the pages so far and a shorter one stays inside the episode. The episode's own wake decides it, never the
190
+ * drain's cadence. */
191
+ export declare const WRUN_REBUILD_SETTLE_STILL_MS = 1000;
177
192
  /** The reconcile window reaches this many bars behind the session watermark
178
193
  * (the kScript poll's 8-bar tail, V2_TECHNICAL_SOURCE_REFRESH_TAIL_BARS),
179
194
  * and a late point older than this many bars reseeds on its own gap. */
@@ -259,9 +274,12 @@ export declare function wrunLiveLanesOf(metadata: WrunIndicatorMetadata): WrunLi
259
274
  /** Every lane a session's reconcile re-asks: the row builder's own lanes
260
275
  * the sheet declares, then the trades leg lanes the full run asked (kit 0.77.0:
261
276
  * the ones the session holds a buffer for, `context.tradeLegRows`; a leg never
262
- * asked is never re-asked), then the registry poll lane instances the full run
263
- * planned (`context.pollLanes`), then its row lane instances
264
- * (`context.rowLanes`), in the full run's order. */
277
+ * asked is never re-asked), then the pinned lanes it asked (U9e: a book, oi,
278
+ * funding or liquidations input pinned to another market, by the buffers
279
+ * `context.pinnedLaneRows` holds; each re-asked on its own market, an oi lane's
280
+ * forming bucket by the same poll as the chart's own oi), then the registry
281
+ * poll lane instances the full run planned (`context.pollLanes`), then its row
282
+ * lane instances (`context.rowLanes`), in the full run's order. */
265
283
  export declare function wrunLiveLanesOfContext(context: WrunOverlayLiveContext): WrunLiveLane[];
266
284
  /**
267
285
  * What the pass that installed a source-fed session hands its drain (WRUN-PARITY-PLAN C7, plan row 20): the verdict
@@ -331,7 +349,9 @@ export declare function scheduleWrunOverlayLiveTick(chartIndex: number, indicato
331
349
  export declare function requestWrunOverlayLiveDrain(indicatorId: string): void;
332
350
  /**
333
351
  * Contract C7: re-arm the overlay's deferred drain on a prefix run's outcome
334
- * (landed, rejected, or skipped after planning). A frame that arrived while
352
+ * (landed, rejected, or skipped after planning), and on a warm switch's
353
+ * adoption (wrun-overlay-run.util adoptWrunParkedLiveSession), whose
354
+ * `session-start` drain can meet the adoption's own run in flight. A frame that arrived while
335
355
  * the prefix ran woke a drain the in-flight gate turned away
336
356
  * (`runWrunOverlayLiveTick` returns before its planner while any executor run
337
357
  * is active), and the scheduler then dropped its record with nothing pending,
@@ -345,6 +365,14 @@ export declare function requestWrunOverlayLiveDrain(indicatorId: string): void;
345
365
  * (`drainWrunLiveTick`) until it gets past the gate.
346
366
  */
347
367
  export declare function rearmWrunLiveTickDrain(chartIndex: number, indicatorId: string): void;
368
+ /**
369
+ * The rows a session's evaluated bars read moved from `fromTs` on, with no lane point to say so: the host's session
370
+ * composition changed owner (web: an order-flow hand-back, or a new seam), so the bars it evaluated from the old
371
+ * seam read rows that are no longer the overlay's. It is the revised closed bar's obligation (`closedBarRevisions`):
372
+ * the next drain reseeds over the buffers, composed as they stand then, and no fetch is made. A session with no bar
373
+ * evaluated at or past `fromTs` owes nothing (the tail re-sends its forming bar anyway). Answers whether it owed.
374
+ */
375
+ export declare function reviseWrunOverlayLiveFrom(chartIndex: number, indicatorId: string, fromTs: number): boolean;
348
376
  export declare function holdWrunLiveTicks(on: boolean): void;
349
377
  /** The next moment any pinned leg of the context closes (the earliest over
350
378
  * the legs), null without legs: `floor(now / L) * L + L` for a fixed span,
@@ -508,7 +536,16 @@ export type WrunLiveTickPlan =
508
536
  /** rerunWrunOverlayForChartWave (fetches). */
509
537
  | {
510
538
  kind: 'rebuild';
511
- reason: 'identity' | 'history' | 'gap-too-wide' | 'acquisition';
539
+ reason: 'identity' | 'gap-too-wide' | 'acquisition' | 'tape-price';
540
+ }
541
+ /** History moved under the session. `extension`, read on the chart's own bars (WRUN-PANBACK A2): `backward` when
542
+ * the chart's first bar moved earlier, the session's first chart bar is still loaded and the newest bar did not move
543
+ * back (a pan-back page: the settle gate hands it off once the pan settled); `other` for a dataset replacement, a
544
+ * rolled-off head or a newest-bar rollback (handed off at once). */
545
+ | {
546
+ kind: 'rebuild';
547
+ reason: 'history';
548
+ extension: 'backward' | 'other';
512
549
  };
513
550
  export interface WrunLiveTickPlanInput {
514
551
  context: WrunOverlayLiveContext;
@@ -566,6 +603,9 @@ export interface WrunLiveRunClock {
566
603
  chartFirstTs: number;
567
604
  /** The chart's first loaded bar the session's run was built over. */
568
605
  sessionChartFirstTs: number;
606
+ /** The chart's rows still hold `sessionChartFirstTs` (a page joined in front of the bars the session computed, not a
607
+ * replaced dataset): the history check's backward-extension test (WRUN-PANBACK A2). Absent reads false. */
608
+ sessionChartFirstHeld?: boolean;
569
609
  /** The open of the run bar holding the chart's newest bar (the forming one):
570
610
  * the reconcile window ends with it. */
571
611
  formingTs: number;
@@ -580,7 +620,8 @@ export interface WrunLiveRunClock {
580
620
  /**
581
621
  * Decide one drain's plan from the context, the chart's main rows, the gap
582
622
  * marks taken and what the fold reported. In order: a moved identity, a
583
- * moved row-lane acquisition, or history (a clamped session: a head rolled
623
+ * moved row-lane acquisition, a coins tape whose market traded below its
624
+ * priced low x 0.9, or history (a clamped session: a head rolled
584
625
  * past its first row; a pan-back page left to its wave is not one, C1), or a
585
626
  * gap wider than 250 bars, rebuilds; any reconcile trigger
586
627
  * (session-start, main-jump, wake, poll-due; main-jump is detected here from
@@ -631,6 +672,9 @@ export declare function wrunPinnedCloseTimerDueAt(indicatorId: string): number |
631
672
  * prefix has not landed reads no identity, so no earlier run's coverage
632
673
  * skips the wave that owes the page's rows; a run's own start (in flight)
633
674
  * reads the chart's identity, so a prefix that lands covers the waves over
634
- * the same rows after it. Exported for the specs. */
675
+ * the same rows after it, and is noted (`wrunRunStarts`). A coverage check
676
+ * for an overlay whose live session carries the chart's tail reads the key
677
+ * its latest run started on while the history it computed stands
678
+ * (`wrunLiveCarriedCoverage`). Exported for the specs. */
635
679
  export declare function wrunChartRowsIdentity(chartIndex: number, indicatorId?: string): string | undefined;
636
680
  export {};