@orangecharts/wrun-chart-host 0.8.0 → 0.10.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 +3 -1
- package/dist/constants/feature-flags.constants.d.ts +9 -0
- package/dist/constants/feature-flags.constants.js +86 -16
- package/dist/constants/marketCapabilities.constants.d.ts +14 -9
- package/dist/constants/marketCapabilities.constants.js +36 -13
- package/dist/constants/opra-compliance.constants.d.ts +15 -0
- package/dist/constants/opra-compliance.constants.js +15 -0
- package/dist/constants/option-venues.constants.d.ts +11 -6
- package/dist/constants/option-venues.constants.js +5 -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 +39 -9
- package/dist/host-env.js +6 -0
- package/dist/host-ports.types.d.ts +108 -18
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
- package/dist/interfaces/opra-realtime.interface.js +10 -10
- package/dist/interfaces/replay.interface.d.ts +8 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +52 -15
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +94 -14
- package/dist/kscript-data/controls/live-trades-merge.util.js +132 -22
- package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +56 -0
- package/dist/kscript-data/controls/live-trades-order-gate.util.js +107 -0
- package/dist/market-data/billing.interface.d.ts +227 -42
- package/dist/market-data/billing.interface.js +60 -12
- package/dist/market-data/venue.d.ts +88 -6
- 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 +165 -8
- package/dist/market-data/venues/index.js +48 -6
- package/dist/market-data/venues/opra.contract.copy.json +5 -3
- package/dist/market-data/venues/opra.d.ts +3 -3
- package/dist/market-data/venues/opra.js +5 -4
- package/dist/replay/replayLadder.js +3 -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 +45 -6
- package/dist/settings-templates/tool-rules.d.ts +27 -17
- package/dist/settings-templates/tool-rules.js +27 -11
- package/dist/settings-templates/tool-tables.generated.js +91 -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/crypto-index.leaf.d.ts +2 -2
- package/dist/utility/chart/crypto-index.leaf.js +2 -2
- package/dist/utility/chart/index-mode-admission.util.js +24 -3
- package/dist/utility/chart/index-mode.util.d.ts +5 -2
- package/dist/utility/chart/index-mode.util.js +23 -13
- 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 +7 -2
- package/dist/utility/chart/kscript-live-coalesce.util.js +9 -3
- package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -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 +53 -27
- package/dist/utility/chart/kscript-venue-policy.util.js +74 -32
- 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.d.ts +12 -10
- package/dist/utility/chart/marketKind.util.js +17 -7
- package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
- package/dist/utility/chart/om-panel-push-style.util.js +17 -15
- package/dist/utility/chart/om-panel.util.js +6 -6
- 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/profile-block-size.util.d.ts +16 -0
- package/dist/utility/chart/profile-block-size.util.js +7 -0
- package/dist/utility/chart/quote-perp.leaf.d.ts +17 -0
- package/dist/utility/chart/quote-perp.leaf.js +20 -0
- package/dist/utility/chart/rth-session.util.d.ts +3 -2
- package/dist/utility/chart/rth-session.util.js +2 -1
- 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/wrun-run-result.util.d.ts +17 -0
- package/dist/utility/chart/wrun-run-result.util.js +145 -7
- package/dist/utility/common/transformations.util.d.ts +7 -0
- package/dist/utility/common/transformations.util.js +11 -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 +21 -3
- package/dist/utility/options/option-venue.util.js +30 -3
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
- package/dist/utility/wrun/derived-roots.util.d.ts +213 -0
- package/dist/utility/wrun/derived-roots.util.js +471 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +41 -6
- 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 +5 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +6 -4
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +2 -2
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +5 -1
- 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-lane-registry.js +3 -2
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +9 -3
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +15 -6
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +14 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +82 -13
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +55 -8
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +95 -14
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +5 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +7 -3
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +35 -14
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +70 -20
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +64 -0
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +89 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +45 -1
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +114 -6
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +56 -5
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +224 -26
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +822 -58
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +16 -3
- package/dist/utility/wrun/wrun-batched-marks.util.js +30 -19
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +37 -9
- package/dist/utility/wrun/wrun-batched-readout.util.js +61 -15
- 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-canvas-readout.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.d.ts +66 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.js +86 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +192 -13
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +437 -55
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +15 -4
- package/dist/utility/wrun/wrun-color-settings.util.js +31 -12
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +107 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +134 -0
- 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-draft-overlay.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-draft-overlay.util.js +23 -3
- package/dist/utility/wrun/wrun-frames.d.ts +27 -6
- package/dist/utility/wrun/wrun-frames.js +78 -15
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +7 -0
- 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 +51 -21
- package/dist/utility/wrun/wrun-hud-looks.util.js +74 -28
- package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +8 -6
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +8 -6
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -2
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-live-intake.util.js +213 -45
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +246 -49
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.d.ts +53 -0
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.js +162 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +205 -48
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +277 -34
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +51 -7
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +340 -56
- 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-prints.util.d.ts +41 -2
- package/dist/utility/wrun/wrun-option-prints.util.js +80 -13
- 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 +26 -6
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +50 -11
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +109 -19
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +222 -61
- package/dist/utility/wrun/wrun-option-views.util.d.ts +96 -18
- package/dist/utility/wrun/wrun-option-views.util.js +246 -51
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-options-stop.util.js +3 -2
- 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 +20 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +31 -14
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +22 -0
- 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.d.ts +7 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +25 -1
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +134 -37
- package/dist/utility/wrun/wrun-overlay-run.util.js +1118 -254
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +4 -4
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +4 -4
- package/dist/utility/wrun/wrun-pack.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-pack.util.js +20 -9
- 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 +63 -13
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +37 -24
- package/dist/utility/wrun/wrun-panel-style.util.js +100 -29
- package/dist/utility/wrun/wrun-param-map.util.d.ts +15 -11
- package/dist/utility/wrun/wrun-param-map.util.js +13 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +21 -3
- package/dist/utility/wrun/wrun-param-values.util.js +6 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +12 -11
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
- 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.js +10 -1
- 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-row-source.d.ts +11 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-run-interval.util.js +9 -6
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +52 -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 +113 -8
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-source-rows.util.js +108 -43
- 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 +26 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +126 -50
- package/dist/utility/wrun/wrun-tape-source.util.js +193 -68
- package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
- package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
- package/dist/utils/replay/replay-buffer-math.js +227 -20
- package/dist/workers/utils/volume-profile.worker.util.d.ts +4 -1
- package/dist/workers/utils/volume-profile.worker.util.js +5 -2
- package/dist/workers/wrun/wrun-abi-host.js +3 -2
- package/package.json +5 -5
|
@@ -9,12 +9,17 @@
|
|
|
9
9
|
* params ride the input as flat knobs (`WrunOptionViewSpec` `params`: the knob, then the wire name the gateway
|
|
10
10
|
* reads), each a finite number once the paint seam ran (`wrunSheetWithSettings` writes a `"@<param>"` handle's
|
|
11
11
|
* current value, the `ticks_per_bar` rule). The views' `expiries` param rides `view_expiries`: the class keeps its own
|
|
12
|
-
* `expiries` word. Every refusal is om's one knob name (`wrun_option_knob_invalid`), but for a
|
|
12
|
+
* `expiries` word. Every refusal is om's one knob name (`wrun_option_knob_invalid`), but for a view this host does
|
|
13
|
+
* not read yet (below).
|
|
13
14
|
* - Answers. A projection (`answer: 'tuples'`) is a subsequence of B in B's order with B's values, so a package whose
|
|
14
15
|
* code is unchanged reads it as it reads B: it reaches the package as the class's own block. A fold
|
|
15
|
-
* (`answer: 'fold'`: totals, boards, the curve) answers rows of another layout,
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* (`answer: 'fold'`: totals, boards, the curve) answers rows of another layout, so an input naming one reads a view
|
|
17
|
+
* block (`wrunOptionInputTupleWidth`: its projections' tuples as `[0, ...tuple]`, then each fold's rows as
|
|
18
|
+
* `[layout, ...cells]`, every row padded to the class's `WRUN_OPTION_VIEW_ROW_WIDTHS`). This host reads
|
|
19
|
+
* option_contract_state's folds (Top Contracts' totals); a view it does not read yet (`wrunOptionViewUnread`: an
|
|
20
|
+
* options_chain fold, whose twin reads class tuples alone, and a state view that follows the chart's close, which
|
|
21
|
+
* the state lane does not send) refuses by name before any read (`wrun_option_view_unread`), never an empty or
|
|
22
|
+
* misread block.
|
|
18
23
|
* - Hinted views (`hinted`: the window board, the smile and surface reads, and the folds that read the close where a
|
|
19
24
|
* contract carries no underlying: exposure, strike_table, gex_curve, oi_board) cover every close within
|
|
20
25
|
* `WRUN_OPTION_VIEW_MARGIN_PCT` of the hint the ask carries, the chart's close at ask time; a run whose close left
|
|
@@ -23,9 +28,10 @@
|
|
|
23
28
|
* for word by tests/utility/wrun/wrun-option-views.kit-pin.spec.ts.
|
|
24
29
|
* - The per-bar words (OPTLOAD-CHAIN-PLAN 6.2, 6.3 and 9): `pick` on `option_surface` ("nearest_days" or
|
|
25
30
|
* "tenor_bracket", the bar's newest 5m bucket picked to the tuples Skew History and Options Sentiment read) and
|
|
26
|
-
* `fold` "kit" on `option_strikes` (the bar's newest minute folded to one levels row
|
|
27
|
-
* Exposures draws), their params read by the SDK's rules
|
|
28
|
-
* asked of the gateway in the lane's fields
|
|
31
|
+
* `fold` "kit" on `option_strikes` (the bar's newest minute folded to one levels row, with `curve` the gamma curve's
|
|
32
|
+
* row after it, and the strike rows Spot Exposures draws), their params read by the SDK's rules
|
|
33
|
+
* (`WRUN_OPTION_LANE_KNOBS`, `wrunOptionLaneAskOfSource`) and asked of the gateway in the lane's fields
|
|
34
|
+
* (`wrunOptionLaneAskFields`, the `OptionReadShape` G5 fields 40 to 53).
|
|
29
35
|
* The kit fold keeps its expiries with its own `nearest`: an `expiries` word other than "all" beside it is refused
|
|
30
36
|
* at declaration (kit 0.91.1, `WRUN_OPTION_STRIKES_KIT_EXPIRIES_TAKES`).
|
|
31
37
|
* - The ask's payload fields (`wrunOptionViewLaneFields`): `<prefix>Views`, the canonical text (`wrunOptionViewsText`:
|
|
@@ -33,8 +39,12 @@
|
|
|
33
39
|
* read), `<prefix>SpotMarginPct` for a hinted set, and on `options_chain` the gateway's scope inputs
|
|
34
40
|
* (`chainNearestExpiries`, `chainMaxContracts`: the gateway sizes B on its page, so a view ask reads no expiry
|
|
35
41
|
* directory). The worker twins read them back (`wrunOptionViewsOf`, `wrunOptionViewAskFieldsOf`).
|
|
36
|
-
* - A gateway without the views answers `knobsVersion` 0
|
|
37
|
-
*
|
|
42
|
+
* - A gateway without the views answers `knobsVersion` 0. On a crypto chain (the plain reader serves none) the worker
|
|
43
|
+
* projects the views over the block today's path builds, in the very rows a served answer reads as
|
|
44
|
+
* (option-views-local.worker.util, the SDK's reference); a governed gateway without them is refused by name
|
|
45
|
+
* (`WRUN_OPTION_VIEWS_UNSERVED_CODE`). An input that declares no views reads its block B whole through its class's
|
|
46
|
+
* implicit view (`WRUN_OPTIONS_CHAIN_IMPLICIT_VIEW`, `WRUN_OPTION_STATE_IMPLICIT_VIEW`): B's rows from the gateway,
|
|
47
|
+
* or today's path for an answer that is not B's rows; a crypto chain keeps its plain reader.
|
|
38
48
|
*
|
|
39
49
|
* Worker-safe: the worker twins parse the same words. The one main-thread door (`wrunHeldOpraPlaneChain`) touches the
|
|
40
50
|
* host env only when called.
|
|
@@ -122,7 +132,7 @@ export const WRUN_OPTION_VIEWS = Object.freeze({
|
|
|
122
132
|
export const WRUN_OPTION_VIEW_MARGIN_PCT = 0.5;
|
|
123
133
|
/** The lane refusal code (wrun-lane-refusal.leaf) of a view ask the gateway answered without the views. */
|
|
124
134
|
export const WRUN_OPTION_VIEWS_UNSERVED_CODE = 'option-views-unserved';
|
|
125
|
-
/** The plan's refusal of a view
|
|
135
|
+
/** The plan's refusal of a view this host does not read yet (`wrunOptionViewUnread`). */
|
|
126
136
|
export const WRUN_OPTION_VIEW_UNREAD_CODE = 'wrun_option_view_unread';
|
|
127
137
|
/** The plan's refusal of one chain lane whose inputs read it through views and whole at once (one ask serves both
|
|
128
138
|
* never: B and a view of B are two answers). */
|
|
@@ -137,6 +147,29 @@ export function wrunOptionViewSpec(word) {
|
|
|
137
147
|
? WRUN_OPTION_VIEWS[word]
|
|
138
148
|
: undefined;
|
|
139
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* What this host reads of each class's views (web: the `k-options-chain` and `k-option-contract-state` workers and
|
|
152
|
+
* their lanes): `folds`, whether the twin reads a fold's rows (option_contract_state's twin reads the answer's fold
|
|
153
|
+
* entries as the view block, `optionsChainViewRows`; options_chain's reads class tuples alone); `hint`, whether the
|
|
154
|
+
* lane sends a hinted view the chart's close (`chainSpotHint`; the state lane sends none, and the gateway and the kit
|
|
155
|
+
* refuse a hinted view without it).
|
|
156
|
+
*/
|
|
157
|
+
const WRUN_OPTION_VIEW_HOST_READS = Object.freeze({
|
|
158
|
+
options_chain: Object.freeze({ folds: false, hint: true }),
|
|
159
|
+
option_contract_state: Object.freeze({ folds: true, hint: false }),
|
|
160
|
+
});
|
|
161
|
+
/** Why this host does not read a view yet, in a refusal's words, or undefined when it reads it (every projection,
|
|
162
|
+
* option_contract_state's folds but `oi_board`, which follows the chart's close). */
|
|
163
|
+
export function wrunOptionViewUnread(spec) {
|
|
164
|
+
const reads = WRUN_OPTION_VIEW_HOST_READS[spec.cls];
|
|
165
|
+
if (spec.answer === 'fold' && !reads.folds) {
|
|
166
|
+
return `its answer is a fold, whose rows no ${spec.cls} reader of this host takes yet`;
|
|
167
|
+
}
|
|
168
|
+
if (spec.hinted === true && !reads.hint) {
|
|
169
|
+
return `it follows the chart's close, which this host's ${spec.cls} lane does not send yet`;
|
|
170
|
+
}
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
140
173
|
/** The words of one class, spelled for a refusal. */
|
|
141
174
|
function wrunOptionViewWordsOf(cls) {
|
|
142
175
|
const words = Object.keys(WRUN_OPTION_VIEWS)
|
|
@@ -189,8 +222,8 @@ function declaredViewWords(source, ctx) {
|
|
|
189
222
|
/**
|
|
190
223
|
* An input's views, validated (main thread, after the paint seam): undefined when it declares none (today's path),
|
|
191
224
|
* else the views in canonical order (`canonicalViews`). Refuses by name a word that names no view of the input's
|
|
192
|
-
* class, a
|
|
193
|
-
*
|
|
225
|
+
* class, a view this host does not read yet (`wrunOptionViewUnread`), and a param that is no finite number (a
|
|
226
|
+
* `"@<param>"` the sheet declares no param of stays a string here).
|
|
194
227
|
*/
|
|
195
228
|
export function wrunOptionViewsOfSource(input, ctx, cls) {
|
|
196
229
|
// A sheet's input source, read by knob name (its knobs are open: the class's own and each view's params).
|
|
@@ -205,9 +238,10 @@ export function wrunOptionViewsOfSource(input, ctx, cls) {
|
|
|
205
238
|
if (spec === undefined || spec.cls !== cls) {
|
|
206
239
|
return refuseWrunOptionKnob(ctx, knob, word, wrunOptionViewWordsOf(cls));
|
|
207
240
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
241
|
+
const unread = wrunOptionViewUnread(spec);
|
|
242
|
+
if (unread !== undefined) {
|
|
243
|
+
return refuseWrunPollInput(ctx, `reads ${cls} with ${knob} "${String(word)}" (${WRUN_OPTION_VIEW_UNREAD_CODE}): ${unread}; declare another ` +
|
|
244
|
+
'view or read the block whole', wrunAuthorRuleSeed(WRUN_OPTION_VIEW_UNREAD_CODE));
|
|
211
245
|
}
|
|
212
246
|
const params = {};
|
|
213
247
|
for (const [knob, wire] of Object.entries(spec.params)) {
|
|
@@ -248,7 +282,8 @@ export function wrunOptionViewsHinted(views) {
|
|
|
248
282
|
/**
|
|
249
283
|
* A payload's `<prefix>Views` read back (the worker twins, the K controls): the views of `cls`, canonical, or
|
|
250
284
|
* undefined for a payload that names none; null for a text that is not one this module writes (a word of another
|
|
251
|
-
* class, a param that is no finite number, garbage): the ask is refused, never
|
|
285
|
+
* class, a view this host does not read, a param that is no finite number, garbage): the ask is refused, never
|
|
286
|
+
* widened to B whole.
|
|
252
287
|
*/
|
|
253
288
|
export function wrunOptionViewsOf(text, cls) {
|
|
254
289
|
if (text === undefined || text === null)
|
|
@@ -268,7 +303,7 @@ export function wrunOptionViewsOf(text, cls) {
|
|
|
268
303
|
for (const entry of parsed) {
|
|
269
304
|
const record = entry;
|
|
270
305
|
const spec = wrunOptionViewSpec(record?.view);
|
|
271
|
-
if (spec === undefined || spec.cls !== cls || spec
|
|
306
|
+
if (spec === undefined || spec.cls !== cls || wrunOptionViewUnread(spec) !== undefined)
|
|
272
307
|
return null;
|
|
273
308
|
const params = record?.params;
|
|
274
309
|
if (params === null || typeof params !== 'object' || Array.isArray(params))
|
|
@@ -317,16 +352,65 @@ function positiveNumber(value) {
|
|
|
317
352
|
function positiveInteger(value) {
|
|
318
353
|
return typeof value === 'number' && Number.isSafeInteger(value) && value > 0 ? value : undefined;
|
|
319
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* The implicit view (OPTLOAD W3 FE-STATE): an `option_contract_state` input that declares no view reads its block B
|
|
357
|
+
* whole, so its lane asks the gateway for exactly that, the `WHOLE` view of B (pb-common `OPTION_CHAIN_VIEW_WHOLE`,
|
|
358
|
+
* which the gateway answers on either class), in ONE chain summary read: no expiry directory, no page of every strike,
|
|
359
|
+
* no per-contract registry read. The answer is B's own class tuples in B's order, so the input reads it as it read B.
|
|
360
|
+
* The acquisition names it apart from any view text (`stateViews: "whole"`, never a JSON list: the authoring table
|
|
361
|
+
* keeps `whole` an options_chain word, as the kit does, and no author declares it on this class), so it keys an
|
|
362
|
+
* instance of its own (one key per chain, tier, expiries word, window and book), and the worker twin reads it back as
|
|
363
|
+
* the `whole` view, `implicit` (`wrunOptionViewAskFieldsOf`).
|
|
364
|
+
*/
|
|
365
|
+
export const WRUN_OPTION_STATE_IMPLICIT_VIEW = 'whole';
|
|
366
|
+
/** The payload field of the implicit view (`WRUN_OPTION_STATE_IMPLICIT_VIEW`), as the state lane writes it. */
|
|
367
|
+
export function wrunOptionStateImplicitViewFields() {
|
|
368
|
+
return { [`${WRUN_OPTION_VIEW_PREFIX.option_contract_state}Views`]: WRUN_OPTION_STATE_IMPLICIT_VIEW };
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* The implicit view of an `options_chain` input (OPTLOAD W3 FE-CHAIN), FE-STATE's rule on the chain class: a governed
|
|
372
|
+
* chain whose inputs declare no view reads its block B whole, so its lane asks the gateway's `WHOLE` view of B in ONE
|
|
373
|
+
* chain summary read, sized on the gateway's page by the inputs' expiries word and budget (`chainNearestExpiries`, the
|
|
374
|
+
* inputs' `nearest:N` when every input declares one; `chainMaxContracts`, the smallest `max_cells`; the gateway ports the
|
|
375
|
+
* lane scope's arithmetic, `wrunOptionsChainLaneScope`): no expiry directory before the ask and no per-contract registry
|
|
376
|
+
* read after it. The answer is B's 10-value tuples in B's order, so the inputs read it as they read B. The acquisition
|
|
377
|
+
* names it by the bare word (`chainViews: "whole"`), never a JSON list, so it never shares an author's spelling (an
|
|
378
|
+
* explicit `page_view: "whole"` rides as view text and is refused like any view when the gateway does not answer it),
|
|
379
|
+
* and the worker twin reads it back as the `whole` view, `implicit` (`wrunOptionViewAskFieldsOf`).
|
|
380
|
+
*/
|
|
381
|
+
export const WRUN_OPTIONS_CHAIN_IMPLICIT_VIEW = 'whole';
|
|
382
|
+
/** The payload fields of the options_chain implicit view (`WRUN_OPTIONS_CHAIN_IMPLICIT_VIEW`), as the chain lane writes
|
|
383
|
+
* them: the bare word, then the gateway's scope inputs. */
|
|
384
|
+
export function wrunOptionsChainImplicitViewFields(scope) {
|
|
385
|
+
return {
|
|
386
|
+
[`${WRUN_OPTION_VIEW_PREFIX.options_chain}Views`]: WRUN_OPTIONS_CHAIN_IMPLICIT_VIEW,
|
|
387
|
+
...(scope.nearestExpiries !== undefined ? { chainNearestExpiries: scope.nearestExpiries } : {}),
|
|
388
|
+
...(scope.maxContracts !== undefined ? { chainMaxContracts: scope.maxContracts } : {}),
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
/** Each class's implicit view word, as its lane writes it. */
|
|
392
|
+
const WRUN_OPTION_IMPLICIT_VIEWS = Object.freeze({
|
|
393
|
+
options_chain: WRUN_OPTIONS_CHAIN_IMPLICIT_VIEW,
|
|
394
|
+
option_contract_state: WRUN_OPTION_STATE_IMPLICIT_VIEW,
|
|
395
|
+
});
|
|
320
396
|
export function wrunOptionViewAskFieldsOf(cls, payload) {
|
|
321
397
|
const prefix = WRUN_OPTION_VIEW_PREFIX[cls];
|
|
398
|
+
const nearestExpiries = cls === 'options_chain' ? positiveInteger(payload.chainNearestExpiries) : undefined;
|
|
399
|
+
const maxContracts = cls === 'options_chain' ? positiveInteger(payload.chainMaxContracts) : undefined;
|
|
400
|
+
if (payload[`${prefix}Views`] === WRUN_OPTION_IMPLICIT_VIEWS[cls]) {
|
|
401
|
+
return {
|
|
402
|
+
views: [{ view: 'whole', params: {} }],
|
|
403
|
+
implicit: true,
|
|
404
|
+
...(nearestExpiries !== undefined ? { nearestExpiries } : {}),
|
|
405
|
+
...(maxContracts !== undefined ? { maxContracts } : {}),
|
|
406
|
+
};
|
|
407
|
+
}
|
|
322
408
|
const views = wrunOptionViewsOf(payload[`${prefix}Views`], cls);
|
|
323
409
|
if (views === undefined || views === null)
|
|
324
410
|
return views;
|
|
325
411
|
const hinted = wrunOptionViewsHinted(views);
|
|
326
412
|
const spotHint = hinted ? positiveNumber(payload[`${prefix}SpotHint`]) : undefined;
|
|
327
413
|
const spotMarginPct = hinted ? positiveNumber(payload[`${prefix}SpotMarginPct`]) : undefined;
|
|
328
|
-
const nearestExpiries = cls === 'options_chain' ? positiveInteger(payload.chainNearestExpiries) : undefined;
|
|
329
|
-
const maxContracts = cls === 'options_chain' ? positiveInteger(payload.chainMaxContracts) : undefined;
|
|
330
414
|
return {
|
|
331
415
|
views,
|
|
332
416
|
...(nearestExpiries !== undefined ? { nearestExpiries } : {}),
|
|
@@ -405,11 +489,19 @@ export const WRUN_OPTION_LANE_KNOBS = Object.freeze({
|
|
|
405
489
|
step_rows: Object.freeze({ kind: 'whole', min: 1, max: 1000, what: 'the strike steps each side kept' }),
|
|
406
490
|
carry: Object.freeze({ kind: 'flag', what: "the next bar's drawn strikes kept too", fallback: 0 }),
|
|
407
491
|
levels: Object.freeze({ kind: 'flag', what: 'one levels row per bar', fallback: 0 }),
|
|
492
|
+
curve: Object.freeze({
|
|
493
|
+
kind: 'flag',
|
|
494
|
+
what: "one curve row after each levels row: the gamma curve's net GEX at spot, its flip, spot and the rows' clock",
|
|
495
|
+
fallback: 0,
|
|
496
|
+
}),
|
|
408
497
|
}),
|
|
409
498
|
});
|
|
410
499
|
/** What `expiries` takes beside the strike kit fold (the SDK's `WRUN_OPTION_STRIKES_KIT_EXPIRIES_TAKES`, kit 0.91.1):
|
|
411
500
|
* the fold keeps its expiries with its own `nearest`, so any other word beside it is refused at declaration. */
|
|
412
501
|
export const WRUN_OPTION_STRIKES_KIT_EXPIRIES_TAKES = '"all" (or no expiries) beside fold "kit": the fold keeps its expiries with its own `nearest`';
|
|
502
|
+
/** What `curve` takes beside the strike kit fold (the SDK's `WRUN_OPTION_STRIKES_KIT_CURVE_TAKES`, kit 0.96.0): the
|
|
503
|
+
* curve row follows each bar's levels row, so `curve: true` without `levels: true` is refused at declaration. */
|
|
504
|
+
export const WRUN_OPTION_STRIKES_KIT_CURVE_TAKES = "true only beside levels: true (the curve row follows each bar's levels row), or false";
|
|
413
505
|
/** A per-bar class, or undefined for a class that declares no per-bar word. */
|
|
414
506
|
export function wrunOptionLaneClassOf(sourceClass) {
|
|
415
507
|
return sourceClass === 'option_surface' || sourceClass === 'option_strikes' ? sourceClass : undefined;
|
|
@@ -516,6 +608,10 @@ export function wrunOptionLaneAskOf(source) {
|
|
|
516
608
|
if (cls === 'option_strikes' && word === 'kit' && source.expiries !== undefined && source.expiries !== 'all') {
|
|
517
609
|
issues.push({ knob: 'expiries', value: source.expiries, takes: WRUN_OPTION_STRIKES_KIT_EXPIRIES_TAKES });
|
|
518
610
|
}
|
|
611
|
+
// The kit fold's curve row follows each bar's levels row: curve without levels refuses by name (kit 0.96.0).
|
|
612
|
+
if (cls === 'option_strikes' && word === 'kit' && source.curve === true && source.levels !== true) {
|
|
613
|
+
issues.push({ knob: 'curve', value: source.curve, takes: WRUN_OPTION_STRIKES_KIT_CURVE_TAKES });
|
|
614
|
+
}
|
|
519
615
|
if (issues.length > 0 || word === undefined)
|
|
520
616
|
return { issue: issues[0] };
|
|
521
617
|
const params = {};
|
|
@@ -547,30 +643,74 @@ export const WRUN_OPTION_VIEW_ROW_WIDTHS = Object.freeze({
|
|
|
547
643
|
option_contract_state: 16,
|
|
548
644
|
option_strikes: 14,
|
|
549
645
|
});
|
|
550
|
-
/** Column 0 of every strike kit fold row (the SDK's `WRUN_OPTION_STRIKES_KIT_LAYOUTS`)
|
|
551
|
-
|
|
646
|
+
/** Column 0 of every strike kit fold row (the SDK's `WRUN_OPTION_STRIKES_KIT_LAYOUTS`): a strike row, a bar's levels
|
|
647
|
+
* row and, with `curve` (kit 0.96.0), its curve row after the levels row. */
|
|
648
|
+
export const WRUN_OPTION_STRIKES_KIT_LAYOUTS = Object.freeze({ strike: 0, levels: 1, curve: 2 });
|
|
552
649
|
/** The column of a kit levels row that says the bar was refused (its newest minute held more rows than the input's
|
|
553
650
|
* `max_cells`): 1 refused, 0 served. */
|
|
554
651
|
export const WRUN_OPTION_STRIKES_KIT_REFUSED_COLUMN = 13;
|
|
652
|
+
/**
|
|
653
|
+
* `option_strikes`' strike velocity knob (contract H; the om schema takes the knob by this name and shape): a literal
|
|
654
|
+
* list of 1 to 7 distinct windows in minutes, each one of `WRUN_OPTION_STRIKES_VELOCITY_WINDOWS`, in the order its
|
|
655
|
+
* columns take. A setting's handle (`"@param"`) never names it: the windows size the block, and a setting never
|
|
656
|
+
* resizes one (`wrunOptionInputTupleWidth`).
|
|
657
|
+
*/
|
|
658
|
+
export const WRUN_OPTION_STRIKES_VELOCITY_KNOB = 'velocity_windows';
|
|
659
|
+
/** The windows the gateway answers velocity over (tsdb-gateway `optionStrikeVelocityWindows`), in minutes. */
|
|
660
|
+
export const WRUN_OPTION_STRIKES_VELOCITY_WINDOWS = Object.freeze([1, 5, 10, 15, 60, 240, 1440]);
|
|
661
|
+
/** What `velocity_windows` takes, for a refusal. */
|
|
662
|
+
export const WRUN_OPTION_STRIKES_VELOCITY_TAKES = 'a list of 1 to 7 distinct windows in minutes, each one of 1, 5, 10, 15, 60, 240 and 1440';
|
|
663
|
+
/** The ask's field the windows ride (the K control copies it, the worker twin reads it), in the knob's order. */
|
|
664
|
+
export const WRUN_OPTION_STRIKES_VELOCITY_FIELD = 'strikeVelocityWindowsMin';
|
|
665
|
+
/**
|
|
666
|
+
* The velocity lists a tuple appends after `underlying` when the knob is set, in this order, each one entry per window
|
|
667
|
+
* in the knob's order: the change of net GEX, net DEX, net VEX, and the open interest (calls plus puts, in contracts).
|
|
668
|
+
*/
|
|
669
|
+
export const WRUN_OPTION_STRIKES_VELOCITY_LISTS = Object.freeze([
|
|
670
|
+
'net_gex_velocity',
|
|
671
|
+
'net_dex_velocity',
|
|
672
|
+
'net_vex_velocity',
|
|
673
|
+
'oi_velocity',
|
|
674
|
+
]);
|
|
675
|
+
/** A `velocity_windows` value's windows in its own order, or undefined for a value outside the knob's words. */
|
|
676
|
+
export function wrunOptionStrikesVelocityWindows(value) {
|
|
677
|
+
if (!Array.isArray(value) || value.length < 1 || value.length > WRUN_OPTION_STRIKES_VELOCITY_WINDOWS.length) {
|
|
678
|
+
return undefined;
|
|
679
|
+
}
|
|
680
|
+
if (!value.every((window) => typeof window === 'number' && WRUN_OPTION_STRIKES_VELOCITY_WINDOWS.includes(window))) {
|
|
681
|
+
return undefined;
|
|
682
|
+
}
|
|
683
|
+
return new Set(value).size === value.length ? [...value] : undefined;
|
|
684
|
+
}
|
|
685
|
+
/** The f64s per tuple of a velocity read: the class's tuple, then one value per list per window. */
|
|
686
|
+
export function wrunOptionStrikesVelocityWidth(classWidth, windows) {
|
|
687
|
+
return classWidth + WRUN_OPTION_STRIKES_VELOCITY_LISTS.length * windows.length;
|
|
688
|
+
}
|
|
689
|
+
/** Whether page view words name a fold of `cls` (the SDK's `wrunOptionViewWordsFold` on a page view class). */
|
|
690
|
+
function pageViewWordsFold(cls, words) {
|
|
691
|
+
return words.some((word) => {
|
|
692
|
+
const spec = wrunOptionViewSpec(word);
|
|
693
|
+
return spec?.cls === cls && spec.answer === 'fold';
|
|
694
|
+
});
|
|
695
|
+
}
|
|
555
696
|
/**
|
|
556
697
|
* The f64s per tuple one input's block carries (the SDK's `wrunOptionInputTupleWidth`, the one rule every host sizes
|
|
557
|
-
* by): a view block's row width when its words name a fold (a page view fold, the strike kit fold),
|
|
558
|
-
*
|
|
698
|
+
* by): a view block's row width when its words name a fold (a page view fold, the strike kit fold), the class's tuple
|
|
699
|
+
* and its velocity lists when an `option_strikes` input names `velocity_windows` (`wrunOptionStrikesVelocityWidth`;
|
|
700
|
+
* the kit sizes it so from the om schema's knob on, `WRUN_OPTION_STRIKES_VELOCITY_SERVED`), else the class's own
|
|
701
|
+
* width. The words alone decide it, never a param, so a setting never resizes a block.
|
|
559
702
|
*/
|
|
560
703
|
export function wrunOptionInputTupleWidth(source, classWidth) {
|
|
561
704
|
const cls = source.source;
|
|
562
705
|
if (cls === 'option_strikes') {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
706
|
+
if (source[WRUN_OPTION_LANE_WORDS.option_strikes.knob] === 'kit')
|
|
707
|
+
return WRUN_OPTION_VIEW_ROW_WIDTHS.option_strikes;
|
|
708
|
+
const windows = wrunOptionStrikesVelocityWindows(source[WRUN_OPTION_STRIKES_VELOCITY_KNOB]);
|
|
709
|
+
return windows === undefined ? classWidth : wrunOptionStrikesVelocityWidth(classWidth, windows);
|
|
566
710
|
}
|
|
567
711
|
if (cls !== 'options_chain' && cls !== 'option_contract_state')
|
|
568
712
|
return classWidth;
|
|
569
|
-
|
|
570
|
-
const spec = wrunOptionViewSpec(word);
|
|
571
|
-
return spec?.cls === cls && spec.answer === 'fold';
|
|
572
|
-
});
|
|
573
|
-
return folds ? WRUN_OPTION_VIEW_ROW_WIDTHS[cls] : classWidth;
|
|
713
|
+
return pageViewWordsFold(cls, wrunOptionViewWordsDeclared(source)) ? WRUN_OPTION_VIEW_ROW_WIDTHS[cls] : classWidth;
|
|
574
714
|
}
|
|
575
715
|
/** pb-common `OptionSurfacePick` by word (the gateway decodes numbers, never names). */
|
|
576
716
|
export const WRUN_OPTION_SURFACE_PICK_CODES = Object.freeze({
|
|
@@ -580,13 +720,15 @@ export const WRUN_OPTION_SURFACE_PICK_CODES = Object.freeze({
|
|
|
580
720
|
/** pb-common `StrikeMetric` by the kit fold's lens code (0 gamma, 1 delta, 2 vega): NET_GEX, DEX, VEX. */
|
|
581
721
|
export const WRUN_OPTION_STRIKES_KIT_METRICS = Object.freeze({ 0: 1, 1: 2, 2: 3 });
|
|
582
722
|
/**
|
|
583
|
-
* The `OptionReadShape` G5 fields (pb-common 12.
|
|
723
|
+
* The `OptionReadShape` G5 fields (pb-common 12.74.0, fields 40 to 53) a per-bar ask names, as they ride the lane's
|
|
584
724
|
* payload and the gateway reads them (JSON names, enums as numbers):
|
|
585
725
|
* - the surface pick: `surfacePick` (1 nearest_days, 2 tenor_bracket) with `surfaceDays` and `surfaceDelta` (25 or
|
|
586
726
|
* 10, the wings) or `surfaceTenorDays`;
|
|
587
727
|
* - the strike kit fold: `strikeKitFold`, `strikeNearest`, `strikeKitWindowPct`, `strikeStepRows`, `strikeCarryNext`,
|
|
588
728
|
* `strikeLevels`, `strikeMaxCells` (the input's `max_cells`: a minute with more rows answers a refused levels row)
|
|
589
|
-
* and `strikeKitMetric` (the lens)
|
|
729
|
+
* and `strikeKitMetric` (the lens); with `curve` (OPTLOAD W3 U4) `strikeKitCurve` and `strikeKitMultiplier` (the
|
|
730
|
+
* chart's `market.option_multiplier()`, `facts.optionMultiplier`; 0, which the gateway reads as 1, when unknown),
|
|
731
|
+
* both or neither, so an input without `curve` asks exactly what it asked before.
|
|
590
732
|
* The fields key the lane instance, so two inputs asking two picks are two reads, and an input declaring no word asks
|
|
591
733
|
* none of them (today's read).
|
|
592
734
|
*/
|
|
@@ -610,6 +752,7 @@ export function wrunOptionLaneAskFields(ask, facts = {}) {
|
|
|
610
752
|
strikeLevels: params.levels === 1,
|
|
611
753
|
...(facts.maxCells !== undefined ? { strikeMaxCells: facts.maxCells } : {}),
|
|
612
754
|
strikeKitMetric: WRUN_OPTION_STRIKES_KIT_METRICS[params.lens] ?? WRUN_OPTION_STRIKES_KIT_METRICS[0],
|
|
755
|
+
...(params.curve === 1 ? { strikeKitCurve: true, strikeKitMultiplier: facts.optionMultiplier ?? 0 } : {}),
|
|
613
756
|
};
|
|
614
757
|
}
|
|
615
758
|
/** The payload fields of a per-bar ask, by class (the K controls copy exactly these onto the request they build). */
|
|
@@ -624,6 +767,8 @@ const WRUN_OPTION_LANE_PAYLOAD_FIELDS = Object.freeze({
|
|
|
624
767
|
'strikeLevels',
|
|
625
768
|
'strikeMaxCells',
|
|
626
769
|
'strikeKitMetric',
|
|
770
|
+
'strikeKitCurve',
|
|
771
|
+
'strikeKitMultiplier',
|
|
627
772
|
]),
|
|
628
773
|
});
|
|
629
774
|
/** A per-bar ask's fields of a payload, as they ride (a K control copies them onto the request it builds). */
|
|
@@ -673,6 +818,11 @@ export function wrunOptionLaneAskOfPayload(cls, payload) {
|
|
|
673
818
|
}
|
|
674
819
|
read.strikeCarryNext = payload.strikeCarryNext === true;
|
|
675
820
|
read.strikeLevels = payload.strikeLevels === true;
|
|
821
|
+
// The curve rides with its multiplier, both or neither (a multiplier without the curve is no ask of it).
|
|
822
|
+
if (payload.strikeKitCurve === true) {
|
|
823
|
+
read.strikeKitCurve = true;
|
|
824
|
+
read.strikeKitMultiplier = finiteOrUndefined(payload.strikeKitMultiplier) ?? 0;
|
|
825
|
+
}
|
|
676
826
|
return read;
|
|
677
827
|
}
|
|
678
828
|
/** The kit fold's params by knob (the SDK reference's names) off a payload's ask, the lens back to its code. */
|
|
@@ -685,6 +835,7 @@ export function wrunOptionStrikesKitParamsOf(read) {
|
|
|
685
835
|
step_rows: read.strikeStepRows ?? 48,
|
|
686
836
|
carry: read.strikeCarryNext === true ? 1 : 0,
|
|
687
837
|
levels: read.strikeLevels === true ? 1 : 0,
|
|
838
|
+
curve: read.strikeKitCurve === true ? 1 : 0,
|
|
688
839
|
};
|
|
689
840
|
}
|
|
690
841
|
/** Whether a lane instance's acquisition asks a per-bar word (a pick or the kit fold): its rows are landed on the
|
|
@@ -708,18 +859,47 @@ export function wrunOptionKitBarHasRows(tuples) {
|
|
|
708
859
|
tuple[0] === WRUN_OPTION_STRIKES_KIT_LAYOUTS.levels &&
|
|
709
860
|
tuple[WRUN_OPTION_STRIKES_KIT_REFUSED_COLUMN] === 1);
|
|
710
861
|
}
|
|
711
|
-
/**
|
|
712
|
-
*
|
|
862
|
+
/**
|
|
863
|
+
* The f64s per row an instance's rows carry, by its facets (the SDK's `wrunAskTupleWidth`, the ask's side of
|
|
864
|
+
* `wrunOptionInputTupleWidth`: the views ride the instance's key, so every input it serves shares its width): the kit
|
|
865
|
+
* fold's rows on an instance asking it, the class's tuple and its velocity lists on an `option_strikes` instance asking
|
|
866
|
+
* velocity windows (`WRUN_OPTION_STRIKES_VELOCITY_FIELD`), a view block's rows on one whose views (`<prefix>Views`) name
|
|
867
|
+
* a fold of its class (Top Contracts' totals), else the class's own tuple (`classWidth`).
|
|
868
|
+
*/
|
|
713
869
|
export function wrunOptionLaneTupleWidth(sourceClass, acquisition, classWidth) {
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
870
|
+
if (sourceClass === 'option_strikes') {
|
|
871
|
+
if (acquisition.strikeKitFold === true)
|
|
872
|
+
return WRUN_OPTION_VIEW_ROW_WIDTHS.option_strikes;
|
|
873
|
+
const windows = wrunOptionStrikesVelocityWindows(acquisition[WRUN_OPTION_STRIKES_VELOCITY_FIELD]);
|
|
874
|
+
return windows === undefined ? classWidth : wrunOptionStrikesVelocityWidth(classWidth, windows);
|
|
875
|
+
}
|
|
876
|
+
if (sourceClass !== 'options_chain' && sourceClass !== 'option_contract_state')
|
|
877
|
+
return classWidth;
|
|
878
|
+
const text = acquisition[`${WRUN_OPTION_VIEW_PREFIX[sourceClass]}Views`];
|
|
879
|
+
return pageViewWordsFold(sourceClass, viewWordsOfText(text)) ? WRUN_OPTION_VIEW_ROW_WIDTHS[sourceClass] : classWidth;
|
|
880
|
+
}
|
|
881
|
+
/** The view words a `<prefix>Views` text names, unvalidated (the width reads the words alone, as the SDK's
|
|
882
|
+
* `wrunAskTupleWidth` does); none for a text that is no list of views. */
|
|
883
|
+
function viewWordsOfText(text) {
|
|
884
|
+
if (typeof text !== 'string')
|
|
885
|
+
return [];
|
|
886
|
+
let parsed;
|
|
887
|
+
try {
|
|
888
|
+
parsed = JSON.parse(text);
|
|
889
|
+
}
|
|
890
|
+
catch {
|
|
891
|
+
return [];
|
|
892
|
+
}
|
|
893
|
+
return Array.isArray(parsed)
|
|
894
|
+
? parsed.map((view) => (view !== null && typeof view === 'object' ? view.view : undefined))
|
|
895
|
+
: [];
|
|
717
896
|
}
|
|
718
|
-
/** The rows a strike kit fold bar is projected to hold for the first paint: the levels row
|
|
719
|
-
* within `step_rows` + 1 finest steps each side of the centre, the finest pair
|
|
897
|
+
/** The rows a strike kit fold bar is projected to hold for the first paint: the levels row (and the curve row on an
|
|
898
|
+
* ask naming it), the window's strikes within `step_rows` + 1 finest steps each side of the centre, the finest pair
|
|
899
|
+
* and the two edges. */
|
|
720
900
|
function wrunOptionStrikesKitBarRows(acquisition) {
|
|
721
901
|
const stepRows = finiteOrUndefined(acquisition.strikeStepRows) ?? 48;
|
|
722
|
-
return 1 + 2 * (Math.max(0, stepRows) + 1) + 1 + 4;
|
|
902
|
+
return (acquisition.strikeKitCurve === true ? 2 : 1) + 2 * (Math.max(0, stepRows) + 1) + 1 + 4;
|
|
723
903
|
}
|
|
724
904
|
/**
|
|
725
905
|
* The row budget the first-paint slice sizes an instance asking a per-bar word by (wrun-row-lane-first-paint.util, the
|
|
@@ -831,23 +1011,38 @@ export function wrunOptionSurfacePickTuples(tuples, word, params) {
|
|
|
831
1011
|
}
|
|
832
1012
|
/**
|
|
833
1013
|
* The chart's chain on the OPRA plane by coin, held in place of the chain directory's answer (section 8, O1): the
|
|
834
|
-
* chain `wrunLaneOpraPlaneChain` reads for the
|
|
835
|
-
*
|
|
836
|
-
*
|
|
837
|
-
*
|
|
838
|
-
*
|
|
839
|
-
*
|
|
1014
|
+
* chain `wrunLaneOpraPlaneChain` reads for the coin when the chart's options ride the OPRA plane. With the planner's
|
|
1015
|
+
* verdict (`opraPlane`, which the lane context carries: a stock twin's context names its stock's ticker as the coin) the
|
|
1016
|
+
* coin is read as given; without one the market is judged through the options seam (the gate port's
|
|
1017
|
+
* `chartOptionsMarket`, then `governedOptionPlane` over the market it answers, exchange and `symbol` both: the
|
|
1018
|
+
* predicate the planners' `isOpraPlaneExchange` is), and a stock twin's chain is its stock's, by the twin's ticker,
|
|
1019
|
+
* never the chart's own coin, naming the chart market (`stockTwinOf`). Undefined off the plane, for a chart naming no
|
|
1020
|
+
* coin, and while another screen holds the plane's session (the directory resolution then stops by that name before
|
|
1021
|
+
* any read). Main thread only; the lane resolver loads lazily (this module stays light: the paint seam reads its view
|
|
1022
|
+
* table).
|
|
840
1023
|
*/
|
|
841
|
-
export async function wrunHeldOpraPlaneChain(exchange, coin, opraPlane) {
|
|
1024
|
+
export async function wrunHeldOpraPlaneChain(exchange, coin, opraPlane, symbol) {
|
|
842
1025
|
if (typeof coin !== 'string' || coin.trim() === '' || gateSessionHeldElsewhere('opra'))
|
|
843
1026
|
return undefined;
|
|
844
1027
|
let onPlane = opraPlane;
|
|
1028
|
+
let heldCoin = coin;
|
|
1029
|
+
let stockTwinOf;
|
|
845
1030
|
if (onPlane === undefined) {
|
|
846
|
-
const
|
|
847
|
-
|
|
1031
|
+
const gate = await wrunChartHostEnv().market.loadOptionsGate();
|
|
1032
|
+
const chart = {
|
|
1033
|
+
exchange: typeof exchange === 'string' ? exchange : undefined,
|
|
1034
|
+
symbol: typeof symbol === 'string' ? symbol : undefined,
|
|
1035
|
+
coin,
|
|
1036
|
+
};
|
|
1037
|
+
const market = gate.chartOptionsMarket?.(chart) ?? chart;
|
|
1038
|
+
onPlane = gate.governedOptionPlane(market) === 'opra';
|
|
1039
|
+
if (market.twinOf !== undefined && typeof market.coin === 'string' && market.coin.trim() !== '') {
|
|
1040
|
+
heldCoin = market.coin;
|
|
1041
|
+
stockTwinOf = market.twinOf;
|
|
1042
|
+
}
|
|
848
1043
|
}
|
|
849
1044
|
if (!onPlane)
|
|
850
1045
|
return undefined;
|
|
851
1046
|
const { wrunLaneOpraPlaneChain } = await import('./sources/opra-option-lanes.util.js');
|
|
852
|
-
return wrunLaneOpraPlaneChain(
|
|
1047
|
+
return wrunLaneOpraPlaneChain(heldCoin, stockTwinOf);
|
|
853
1048
|
}
|
|
@@ -38,7 +38,8 @@ export declare function wrunLaneGatePlanes(facts: WrunGateLaneFacts): Map<string
|
|
|
38
38
|
* A run's lane thunks with every lane on a plane another screen holds (`heldElsewhere`, read at dispatch) answering
|
|
39
39
|
* at once with the typed stop instead of its read. Thunks are the run's shape: the builtin lanes by name (a function
|
|
40
40
|
* or undefined), and the lists of `[lane id, thunk]` pairs (trades legs, poll lanes, row lanes). Everything else is
|
|
41
|
-
* returned as it is.
|
|
41
|
+
* returned as it is. A lane that is sent gets every argument the lane runner hands its thunk (its abandon signal, so a
|
|
42
|
+
* lane asked in pieces stops at its budget; a row lane's early rows).
|
|
42
43
|
*/
|
|
43
44
|
export declare function wrunGateLatchedThunks<T extends object>(thunks: T, planes: ReadonlyMap<string, WrunRefusalGatePlane>, heldElsewhere: (plane: WrunRefusalGatePlane) => boolean): T;
|
|
44
45
|
/**
|
|
@@ -85,7 +85,8 @@ export function wrunLaneGatePlanes(facts) {
|
|
|
85
85
|
* A run's lane thunks with every lane on a plane another screen holds (`heldElsewhere`, read at dispatch) answering
|
|
86
86
|
* at once with the typed stop instead of its read. Thunks are the run's shape: the builtin lanes by name (a function
|
|
87
87
|
* or undefined), and the lists of `[lane id, thunk]` pairs (trades legs, poll lanes, row lanes). Everything else is
|
|
88
|
-
* returned as it is.
|
|
88
|
+
* returned as it is. A lane that is sent gets every argument the lane runner hands its thunk (its abandon signal, so a
|
|
89
|
+
* lane asked in pieces stops at its budget; a row lane's early rows).
|
|
89
90
|
*/
|
|
90
91
|
export function wrunGateLatchedThunks(thunks, planes, heldElsewhere) {
|
|
91
92
|
if (planes.size === 0)
|
|
@@ -94,7 +95,7 @@ export function wrunGateLatchedThunks(thunks, planes, heldElsewhere) {
|
|
|
94
95
|
const plane = planes.get(lane);
|
|
95
96
|
if (plane === undefined)
|
|
96
97
|
return run;
|
|
97
|
-
return () => heldElsewhere(plane) ? Promise.reject(new WrunLaneStoppedError('session-elsewhere', plane, lane)) : run();
|
|
98
|
+
return (...args) => heldElsewhere(plane) ? Promise.reject(new WrunLaneStoppedError('session-elsewhere', plane, lane)) : run(...args);
|
|
98
99
|
};
|
|
99
100
|
const out = { ...thunks };
|
|
100
101
|
for (const [key, value] of Object.entries(out)) {
|
|
@@ -29,6 +29,9 @@ export declare const WRUN_CANDLE_STYLES: readonly ["candle", "hollow", "ohlc", "
|
|
|
29
29
|
export declare const WRUN_BAR_GRADINGS: readonly ["linear", "square"];
|
|
30
30
|
/** The on-line label pill of a guide (OT10). */
|
|
31
31
|
export declare const WRUN_PILL_STYLES: readonly ["filled", "outlined"];
|
|
32
|
+
/** The axis tag look of a guide with `axis_label: true` (kit scaffold 102,
|
|
33
|
+
* the kit's `WRUN_OUTPUT_AXIS_LOOKS`). */
|
|
34
|
+
export declare const WRUN_AXIS_LOOKS: readonly ["pill", "quiet", "words"];
|
|
32
35
|
/** The pane's value scale (OT18) and the engine value mode it maps to. */
|
|
33
36
|
export declare const WRUN_PANE_SCALES: readonly ["linear", "log", "percent", "indexed"];
|
|
34
37
|
/** Where a pane sits (OT24). */
|
|
@@ -110,8 +113,9 @@ export declare function wrunOutputLookPatch(output: WrunMetadataOutput, mount: W
|
|
|
110
113
|
/** The hline fields a `role: "guide"` output adds (OT10): the on-line label
|
|
111
114
|
* (`align` places the output's `label`, `pill_style` and `font_size` dress
|
|
112
115
|
* it), the axis pill (`axis_label: true` puts value + label on the axis
|
|
113
|
-
* instead
|
|
114
|
-
*
|
|
116
|
+
* instead, `axis_look` picks the tag's look as `axisTagLook`), the constant
|
|
117
|
+
* `value` and the paint order. `lastValue` is the output's last finite value
|
|
118
|
+
* (NaN when the run never gave one). */
|
|
115
119
|
export declare function wrunGuideLook(output: WrunMetadataOutput, lastValue: number, label: string): Record<string, unknown>;
|
|
116
120
|
/** The candle look a group's first output declares (OT17): the body style
|
|
117
121
|
* as the engine plot kind, the border and wick pairs (faded by the group's
|
|
@@ -52,6 +52,9 @@ const WRUN_CANDLE_PLOT_TYPES = {
|
|
|
52
52
|
export const WRUN_BAR_GRADINGS = ['linear', 'square'];
|
|
53
53
|
/** The on-line label pill of a guide (OT10). */
|
|
54
54
|
export const WRUN_PILL_STYLES = ['filled', 'outlined'];
|
|
55
|
+
/** The axis tag look of a guide with `axis_label: true` (kit scaffold 102,
|
|
56
|
+
* the kit's `WRUN_OUTPUT_AXIS_LOOKS`). */
|
|
57
|
+
export const WRUN_AXIS_LOOKS = ['pill', 'quiet', 'words'];
|
|
55
58
|
const WRUN_GUIDE_ALIGNS = ['left', 'center', 'right'];
|
|
56
59
|
const WRUN_GRADIENT_MODES = ['pane', 'fill', 'line'];
|
|
57
60
|
const WRUN_LINE_STYLE_WORDS = ['solid', 'dashed', 'dotted'];
|
|
@@ -421,6 +424,9 @@ export function wrunOutputLookPatch(output, mount, ctx) {
|
|
|
421
424
|
if (output.price_line)
|
|
422
425
|
patch.showLastValueLine = true;
|
|
423
426
|
}
|
|
427
|
+
// A guide's axis tag look (scaffold 102): wrunGuideLook maps it, any other output refuses it by name.
|
|
428
|
+
if (output.axis_look !== undefined && !guide)
|
|
429
|
+
throw refusal(sheetId, subject, 'axis_look needs role "guide"');
|
|
424
430
|
// OT04, OT16, OT32.
|
|
425
431
|
Object.assign(patch, zOrderPatch(output.z, subject, sheetId));
|
|
426
432
|
Object.assign(patch, glowPatch(output.glow, subject, sheetId));
|
|
@@ -569,8 +575,9 @@ export function wrunOutputLookPatch(output, mount, ctx) {
|
|
|
569
575
|
/** The hline fields a `role: "guide"` output adds (OT10): the on-line label
|
|
570
576
|
* (`align` places the output's `label`, `pill_style` and `font_size` dress
|
|
571
577
|
* it), the axis pill (`axis_label: true` puts value + label on the axis
|
|
572
|
-
* instead
|
|
573
|
-
*
|
|
578
|
+
* instead, `axis_look` picks the tag's look as `axisTagLook`), the constant
|
|
579
|
+
* `value` and the paint order. `lastValue` is the output's last finite value
|
|
580
|
+
* (NaN when the run never gave one). */
|
|
574
581
|
export function wrunGuideLook(output, lastValue, label) {
|
|
575
582
|
const subject = `output '${output.name}'`;
|
|
576
583
|
const patch = { value: lastValue };
|
|
@@ -609,6 +616,17 @@ export function wrunGuideLook(output, lastValue, label) {
|
|
|
609
616
|
patch.axisLabel = true;
|
|
610
617
|
patch.label = label;
|
|
611
618
|
}
|
|
619
|
+
// The look of the tag `axis_label: true` puts on the axis (kit scaffold 102). An engine that predates the field
|
|
620
|
+
// ignores it and draws today's pill.
|
|
621
|
+
if (output.axis_look !== undefined) {
|
|
622
|
+
if (!isWord(WRUN_AXIS_LOOKS, output.axis_look)) {
|
|
623
|
+
throw refusal(undefined, subject, `axis_look must be one of ${wordList(WRUN_AXIS_LOOKS)}`);
|
|
624
|
+
}
|
|
625
|
+
if (output.axis_label !== true) {
|
|
626
|
+
throw refusal(undefined, subject, "axis_look needs axis_label: true (the look of the guide's axis tag)");
|
|
627
|
+
}
|
|
628
|
+
patch.axisTagLook = output.axis_look;
|
|
629
|
+
}
|
|
612
630
|
Object.assign(patch, zOrderPatch(output.z, subject, undefined));
|
|
613
631
|
return patch;
|
|
614
632
|
}
|