@orangecharts/wrun-chart-host 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/README.md +2 -0
  2. package/dist/constants/feature-flags.constants.d.ts +15 -1
  3. package/dist/constants/feature-flags.constants.js +130 -24
  4. package/dist/constants/governed-exchanges.constants.d.ts +12 -0
  5. package/dist/constants/governed-exchanges.constants.js +16 -0
  6. package/dist/constants/opra-compliance.constants.d.ts +3 -2
  7. package/dist/constants/opra-compliance.constants.js +3 -2
  8. package/dist/constants/option-venues.constants.d.ts +2 -2
  9. package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
  10. package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
  11. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
  12. package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
  13. package/dist/constants/venue-presets.constants.d.ts +20 -20
  14. package/dist/constants/venue-presets.constants.js +24 -26
  15. package/dist/host-env.d.ts +21 -5
  16. package/dist/host-env.js +6 -0
  17. package/dist/host-ports.types.d.ts +102 -19
  18. package/dist/index.d.ts +18 -0
  19. package/dist/index.js +18 -0
  20. package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
  21. package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
  22. package/dist/interfaces/cme-realtime.interface.js +6 -3
  23. package/dist/interfaces/kscript-diagnostics.interface.d.ts +12 -0
  24. package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
  25. package/dist/interfaces/prediction-market.interface.d.ts +7 -0
  26. package/dist/interfaces/replay.interface.d.ts +8 -0
  27. package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
  28. package/dist/interfaces/stocks-realtime.interface.js +32 -0
  29. package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
  30. package/dist/kscript-data/controls/live-trades-merge.util.d.ts +62 -94
  31. package/dist/kscript-data/controls/live-trades-merge.util.js +106 -171
  32. package/dist/market-data/billing.interface.d.ts +174 -36
  33. package/dist/market-data/billing.interface.js +58 -8
  34. package/dist/market-data/venue.d.ts +152 -7
  35. package/dist/market-data/venues/cme.contract.copy.json +66 -0
  36. package/dist/market-data/venues/cme.d.ts +126 -0
  37. package/dist/market-data/venues/cme.js +133 -0
  38. package/dist/market-data/venues/index.d.ts +294 -7
  39. package/dist/market-data/venues/index.js +49 -6
  40. package/dist/market-data/venues/opra.contract.copy.json +3 -2
  41. package/dist/market-data/venues/opra.d.ts +2 -2
  42. package/dist/market-data/venues/opra.js +5 -2
  43. package/dist/market-data/venues/stocks.contract.copy.json +64 -0
  44. package/dist/market-data/venues/stocks.d.ts +130 -0
  45. package/dist/market-data/venues/stocks.js +117 -0
  46. package/dist/settings-templates/footprint-rows.js +35 -2
  47. package/dist/settings-templates/form-rows.d.ts +2 -1
  48. package/dist/settings-templates/index.js +7 -3
  49. package/dist/settings-templates/indicator-fields.d.ts +5 -4
  50. package/dist/settings-templates/indicator-fields.js +79 -10
  51. package/dist/settings-templates/tool-rules.d.ts +32 -15
  52. package/dist/settings-templates/tool-rules.js +33 -11
  53. package/dist/settings-templates/tool-tables.generated.js +95 -31
  54. package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
  55. package/dist/utility/chart/book-live-bucket.util.js +47 -0
  56. package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
  57. package/dist/utility/chart/cme-cache-context.util.js +10 -6
  58. package/dist/utility/chart/cme-realtime.util.js +10 -0
  59. package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
  60. package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
  61. package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
  62. package/dist/utility/chart/effective-chart-session.util.js +39 -0
  63. package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
  64. package/dist/utility/chart/host-bar-placement.util.js +170 -30
  65. package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
  66. package/dist/utility/chart/index-host-tier.util.js +7 -2
  67. package/dist/utility/chart/index-mode-admission.util.js +30 -3
  68. package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
  69. package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
  70. package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
  71. package/dist/utility/chart/kscript-live-coalesce.util.d.ts +9 -7
  72. package/dist/utility/chart/kscript-live-coalesce.util.js +13 -8
  73. package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
  74. package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
  75. package/dist/utility/chart/kscript-provenance-keys.util.js +13 -0
  76. package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +5 -1
  77. package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
  78. package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
  79. package/dist/utility/chart/kscript-venue-policy.util.d.ts +156 -43
  80. package/dist/utility/chart/kscript-venue-policy.util.js +249 -59
  81. package/dist/utility/chart/live-bucket.util.d.ts +24 -8
  82. package/dist/utility/chart/live-bucket.util.js +85 -27
  83. package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
  84. package/dist/utility/chart/market-session-schedule.util.js +16 -0
  85. package/dist/utility/chart/marketKind.util.js +5 -0
  86. package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
  87. package/dist/utility/chart/mixed-mode.util.js +14 -0
  88. package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
  89. package/dist/utility/chart/opra-read-access.leaf.js +5 -3
  90. package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
  91. package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
  92. package/dist/utility/chart/rth-session.util.d.ts +12 -10
  93. package/dist/utility/chart/rth-session.util.js +25 -21
  94. package/dist/utility/chart/trading-day.util.d.ts +17 -0
  95. package/dist/utility/chart/trading-day.util.js +59 -0
  96. package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
  97. package/dist/utility/chart/window-geometry.leaf.js +22 -6
  98. package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
  99. package/dist/utility/chart/window-owner.leaf.js +45 -3
  100. package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
  101. package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
  102. package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
  103. package/dist/utility/chart/wrun-run-result.util.js +141 -6
  104. package/dist/utility/intl-locale.util.js +5 -0
  105. package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
  106. package/dist/utility/options/option-bar-anchor.util.js +340 -0
  107. package/dist/utility/options/option-venue.util.d.ts +18 -0
  108. package/dist/utility/options/option-venue.util.js +27 -0
  109. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +4 -0
  110. package/dist/utility/v2/gate-plane.util.d.ts +12 -3
  111. package/dist/utility/v2/gate-plane.util.js +30 -4
  112. package/dist/utility/v2/gate-session-latch.util.js +1 -1
  113. package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
  114. package/dist/utility/v2/stocks-governed.util.js +34 -0
  115. package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
  116. package/dist/utility/wrun/derived-roots.leaf.js +27 -0
  117. package/dist/utility/wrun/derived-roots.util.d.ts +205 -0
  118. package/dist/utility/wrun/derived-roots.util.js +451 -0
  119. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +43 -7
  120. package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
  121. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
  122. package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
  123. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
  124. package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
  125. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
  126. package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
  127. package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
  128. package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
  129. package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
  130. package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
  131. package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
  132. package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
  133. package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
  134. package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
  135. package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
  136. package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
  137. package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
  138. package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
  139. package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
  140. package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
  141. package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +41 -10
  142. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +111 -0
  143. package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +133 -0
  144. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
  145. package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
  146. package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
  147. package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +197 -13
  148. package/dist/utility/wrun/sources/wrun-row-lanes.util.js +761 -27
  149. package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
  150. package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
  151. package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
  152. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +60 -16
  153. package/dist/utility/wrun/wrun-chart-market-facts.util.js +113 -61
  154. package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
  155. package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
  156. package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
  157. package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
  158. package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
  159. package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
  160. package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
  161. package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
  162. package/dist/utility/wrun/wrun-frames.d.ts +27 -6
  163. package/dist/utility/wrun/wrun-frames.js +73 -10
  164. package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
  165. package/dist/utility/wrun/wrun-handles.util.js +9 -8
  166. package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
  167. package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
  168. package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
  169. package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
  170. package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
  171. package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
  172. package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
  173. package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
  174. package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
  175. package/dist/utility/wrun/wrun-live-intake.util.d.ts +35 -15
  176. package/dist/utility/wrun/wrun-live-intake.util.js +243 -126
  177. package/dist/utility/wrun/wrun-live-tick.util.d.ts +13 -5
  178. package/dist/utility/wrun/wrun-live-tick.util.js +279 -99
  179. package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
  180. package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
  181. package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +60 -11
  182. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +70 -5
  183. package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
  184. package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
  185. package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
  186. package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
  187. package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
  188. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
  189. package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
  190. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
  191. package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
  192. package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
  193. package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
  194. package/dist/utility/wrun/wrun-option-views.util.d.ts +323 -28
  195. package/dist/utility/wrun/wrun-option-views.util.js +484 -71
  196. package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
  197. package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
  198. package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
  199. package/dist/utility/wrun/wrun-output-style.util.js +20 -2
  200. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +32 -2
  201. package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
  202. package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
  203. package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
  204. package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
  205. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +160 -42
  206. package/dist/utility/wrun/wrun-overlay-run.util.js +1244 -209
  207. package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
  208. package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
  209. package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
  210. package/dist/utility/wrun/wrun-panel-mount.util.js +114 -19
  211. package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
  212. package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
  213. package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
  214. package/dist/utility/wrun/wrun-param-map.util.js +10 -5
  215. package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
  216. package/dist/utility/wrun/wrun-param-values.util.js +4 -0
  217. package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
  218. package/dist/utility/wrun/wrun-pin-spelling.util.js +39 -14
  219. package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
  220. package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
  221. package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
  222. package/dist/utility/wrun/wrun-refusal.util.js +22 -0
  223. package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
  224. package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
  225. package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
  226. package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
  227. package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
  228. package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
  229. package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
  230. package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
  231. package/dist/utility/wrun/wrun-run-interval.util.d.ts +43 -9
  232. package/dist/utility/wrun/wrun-run-interval.util.js +58 -15
  233. package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
  234. package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
  235. package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
  236. package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
  237. package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
  238. package/dist/utility/wrun/wrun-socket-row-source.js +118 -8
  239. package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -18
  240. package/dist/utility/wrun/wrun-source-rows.util.js +61 -27
  241. package/dist/utility/wrun/wrun-style-words.util.js +6 -4
  242. package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
  243. package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
  244. package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
  245. package/dist/utility/wrun/wrun-tape-per-order.util.js +7 -0
  246. package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
  247. package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
  248. package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
  249. package/dist/utils/replay/replay-buffer-math.js +227 -20
  250. package/dist/workers/constants/socket-slots.d.ts +91 -6
  251. package/dist/workers/constants/socket-slots.js +85 -6
  252. package/package.json +5 -5
