@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.
- package/README.md +2 -0
- package/dist/constants/feature-flags.constants.d.ts +15 -1
- package/dist/constants/feature-flags.constants.js +130 -24
- package/dist/constants/governed-exchanges.constants.d.ts +12 -0
- package/dist/constants/governed-exchanges.constants.js +16 -0
- package/dist/constants/opra-compliance.constants.d.ts +3 -2
- package/dist/constants/opra-compliance.constants.js +3 -2
- package/dist/constants/option-venues.constants.d.ts +2 -2
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
- package/dist/constants/venue-presets.constants.d.ts +20 -20
- package/dist/constants/venue-presets.constants.js +24 -26
- package/dist/host-env.d.ts +21 -5
- package/dist/host-env.js +6 -0
- package/dist/host-ports.types.d.ts +102 -19
- package/dist/index.d.ts +18 -0
- package/dist/index.js +18 -0
- package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
- package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
- package/dist/interfaces/cme-realtime.interface.js +6 -3
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +12 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
- package/dist/interfaces/prediction-market.interface.d.ts +7 -0
- package/dist/interfaces/replay.interface.d.ts +8 -0
- package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
- package/dist/interfaces/stocks-realtime.interface.js +32 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +18 -2
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +62 -94
- package/dist/kscript-data/controls/live-trades-merge.util.js +106 -171
- package/dist/market-data/billing.interface.d.ts +174 -36
- package/dist/market-data/billing.interface.js +58 -8
- package/dist/market-data/venue.d.ts +152 -7
- package/dist/market-data/venues/cme.contract.copy.json +66 -0
- package/dist/market-data/venues/cme.d.ts +126 -0
- package/dist/market-data/venues/cme.js +133 -0
- package/dist/market-data/venues/index.d.ts +294 -7
- package/dist/market-data/venues/index.js +49 -6
- package/dist/market-data/venues/opra.contract.copy.json +3 -2
- package/dist/market-data/venues/opra.d.ts +2 -2
- package/dist/market-data/venues/opra.js +5 -2
- package/dist/market-data/venues/stocks.contract.copy.json +64 -0
- package/dist/market-data/venues/stocks.d.ts +130 -0
- package/dist/market-data/venues/stocks.js +117 -0
- package/dist/settings-templates/footprint-rows.js +35 -2
- package/dist/settings-templates/form-rows.d.ts +2 -1
- package/dist/settings-templates/index.js +7 -3
- package/dist/settings-templates/indicator-fields.d.ts +5 -4
- package/dist/settings-templates/indicator-fields.js +79 -10
- package/dist/settings-templates/tool-rules.d.ts +32 -15
- package/dist/settings-templates/tool-rules.js +33 -11
- package/dist/settings-templates/tool-tables.generated.js +95 -31
- package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
- package/dist/utility/chart/book-live-bucket.util.js +47 -0
- package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
- package/dist/utility/chart/cme-cache-context.util.js +10 -6
- package/dist/utility/chart/cme-realtime.util.js +10 -0
- package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
- package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
- package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
- package/dist/utility/chart/effective-chart-session.util.js +39 -0
- package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
- package/dist/utility/chart/host-bar-placement.util.js +170 -30
- package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
- package/dist/utility/chart/index-host-tier.util.js +7 -2
- package/dist/utility/chart/index-mode-admission.util.js +30 -3
- package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +9 -7
- package/dist/utility/chart/kscript-live-coalesce.util.js +13 -8
- package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
- package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
- package/dist/utility/chart/kscript-provenance-keys.util.js +13 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +5 -1
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +156 -43
- package/dist/utility/chart/kscript-venue-policy.util.js +249 -59
- package/dist/utility/chart/live-bucket.util.d.ts +24 -8
- package/dist/utility/chart/live-bucket.util.js +85 -27
- package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
- package/dist/utility/chart/market-session-schedule.util.js +16 -0
- package/dist/utility/chart/marketKind.util.js +5 -0
- package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
- package/dist/utility/chart/mixed-mode.util.js +14 -0
- package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
- package/dist/utility/chart/opra-read-access.leaf.js +5 -3
- package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
- package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
- package/dist/utility/chart/rth-session.util.d.ts +12 -10
- package/dist/utility/chart/rth-session.util.js +25 -21
- package/dist/utility/chart/trading-day.util.d.ts +17 -0
- package/dist/utility/chart/trading-day.util.js +59 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
- package/dist/utility/chart/window-geometry.leaf.js +22 -6
- package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
- package/dist/utility/chart/window-owner.leaf.js +45 -3
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
- package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
- package/dist/utility/chart/wrun-run-result.util.d.ts +12 -0
- package/dist/utility/chart/wrun-run-result.util.js +141 -6
- package/dist/utility/intl-locale.util.js +5 -0
- package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
- package/dist/utility/options/option-bar-anchor.util.js +340 -0
- package/dist/utility/options/option-venue.util.d.ts +18 -0
- package/dist/utility/options/option-venue.util.js +27 -0
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +4 -0
- package/dist/utility/v2/gate-plane.util.d.ts +12 -3
- package/dist/utility/v2/gate-plane.util.js +30 -4
- package/dist/utility/v2/gate-session-latch.util.js +1 -1
- package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
- package/dist/utility/v2/stocks-governed.util.js +34 -0
- package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
- package/dist/utility/wrun/derived-roots.leaf.js +27 -0
- package/dist/utility/wrun/derived-roots.util.d.ts +205 -0
- package/dist/utility/wrun/derived-roots.util.js +451 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +43 -7
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -2
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -2
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
- package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
- package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +3 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +19 -4
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +52 -13
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +88 -19
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +2 -1
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +24 -9
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +41 -10
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +111 -0
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +133 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +15 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +22 -3
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +197 -13
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +761 -27
- package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
- package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
- package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +60 -16
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +113 -61
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +14 -2
- package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
- package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
- package/dist/utility/wrun/wrun-frames.d.ts +27 -6
- package/dist/utility/wrun/wrun-frames.js +73 -10
- package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-handles.util.js +9 -8
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +18 -4
- package/dist/utility/wrun/wrun-hud-looks.util.js +45 -13
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
- package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
- package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
- package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +35 -15
- package/dist/utility/wrun/wrun-live-intake.util.js +243 -126
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +13 -5
- package/dist/utility/wrun/wrun-live-tick.util.js +279 -99
- package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
- package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +60 -11
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +70 -5
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +31 -5
- package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
- package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
- package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
- package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +23 -6
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +47 -11
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +86 -19
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +168 -62
- package/dist/utility/wrun/wrun-option-views.util.d.ts +323 -28
- package/dist/utility/wrun/wrun-option-views.util.js +484 -71
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
- package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-output-style.util.js +20 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +32 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +160 -42
- package/dist/utility/wrun/wrun-overlay-run.util.js +1244 -209
- package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +114 -19
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +10 -9
- package/dist/utility/wrun/wrun-panel-style.util.js +58 -9
- package/dist/utility/wrun/wrun-param-map.util.d.ts +14 -11
- package/dist/utility/wrun/wrun-param-map.util.js +10 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +14 -4
- package/dist/utility/wrun/wrun-param-values.util.js +4 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
- package/dist/utility/wrun/wrun-pin-spelling.util.js +39 -14
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
- package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-refusal.util.js +22 -0
- package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
- package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
- package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
- package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
- package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +43 -9
- package/dist/utility/wrun/wrun-run-interval.util.js +58 -15
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +45 -1
- package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
- package/dist/utility/wrun/wrun-socket-row-source.js +118 -8
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -18
- package/dist/utility/wrun/wrun-source-rows.util.js +61 -27
- package/dist/utility/wrun/wrun-style-words.util.js +6 -4
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
- package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-tape-per-order.util.js +7 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
- package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
- package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
- package/dist/utils/replay/replay-buffer-math.js +227 -20
- package/dist/workers/constants/socket-slots.d.ts +91 -6
- package/dist/workers/constants/socket-slots.js +85 -6
- package/package.json +5 -5
|
@@ -34,25 +34,39 @@
|
|
|
34
34
|
* packer judges `max_cells`, never a fetch facet). A market pin, `history` and `min_size` are refused by name; a
|
|
35
35
|
* block over `max_cells` refuses the run (wrun_cell_block_too_large, never truncated). One chain per package.
|
|
36
36
|
* - `fold` "kit" (OPTLOAD G5, kit 0.90.0; wrun-option-views.util): `nearest`, `window_pct` (required), `lens`,
|
|
37
|
-
* `step_rows` (required), `carry` and `levels
|
|
38
|
-
* `expiries` word is "all" or none (kit 0.91.1: the fold keeps its
|
|
39
|
-
* refused at declaration). Each bar reads the fold of its newest
|
|
37
|
+
* `step_rows` (required), `carry`, `levels` and `curve` (kit 0.96.0, beside `levels` only), refused by the SDK's
|
|
38
|
+
* rules by name (`wrun_option_knob_invalid`); its `expiries` word is "all" or none (kit 0.91.1: the fold keeps its
|
|
39
|
+
* expiries with its own `nearest`, any other word refused at declaration). Each bar reads the fold of its newest
|
|
40
40
|
* minute, 14-value rows (`[1, totals..., max_pain, zero_gamma, call_wall, put_wall, spot, refused]` when `levels`,
|
|
41
|
+
* with `curve` the curve row `[2, gex_at_spot, gamma_flip, curve_spot, priced_at_ms, contracts, 0...]` after it,
|
|
41
42
|
* then `[0, strike, value]` at the strikes the template draws), asked of the gateway at the chart's bars
|
|
42
|
-
* (`strikeKitFold` and its params, `strikeMaxCells` the input's `max_cells
|
|
43
|
-
*
|
|
43
|
+
* (`strikeKitFold` and its params, `strikeMaxCells` the input's `max_cells`, with `curve` `strikeKitCurve` and
|
|
44
|
+
* `strikeKitMultiplier`, the chart's `market.option_multiplier()`) and folded by the worker with the kit's own fold
|
|
45
|
+
* while the gateway refuses the read. A bar whose newest minute held more rows than `max_cells` answers its
|
|
44
46
|
* levels row refused, and that refuses the run (wrun_cell_block_too_large), as a block over `max_cells` does today;
|
|
45
47
|
* an input declaring `missing: "empty"` reads that bar empty instead (C1.2b). The run carries the 14-value rows: the
|
|
46
48
|
* lane's plan, the packer and the shared aligner (kit 0.91.1) size the block by the input's width
|
|
47
49
|
* (`WRUN_OPTION_STRIKES_KIT_SERVED`).
|
|
48
50
|
* - O1 (OPTLOAD G5): on the OPRA plane the chain is the plane's own by coin (`wrunHeldOpraPlaneChain`), no chain
|
|
49
51
|
* directory read.
|
|
52
|
+
* - `velocity_windows` (SKYLIT-PARITY contract H; the om schema takes the knob by this name and shape): 1 to 7 distinct
|
|
53
|
+
* windows in minutes from 1, 5, 10, 15, 60, 240 and 1440, a literal list. It rides the ask
|
|
54
|
+
* (`strikeVelocityWindowsMin`, the knob's order) and each tuple appends four lists after `underlying`, each one entry
|
|
55
|
+
* per window in the knob's order: `[...12 values, net_gex_velocity..., net_dex_velocity..., net_vex_velocity...,
|
|
56
|
+
* oi_velocity...]`, width 12 + 4N (`wrunOptionStrikesVelocityWidth`). Without the knob the 12-value tuple is
|
|
57
|
+
* byte-identical. The gateway answers velocity on its fold BAR state read alone, whose rows are per strike (every
|
|
58
|
+
* live expiry of the bar summed), so every tuple of one strike in one bar carries the strike's lists; NaN where the
|
|
59
|
+
* gateway has no lagged minute, where it does not draw the chart's bars, on a crypto chain (the state fold sums every
|
|
60
|
+
* book of the coin) and wherever the read fails. Refused by name beside `fold: "kit"` (the gateway refuses velocity
|
|
61
|
+
* on the kit fold) and, while the kit sizes an input by the class width alone, by this host
|
|
62
|
+
* (`WRUN_OPTION_STRIKES_VELOCITY_SERVED`).
|
|
50
63
|
*
|
|
51
64
|
* LIGHT at module load: the chain resolver's directory, listing and lead reads run inside `identity` and `facets`.
|
|
52
65
|
*/
|
|
53
66
|
import { decideWrunLaneChain, decideWrunLaneChainIdentity, refuseWrunLaneStrayKnob, resolveWrunLaneChainChart, WRUN_OPTION_CHART_UNRESOLVED_CODE, wrunLaneChainLeadMoved, wrunLaneChainRefusalError, wrunLaneChartKey, } from '../opra-option-lanes.util.js';
|
|
54
67
|
import { refuseWrunPollInput } from '../wrun-poll-lane.types.js';
|
|
55
|
-
import { WRUN_OPTION_STRIKES_KIT_LAYOUTS, WRUN_OPTION_STRIKES_KIT_REFUSED_COLUMN, wrunHeldOpraPlaneChain, wrunOptionLaneAskFields, wrunOptionLaneAskOfSource, } from '../../wrun-option-views.util.js';
|
|
68
|
+
import { WRUN_OPTION_STRIKES_KIT_LAYOUTS, WRUN_OPTION_STRIKES_KIT_REFUSED_COLUMN, WRUN_OPTION_STRIKES_VELOCITY_FIELD, WRUN_OPTION_STRIKES_VELOCITY_KNOB, WRUN_OPTION_STRIKES_VELOCITY_TAKES, wrunHeldOpraPlaneChain, wrunOptionLaneAskFields, wrunOptionLaneAskOfSource, wrunOptionStrikesVelocityWindows, } from '../../wrun-option-views.util.js';
|
|
69
|
+
import { refuseWrunOptionKnob } from '../../wrun-option-knobs.util.js';
|
|
56
70
|
import { WRUN_OPTIONS_CHAIN_EXPIRIES_CODE, wrunOptionsChainExpiries, wrunOptionsChainIdentityKey, } from '../../wrun-options-chain.util.js';
|
|
57
71
|
import { attachWrunRefusal, wrunAuthorRuleSeed } from '../../wrun-refusal.util.js';
|
|
58
72
|
/** f64s per tuple (om's `WRUN_OPTION_STRIKES_TUPLE_WIDTH`). */
|
|
@@ -137,20 +151,69 @@ export const WRUN_OPTION_VIEWS_UNSERVED_REFUSAL = 'wrun_option_views_unserved';
|
|
|
137
151
|
export const WRUN_OPTION_STRIKES_KIT_SERVED = true;
|
|
138
152
|
/**
|
|
139
153
|
* Whether this host answers the strike kit fold's curve row (kit 0.96.0: `curve: true` beside `levels: true`, a row of
|
|
140
|
-
* the gamma curve's readings after each bar's levels row).
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
154
|
+
* the gamma curve's readings after each bar's levels row). It does (OPTLOAD W3 U4): the ask names `strikeKitCurve` and
|
|
155
|
+
* `strikeKitMultiplier`, the worker reads the gateway's curve fields into the row (pb-common 12.74.0, fields 24 to 28)
|
|
156
|
+
* and folds it with the kit's own fold while the gateway refuses the read; a grouped answer without the curve fields
|
|
157
|
+
* is refused, never drawn. False refuses a `curve: true` input by name after its knobs pass.
|
|
144
158
|
*/
|
|
145
|
-
export const WRUN_OPTION_STRIKES_KIT_CURVE_SERVED =
|
|
159
|
+
export const WRUN_OPTION_STRIKES_KIT_CURVE_SERVED = true;
|
|
160
|
+
/**
|
|
161
|
+
* Whether this host carries the velocity lists (`velocity_windows`) into a run. Not yet: the shared host plans and
|
|
162
|
+
* aligns each input at the KIT's width rule (kit `planWrunRun`, `alignWrunRows`, `wrunOptionInputTupleWidth`), and the
|
|
163
|
+
* kit sizes an option_strikes input at the class's 12 values until the om schema names the knob, so a velocity block
|
|
164
|
+
* (12 + 4N values a tuple) would split wrong there. So an input declaring the knob is refused by name after its words
|
|
165
|
+
* pass, never read wrong; the kit bump whose rule sizes it (`wrunOptionStrikesVelocityWidth`) sets this true
|
|
166
|
+
* (tests/utility/wrun/sources/option_strikes.velocity.spec.ts holds the two together).
|
|
167
|
+
*/
|
|
168
|
+
export const WRUN_OPTION_STRIKES_VELOCITY_SERVED = false;
|
|
169
|
+
/**
|
|
170
|
+
* An input's velocity windows as the ask carries them (`strikeVelocityWindowsMin`, the knob's order), none without the
|
|
171
|
+
* knob, or a refusal by name: a value outside the knob's words (`wrun_option_knob_invalid`), the knob beside
|
|
172
|
+
* `fold: "kit"` (the gateway answers velocity on the state fold alone), and while this host does not carry the lists
|
|
173
|
+
* into a run (`WRUN_OPTION_STRIKES_VELOCITY_SERVED`).
|
|
174
|
+
*/
|
|
175
|
+
export function wrunOptionStrikesVelocityExtras(source, ctx) {
|
|
176
|
+
const value = source[WRUN_OPTION_STRIKES_VELOCITY_KNOB];
|
|
177
|
+
if (value === undefined)
|
|
178
|
+
return undefined;
|
|
179
|
+
const windows = wrunOptionStrikesVelocityWindows(value);
|
|
180
|
+
if (windows === undefined) {
|
|
181
|
+
return refuseWrunOptionKnob(ctx, WRUN_OPTION_STRIKES_VELOCITY_KNOB, value, WRUN_OPTION_STRIKES_VELOCITY_TAKES);
|
|
182
|
+
}
|
|
183
|
+
if (source.fold === 'kit') {
|
|
184
|
+
return refuseWrunOptionKnob(ctx, WRUN_OPTION_STRIKES_VELOCITY_KNOB, value, 'the strike rows alone, never fold "kit" (drop one of the two)');
|
|
185
|
+
}
|
|
186
|
+
if (!WRUN_OPTION_STRIKES_VELOCITY_SERVED) {
|
|
187
|
+
return refuseWrunPollInput(ctx, `reads option_strikes with ${WRUN_OPTION_STRIKES_VELOCITY_KNOB} (${WRUN_OPTION_VIEWS_UNSERVED_REFUSAL}): this ` +
|
|
188
|
+
"app does not carry the strike velocity columns into a run yet; drop the knob and read the strike rows' " +
|
|
189
|
+
'own columns', wrunAuthorRuleSeed(WRUN_OPTION_VIEWS_UNSERVED_REFUSAL));
|
|
190
|
+
}
|
|
191
|
+
return { [WRUN_OPTION_STRIKES_VELOCITY_FIELD]: windows };
|
|
192
|
+
}
|
|
146
193
|
/**
|
|
147
194
|
* The acquisition fields of an input's strike kit fold (OPTLOAD G5): the fold, its params and the input's `max_cells`,
|
|
148
195
|
* so the gateway (or the worker's fold while the gateway refuses it) answers a refused levels row for a bar whose newest
|
|
149
|
-
* minute held more rows
|
|
150
|
-
*
|
|
196
|
+
* minute held more rows; with `curve`, the curve fields and `optionMultiplier` (the chart's
|
|
197
|
+
* `market.option_multiplier()`, `wrunOptionStrikesChartMultiplier`). The fold reads every expiry of the minute (its
|
|
198
|
+
* `nearest` keeps the soonest): an `expiries` word other than "all" beside it was refused at declaration
|
|
199
|
+
* (`wrunOptionLaneAskOfSource`, the SDK's words).
|
|
200
|
+
*/
|
|
201
|
+
export function wrunOptionStrikesKitExtras(ask, ctx, optionMultiplier) {
|
|
202
|
+
return wrunOptionLaneAskFields(ask, {
|
|
203
|
+
maxCells: ctx.maxCells,
|
|
204
|
+
...(optionMultiplier !== undefined ? { optionMultiplier } : {}),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* The multiplier the curve reads: the chart's `market.option_multiplier()` as the host fill computes it
|
|
209
|
+
* (wrun-chart-market-facts.util `wrunChartOptionMultiplier`: OPRA 100, a CME root's point value, crypto 1, else 0), so
|
|
210
|
+
* the gateway's curve values the chain as the template's own curve did. The lane context's market is the one the
|
|
211
|
+
* chain is read as: a stock twin's context names its stock on the OPRA plane (100). Loaded with the facts module at
|
|
212
|
+
* the first curve ask: the lane module stays off the boot path's weight.
|
|
151
213
|
*/
|
|
152
|
-
export function
|
|
153
|
-
|
|
214
|
+
export async function wrunOptionStrikesChartMultiplier(ctx) {
|
|
215
|
+
const { wrunChartOptionMultiplier } = await import('../../wrun-chart-market-facts.util.js');
|
|
216
|
+
return wrunChartOptionMultiplier({ exchange: ctx.exchange, symbol: ctx.symbol });
|
|
154
217
|
}
|
|
155
218
|
/** Whether a kit fold bar's rows carry the refusal: its levels row with `refused` 1 (the bar's newest minute held more
|
|
156
219
|
* rows than the input's `max_cells`). */
|
|
@@ -190,8 +253,9 @@ export const rowLane = {
|
|
|
190
253
|
horizon: wrunOptionStrikesHorizon,
|
|
191
254
|
acquisitionMoved: wrunOptionStrikesAcquisitionMoved,
|
|
192
255
|
identity: async (ctx) => {
|
|
193
|
-
// O1: on the OPRA plane the chain is the plane's own by coin, no chain directory read
|
|
194
|
-
|
|
256
|
+
// O1: on the OPRA plane the chain is the plane's own by coin, no chain directory read (the chart market judged whole
|
|
257
|
+
// where the planner handed no verdict).
|
|
258
|
+
const held = await wrunHeldOpraPlaneChain(ctx.exchange, ctx.coin, ctx.opraPlane, ctx.symbol);
|
|
195
259
|
rememberStrikesChart(wrunLaneChartKey(ctx), await resolveWrunLaneChainChart(ctx, held));
|
|
196
260
|
},
|
|
197
261
|
facets: async (source, ctx) => {
|
|
@@ -220,8 +284,7 @@ export const rowLane = {
|
|
|
220
284
|
throw wrunLaneChainRefusalError(decision, 'option_strikes');
|
|
221
285
|
// The kit fold and its params, by the SDK's rules (`wrun_option_knob_invalid`), then this host's guard.
|
|
222
286
|
const kit = wrunOptionLaneAskOfSource(source, ctx);
|
|
223
|
-
|
|
224
|
-
if (kitExtras !== undefined && !WRUN_OPTION_STRIKES_KIT_SERVED) {
|
|
287
|
+
if (kit !== undefined && !WRUN_OPTION_STRIKES_KIT_SERVED) {
|
|
225
288
|
return refuseWrunPollInput(ctx, `reads option_strikes with fold "kit" (${WRUN_OPTION_VIEWS_UNSERVED_REFUSAL}): this app does not carry the ` +
|
|
226
289
|
"kit fold's rows into a run yet; read the strike rows whole (drop fold and its params)", wrunAuthorRuleSeed(WRUN_OPTION_VIEWS_UNSERVED_REFUSAL));
|
|
227
290
|
}
|
|
@@ -229,6 +292,11 @@ export const rowLane = {
|
|
|
229
292
|
return refuseWrunPollInput(ctx, `reads option_strikes with fold "kit" and curve (${WRUN_OPTION_VIEWS_UNSERVED_REFUSAL}): this app does not ` +
|
|
230
293
|
"answer the kit fold's curve row yet; drop curve and read the gamma curve from the strike rows", wrunAuthorRuleSeed(WRUN_OPTION_VIEWS_UNSERVED_REFUSAL));
|
|
231
294
|
}
|
|
295
|
+
const velocityExtras = wrunOptionStrikesVelocityExtras(source, ctx);
|
|
296
|
+
// The curve's multiplier is read for an input declaring it alone: any other asks exactly what it asked before.
|
|
297
|
+
const kitExtras = kit === undefined
|
|
298
|
+
? undefined
|
|
299
|
+
: wrunOptionStrikesKitExtras(kit, ctx, kit.params.curve === 1 ? await wrunOptionStrikesChartMultiplier(ctx) : undefined);
|
|
232
300
|
const chain = await decideWrunLaneChain(chart, { venue: source.venue, book: source.book }, ctx);
|
|
233
301
|
return {
|
|
234
302
|
// The chain's identity as the options chain keys it (one chain per package: `acquisitions: 'one'`).
|
|
@@ -237,6 +305,7 @@ export const rowLane = {
|
|
|
237
305
|
// The run's bar span: the worker keeps the newest minute of each of these bars.
|
|
238
306
|
hostIntervalMs: ctx.intervalMs,
|
|
239
307
|
...kitExtras,
|
|
308
|
+
...velocityExtras,
|
|
240
309
|
};
|
|
241
310
|
},
|
|
242
311
|
cells: wrunOptionStrikesCells,
|
|
@@ -149,7 +149,8 @@ export const rowLane = {
|
|
|
149
149
|
await assertWrunProtocolType(ctx, WRUN_OPTION_SURFACE_TYPE, 'option_surface');
|
|
150
150
|
// O1: on the OPRA plane the chain is the plane's own by coin, no chain directory read.
|
|
151
151
|
const held = await wrunHeldOpraPlaneChain(ctx.exchange, ctx.coin, ctx.opraPlane);
|
|
152
|
-
|
|
152
|
+
// Every input decides through decideWrunLaneChain: the crypto venue listing waits for a crypto venue word.
|
|
153
|
+
rememberSurfaceChart(wrunLaneChartKey(ctx), await resolveWrunLaneChainChart(ctx, held, { cryptoListingOnDemand: true }));
|
|
153
154
|
},
|
|
154
155
|
facets: async (source, ctx) => {
|
|
155
156
|
for (const [knob, owners] of STRAY_KNOBS) {
|
|
@@ -38,7 +38,9 @@
|
|
|
38
38
|
* interval pin and a view on these classes refuse in the pinned-wire planner before the lane is
|
|
39
39
|
* planned; `forming` views and bindings are refused by the kit.
|
|
40
40
|
*/
|
|
41
|
+
import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
|
|
41
42
|
import type { WrunInputSource } from '../../../interfaces/wrun-runtime.interface.js';
|
|
43
|
+
import type { GateProvider } from '../../../workers/constants/socket-slots.js';
|
|
42
44
|
import type { WrunDailyLanding } from '../wrun-daily-lane.util.js';
|
|
43
45
|
import { type WrunRefusalSeed } from '../wrun-refusal.util.js';
|
|
44
46
|
import type { WrunBackendTier, WrunTierChoice, WrunTierLanding } from '../wrun-tier-grid.util.js';
|
|
@@ -81,6 +83,23 @@ export interface WrunPollLaneContext {
|
|
|
81
83
|
/** The chart's options ride the OPRA plane (the run's `isOpraPlaneExchange`, the planner's one verdict), handed to a
|
|
82
84
|
* `chain` lane: its chain there is OPRA's chain of the chart's own underlying. Absent reads false. */
|
|
83
85
|
opraPlane?: boolean;
|
|
86
|
+
/** The chart market a stock twin's lane context stands in for (derived-roots.util `wrunUnderlyingLaneContext` over the
|
|
87
|
+
* run's twin lane market, `wrunChartOptionsLaneMarket`): the context names the twin's stock on the OPRA plane, and a
|
|
88
|
+
* crypto venue word still reads that venue's chain of the coin (opra-option-lanes.util `resolveWrunLaneCryptoVenues`).
|
|
89
|
+
* Absent on every other context. */
|
|
90
|
+
stockTwinOf?: {
|
|
91
|
+
exchange: string;
|
|
92
|
+
symbol: string;
|
|
93
|
+
};
|
|
94
|
+
/** The run's one options decision for the market this context names (derived-roots.util
|
|
95
|
+
* `decideWrunRunOptionsMarket`, handed on by the planners): the gate plane its chain rides, and off every plane the
|
|
96
|
+
* known stop. A chain lane's chain resolution reads it instead of deciding the plane again
|
|
97
|
+
* (opra-option-lanes.util `resolveWrunLaneChartChain`), so no lane of a run reads another plane than its head
|
|
98
|
+
* decided. Absent outside a run's plan: the plane is read when the chain resolves. */
|
|
99
|
+
optionsDecision?: {
|
|
100
|
+
plane: GateProvider | null;
|
|
101
|
+
opraStop?: OpraOptionPlaneStop;
|
|
102
|
+
};
|
|
84
103
|
/**
|
|
85
104
|
* The run's plan as an identity: one object per `planWrunPollLanes` call, the same for every input it plans. A lane
|
|
86
105
|
* keys a resolution every input of the run shares by it (a `WeakMap`: a `chain` lane's chart, its chain and its
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
import type { WrunIndicatorMetadata, WrunInputSource, WrunMetadataParam } from '../../../interfaces/wrun-runtime.interface.js';
|
|
43
43
|
import type { OpraReadFacts } from '../../chart/opra-read-access.leaf.js';
|
|
44
44
|
import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
|
|
45
|
+
import { type WrunRunOptionsMarket } from '../derived-roots.util.js';
|
|
45
46
|
import { type WrunRefusalSeed } from '../wrun-refusal.util.js';
|
|
46
47
|
import { type WrunPollLane, type WrunPollLaneContext, type WrunPollLaneId, type WrunPollLaneInstance, type WrunPollLaneSource } from './wrun-poll-lane.types.js';
|
|
47
48
|
import { type WrunLaneChainPlane, type WrunRowLaneHorizon } from './wrun-row-lane.types.js';
|
|
@@ -76,15 +77,21 @@ export declare function wrunPollLaneInstanceKey(laneKey: string, extras: Readonl
|
|
|
76
77
|
* says it: such a chart serves candles, time and the global series (named by class). */
|
|
77
78
|
export declare function wrunPollLaneIndexModeReason(): string;
|
|
78
79
|
/** What the run hands the poll planner beside the chart: its OPRA facts (`mayReadOpra`: who may read the plane)
|
|
79
|
-
* and the predicate an `opra` lane is admitted by (`isOpraPlaneExchange
|
|
80
|
-
* a US stock or ETF chart under either venue spelling while the
|
|
81
|
-
* no chart is judged off
|
|
80
|
+
* and the predicate an `opra` lane is admitted by (`isOpraPlaneExchange`, over the chart market's exchange and
|
|
81
|
+
* symbol: the chart's options ride the OPRA plane, a US stock or ETF chart under either venue spelling while the
|
|
82
|
+
* `opra` flag is lit, an OPRA contract chart, a stock twin reading its stock's chain; absent, no chart is judged off
|
|
83
|
+
* the plane). */
|
|
82
84
|
export interface WrunPollLaneRunFacts extends OpraReadFacts {
|
|
83
|
-
isOpraPlaneExchange?: (exchange: string) => boolean;
|
|
85
|
+
isOpraPlaneExchange?: (exchange: string, symbol: string) => boolean;
|
|
84
86
|
/** Why a chart off the plane is off it although its options list on OPRA (opra-options-gate.util
|
|
85
87
|
* `opraOptionPlaneStop`: the flag check's `flag-off`, the plane router's `chart-kind`); absent, the market's own
|
|
86
88
|
* words ("no such feed here"). */
|
|
87
|
-
opraPlaneStop?: (exchange: string) => OpraOptionPlaneStop | undefined;
|
|
89
|
+
opraPlaneStop?: (exchange: string, symbol: string) => OpraOptionPlaneStop | undefined;
|
|
90
|
+
/** The run's one options decision (derived-roots.util `decideWrunRunOptionsMarket`, taken at its head): every chain
|
|
91
|
+
* lane's input on the chart it was taken for carries it (`wrunChainLaneContext`), so its chain resolves under the
|
|
92
|
+
* decided plane, and a stock twin's input is planned against the twin's lane market (`options.lane`, through
|
|
93
|
+
* `wrunUnderlyingLaneContext`, as an `underlying` root's is). Absent: the plane is read when the chain resolves. */
|
|
94
|
+
options?: WrunRunOptionsMarket;
|
|
88
95
|
/** The run's current setting values by name (wrun-param-values.util `wrunParamValuesFromSettings` over the
|
|
89
96
|
* overlay's settings): what an option knob naming a setting reads (`resolveWrunOptionSettingKnobs`). Absent, no
|
|
90
97
|
* knob's setting is read, and a lane refuses a name it cannot read by name. */
|
|
@@ -134,9 +141,17 @@ export interface WrunChartOpraPlane {
|
|
|
134
141
|
* `opraOptionPlaneStop`: the flag check's `flag-off`, the plane router's `chart-kind`); absent, none is known. */
|
|
135
142
|
stop?: OpraOptionPlaneStop;
|
|
136
143
|
}
|
|
137
|
-
/** The chart's OPRA plane facts, off the predicates the run injects
|
|
138
|
-
* the plane; `opraPlaneStop`, asked only off the plane). */
|
|
139
|
-
export declare function wrunChartOpraPlane(
|
|
144
|
+
/** The chart's OPRA plane facts, off the predicates the run injects over the chart's market, exchange and symbol
|
|
145
|
+
* (`isOpraPlaneExchange`: absent, no chart rides the plane; `opraPlaneStop`, asked only off the plane). */
|
|
146
|
+
export declare function wrunChartOpraPlane(chart: Pick<WrunPollLaneContext, 'exchange' | 'symbol'>, facts: Pick<WrunPollLaneRunFacts, 'isOpraPlaneExchange' | 'opraPlaneStop'> | undefined): WrunChartOpraPlane;
|
|
147
|
+
/**
|
|
148
|
+
* A chain lane input's context under the run's one options decision (`options`), both planners' one rule: on the chart
|
|
149
|
+
* the decision was taken for, the decision rides along (`optionsDecision`: the plane the input's chain resolves under,
|
|
150
|
+
* never decided again) and a stock twin's lane market stands in place of the chart's (`wrunUnderlyingLaneContext`, the
|
|
151
|
+
* swap an `underlying` root's input reads). A context with no decision, or one of another chart market (a switch since
|
|
152
|
+
* the head: the run is superseded), is left as it is.
|
|
153
|
+
*/
|
|
154
|
+
export declare function wrunChainLaneContext<Ctx extends WrunPollLaneContext>(ctx: Ctx, options: WrunRunOptionsMarket | undefined): Ctx;
|
|
140
155
|
/**
|
|
141
156
|
* Why one input of a lane the chart does not serve is not served, as `wrunUnservedLaneInput` reads it: the planner's
|
|
142
157
|
* own words after the input's label (`words`, with the `stop` when a known stop keeps the chart's OPRA options off the
|
|
@@ -201,7 +216,7 @@ export declare function wrunLaneUnservedScopeRefusal(error: unknown): error is E
|
|
|
201
216
|
* stop. Undefined: the lane resolves its chain (its instance then meets its own plane's wall,
|
|
202
217
|
* `assertWrunLaneChainPlaneReadable`).
|
|
203
218
|
*/
|
|
204
|
-
export declare function wrunChainLaneStop(plane: WrunChartOpraPlane, run: OpraReadFacts | undefined, ctx: Pick<WrunPollLaneContext, 'inputName' | 'sourceClass'
|
|
219
|
+
export declare function wrunChainLaneStop(plane: WrunChartOpraPlane, run: OpraReadFacts | undefined, ctx: Pick<WrunPollLaneContext, 'inputName' | 'sourceClass' | 'stockTwinOf'>, venue?: unknown): WrunUnservedLaneWhy | undefined;
|
|
205
220
|
/** The run's plan against the chart (WRUN-REFUSALS contract): the lane instances to fetch, and
|
|
206
221
|
* the feeds the chart's fetch never serves to inputs that declared a missing fill (one entry per
|
|
207
222
|
* lane key, its inputs in declaration order). */
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { wrunUnderlyingLaneContext } from '../derived-roots.util.js';
|
|
1
2
|
import { wrunParamChoices } from '../wrun-color-settings.util.js';
|
|
3
|
+
import { isWrunOptionsChainCryptoVenueWord } from '../wrun-options-chain.util.js';
|
|
2
4
|
import { refuseWrunOptionKnob } from '../wrun-option-knobs.util.js';
|
|
3
5
|
import { wrunOptionPrintKnobWords } from '../wrun-option-prints.util.js';
|
|
4
6
|
import { WRUN_OPTION_STRIKE_FLOW_CLASS, WRUN_OPTION_STRIKE_FLOW_EXPIRIES_WORDS, wrunOptionStrikeFlowExpiriesOf, } from '../wrun-option-strike-flow-lane.util.js';
|
|
@@ -216,14 +218,35 @@ export function wrunOpraPlaneStopDetail(stop) {
|
|
|
216
218
|
? 'is not served for this account yet: the opra flag is off, so no US options data is read on any chart'
|
|
217
219
|
: 'is not served on this chart: an index chart does not ride the OPRA plane yet, so no US options data is read for it';
|
|
218
220
|
}
|
|
219
|
-
/** The chart's OPRA plane facts, off the predicates the run injects
|
|
220
|
-
* the plane; `opraPlaneStop`, asked only off the plane). */
|
|
221
|
-
export function wrunChartOpraPlane(
|
|
222
|
-
if (facts?.isOpraPlaneExchange?.(exchange) === true)
|
|
221
|
+
/** The chart's OPRA plane facts, off the predicates the run injects over the chart's market, exchange and symbol
|
|
222
|
+
* (`isOpraPlaneExchange`: absent, no chart rides the plane; `opraPlaneStop`, asked only off the plane). */
|
|
223
|
+
export function wrunChartOpraPlane(chart, facts) {
|
|
224
|
+
if (facts?.isOpraPlaneExchange?.(chart.exchange, chart.symbol) === true)
|
|
223
225
|
return { onPlane: true };
|
|
224
|
-
const stop = facts?.opraPlaneStop?.(exchange);
|
|
226
|
+
const stop = facts?.opraPlaneStop?.(chart.exchange, chart.symbol);
|
|
225
227
|
return stop !== undefined ? { onPlane: false, stop } : { onPlane: false };
|
|
226
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* A chain lane input's context under the run's one options decision (`options`), both planners' one rule: on the chart
|
|
231
|
+
* the decision was taken for, the decision rides along (`optionsDecision`: the plane the input's chain resolves under,
|
|
232
|
+
* never decided again) and a stock twin's lane market stands in place of the chart's (`wrunUnderlyingLaneContext`, the
|
|
233
|
+
* swap an `underlying` root's input reads). A context with no decision, or one of another chart market (a switch since
|
|
234
|
+
* the head: the run is superseded), is left as it is.
|
|
235
|
+
*/
|
|
236
|
+
export function wrunChainLaneContext(ctx, options) {
|
|
237
|
+
if (options === undefined)
|
|
238
|
+
return ctx;
|
|
239
|
+
if ((options.chart.exchange ?? '') !== ctx.exchange || (options.chart.symbol ?? '') !== ctx.symbol)
|
|
240
|
+
return ctx;
|
|
241
|
+
const decided = {
|
|
242
|
+
...ctx,
|
|
243
|
+
optionsDecision: {
|
|
244
|
+
plane: options.plane,
|
|
245
|
+
...(options.opraStop !== undefined ? { opraStop: options.opraStop } : {}),
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
return options.lane === undefined ? decided : wrunUnderlyingLaneContext(decided, options.lane);
|
|
249
|
+
}
|
|
227
250
|
/** The fills a scalar input reads on every bar of a feed the chart does not serve (`missing: "nan"` or `"zero"`). */
|
|
228
251
|
const WRUN_POLL_LANE_UNSERVED_FILLS = Object.freeze(['nan', 'zero']);
|
|
229
252
|
/**
|
|
@@ -313,8 +336,11 @@ export function wrunLaneUnservedScopeRefusal(error) {
|
|
|
313
336
|
* stop. Undefined: the lane resolves its chain (its instance then meets its own plane's wall,
|
|
314
337
|
* `assertWrunLaneChainPlaneReadable`).
|
|
315
338
|
*/
|
|
316
|
-
export function wrunChainLaneStop(plane, run, ctx) {
|
|
317
|
-
|
|
339
|
+
export function wrunChainLaneStop(plane, run, ctx, venue) {
|
|
340
|
+
// A stock twin's input pinning a crypto venue reads that venue's chain of the coin, never OPRA's: no OPRA wall stands
|
|
341
|
+
// before it (its instance meets its own plane's wall, `assertWrunLaneChainPlaneReadable`).
|
|
342
|
+
const twinCryptoVenue = ctx.stockTwinOf !== undefined && typeof venue === 'string' && isWrunOptionsChainCryptoVenueWord(venue);
|
|
343
|
+
if ((plane.onPlane || plane.stop !== undefined) && !twinCryptoVenue)
|
|
318
344
|
assertWrunOpraLaneReadable(run, ctx);
|
|
319
345
|
return plane.stop === undefined ? undefined : { words: wrunOpraPlaneStopDetail(plane.stop), stop: plane.stop };
|
|
320
346
|
}
|
|
@@ -418,7 +444,7 @@ export async function planWrunPollLanes(metadata, chart, isIndexModeExchange = (
|
|
|
418
444
|
const category = typeof chart.category === 'number' ? { category: chart.category } : {};
|
|
419
445
|
// The chart's OPRA plane facts, read once (`wrunChartOpraPlane`, the row lanes' planner reads them the same way):
|
|
420
446
|
// whether its options ride the plane, and off it the known reason a chart whose options list on OPRA rides none.
|
|
421
|
-
const plane = wrunChartOpraPlane(chart
|
|
447
|
+
const plane = wrunChartOpraPlane(chart, run);
|
|
422
448
|
// One object per plan: the inputs of this run share a chain lane's resolutions by it.
|
|
423
449
|
const runScope = {};
|
|
424
450
|
for (const planned of planWrunPollLaneInputs(metadata)) {
|
|
@@ -443,6 +469,9 @@ export async function planWrunPollLanes(metadata, chart, isIndexModeExchange = (
|
|
|
443
469
|
: {}),
|
|
444
470
|
...(chainLane ? { runScope, opraPlane: plane.onPlane } : {}),
|
|
445
471
|
};
|
|
472
|
+
// A chain lane reads the run's one options market: a stock twin's stock in place of the chart's
|
|
473
|
+
// (`wrunChainLaneContext`); every other lane, and every chain lane of any other chart, the chart's own context.
|
|
474
|
+
const laneCtx = chainLane ? wrunChainLaneContext(ctx, run?.options) : ctx;
|
|
446
475
|
const unserved = {
|
|
447
476
|
inputName: planned.inputName,
|
|
448
477
|
sourceClass: planned.lane.sourceClass,
|
|
@@ -454,7 +483,7 @@ export async function planWrunPollLanes(metadata, chart, isIndexModeExchange = (
|
|
|
454
483
|
// served by its own plane and the chart's mode. An input the chart does not serve meets the one rule both planners
|
|
455
484
|
// keep (`wrunUnservedLaneInput`: a declared fill drops it with a note, any other refuses by name).
|
|
456
485
|
const why = chainLane
|
|
457
|
-
? wrunChainLaneStop(plane, run,
|
|
486
|
+
? wrunChainLaneStop(plane, run, laneCtx, planned.source.venue)
|
|
458
487
|
: wrunPollLaneUnserved(planned.lane, plane, indexModeChart, run, ctx);
|
|
459
488
|
if (why !== undefined) {
|
|
460
489
|
wrunUnservedLaneInput(missing, unserved, WRUN_POLL_LANE_UNSERVED_FILLS, why, cryptoVenue);
|
|
@@ -465,7 +494,7 @@ export async function planWrunPollLanes(metadata, chart, isIndexModeExchange = (
|
|
|
465
494
|
// An option knob naming a setting reads the setting's current value before the lane judges it (om
|
|
466
495
|
// `resolveOptionParamKnobs`): the instance's extras carry the value, so a settings change re-plans and re-asks.
|
|
467
496
|
const source = resolveWrunOptionSettingKnobs(ctx, planned.source, metadata.params ?? [], run?.paramValues);
|
|
468
|
-
answered = await planned.lane.plan(source,
|
|
497
|
+
answered = await planned.lane.plan(source, laneCtx);
|
|
469
498
|
}
|
|
470
499
|
catch (error) {
|
|
471
500
|
// A chart with no option chain does not serve the feed (`wrunLaneNoChainRefusal`), nor one whose options plane
|
|
@@ -519,6 +548,8 @@ const WRUN_CME_WALL_SEED = Object.freeze({ cls: 'cme-wall' });
|
|
|
519
548
|
export function assertWrunLaneChainPlaneReadable(plane, exchange, run, ctx) {
|
|
520
549
|
if (plane === 'opra')
|
|
521
550
|
assertWrunOpraLaneReadable(run, ctx);
|
|
551
|
+
// OpenMarket's own packages only, whatever the `cme-user-scripts` gate says: the gate opens CME chart studies (the
|
|
552
|
+
// chart's own futures data), never CME options data (no implied expansion to CME options in this release).
|
|
522
553
|
if (plane === 'cme' && run?.official !== true) {
|
|
523
554
|
refuseWrunPollInput(ctx, `reads CME options data (${exchange}), which is open to OpenMarket's own Indicators only: a package you wrote ` +
|
|
524
555
|
'or added from the community cannot read it yet', WRUN_CME_WALL_SEED);
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One record per ADD of what its reads landed (OPTLOAD W3, after R2 and FE-FOLD-CAP; wrun-row-lanes.util
|
|
3
|
+
* `fetchWrunRowLaneRows` `addMemo`). Every read of one row lane instance of a mounted indicator (its runs, its live
|
|
4
|
+
* start, each live reconcile) leaves the add a memo: the bars it landed whole and final with their rows. Every later
|
|
5
|
+
* read of the same add reuses the landed bars and asks only the bars the memo does not hold (a new bar at the head, a
|
|
6
|
+
* bar still forming). The reuse is unconditional: it never waits on the download budget (`wrun-download-budget-cut`).
|
|
7
|
+
* Gated on it, an add's live start and every live reconcile asked their whole window again: ES1! 1h Interval Flow on
|
|
8
|
+
* INT (2026-10-27, after the close) read its newest regular hour and the 26 h before it (0.68 MB), then its live row
|
|
9
|
+
* read that hour and the 6 h before it again, at +3.6 s and at +17 s (0.50 MB each), every bar of them final.
|
|
10
|
+
*
|
|
11
|
+
* The budget's cut alone stays behind its flag: a budgeted read also leaves the bars its budget cut (kept partial,
|
|
12
|
+
* never asked again by the add) and what it downloaded within which share (a later budgeted run reads what is left), so
|
|
13
|
+
* the add spends its budget once, not once a read. INT 2026-10-23, Premium by Strike 0.3.0 on ES1! 1h: the refresh run,
|
|
14
|
+
* the live start and a live reconcile each folded the same 3 newest bars again, 1.21 MB a read. A whole run (no budget
|
|
15
|
+
* applies) reads the add's memo with the budget's record dropped (`wrunRowLaneAddMemoWhole`).
|
|
16
|
+
*
|
|
17
|
+
* Off the boot path: wrun-row-lanes.util loads it only for a read that names an add.
|
|
18
|
+
*/
|
|
19
|
+
import type { LiveBucketVenue } from '../../chart/live-bucket.util.js';
|
|
20
|
+
import { type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
|
|
21
|
+
/** A landed bar is final once it ended this long before the read: a delayed route serves a bar's last buckets up to 15
|
|
22
|
+
* minutes after its close, so a bar closer to the clock is asked again by the add's next read. */
|
|
23
|
+
export declare const WRUN_ROW_LANE_FINAL_LAG_MS: number;
|
|
24
|
+
/**
|
|
25
|
+
* What one host bar's landed row depends on beyond its own span: the add memo's one eligibility rule, decided per row
|
|
26
|
+
* lane instance off its acquisition (wrun-row-lanes.util `wrunRowLaneRowDependencyOf`), so the memo never freezes a row
|
|
27
|
+
* a later read would answer otherwise (LIVE-REREAD review 2026-10-28: a whole session's sum, a carried next bar, a
|
|
28
|
+
* window-wide cut, the chart's newest trade date):
|
|
29
|
+
* - `bar`: the bar's own span and the data up to its end: final `WRUN_ROW_LANE_FINAL_LAG_MS` after the bar ends;
|
|
30
|
+
* - `session`: the whole trade date the bar falls on (`span: "session"`: one sum per contract per trade date, landed on
|
|
31
|
+
* the session's first bar and growing all session): final the lag after that trade date ends (`sessionEndMs`, on the
|
|
32
|
+
* chain's trade-date clock);
|
|
33
|
+
* - `next-bar`: the next bar with rows (a kit fold carrying the next bar's strikes): final once every bar after it, up
|
|
34
|
+
* to and including the next one with rows (`hasRows`), is whole and final too;
|
|
35
|
+
* - `never`: what no bar's clock settles (the window's newest cut, the chart's newest trade date under `history`
|
|
36
|
+
* "today"): the read neither reuses nor records a memo.
|
|
37
|
+
* Beside it, `emptyIsQuiet`: whether a bar the answer left with no row can be final at all. A flow's empty bar is quiet
|
|
38
|
+
* (nothing traded in it). A snapshot's is a picture not shown yet, asked again by every read: a read its worker failed
|
|
39
|
+
* and answered empty (option_strikes, option_surface), the older bars a folded strike kit read leaves unread past its
|
|
40
|
+
* cap, a CME surface bar whose settlement row is published after the bar's own end.
|
|
41
|
+
*/
|
|
42
|
+
export type WrunRowLaneRowDependency = (({
|
|
43
|
+
kind: 'bar';
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'session';
|
|
46
|
+
sessionEndMs: (stampMs: number) => number;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'next-bar';
|
|
49
|
+
hasRows: (row: ReadonlyArray<unknown>) => boolean;
|
|
50
|
+
}) & {
|
|
51
|
+
emptyIsQuiet: boolean;
|
|
52
|
+
}) | {
|
|
53
|
+
kind: 'never';
|
|
54
|
+
why: string;
|
|
55
|
+
};
|
|
56
|
+
/** What the add's reads of one row lane instance hold (`wrunRowLaneAddMemoAfter`). */
|
|
57
|
+
export interface WrunRowLaneAddMemo {
|
|
58
|
+
/** The lane, its acquisition without any per-ask field, and the bar span: a read printing another reads another add
|
|
59
|
+
* (a setting, the market or the interval moved) and replaces the memo. */
|
|
60
|
+
readonly fingerprint: string;
|
|
61
|
+
/** The bars read whole and final, each with its landed row (undefined: the bar answered nothing, an empty bar). */
|
|
62
|
+
readonly landed: ReadonlyMap<number, ReadonlyArray<unknown> | undefined>;
|
|
63
|
+
/** The bars the add's budget left partial: never asked again by the add (none without a budgeted read). */
|
|
64
|
+
readonly cut: ReadonlySet<number>;
|
|
65
|
+
/** What the add's budgeted reads downloaded, and the share they read within (a later budgeted run reads what is left).
|
|
66
|
+
* No share before a budgeted read names one: a later budgeted run then reads its own whole share. */
|
|
67
|
+
readonly spentBytes: number;
|
|
68
|
+
readonly shareBytes: number | undefined;
|
|
69
|
+
}
|
|
70
|
+
/** The add's memo, or undefined when it holds none or one of another fingerprint (dropped then). */
|
|
71
|
+
export declare function wrunRowLaneAddMemoOf(key: string, fingerprint: string): WrunRowLaneAddMemo | undefined;
|
|
72
|
+
export declare function rememberWrunRowLaneAdd(key: string, memo: WrunRowLaneAddMemo): void;
|
|
73
|
+
/** The memo a whole run of the add reads (no budget applies: its plan fits, or the cut is off): the landed bars are
|
|
74
|
+
* still reused, the bars a budgeted read cut are asked again, and the add's spend and share start over. */
|
|
75
|
+
export declare function wrunRowLaneAddMemoWhole(memo: WrunRowLaneAddMemo): WrunRowLaneAddMemo;
|
|
76
|
+
/** Test seam: forget every memo. */
|
|
77
|
+
export declare function __resetWrunRowLaneAddMemosForTests(): void;
|
|
78
|
+
/** The asks over the bars `keep` keeps: each ask cut into the runs of its kept bars (a bar belongs to the ask its span
|
|
79
|
+
* opens in), the tier kept; a run reaching the ask's last bar keeps the ask's own end. */
|
|
80
|
+
export declare function wrunRowLaneAsksOverBars(asks: readonly WrunHostGridAsk[], keep: (stampMs: number) => boolean, window: {
|
|
81
|
+
barOpens: readonly number[];
|
|
82
|
+
intervalMs: number;
|
|
83
|
+
}, sessionGrid: LiveBucketVenue | null | undefined): WrunHostGridAsk[];
|
|
84
|
+
/**
|
|
85
|
+
* The add's memo after one of its reads, whatever its role and whether or not a budget applies: every bar the read
|
|
86
|
+
* asked that landed whole (not partial for the read, no partial mark on its row, and a row at all unless an empty bar
|
|
87
|
+
* is quiet for the instance) and final under the instance's dependency (`WrunRowLaneRowDependency`: the lag after the
|
|
88
|
+
* bar's own end, its trade date's end, or its next bar with rows' being whole and final too) joins the landed bars and
|
|
89
|
+
* leaves the cut; every bar the read's budget cut joins the cut unless it is landed; a budgeted read adds what it
|
|
90
|
+
* downloaded and names its share (a whole run and a live read add nothing: the add's budget is its budgeted runs').
|
|
91
|
+
*/
|
|
92
|
+
export declare function wrunRowLaneAddMemoAfter(args: {
|
|
93
|
+
previous: WrunRowLaneAddMemo | undefined;
|
|
94
|
+
fingerprint: string;
|
|
95
|
+
dependency: Exclude<WrunRowLaneRowDependency, {
|
|
96
|
+
kind: 'never';
|
|
97
|
+
}>;
|
|
98
|
+
window: {
|
|
99
|
+
intervalMs: number;
|
|
100
|
+
nowMs: number;
|
|
101
|
+
barOpens: readonly number[];
|
|
102
|
+
};
|
|
103
|
+
sessionGrid: LiveBucketVenue | null | undefined;
|
|
104
|
+
askedBars: Iterable<number>;
|
|
105
|
+
landedRows: ReadonlyMap<number, ReadonlyArray<unknown>>;
|
|
106
|
+
partialBars: ReadonlySet<number>;
|
|
107
|
+
marked: (row: ReadonlyArray<unknown>) => boolean;
|
|
108
|
+
cutBars: Iterable<number>;
|
|
109
|
+
spentBytes: number;
|
|
110
|
+
shareBytes: number | undefined;
|
|
111
|
+
}): WrunRowLaneAddMemo;
|