@@ -0,0 +1,119 @@
1
+ /**
2
+ * FE-FOLD-CAP (OPTLOAD wave 3, an amendment to the download budget's unit R2; UW-PARITY/reports/OPTLOAD-W3/
3
+ * strike-family-design.md "Unit FE-FOLD-CAP"): what an `option_strike_flow` read is forecast to download where the
4
+ * worker folds it from the chain's contract rows in the browser, which no declaration says (the kit charges the grouped
5
+ * read it declares: Premium by Expiry on ES1! 1h, 2.30 MB declared, 12.90 MB measured). The run's download plan prices
6
+ * the read at the fold before any fetch (wrun-download-plan.util, the lane's `download.forecastBytes`), so a fold puts
7
+ * the run in budgeted mode and its asks name the rows their share buys (`foldBudgetRows`).
8
+ *
9
+ * Loaded by the lane on a run with the download budget's flag on, never at boot (the strike flow util rides the boot
10
+ * path through its K control; this module does not).
11
+ */
12
+ import { KSCRIPT_SOURCE_CELL_BYTES } from '../chart/kscript-source-answer-budget.leaf.js';
13
+ import { optionTodayStartMsByClock, optionTradeDayByClock } from '../options/option-trade-date.util.js';
14
+ import { wrunLaneChainPlaneOf, } from './sources/wrun-row-lane.types.js';
15
+ import { WRUN_OPTION_CONTRACT_FLOW_EXCHANGE_FIELD, WRUN_OPTION_CONTRACT_FLOW_RAW_WIDTH, } from './wrun-option-contract-flow.util.js';
16
+ import { WRUN_OPTION_STRIKE_FLOW_SCOPE, WRUN_OPTION_STRIKE_FLOW_TIERS, wrunOptionFlowClockOf, wrunOptionFlowGroupedRead, wrunOptionStrikeFlowAcquisitionOf, wrunOptionStrikeFlowFoldPlan, wrunOptionStrikeFlowKnobsOf, wrunOptionStrikeFlowSessionTierOf, } from './wrun-option-strike-flow.util.js';
17
+ import { wrunHostBarSpanOf } from './wrun-tier-grid.util.js';
18
+ const MINUTE_MS = 60_000;
19
+ /** The OPRA plane's delayed route, as the forecast reads it: the gate serves a read up to its now minus this
20
+ * (governed-route.util `servedDelaySecondsForAccess`, 15 minutes on OPRA), so a grouped read is cut at its grid's last
21
+ * boundary behind it and the rest is folded (k-option-strike-flow.worker.ts, the delayed tail). */
22
+ export const WRUN_OPTION_FLOW_DELAYED_FORECAST_MS = 15 * MINUTE_MS;
23
+ /**
24
+ * The contract rows the worker is forecast to fold in the browser for one strike flow read over a window's host bars,
25
+ * before any fetch, by the worker's own choice (k-option-strike-flow.worker `streamHistoricalData`): every bar on a
26
+ * crypto chain (the grouped scopes sum every book of a coin), every bar of a grouping the gateway cannot draw on the
27
+ * chain's venue (`wrunOptionFlowGroupedRead` `host`, the worker's call: a Globex lattice bar off the UTC floor, a
28
+ * session span on a clock with no gateway session, a week), and on a delayed route (`servedTier` "delayed") the groups that end past the delayed bound (a session span's
29
+ * whole newest session, a bar grouping's bars ending past it). Projected by the fold plan's own rule (`projectedRows`,
30
+ * under the source answer budget one fold read keeps today). 0 when the data plane groups the whole window. Under
31
+ * `history` "today" only today's bars count (the acquisition's `todayFromMs`, else the newest bar's trade date on the
32
+ * chain's clock).
33
+ */
34
+ export function wrunOptionStrikeFlowFoldForecastRows(args) {
35
+ const { barMs, barGrid, nowMs } = args;
36
+ const acquisition = wrunOptionStrikeFlowAcquisitionOf(args.acquisition);
37
+ if (args.barOpens.length === 0 || !(barMs > 0) || acquisition.exchange === '')
38
+ return 0;
39
+ const clock = wrunOptionFlowClockOf(acquisition);
40
+ const newest = args.barOpens[args.barOpens.length - 1];
41
+ const todayFromMs = acquisition.history !== 'today'
42
+ ? undefined
43
+ : (acquisition.todayFromMs ?? optionTodayStartMsByClock(clock, { openMs: newest, endMs: newest + barMs }));
44
+ const dayOf = (open) => optionTradeDayByClock(clock, open + Math.floor(barMs / 2));
45
+ const spanOf = (open) => wrunHostBarSpanOf(open, barMs, barGrid ?? null);
46
+ const bars = args.barOpens.filter((open) => todayFromMs === undefined || spanOf(open).toMs > todayFromMs);
47
+ if (bars.length === 0)
48
+ return 0;
49
+ // The tier the lane asks a bar at (its coarsest that fits), the window on its grid; then the worker's own choice
50
+ // (k-option-strike-flow.worker): the anchors the chain's venue and the group's scope take, at that tier or the
51
+ // coarsest finer one the anchor takes (a CME regular-hours hour groups on CME_RTH from 5 minutes).
52
+ const tiers = WRUN_OPTION_STRIKE_FLOW_TIERS[acquisition.group];
53
+ const tier = [...tiers].reverse().find((candidate) => barMs % candidate.ms === 0) ?? tiers[0];
54
+ const fromMs = spanOf(bars[0]).fromMs;
55
+ const toMs = spanOf(bars[bars.length - 1]).toMs;
56
+ const session = acquisition.span === 'session';
57
+ const { grouping } = wrunOptionFlowGroupedRead({
58
+ barMs,
59
+ barGrid,
60
+ fromMs: fromMs - (fromMs % tier.ms),
61
+ toMs: toMs % tier.ms === 0 ? toMs : toMs - (toMs % tier.ms) + tier.ms,
62
+ session,
63
+ clock,
64
+ exchange: acquisition.exchange,
65
+ read: WRUN_OPTION_STRIKE_FLOW_SCOPE[acquisition.group].read,
66
+ askTier: tier,
67
+ tiers,
68
+ sessionTier: wrunOptionStrikeFlowSessionTierOf(acquisition.group),
69
+ nowMs,
70
+ });
71
+ let folded;
72
+ if (wrunLaneChainPlaneOf(acquisition.exchange) === 'plain' || grouping.kind === 'host') {
73
+ folded = bars;
74
+ }
75
+ else if (args.acquisition.servedTier !== 'delayed') {
76
+ folded = [];
77
+ }
78
+ else {
79
+ const boundMs = nowMs - WRUN_OPTION_FLOW_DELAYED_FORECAST_MS;
80
+ // A session straddling the bound is folded whole; a bar grouping folds the bars ending past it.
81
+ const newestDay = dayOf(newest);
82
+ folded = session
83
+ ? spanOf(newest).toMs > boundMs
84
+ ? bars.filter((open) => dayOf(open) === newestDay)
85
+ : []
86
+ : bars.filter((open) => spanOf(open).toMs > boundMs);
87
+ }
88
+ if (folded.length === 0)
89
+ return 0;
90
+ return wrunOptionStrikeFlowFoldPlan({
91
+ barOpens: folded,
92
+ newerBarOpens: [],
93
+ barMs,
94
+ barGrid,
95
+ nowMs,
96
+ acquisition: args.acquisition,
97
+ }).projectedRows;
98
+ }
99
+ /**
100
+ * The lane's `download.forecastBytes` (row-lanes/option_strike_flow.ts): a read of one input (its declaration, its
101
+ * setting-bound knobs read) on the chart's chain, priced at the forecast fold's contract rows of 21 values; undefined
102
+ * when the data plane groups the window, so the kit's projection of the declared read holds. A knob its rules refuse
103
+ * throws by name (the run's plan prices nothing for it; the lane's plan refuses the input).
104
+ */
105
+ export function wrunOptionStrikeFlowForecastBytes(source, ctx, chart) {
106
+ const rows = wrunOptionStrikeFlowFoldForecastRows({
107
+ acquisition: {
108
+ ...wrunOptionStrikeFlowKnobsOf(source, ctx),
109
+ coin: chart.coin,
110
+ [WRUN_OPTION_CONTRACT_FLOW_EXCHANGE_FIELD]: chart.chainExchange,
111
+ ...(chart.servedTier !== undefined ? { servedTier: chart.servedTier } : {}),
112
+ },
113
+ barOpens: chart.barOpens,
114
+ barMs: chart.intervalMs,
115
+ barGrid: chart.barGrid ?? undefined,
116
+ nowMs: chart.nowMs,
117
+ });
118
+ return rows > 0 ? rows * WRUN_OPTION_CONTRACT_FLOW_RAW_WIDTH * KSCRIPT_SOURCE_CELL_BYTES : undefined;
119
+ }
@@ -1,6 +1,9 @@
1
1
  import type { WrunBackendTier } from './wrun-tier-grid.util.js';
2
2
  /** The class, its lane key and its K type word (om `WRUN_OPTION_FETCH_TYPES.option_strike_flow`). */
3
3
  export declare const WRUN_OPTION_STRIKE_FLOW_CLASS = "option_strike_flow";
4
+ /** The ask field a budgeted run names a browser fold's contract-row cap in (FE-FOLD-CAP, OPTLOAD W3 under R2's flag;
5
+ * wrun-row-lanes.util `download.fold`, the worker's `wrunOptionStrikeFlowFoldPlan` `budgetRows`). */
6
+ export declare const WRUN_OPTION_STRIKE_FLOW_FOLD_BUDGET_FIELD = "foldBudgetRows";
4
7
  /** f64s per tuple, the `present` mask included (om `WRUN_OPTION_TUPLE_WIDTHS.option_strike_flow`). */
5
8
  export declare const WRUN_OPTION_STRIKE_FLOW_WIDTH = 15;
6
9
  /** The tuple's columns (om `WRUN_OPTION_CELL_COLUMNS.option_strike_flow`). */
@@ -69,19 +72,33 @@ export declare function wrunOptionStrikeFlowHorizon(extras: Readonly<Record<stri
69
72
  servedFromMs: number;
70
73
  completeFromMs: number;
71
74
  } | undefined;
72
- /** The tuples one SPY bar of a group holds (one 30-minute session of 13 bars measured 2026-10-19): STRIKE 357 (471 with
73
- * the 0DTE split), EXPIRY 75, the per-(expiry, strike) rows 2,326; 33 traded expiries. Any bar width, every chain. */
75
+ /** The tuples one SPY bar of a group holds (one 30-minute session of 13 bars measured 2026-10-19, `barMs`): STRIKE 357
76
+ * (471 with the 0DTE split), EXPIRY 75, the per-(expiry, strike) rows 2,326; 33 traded expiries; every chain. */
74
77
  export declare const WRUN_OPTION_STRIKE_FLOW_BAR_TUPLES: Readonly<{
75
78
  strike: 357;
76
79
  strikeSplit: 471;
77
80
  expiry: 75;
78
81
  expiryStrike: 2326;
79
82
  expiries: 33;
83
+ barMs: number;
80
84
  }>;
81
- /** The tuples a bar of one acquisition is projected to hold, from its knobs over SPY's measured bars. */
82
- export declare function wrunOptionStrikeFlowTuplesPerBar(acquisition: Readonly<Record<string, unknown>>): number;
83
- /** The rows one host bar is projected to read (the lane's row budget): its projected tuples, none for a bar before
84
- * today's first instant as the acquisition names it under `history` "today" (it reads nothing;
85
+ /** The share of a measured bar's tuples a bar `barMs` wide holds, 1 from 30 minutes up: a bar's distinct contracts grow
86
+ * slower than its width, as the contract rows one SPY bucket holds at the 1m, 5m and 1h tiers say
87
+ * (`WRUN_OPTION_CONTRACT_FLOW_SESSION_ROWS`: 647, 1,395 and 4,148), read on the log-log line between neighbouring
88
+ * tiers: a 5-minute bar 0.46, a 1-minute bar 0.21, where a straight sixth and thirtieth under-projected them. */
89
+ export declare function wrunOptionStrikeFlowBarShare(barMs: number): number;
90
+ /** The tuples a bar `barMs` wide of one acquisition is projected to hold, from its knobs over SPY's measured bars at
91
+ * its share of them (`wrunOptionStrikeFlowBarShare`). One width for all kept a 5-minute Strike Footprint to its newest
92
+ * 30 bars. The row budget's proxy, which the host raises to what the lane's reads measured. */
93
+ export declare function wrunOptionStrikeFlowTuplesPerBar(acquisition: Readonly<Record<string, unknown>>, barMs?: number): number;
94
+ /** The facets' `maxCells`: the package's most `max_cells` of the class (tuples, `WrunRowLanePlanFacts.laneMaxCells`)
95
+ * where it is under the knobs' projection. A bar past it refuses the run, so no bar is projected past it. */
96
+ export declare function wrunOptionStrikeFlowMaxCellsField(acquisition: Readonly<Record<string, unknown>>, laneMaxCells: unknown): {
97
+ maxCells?: number;
98
+ };
99
+ /** The rows one host bar is projected to read (the lane's row budget; wrun-row-lanes.util `wrunRowLaneProjectedBarRows`
100
+ * raises it to what its reads measured): its projected tuples at its width, at most the acquisition's `maxCells`, none
101
+ * for a bar before today's first instant as the acquisition names it under `history` "today" (it reads nothing;
85
102
  * wrun-option-contract-flow.util `wrunOptionFlowBarBeforeToday`, never dated off `nowMs`). */
86
103
  export declare function wrunOptionStrikeFlowBarRows(bar: {
87
104
  openMs: number;
@@ -7,12 +7,15 @@
7
7
  * (tests/utility/wrun/sources/option_strike_flow.boot-path.spec.ts). The class: docs/features/kscript/wrun/
8
8
  * wrun-browser-runtime.md.
9
9
  */
10
- import { wrunOptionFlowBarBeforeToday } from './wrun-option-contract-flow.util.js';
10
+ import { WRUN_OPTION_CONTRACT_FLOW_SESSION_ROWS, wrunOptionFlowBarBeforeToday } from './wrun-option-contract-flow.util.js';
11
11
  import { wrunPresentIsPartial, wrunPresentWithPartial } from './wrun-present-bits.util.js';
12
12
  const MINUTE_MS = 60_000;
13
13
  const DAY_MS = 86_400_000;
14
14
  /** The class, its lane key and its K type word (om `WRUN_OPTION_FETCH_TYPES.option_strike_flow`). */
15
15
  export const WRUN_OPTION_STRIKE_FLOW_CLASS = 'option_strike_flow';
16
+ /** The ask field a budgeted run names a browser fold's contract-row cap in (FE-FOLD-CAP, OPTLOAD W3 under R2's flag;
17
+ * wrun-row-lanes.util `download.fold`, the worker's `wrunOptionStrikeFlowFoldPlan` `budgetRows`). */
18
+ export const WRUN_OPTION_STRIKE_FLOW_FOLD_BUDGET_FIELD = 'foldBudgetRows';
16
19
  /** f64s per tuple, the `present` mask included (om `WRUN_OPTION_TUPLE_WIDTHS.option_strike_flow`). */
17
20
  export const WRUN_OPTION_STRIKE_FLOW_WIDTH = 15;
18
21
  /** The tuple's columns (om `WRUN_OPTION_CELL_COLUMNS.option_strike_flow`). */
@@ -110,19 +113,40 @@ export function wrunOptionStrikeFlowHorizon(extras, nowMs) {
110
113
  return undefined;
111
114
  return { servedFromMs: nowMs - reach, completeFromMs: nowMs - reach };
112
115
  }
113
- /** The tuples one SPY bar of a group holds (one 30-minute session of 13 bars measured 2026-10-19): STRIKE 357 (471 with
114
- * the 0DTE split), EXPIRY 75, the per-(expiry, strike) rows 2,326; 33 traded expiries. Any bar width, every chain. */
116
+ /** The tuples one SPY bar of a group holds (one 30-minute session of 13 bars measured 2026-10-19, `barMs`): STRIKE 357
117
+ * (471 with the 0DTE split), EXPIRY 75, the per-(expiry, strike) rows 2,326; 33 traded expiries; every chain. */
115
118
  export const WRUN_OPTION_STRIKE_FLOW_BAR_TUPLES = Object.freeze({
116
119
  strike: 357,
117
120
  strikeSplit: 471,
118
121
  expiry: 75,
119
122
  expiryStrike: 2_326,
120
123
  expiries: 33,
124
+ barMs: 30 * MINUTE_MS,
121
125
  });
122
- /** The tuples a bar of one acquisition is projected to hold, from its knobs over SPY's measured bars. */
123
- export function wrunOptionStrikeFlowTuplesPerBar(acquisition) {
126
+ /** The share of a measured bar's tuples a bar `barMs` wide holds, 1 from 30 minutes up: a bar's distinct contracts grow
127
+ * slower than its width, as the contract rows one SPY bucket holds at the 1m, 5m and 1h tiers say
128
+ * (`WRUN_OPTION_CONTRACT_FLOW_SESSION_ROWS`: 647, 1,395 and 4,148), read on the log-log line between neighbouring
129
+ * tiers: a 5-minute bar 0.46, a 1-minute bar 0.21, where a straight sixth and thirtieth under-projected them. */
130
+ export function wrunOptionStrikeFlowBarShare(barMs) {
131
+ const measured = WRUN_OPTION_STRIKE_FLOW_BAR_TUPLES.barMs / MINUTE_MS;
132
+ const minutes = barMs / MINUTE_MS;
133
+ if (!(minutes > 0 && minutes < measured))
134
+ return 1;
135
+ const R = WRUN_OPTION_CONTRACT_FLOW_SESSION_ROWS;
136
+ // A bucket's rows, in proportion: its tier's rows a session times its minutes.
137
+ const rowsAt = (m) => {
138
+ const [m0, r0, m1, r1] = m < 5 ? [1, R['1m'], 5, 5 * R['5m']] : [5, 5 * R['5m'], 60, 60 * R['1h']];
139
+ return r0 * (m / m0) ** (Math.log(r1 / r0) / Math.log(m1 / m0));
140
+ };
141
+ return rowsAt(Math.max(1, minutes)) / rowsAt(measured);
142
+ }
143
+ /** The tuples a bar `barMs` wide of one acquisition is projected to hold, from its knobs over SPY's measured bars at
144
+ * its share of them (`wrunOptionStrikeFlowBarShare`). One width for all kept a 5-minute Strike Footprint to its newest
145
+ * 30 bars. The row budget's proxy, which the host raises to what the lane's reads measured. */
146
+ export function wrunOptionStrikeFlowTuplesPerBar(acquisition, barMs = WRUN_OPTION_STRIKE_FLOW_BAR_TUPLES.barMs) {
124
147
  const knobs = wrunOptionStrikeFlowPayloadKnobsOf(acquisition);
125
148
  const T = WRUN_OPTION_STRIKE_FLOW_BAR_TUPLES;
149
+ const share = wrunOptionStrikeFlowBarShare(barMs);
126
150
  const sides = knobs.foldTypes ? 1 : 2;
127
151
  const parts = knobs.splitDte ? 2 : 1;
128
152
  const nearest = wrunOptionStrikeFlowExpiriesOf(knobs.expiries);
@@ -130,26 +154,38 @@ export function wrunOptionStrikeFlowTuplesPerBar(acquisition) {
130
154
  const windowShare = knobs.strikeWindowPct !== undefined ? Math.min(1, knobs.strikeWindowPct / 25) : 1;
131
155
  switch (knobs.group) {
132
156
  case 'expiry':
133
- return Math.ceil(T.expiry * expiryShare);
157
+ return Math.ceil(T.expiry * expiryShare * share);
134
158
  case 'expiry_strike': {
135
- const cells = T.expiryStrike * expiryShare * windowShare;
159
+ const cells = T.expiryStrike * expiryShare * windowShare * share;
136
160
  const rows = knobs.strikeRows !== undefined ? knobs.strikeRows * 2 * Math.ceil(T.expiries * expiryShare) : Infinity;
137
161
  return Math.ceil(Math.min(cells, rows));
138
162
  }
139
163
  default: {
140
164
  const all = ((knobs.splitDte ? T.strikeSplit : T.strike) * sides) / 2;
141
165
  const rows = knobs.strikeRows !== undefined ? knobs.strikeRows * sides * parts : Infinity;
142
- return Math.ceil(Math.min(all * windowShare, rows));
166
+ return Math.ceil(Math.min(all * windowShare * share, rows));
143
167
  }
144
168
  }
145
169
  }
146
- /** The rows one host bar is projected to read (the lane's row budget): its projected tuples, none for a bar before
147
- * today's first instant as the acquisition names it under `history` "today" (it reads nothing;
170
+ /** The facets' `maxCells`: the package's most `max_cells` of the class (tuples, `WrunRowLanePlanFacts.laneMaxCells`)
171
+ * where it is under the knobs' projection. A bar past it refuses the run, so no bar is projected past it. */
172
+ export function wrunOptionStrikeFlowMaxCellsField(acquisition, laneMaxCells) {
173
+ return typeof laneMaxCells === 'number' &&
174
+ laneMaxCells >= 1 &&
175
+ laneMaxCells < wrunOptionStrikeFlowTuplesPerBar(acquisition)
176
+ ? { maxCells: laneMaxCells }
177
+ : {};
178
+ }
179
+ /** The rows one host bar is projected to read (the lane's row budget; wrun-row-lanes.util `wrunRowLaneProjectedBarRows`
180
+ * raises it to what its reads measured): its projected tuples at its width, at most the acquisition's `maxCells`, none
181
+ * for a bar before today's first instant as the acquisition names it under `history` "today" (it reads nothing;
148
182
  * wrun-option-contract-flow.util `wrunOptionFlowBarBeforeToday`, never dated off `nowMs`). */
149
183
  export function wrunOptionStrikeFlowBarRows(bar, _nowMs, acquisition) {
150
184
  if (wrunOptionFlowBarBeforeToday(bar, acquisition))
151
185
  return 0;
152
- return wrunOptionStrikeFlowTuplesPerBar(acquisition);
186
+ const tuples = wrunOptionStrikeFlowTuplesPerBar(acquisition, bar.endMs - bar.openMs);
187
+ const most = acquisition.maxCells;
188
+ return typeof most === 'number' && most >= 1 ? Math.min(tuples, most) : tuples;
153
189
  }
154
190
  /** Every finite tuple a host bar row's cells hold, in order: a packed block's tuples back to back, a plain tuple as it
155
191
  * is. A cell of another shape, and a tuple holding a value that is not finite, is skipped. */
@@ -1,4 +1,5 @@
1
1
  import { type LiveBucketVenue } from '../chart/live-bucket.util.js';
2
+ import { type OptionBarAnchorRead } from '../options/option-bar-anchor.util.js';
2
3
  import { type OptionTradeDateChain, type OptionTradeDateClockRule } from '../options/option-trade-date.util.js';
3
4
  import { type WrunOptionContractFlowRow } from './wrun-option-contract-flow.util.js';
4
5
  import { type WrunOptionStrikeFlowGroup, type WrunOptionStrikeFlowKnobs } from './wrun-option-strike-flow-lane.util.js';
@@ -14,16 +15,21 @@ export declare const WRUN_OPTION_STRIKE_FLOW_DTE_CLASS: Readonly<{
14
15
  }>;
15
16
  /** `strike_rows`: 1 to 200 (om `WRUN_OPTION_STRIKE_ROWS_MAX`). */
16
17
  export declare const WRUN_OPTION_STRIKE_ROWS_MAX = 200;
17
- /** The scope word of each group (pb-common `OptionPrintAggScope` STRIKE 5, EXPIRY 6, EXPIRY_STRIKE 7). */
18
+ /** The scope word of each group (pb-common `OptionPrintAggScope` STRIKE 5, EXPIRY 6, EXPIRY_STRIKE 7) and the read its
19
+ * grouped ask is, as the gateway registers the anchors it takes (option-bar-anchor.util). */
18
20
  export declare const WRUN_OPTION_STRIKE_FLOW_SCOPE: Readonly<Record<WrunOptionStrikeFlowGroup, {
19
21
  word: string;
20
22
  id: number;
23
+ read: OptionBarAnchorRead;
21
24
  }>>;
22
- /** pb-common enums the request names by number (the gateway decodes JSON with encoding/json): `BarAnchor`, `BarSpan`,
23
- * `OptionExpiryClass`, `OptionDteBucket`, `OptionType`. */
25
+ /** pb-common enums the request names by number (the gateway decodes JSON with encoding/json): `BarAnchor` (the anchor
26
+ * mirror's values, option-bar-anchor.util), `BarSpan`, `OptionExpiryClass`, `OptionDteBucket`, `OptionType`. */
24
27
  export declare const WRUN_OPTION_READ_ENUM: Readonly<{
25
- readonly anchorUtc: 0;
26
- readonly anchorUsEquityRth: 1;
28
+ readonly anchorUtc: import("@orangecharts/orange-v2-pb-common").BarAnchor.UTC;
29
+ readonly anchorUsEquityRth: import("@orangecharts/orange-v2-pb-common").BarAnchor.US_EQUITY_RTH;
30
+ readonly anchorCmeSession: import("@orangecharts/orange-v2-pb-common").BarAnchor.CME_SESSION;
31
+ readonly anchorCmeRth: import("@orangecharts/orange-v2-pb-common").BarAnchor.CME_RTH;
32
+ readonly anchorCmeEnergyRth: import("@orangecharts/orange-v2-pb-common").BarAnchor.CME_ENERGY_RTH;
27
33
  readonly spanSession: 1;
28
34
  readonly expiryZeroDte: 1;
29
35
  readonly expiryAfterToday: 2;
@@ -72,6 +78,9 @@ export interface WrunOptionStrikeFlowAcquisition extends WrunOptionStrikeFlowKno
72
78
  /** Today's first instant as the request names it under `history` "today" (wrun-option-contract-flow.util
73
79
  * `WRUN_OPTION_FLOW_TODAY_FIELD`: the K control's, off the chart's newest bar). */
74
80
  todayFromMs?: number;
81
+ /** FE-FOLD-CAP (OPTLOAD W3, under R2's flag): the most contract rows the ask's browser fold reads, its share of the
82
+ * indicator's download budget (`WRUN_OPTION_STRIKE_FLOW_FOLD_BUDGET_FIELD`); absent, the source answer budget's. */
83
+ foldBudgetRows?: number;
75
84
  }
76
85
  /** The bars an ask names (both flow classes' K controls send them, option-flow-bars.util): the run's bar span and the
77
86
  * chart's bar grid, each absent when the ask carries none. */
@@ -90,14 +99,18 @@ export declare function wrunOptionFlowClockOf(acquisition: {
90
99
  coin: string;
91
100
  }): OptionTradeDateClockRule;
92
101
  /**
93
- * How a read's rows group, on the gateway's bar rule (contract 3.2 and 3.4) or the chart's own landing:
102
+ * How a read's rows group, on the gateway's bar rule (contract 3.2 and 3.4: the anchor mirror, option-bar-anchor.util)
103
+ * or the chart's own landing:
94
104
  * - `bars`: `barSeconds` on an anchor (UTC: `ts - ts % B`; US_EQUITY_RTH: the 09:30 New York lattice, buckets outside
95
- * the cash session dropped), exactly the chart's bars;
105
+ * the cash session dropped; CME_RTH and CME_ENERGY_RTH: a CME regular session's lattice, 09:30 to 16:15 or 09:00 to
106
+ * 14:30 New York, buckets outside it dropped), exactly the chart's bars;
96
107
  * - `session`: one group per trade date: on a New York clock the regular session's (RTH buckets only, stamped at its
97
- * 09:30 open), on a UTC clock the UTC date's (stamped 00:00Z);
108
+ * 09:30 open), on a UTC clock the UTC date's (stamped 00:00Z), on the Globex clock of a CME group venue the trade
109
+ * date's (CME_SESSION: every bucket of it, stamped at its 17:00 Chicago open, a weekday holiday's session booked to
110
+ * the next trade date);
98
111
  * - `host`: the chart's own bars (`wrunHostBarOf`) or, with a session span on a clock the gateway draws no session
99
- * for (a CME Globex trade date), the clock's trade dates stamped at each date's first instant: groups the gateway
100
- * cannot draw, so they are folded in the browser.
112
+ * for (a CME crypto root's 16:00 roll, or a read naming no venue), the clock's trade dates stamped at each date's
113
+ * first instant: groups the gateway cannot draw, so they are folded in the browser.
101
114
  */
102
115
  export type WrunOptionFlowGrouping = {
103
116
  kind: 'bars';
@@ -111,13 +124,18 @@ export type WrunOptionFlowGrouping = {
111
124
  session: boolean;
112
125
  };
113
126
  /**
114
- * The grouping of one ask's window `[fromMs, toMs)` at a tier: a session span groups by trade date (the gateway's
115
- * session where the clock has one), else a chart bar of a day reads its trade date's session where that session lands
116
- * on it (a daily bar holding one New York regular session, the cash session's buckets alone, or one UTC date), else the
117
- * chart's bars when the gateway's bars are exactly them (every tier bucket of the window lands on the host bar the
118
- * gateway's bar opens on: the UTC floor, or the 09:30 New York lattice of a regular-session stock chart's 45m to 12h
119
- * bars, the tier dividing 30 minutes, a bucket outside the cash session reaching no bar on either side), else the
120
- * chart's own bars, folded in the browser.
127
+ * The grouping of one ask's window `[fromMs, toMs)` at a tier, from the anchors `read` takes on the read's venue
128
+ * (`exchange`, the chain's; a decider naming none is offered no CME anchor, as the gateway lays those over the CME
129
+ * group's rows alone): a session span groups by trade date (the anchor whose sessions are the clock's trade dates, from
130
+ * a tier its sessions fit), else a chart bar of a day reads its trade date's session where that session lands on it (a
131
+ * daily bar holding one New York regular session, the cash session's buckets alone, one UTC date, or one Globex trade
132
+ * date), else the chart's bars when the gateway's bars are exactly them (every tier bucket of the window lands on the
133
+ * host bar the gateway's bar opens on: the UTC floor; the 09:30 New York lattice of a regular-session stock chart's 45m
134
+ * to 12h bars, the tier dividing 30 minutes, a bucket outside the cash session reaching no bar on either side; a CME
135
+ * regular session's lattice on a regular-hours CME chart, the tier dividing that anchor's (15 minutes on CME_RTH, 30 on
136
+ * CME_ENERGY_RTH), the window on its boundaries, a bucket the anchor drops reaching no bar or falling where the chart's
137
+ * product holds no trading, option-bar-anchor.util `optionChartClosedAt`: a weekday product's weekend, never an
138
+ * always-on root's), else the chart's own bars, folded in the browser.
121
139
  */
122
140
  export declare function wrunOptionFlowGrouping(args: {
123
141
  barMs: number | undefined;
@@ -127,7 +145,49 @@ export declare function wrunOptionFlowGrouping(args: {
127
145
  toMs: number;
128
146
  session: boolean;
129
147
  clock: OptionTradeDateClockRule;
148
+ /** The read's venue, the chain's exchange: every app caller names it (tests/utility/options/
149
+ * option-bar-anchor.class.spec.ts), so a CME chart's anchors reach every grouped read. */
150
+ exchange?: string;
151
+ /** The read the grouping is for (the strike scopes' when absent). */
152
+ read?: OptionBarAnchorRead;
130
153
  }): WrunOptionFlowGrouping;
154
+ /**
155
+ * The grouping of one ask and the tier its grouped read rides (OPTLOAD W3 FE-ANCHOR): the ask's own tier wherever the
156
+ * gateway groups the window there (a session at the group's 30-minute view where that holds the window,
157
+ * `wrunOptionFlowGroupedTier`), else the coarsest of the read's tiers (`tiers`) finer than the ask's, dividing it and
158
+ * still holding the window's start, at which the chart's bars ARE an anchor's bars. A regular-hours CME chart's hours
159
+ * ride the 30-minute tier (their 13:30Z opens sit on it), which CME_RTH's 16:15 close does not divide (the gateway takes
160
+ * CME_RTH from tiers dividing 15 minutes alone), so they group from 5 minutes. Else `host`, at the ask's tier.
161
+ */
162
+ export declare function wrunOptionFlowGroupedRead(args: {
163
+ barMs: number | undefined;
164
+ barGrid: LiveBucketVenue | undefined;
165
+ fromMs: number;
166
+ toMs: number;
167
+ session: boolean;
168
+ clock: OptionTradeDateClockRule;
169
+ exchange?: string;
170
+ read?: OptionBarAnchorRead;
171
+ /** The tier the lane asked. */
172
+ askTier: WrunBackendTier;
173
+ /** The read's tiers (the group's, `WRUN_OPTION_STRIKE_FLOW_TIERS`). */
174
+ tiers: readonly WrunBackendTier[];
175
+ /** The group's 30-minute view a session reads. */
176
+ sessionTier: WrunBackendTier;
177
+ nowMs: number;
178
+ }): {
179
+ grouping: WrunOptionFlowGrouping;
180
+ tier: WrunBackendTier;
181
+ };
182
+ /**
183
+ * The window a grouped read of `[fromMs, toMs)` sends: on a session grouping the window widened to its anchor's session
184
+ * boundaries (the gateway refuses any other window; a CME trade date a weekday holiday's session is booked into opens
185
+ * at that session's open), else the window itself (a bar grouping was proved on it, its edges on the bars).
186
+ */
187
+ export declare function wrunOptionFlowGroupingWindow(grouping: WrunOptionFlowGrouping, fromMs: number, toMs: number): {
188
+ fromMs: number;
189
+ toMs: number;
190
+ };
131
191
  /**
132
192
  * The widest UTC groups a read of `[fromMs, toMs)` at a tier may be summed or picked to so that its answer lands on the
133
193
  * chart exactly as the tier's buckets do, where the chart's bars themselves are no grouping the gateway draws (an RTH
@@ -151,8 +211,9 @@ export declare function wrunOptionNestedUtcBars(args: {
151
211
  barSeconds: number;
152
212
  barAnchor: number;
153
213
  } | undefined;
154
- /** The trade-date group a bucket stamped `ts` sums into under the gateway's session (contract 3.4): on RTH the New York
155
- * date's 09:30 open for a bucket inside the cash session (null outside it), on UTC the UTC date's 00:00Z. */
214
+ /** The trade-date group a bucket stamped `ts` sums into under the gateway's session on an anchor (contract 3.4, the
215
+ * anchor mirror): on RTH the New York date's 09:30 open for a bucket inside the cash session (null outside it), on UTC
216
+ * the UTC date's 00:00Z, on CME_SESSION the 17:00 Chicago open of the trade date's first session day. */
156
217
  export declare function wrunOptionFlowSessionStampMs(ts: number, barAnchor: number): number | null;
157
218
  /**
158
219
  * The stamp of the group a bucket stamped `ts` sums into, on the browser's side of a grouping (the fold's): the
@@ -341,6 +402,10 @@ export type WrunOptionStrikeFlowFoldRead = WrunTierSegment;
341
402
  * bars. A newest bar that cannot fit alone is skipped (a forming day read from minutes); from the first bar that fits,
342
403
  * a bar that would pass the budget stops the walk. The kept bars are read per run of one tier (`reads`); every asked
343
404
  * bar outside them is partial. `newerBarOpens` are the host bars after the ask, up to the clock.
405
+ *
406
+ * FE-FOLD-CAP (OPTLOAD W3, under R2's flag): `budgetRows` (the ask's `foldBudgetRows`, its share of the indicator's
407
+ * download budget in contract rows) caps the walk below the source answer budget; absent, the answer budget's 49,932
408
+ * rows a read, today's plan. `projectedRows` is what the kept bars are projected to read.
344
409
  */
345
410
  export declare function wrunOptionStrikeFlowFoldPlan(args: {
346
411
  barOpens: readonly number[];
@@ -349,11 +414,13 @@ export declare function wrunOptionStrikeFlowFoldPlan(args: {
349
414
  barGrid: LiveBucketVenue | undefined;
350
415
  nowMs: number;
351
416
  acquisition: Readonly<Record<string, unknown>>;
417
+ budgetRows?: number;
352
418
  }): {
353
419
  reads: WrunOptionStrikeFlowFoldRead[];
354
420
  partialBars: number[];
355
421
  keptFromMs: number;
356
422
  keptToMs: number;
423
+ projectedRows: number;
357
424
  };
358
425
  /** The host bars `[fromMs, toMs)` holds on the chart's grid, ascending (`liveBucketStartsInRange` over the grid). */
359
426
  export declare function wrunOptionFlowHostBars(fromMs: number, toMs: number, barMs: number, barGrid: LiveBucketVenue | undefined): number[];