@orangecharts/wrun-chart-host 0.7.1 → 0.8.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 +25 -3
- package/dist/constants/feature-flags.constants.d.ts +1 -0
- package/dist/constants/feature-flags.constants.js +5 -0
- package/dist/constants/option-venues.constants.d.ts +18 -0
- package/dist/constants/option-venues.constants.js +14 -0
- package/dist/constants/venue-presets.constants.d.ts +17 -3
- package/dist/constants/venue-presets.constants.js +17 -3
- package/dist/host-env.d.ts +24 -0
- package/dist/host-env.js +21 -0
- package/dist/host-ports.types.d.ts +12 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +16 -0
- package/dist/indicators/controls/tpo-session.util.d.ts +40 -11
- package/dist/indicators/controls/tpo-session.util.js +138 -14
- package/dist/interfaces/option-instrument.interface.d.ts +6 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +4 -0
- package/dist/kscript-data/controls/live-trades-merge.util.js +4 -0
- package/dist/settings-templates/footprint-rows.d.ts +25 -0
- package/dist/settings-templates/footprint-rows.js +127 -0
- package/dist/settings-templates/form-rows.d.ts +56 -0
- package/dist/settings-templates/form-rows.js +19 -0
- package/dist/settings-templates/frvp-fields.js +14 -0
- package/dist/settings-templates/index.d.ts +10 -1
- package/dist/settings-templates/index.js +11 -2
- package/dist/settings-templates/indicator-fields.js +78 -0
- package/dist/settings-templates/tool-rules.d.ts +35 -9
- package/dist/settings-templates/tool-rules.js +42 -8
- package/dist/settings-templates/tool-tables.generated.js +13 -2
- package/dist/utility/chart/candle-volume-unit.leaf.d.ts +16 -0
- package/dist/utility/chart/candle-volume-unit.leaf.js +61 -0
- package/dist/utility/chart/footprint-columns.util.d.ts +74 -0
- package/dist/utility/chart/footprint-columns.util.js +106 -0
- package/dist/utility/chart/footprint-display-mode.util.d.ts +40 -0
- package/dist/utility/chart/footprint-display-mode.util.js +62 -0
- package/dist/utility/chart/footprint-sierra-look.util.d.ts +2 -0
- package/dist/utility/chart/footprint-sierra-look.util.js +37 -0
- package/dist/utility/chart/kscript-venue-policy.util.js +4 -2
- package/dist/utility/chart/om-panel.util.d.ts +11 -0
- package/dist/utility/chart/om-panel.util.js +59 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +23 -1
- package/dist/utility/chart/window-geometry.leaf.js +78 -6
- package/dist/utility/chart/window-owner.leaf.d.ts +13 -0
- package/dist/utility/chart/window-owner.leaf.js +5 -0
- package/dist/utility/options/cme-options-root.util.d.ts +25 -0
- package/dist/utility/options/cme-options-root.util.js +40 -0
- package/dist/utility/options/option-book.util.d.ts +27 -0
- package/dist/utility/options/option-book.util.js +76 -0
- package/dist/utility/options/option-trade-date.util.d.ts +50 -0
- package/dist/utility/options/option-trade-date.util.js +120 -0
- package/dist/utility/wrun/sources/host-grid-landing.d.ts +4 -2
- package/dist/utility/wrun/sources/host-grid-landing.js +8 -0
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +40 -4
- package/dist/utility/wrun/sources/lanes/options_flow.js +115 -18
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +12 -9
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +10 -7
- package/dist/utility/wrun/sources/row-lane-registry.js +9 -5
- package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +3 -2
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +30 -5
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +14 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +100 -23
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.d.ts +4 -0
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +65 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +47 -1
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +71 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +14 -1
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +30 -2
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +7 -1
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +45 -5
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +115 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +10 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +57 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +60 -6
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +160 -23
- package/dist/utility/wrun/wrun-cloud-record.leaf.d.ts +27 -0
- package/dist/utility/wrun/wrun-cloud-record.leaf.js +71 -0
- package/dist/utility/wrun/wrun-cloud-record.util.d.ts +4 -21
- package/dist/utility/wrun/wrun-cloud-record.util.js +5 -65
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-color-settings.util.js +26 -11
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-draft-overlay.util.js +40 -3
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +1 -1
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +4 -0
- package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +29 -3
- package/dist/utility/wrun/wrun-lane-refusal.leaf.js +33 -3
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -1
- package/dist/utility/wrun/wrun-live-tick.util.js +39 -6
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +106 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +159 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +44 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +213 -0
- package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +43 -8
- package/dist/utility/wrun/wrun-opra-flow.leaf.js +37 -6
- package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +51 -10
- package/dist/utility/wrun/wrun-option-contract-flow.util.js +85 -33
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +133 -3
- package/dist/utility/wrun/wrun-option-prints.util.js +318 -8
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +96 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +215 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +342 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +742 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +183 -3
- package/dist/utility/wrun/wrun-option-views.util.js +504 -7
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +6 -4
- package/dist/utility/wrun/wrun-options-chain.util.js +8 -5
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +7 -2
- package/dist/utility/wrun/wrun-overlay-run.util.js +120 -18
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +15 -0
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +22 -0
- package/dist/utility/wrun/wrun-pack.util.d.ts +9 -8
- package/dist/utility/wrun/wrun-pack.util.js +21 -15
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +62 -22
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +17 -2
- package/dist/utility/wrun/wrun-panel-style.util.js +47 -9
- package/dist/utility/wrun/wrun-pin-spelling.util.js +19 -10
- package/dist/utility/wrun/wrun-refusal.util.js +7 -1
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +43 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-tape-source.util.js +18 -0
- package/package.json +3 -3
|
@@ -27,11 +27,22 @@
|
|
|
27
27
|
* decided when the run plans and named in the acquisition, `auto` the chain's default book over the series its
|
|
28
28
|
* directory lists, opra-option-lanes.util `resolveWrunLaneChainAutoBook`; an answer never picks it) and `max_cells`
|
|
29
29
|
* (a block over it refuses the run); a market pin and the other options classes' knobs refuse by name.
|
|
30
|
+
* - `pick` (OPTLOAD G5, kit 0.90.0; wrun-option-views.util): "nearest_days" (`days`, `delta`) or "tenor_bracket"
|
|
31
|
+
* (`tenor`), each param a number (a setting's value once the paint seam wrote it), refused by the SDK's rules by
|
|
32
|
+
* name (`wrun_option_knob_invalid`). Each bar's block is the pick of its landed bucket (`wrunOptionSurfacePickTuples`,
|
|
33
|
+
* the SDK's reference), so the template reads the one or two tuples it reads today. The pick's fields ride the
|
|
34
|
+
* acquisition (`surfacePick` and its params, with the run's bar span), so the worker asks OPTION_SURFACE grouped to
|
|
35
|
+
* the chart's bars with the pick applied there (`optionRead`: the gateway lands each bar on its newest sealed 5m
|
|
36
|
+
* bucket, as this lane lands it) and reads today's buckets while the gateway refuses the read; the pick applied on
|
|
37
|
+
* the page to a bar the gateway picked picks the same tuples. An input without `pick` asks and lands as before.
|
|
38
|
+
* - O1 (OPTLOAD G5): on the OPRA plane the chain is the plane's own by coin (`wrunHeldOpraPlaneChain`), no chain
|
|
39
|
+
* directory read.
|
|
30
40
|
*
|
|
31
41
|
* LIGHT at module load: pb-common and the chain resolver are imported inside `identity`.
|
|
32
42
|
*/
|
|
33
43
|
import { decideWrunLaneChain, refuseWrunLaneStrayKnob, resolveWrunLaneChainChart, WRUN_OPTION_CHART_UNRESOLVED_CODE, wrunLaneChainLeadMoved, wrunLaneChainPlaneOf, wrunLaneChartKey, } from '../opra-option-lanes.util.js';
|
|
34
44
|
import { refuseWrunPollInput } from '../wrun-poll-lane.types.js';
|
|
45
|
+
import { wrunHeldOpraPlaneChain, wrunOptionLaneAskFields, wrunOptionLaneAskOf, wrunOptionLaneAskOfSource, wrunOptionSurfacePickTuples, } from '../../wrun-option-views.util.js';
|
|
35
46
|
import { assertWrunProtocolType } from '../../wrun-protocol-pending.util.js';
|
|
36
47
|
import { wrunAuthorRuleSeed } from '../../wrun-refusal.util.js';
|
|
37
48
|
const MINUTE_MS = 60_000;
|
|
@@ -113,6 +124,14 @@ export function wrunOptionSurfaceReadsSettlements(acquisition) {
|
|
|
113
124
|
const exchange = acquisition[WRUN_OPTION_SURFACE_EXCHANGE_FIELD];
|
|
114
125
|
return wrunLaneChainPlaneOf(typeof exchange === 'string' ? exchange : '') === 'cme';
|
|
115
126
|
}
|
|
127
|
+
/** One input's block on one bar: the pick of the bar's tuples when the input declares `pick` (the SDK's reference,
|
|
128
|
+
* idempotent on a bar the gateway picked), else the tuples as they are. */
|
|
129
|
+
export function wrunOptionSurfaceCells(tuples, input) {
|
|
130
|
+
const read = wrunOptionLaneAskOf(input.source);
|
|
131
|
+
return read !== undefined && 'ask' in read
|
|
132
|
+
? wrunOptionSurfacePickTuples(tuples, read.ask.word, read.ask.params)
|
|
133
|
+
: tuples;
|
|
134
|
+
}
|
|
116
135
|
export const rowLane = {
|
|
117
136
|
sourceClass: 'option_surface',
|
|
118
137
|
laneKey: 'option_surface',
|
|
@@ -125,7 +144,9 @@ export const rowLane = {
|
|
|
125
144
|
acquisitionMoved: wrunOptionSurfaceAcquisitionMoved,
|
|
126
145
|
identity: async (ctx) => {
|
|
127
146
|
await assertWrunProtocolType(ctx, WRUN_OPTION_SURFACE_TYPE, 'option_surface');
|
|
128
|
-
|
|
147
|
+
// O1: on the OPRA plane the chain is the plane's own by coin, no chain directory read.
|
|
148
|
+
const held = await wrunHeldOpraPlaneChain(ctx.exchange, ctx.coin, ctx.opraPlane);
|
|
149
|
+
rememberSurfaceChart(wrunLaneChartKey(ctx), await resolveWrunLaneChainChart(ctx, held));
|
|
129
150
|
},
|
|
130
151
|
facets: async (source, ctx) => {
|
|
131
152
|
for (const [knob, owners] of STRAY_KNOBS) {
|
|
@@ -135,10 +156,17 @@ export const rowLane = {
|
|
|
135
156
|
if (source.symbol !== undefined || source.exchange !== undefined) {
|
|
136
157
|
refuseWrunPollInput(ctx, "pins option_surface cells to a fixed market (wrun_option_market_pinned); it reads the chart's own underlying, so drop the symbol and exchange pin", wrunAuthorRuleSeed('wrun_option_market_pinned'));
|
|
137
158
|
}
|
|
159
|
+
// The pick and its params, by the SDK's rules, before any chain read.
|
|
160
|
+
const pick = wrunOptionLaneAskOfSource(source, ctx);
|
|
138
161
|
const chart = surfaceCharts.get(wrunLaneChartKey(ctx));
|
|
139
162
|
if (chart === undefined) {
|
|
140
163
|
return refuseWrunPollInput(ctx, 'could not resolve the chart market for its options chain: Run again', wrunAuthorRuleSeed(WRUN_OPTION_CHART_UNRESOLVED_CODE));
|
|
141
164
|
}
|
|
142
|
-
|
|
165
|
+
const extras = wrunOptionSurfaceExtras(await decideWrunLaneChain(chart, { venue: source.venue, book: source.book }, ctx));
|
|
166
|
+
// A pick asks the gateway to land and pick each of the run's bars: its fields and the run's bar span.
|
|
167
|
+
return pick === undefined
|
|
168
|
+
? extras
|
|
169
|
+
: { ...extras, ...wrunOptionLaneAskFields(pick), hostIntervalMs: ctx.intervalMs };
|
|
143
170
|
},
|
|
171
|
+
cells: wrunOptionSurfaceCells,
|
|
144
172
|
};
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
import type { WrunInputSource } from '../../../interfaces/wrun-runtime.interface.js';
|
|
42
42
|
import type { WrunDailyLanding } from '../wrun-daily-lane.util.js';
|
|
43
43
|
import { type WrunRefusalSeed } from '../wrun-refusal.util.js';
|
|
44
|
-
import type { WrunBackendTier, WrunTierLanding } from '../wrun-tier-grid.util.js';
|
|
44
|
+
import type { WrunBackendTier, WrunTierChoice, WrunTierLanding } from '../wrun-tier-grid.util.js';
|
|
45
45
|
import type { WrunRowLaneChain, WrunRowLaneHorizon } from './wrun-row-lane.types.js';
|
|
46
46
|
/** An input's declaration as a lane reads it: the typed fields, and any knob the sheet carries
|
|
47
47
|
* that the interface does not name yet (`asset`, `publisher`, `series`, ...), as `unknown`. */
|
|
@@ -115,10 +115,16 @@ export type WrunPollLaneJoin = 'bar' | {
|
|
|
115
115
|
* the asks under the tier rule: each bar is read from the finest tier that fits it and still retains it, one
|
|
116
116
|
* ask per run of bars on a tier, the tier's key in the ask's payload (`tier`); a bar no tier retains reads
|
|
117
117
|
* no row (the input's `missing` policy). Absent: one ask, the rows as the control answers them.
|
|
118
|
+
* `tierChoice: 'coarsest'` (a flow with tiers only) reads each bar from the coarsest fitting tier that retains it and
|
|
119
|
+
* already serves it (each tier's `servedLagMs`: a bar that closed inside a coarser tier's lag, the forming one among
|
|
120
|
+
* them, reads the next finer tier) instead of the finest: for a lane whose landing sums the same per-bar values from
|
|
121
|
+
* any tier, so a coarse bar reads fewer buckets (the row lanes' rule, wrun-tier-grid.util `wrunBarTiers`). Absent: the
|
|
122
|
+
* finest (rule 9), as every lane that names none.
|
|
118
123
|
*/
|
|
119
124
|
export interface WrunPollLaneBarGrid {
|
|
120
125
|
landing: WrunTierLanding;
|
|
121
126
|
tiers?: readonly WrunBackendTier[];
|
|
127
|
+
tierChoice?: WrunTierChoice;
|
|
122
128
|
}
|
|
123
129
|
/** What `plan` returns: the payload fields beyond the current-market placeholders (`symbol:
|
|
124
130
|
* 'currentSymbol'`, `exchange: 'currentExchange'`), or nothing when the placeholders are the
|
|
@@ -34,13 +34,16 @@
|
|
|
34
34
|
* OPRA plane facts (`wrunChartOpraPlane`), a chain lane's OPRA wall and stop before its chain is resolved
|
|
35
35
|
* (`wrunChainLaneStop`), a lane's refusal that the chart has no option chain (`wrunLaneNoChainRefusal`), and what an
|
|
36
36
|
* input the chart does not serve does (`wrunUnservedLaneInput`: a declared fill drops it with a note, any other
|
|
37
|
-
* refuses by name)
|
|
37
|
+
* refuses by name); an option knob naming a setting read as its current value (`resolveWrunOptionSettingKnobs`, over
|
|
38
|
+
* the one table `WRUN_OPTION_SETTING_KNOBS`, every kind of knob the kit binds: no lane reads a setting itself).
|
|
39
|
+
* - a host-grid lane's asks (`fetchWrunPollLaneHostGridRows`): its tier rule, the finest fitting tier or, for a lane
|
|
40
|
+
* naming `tierChoice: 'coarsest'`, the coarsest that already serves the bar.
|
|
38
41
|
*/
|
|
39
|
-
import type { WrunIndicatorMetadata, WrunInputSource } from '../../../interfaces/wrun-runtime.interface.js';
|
|
42
|
+
import type { WrunIndicatorMetadata, WrunInputSource, WrunMetadataParam } from '../../../interfaces/wrun-runtime.interface.js';
|
|
40
43
|
import type { OpraReadFacts } from '../../chart/opra-read-access.leaf.js';
|
|
41
44
|
import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
|
|
42
45
|
import { type WrunRefusalSeed } from '../wrun-refusal.util.js';
|
|
43
|
-
import { type WrunPollLane, type WrunPollLaneContext, type WrunPollLaneId, type WrunPollLaneInstance } from './wrun-poll-lane.types.js';
|
|
46
|
+
import { type WrunPollLane, type WrunPollLaneContext, type WrunPollLaneId, type WrunPollLaneInstance, type WrunPollLaneSource } from './wrun-poll-lane.types.js';
|
|
44
47
|
import { type WrunLaneChainPlane, type WrunRowLaneHorizon } from './wrun-row-lane.types.js';
|
|
45
48
|
import type { WrunMissingFeed } from '../wrun-run-health.util.js';
|
|
46
49
|
import type { LiveBucketVenue } from '../../chart/live-bucket.util.js';
|
|
@@ -82,7 +85,38 @@ export interface WrunPollLaneRunFacts extends OpraReadFacts {
|
|
|
82
85
|
* `opraOptionPlaneStop`: the flag check's `flag-off`, the plane router's `chart-kind`); absent, the market's own
|
|
83
86
|
* words ("no such feed here"). */
|
|
84
87
|
opraPlaneStop?: (exchange: string) => OpraOptionPlaneStop | undefined;
|
|
88
|
+
/** The run's current setting values by name (wrun-param-values.util `wrunParamValuesFromSettings` over the
|
|
89
|
+
* overlay's settings): what an option knob naming a setting reads (`resolveWrunOptionSettingKnobs`). Absent, no
|
|
90
|
+
* knob's setting is read, and a lane refuses a name it cannot read by name. */
|
|
91
|
+
paramValues?: Readonly<Record<string, number>>;
|
|
85
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* The kind of value a setting-bound option knob takes (om kit `WrunOptionParamKnobKind`): `number` a number, int or
|
|
95
|
+
* price setting's number; `word` the label of a select's picked option, one of the knob's words; `list` the labels of a
|
|
96
|
+
* multi's picked options, each one of the knob's words, in the words' order.
|
|
97
|
+
*/
|
|
98
|
+
export type WrunOptionSettingKnobKind = 'number' | 'word' | 'list';
|
|
99
|
+
/**
|
|
100
|
+
* The option knobs a setting may stand for, by source class, with the kind each takes (om kit 0.89.0
|
|
101
|
+
* `WRUN_OPTION_PARAM_KNOBS`, row for row): ONE table for both planners, read before a poll lane's `plan` and a row lane's
|
|
102
|
+
* `facets` (`resolveWrunOptionSettingKnobs`), so no lane reads a setting itself. The sheet records the setting's NAME in
|
|
103
|
+
* the knob (an author's `min_premium: "@floor"` compiles to `"floor"`), and every host reads that setting's current
|
|
104
|
+
* value on each run, so a settings change re-plans the input and its ask carries the new value: no rebuild.
|
|
105
|
+
* tests/utility/wrun/sources/wrun-row-lanes.setting-knobs.spec.ts holds every row of a class the browser serves equal to
|
|
106
|
+
* the kit's.
|
|
107
|
+
*/
|
|
108
|
+
export declare const WRUN_OPTION_SETTING_KNOBS: Readonly<Record<string, Readonly<Record<string, WrunOptionSettingKnobKind>>>>;
|
|
109
|
+
/**
|
|
110
|
+
* One input's source with every option knob that names a setting read as the setting's current value (om
|
|
111
|
+
* `resolveOptionParamKnobs`, the SDK host's rule, over the class's row of `WRUN_OPTION_SETTING_KNOBS`): a number knob
|
|
112
|
+
* takes a number, int or price setting's number; a word knob (`types`, `moneyness`) the label of a select's picked
|
|
113
|
+
* option, one of its words; a list knob (`sides`) the labels of a multi's picked options, in the words' order. The name
|
|
114
|
+
* must be a compute setting of the sheet (a style knob is none) with a value this run read, of the knob's kind and
|
|
115
|
+
* picking its words, else the input is refused by name (`wrun_option_knob_invalid`). A literal (a number, a list, a word
|
|
116
|
+
* of the knob's own) is left as it is (its lane judges it), and so is every input when the run read no setting values; a
|
|
117
|
+
* class with no such knob is its own source, untouched, so every other lane plans exactly as before.
|
|
118
|
+
*/
|
|
119
|
+
export declare function resolveWrunOptionSettingKnobs(ctx: Pick<WrunPollLaneContext, 'inputName' | 'sourceClass'>, source: WrunPollLaneSource, params: readonly WrunMetadataParam[], values: Readonly<Record<string, number>> | undefined): WrunPollLaneSource;
|
|
86
120
|
/** The technical words of an OPRA lane a known stop keeps off the chart (Copy details), by the stop's reason. */
|
|
87
121
|
export declare function wrunOpraPlaneStopDetail(stop: OpraOptionPlaneStop): string;
|
|
88
122
|
/** The chart's OPRA plane facts as both planners read them, once per plan (`wrunChartOpraPlane`). */
|
|
@@ -233,6 +267,10 @@ export type WrunPollLanePlanResult = WrunPollLanePlan & WrunPollLaneInstance[];
|
|
|
233
267
|
* nowhere, before all of the above: no wall, no admission, no `plan`, no fetch, no note; the row builder reads its
|
|
234
268
|
* fill on every bar.
|
|
235
269
|
*
|
|
270
|
+
* An option knob naming a setting (`min_premium: "floor"`, an author's `"@floor"`) reads the setting's current value
|
|
271
|
+
* (`run.paramValues`) before the lane's `plan` judges it (`resolveWrunOptionSettingKnobs`, the SDK host's rule): the
|
|
272
|
+
* instance's extras carry the value, so a settings change re-plans the input and re-asks with it.
|
|
273
|
+
*
|
|
236
274
|
* The predicates are injected (the run pass hands the chart's own `checkIsIndexMode` and its
|
|
237
275
|
* crypto-venue rule), so this module, which the row builder imports, stays off those modules'
|
|
238
276
|
* import graphs; without one no chart reads as index-mode, and without the other the venue is
|
|
@@ -370,8 +408,10 @@ export declare function wrunHostGridAsksWithinHorizon(plan: {
|
|
|
370
408
|
/**
|
|
371
409
|
* A lane's rows over a chart window, landed on the host bars when it is a host-grid lane (`barGrid`): its asks
|
|
372
410
|
* under the tier rule (`wrunHostGridAsks` over the window's host bars: one per run of bars on a tier, the
|
|
373
|
-
* tier's key in its extras as `tier
|
|
374
|
-
*
|
|
411
|
+
* tier's key in its extras as `tier`; each bar's tier the finest fitting one that retains it, or the coarsest that
|
|
412
|
+
* already serves it for a lane naming `tierChoice: 'coarsest'`), cut to the lane's `horizon` for the acquisition
|
|
413
|
+
* (`wrunHostGridAsksWithinHorizon`: the bars its source no longer holds ask nothing and read the input's `missing`
|
|
414
|
+
* policy), each answer landed by the
|
|
375
415
|
* lane's landing (`wrunLandScalarRowsOnHostBars`: a flow summed per bar, a snapshot's newest sealed row, sealed by its
|
|
376
416
|
* ask's tier), ascending. A bar no tier retains asks nothing and reads no row. A flow sums every bucket inside its bar,
|
|
377
417
|
* so its plan reads the window's bar grid as its session grid (wrun-tier-grid.util `wrunCmeSessionBarSpan`): a CME
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { wrunParamChoices } from '../wrun-color-settings.util.js';
|
|
2
|
+
import { refuseWrunOptionKnob } from '../wrun-option-knobs.util.js';
|
|
3
|
+
import { wrunOptionPrintKnobWords } from '../wrun-option-prints.util.js';
|
|
4
|
+
import { wrunMultiLabels } from '../wrun-param-values.util.js';
|
|
1
5
|
import { wrunOptionsStopSeed, wrunRefusalSeedOf } from '../wrun-refusal.util.js';
|
|
2
6
|
import { wrunPollLaneByKey, wrunPollLaneGlobalClasses, wrunPollLanes, wrunPollLanesOfClass } from './registry.js';
|
|
3
7
|
import { refuseWrunPollInput, WRUN_POLL_LANE_ID_PREFIX, } from './wrun-poll-lane.types.js';
|
|
@@ -85,6 +89,104 @@ function wrunPollLaneNativeRowsClasses() {
|
|
|
85
89
|
function wrunPollLaneServedOnIndexMode(lane) {
|
|
86
90
|
return lane.global === true || lane.nativeRows === true;
|
|
87
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* The option knobs a setting may stand for, by source class, with the kind each takes (om kit 0.89.0
|
|
94
|
+
* `WRUN_OPTION_PARAM_KNOBS`, row for row): ONE table for both planners, read before a poll lane's `plan` and a row lane's
|
|
95
|
+
* `facets` (`resolveWrunOptionSettingKnobs`), so no lane reads a setting itself. The sheet records the setting's NAME in
|
|
96
|
+
* the knob (an author's `min_premium: "@floor"` compiles to `"floor"`), and every host reads that setting's current
|
|
97
|
+
* value on each run, so a settings change re-plans the input and its ask carries the new value: no rebuild.
|
|
98
|
+
* tests/utility/wrun/sources/wrun-row-lanes.setting-knobs.spec.ts holds every row of a class the browser serves equal to
|
|
99
|
+
* the kit's.
|
|
100
|
+
*/
|
|
101
|
+
export const WRUN_OPTION_SETTING_KNOBS = Object.freeze({
|
|
102
|
+
options_flow: Object.freeze({ min_premium: 'number', max_dte: 'number' }),
|
|
103
|
+
option_contract_flow: Object.freeze({ min_premium: 'number' }),
|
|
104
|
+
option_strike_flow: Object.freeze({ strike_rows: 'number' }),
|
|
105
|
+
option_prints: Object.freeze({
|
|
106
|
+
min_premium: 'number',
|
|
107
|
+
types: 'word',
|
|
108
|
+
sides: 'list',
|
|
109
|
+
moneyness: 'word',
|
|
110
|
+
max_dte: 'number',
|
|
111
|
+
newest_tail_ms: 'number',
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
/** The setting types a number knob reads (om `resolveOptionParamKnobs`: a number, int or price setting). */
|
|
115
|
+
const WRUN_NUMBER_SETTING_TYPES = new Set(['number', 'int', 'price']);
|
|
116
|
+
/** What a knob of each kind takes beside a setting's name, as its refusal spells it. */
|
|
117
|
+
function wrunSettingKnobLiteralWords(kind, words) {
|
|
118
|
+
if (kind === 'number')
|
|
119
|
+
return 'a number';
|
|
120
|
+
return kind === 'word' ? `one of ${words.join(', ')}` : `a list of ${words.join(', ')}`;
|
|
121
|
+
}
|
|
122
|
+
/** The setting a knob of each kind reads its value from, as its refusal spells it. */
|
|
123
|
+
const WRUN_SETTING_KNOB_SETTINGS = Object.freeze({
|
|
124
|
+
number: 'a number, int or price setting',
|
|
125
|
+
word: 'a select setting whose picked option is labelled with one of them',
|
|
126
|
+
list: 'a multi setting whose picked options are labelled with them',
|
|
127
|
+
});
|
|
128
|
+
/** The literal a setting stands for on a knob of `kind` at the run's `value`, or why it stands for none. */
|
|
129
|
+
function wrunSettingKnobLiteral(kind, words, param, value) {
|
|
130
|
+
const type = param.type ?? 'number';
|
|
131
|
+
if (kind === 'number')
|
|
132
|
+
return WRUN_NUMBER_SETTING_TYPES.has(type) ? { literal: value } : { why: `is a ${type} setting` };
|
|
133
|
+
if (kind === 'word') {
|
|
134
|
+
if (type !== 'select')
|
|
135
|
+
return { why: `is a ${type} setting` };
|
|
136
|
+
// THE select read's choices (a select's options, labelled by `option_labels`), the picked one by its value.
|
|
137
|
+
const label = wrunParamChoices(param)?.find((choice) => choice.value === value)?.label;
|
|
138
|
+
return label !== undefined && words.includes(label) ? { literal: label } : { why: `picks '${label ?? value}'` };
|
|
139
|
+
}
|
|
140
|
+
if (type !== 'multi')
|
|
141
|
+
return { why: `is a ${type} setting` };
|
|
142
|
+
if (!Number.isInteger(value) || value < 0)
|
|
143
|
+
return { why: `picks ${value}` };
|
|
144
|
+
const picked = wrunMultiLabels(param).filter((_, bit) => Math.floor(value / 2 ** bit) % 2 === 1);
|
|
145
|
+
if (!picked.every((label) => words.includes(label))) {
|
|
146
|
+
return { why: `picks ${picked.map((label) => `'${label}'`).join(', ')}` };
|
|
147
|
+
}
|
|
148
|
+
return { literal: words.filter((word) => picked.includes(word)) };
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* One input's source with every option knob that names a setting read as the setting's current value (om
|
|
152
|
+
* `resolveOptionParamKnobs`, the SDK host's rule, over the class's row of `WRUN_OPTION_SETTING_KNOBS`): a number knob
|
|
153
|
+
* takes a number, int or price setting's number; a word knob (`types`, `moneyness`) the label of a select's picked
|
|
154
|
+
* option, one of its words; a list knob (`sides`) the labels of a multi's picked options, in the words' order. The name
|
|
155
|
+
* must be a compute setting of the sheet (a style knob is none) with a value this run read, of the knob's kind and
|
|
156
|
+
* picking its words, else the input is refused by name (`wrun_option_knob_invalid`). A literal (a number, a list, a word
|
|
157
|
+
* of the knob's own) is left as it is (its lane judges it), and so is every input when the run read no setting values; a
|
|
158
|
+
* class with no such knob is its own source, untouched, so every other lane plans exactly as before.
|
|
159
|
+
*/
|
|
160
|
+
export function resolveWrunOptionSettingKnobs(ctx, source, params, values) {
|
|
161
|
+
const knobs = Object.prototype.hasOwnProperty.call(WRUN_OPTION_SETTING_KNOBS, ctx.sourceClass)
|
|
162
|
+
? WRUN_OPTION_SETTING_KNOBS[ctx.sourceClass]
|
|
163
|
+
: undefined;
|
|
164
|
+
if (knobs === undefined || values === undefined)
|
|
165
|
+
return source;
|
|
166
|
+
let resolved;
|
|
167
|
+
for (const [knob, kind] of Object.entries(knobs)) {
|
|
168
|
+
const name = source[knob];
|
|
169
|
+
if (typeof name !== 'string')
|
|
170
|
+
continue;
|
|
171
|
+
const words = wrunOptionPrintKnobWords(knob);
|
|
172
|
+
// A word knob's own word is a literal, never a setting's name.
|
|
173
|
+
if (kind === 'word' && words.includes(name))
|
|
174
|
+
continue;
|
|
175
|
+
const literalWords = wrunSettingKnobLiteralWords(kind, words);
|
|
176
|
+
const param = params.find((candidate) => candidate.name === name);
|
|
177
|
+
const value = Object.prototype.hasOwnProperty.call(values, name) ? values[name] : undefined;
|
|
178
|
+
if (param === undefined || param.style !== undefined || typeof value !== 'number' || !Number.isFinite(value)) {
|
|
179
|
+
return refuseWrunOptionKnob(ctx, knob, name, `${literalWords} or the name of a compute setting of the sheet, and '${name}' is no such setting`);
|
|
180
|
+
}
|
|
181
|
+
const read = wrunSettingKnobLiteral(kind, words, param, value);
|
|
182
|
+
if ('why' in read) {
|
|
183
|
+
return refuseWrunOptionKnob(ctx, knob, name, `${literalWords} or the name of ${WRUN_SETTING_KNOB_SETTINGS[kind]}, and '${name}' ${read.why}`);
|
|
184
|
+
}
|
|
185
|
+
resolved ??= { ...source };
|
|
186
|
+
resolved[knob] = read.literal;
|
|
187
|
+
}
|
|
188
|
+
return resolved === undefined ? source : resolved;
|
|
189
|
+
}
|
|
88
190
|
/** Why an `opra` lane is not served on a chart whose options ride no OPRA plane, as its refusal says it. */
|
|
89
191
|
const WRUN_POLL_OPRA_UNADMITTED_REASON = "is not served on this chart: it reads US options data, which a US stock or ETF chart (its underlying's options) and an OPRA option contract chart serve";
|
|
90
192
|
/** The technical words of an OPRA lane a known stop keeps off the chart (Copy details), by the stop's reason. */
|
|
@@ -277,6 +379,10 @@ function wrunPollLanePlanResult(lanes, missingFeeds) {
|
|
|
277
379
|
* nowhere, before all of the above: no wall, no admission, no `plan`, no fetch, no note; the row builder reads its
|
|
278
380
|
* fill on every bar.
|
|
279
381
|
*
|
|
382
|
+
* An option knob naming a setting (`min_premium: "floor"`, an author's `"@floor"`) reads the setting's current value
|
|
383
|
+
* (`run.paramValues`) before the lane's `plan` judges it (`resolveWrunOptionSettingKnobs`, the SDK host's rule): the
|
|
384
|
+
* instance's extras carry the value, so a settings change re-plans the input and re-asks with it.
|
|
385
|
+
*
|
|
280
386
|
* The predicates are injected (the run pass hands the chart's own `checkIsIndexMode` and its
|
|
281
387
|
* crypto-venue rule), so this module, which the row builder imports, stays off those modules'
|
|
282
388
|
* import graphs; without one no chart reads as index-mode, and without the other the venue is
|
|
@@ -335,7 +441,10 @@ export async function planWrunPollLanes(metadata, chart, isIndexModeExchange = (
|
|
|
335
441
|
}
|
|
336
442
|
let answered;
|
|
337
443
|
try {
|
|
338
|
-
|
|
444
|
+
// An option knob naming a setting reads the setting's current value before the lane judges it (om
|
|
445
|
+
// `resolveOptionParamKnobs`): the instance's extras carry the value, so a settings change re-plans and re-asks.
|
|
446
|
+
const source = resolveWrunOptionSettingKnobs(ctx, planned.source, metadata.params ?? [], run?.paramValues);
|
|
447
|
+
answered = await planned.lane.plan(source, ctx);
|
|
339
448
|
}
|
|
340
449
|
catch (error) {
|
|
341
450
|
// A chart with no option chain does not serve the feed (`wrunLaneNoChainRefusal`), nor one whose options plane
|
|
@@ -602,8 +711,10 @@ export function wrunHostGridAsksWithinHorizon(plan, window, horizon, sessionGrid
|
|
|
602
711
|
/**
|
|
603
712
|
* A lane's rows over a chart window, landed on the host bars when it is a host-grid lane (`barGrid`): its asks
|
|
604
713
|
* under the tier rule (`wrunHostGridAsks` over the window's host bars: one per run of bars on a tier, the
|
|
605
|
-
* tier's key in its extras as `tier
|
|
606
|
-
*
|
|
714
|
+
* tier's key in its extras as `tier`; each bar's tier the finest fitting one that retains it, or the coarsest that
|
|
715
|
+
* already serves it for a lane naming `tierChoice: 'coarsest'`), cut to the lane's `horizon` for the acquisition
|
|
716
|
+
* (`wrunHostGridAsksWithinHorizon`: the bars its source no longer holds ask nothing and read the input's `missing`
|
|
717
|
+
* policy), each answer landed by the
|
|
607
718
|
* lane's landing (`wrunLandScalarRowsOnHostBars`: a flow summed per bar, a snapshot's newest sealed row, sealed by its
|
|
608
719
|
* ask's tier), ascending. A bar no tier retains asks nothing and reads no row. A flow sums every bucket inside its bar,
|
|
609
720
|
* so its plan reads the window's bar grid as its session grid (wrun-tier-grid.util `wrunCmeSessionBarSpan`): a CME
|
|
@@ -621,6 +732,7 @@ export async function fetchWrunPollLaneHostGridRows(lane, extras, window, fallba
|
|
|
621
732
|
barOpens: window.barOpens,
|
|
622
733
|
intervalMs: window.intervalMs,
|
|
623
734
|
nowMs: window.nowMs,
|
|
735
|
+
...(grid.tierChoice !== undefined ? { choice: grid.tierChoice } : {}),
|
|
624
736
|
...(sessionGrid !== undefined ? { sessionGrid } : {}),
|
|
625
737
|
}), window, lane.horizon?.(extras, window.nowMs), sessionGrid);
|
|
626
738
|
const answers = await Promise.all(asks.map(async (gridAsk) => {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LiveBucketVenue } from '../../chart/live-bucket.util.js';
|
|
2
|
+
import type { WrunRowLaneRowBudget } from './wrun-row-lane.types.js';
|
|
3
|
+
import type { WrunRowLaneWindow } from './wrun-row-lanes.util.js';
|
|
4
|
+
import { type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
|
|
5
|
+
/** The most host bars a row lane's first ask covers (OPTLOAD first paint: the newest 30 bars first). */
|
|
6
|
+
export declare const WRUN_ROW_LANE_FIRST_PAINT_BARS = 30;
|
|
7
|
+
/** The most bytes a row lane's first ask is projected to answer (OPTLOAD first paint: 0.25 MB, at 8 bytes a cell). */
|
|
8
|
+
export declare const WRUN_ROW_LANE_FIRST_PAINT_BYTES: number;
|
|
9
|
+
/** A host-grid ask plan ordered for first paint (see the module doc). */
|
|
10
|
+
export declare function wrunRowLaneFirstPaintAsks(asks: readonly WrunHostGridAsk[], window: Pick<WrunRowLaneWindow, 'barOpens' | 'intervalMs' | 'nowMs'>, budget: WrunRowLaneRowBudget | undefined, acquisition?: Readonly<Record<string, unknown>>, sessionGrid?: LiveBucketVenue | null): WrunHostGridAsk[];
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The first-paint slice of a row lane with a row budget (OPTLOAD-READ-CONTRACT FE-STRIKE-LANE; the per-strike and
|
|
3
|
+
* per-contract flow lanes): the NEWEST asked bars, at most `WRUN_ROW_LANE_FIRST_PAINT_BARS` and only as many as the
|
|
4
|
+
* lane's projection (`barRows` x `cellsPerRow` x 8 bytes) fits `WRUN_ROW_LANE_FIRST_PAINT_BYTES` (the newest bar at
|
|
5
|
+
* least), are asked on their own and FIRST; the asks are cut at that slice's first bar (never inside a bar) and the older
|
|
6
|
+
* parts follow, newest first. The asks cover the same bars at the same tiers, so the landed rows are the same. A lane
|
|
7
|
+
* with no row budget, and a plan the slice holds whole, keep their plan. wrun-row-lanes.util `fetchWrunRowLaneRows`
|
|
8
|
+
* loads this module for a row-budget lane only, so it stays off the boot path (tests/utility/wrun/wrun-door.closure).
|
|
9
|
+
*/
|
|
10
|
+
import { KSCRIPT_SOURCE_CELL_BYTES } from '../../chart/kscript-source-answer-budget.leaf.js';
|
|
11
|
+
import { wrunHostBarSpanOf } from '../wrun-tier-grid.util.js';
|
|
12
|
+
/** The most host bars a row lane's first ask covers (OPTLOAD first paint: the newest 30 bars first). */
|
|
13
|
+
export const WRUN_ROW_LANE_FIRST_PAINT_BARS = 30;
|
|
14
|
+
/** The most bytes a row lane's first ask is projected to answer (OPTLOAD first paint: 0.25 MB, at 8 bytes a cell). */
|
|
15
|
+
export const WRUN_ROW_LANE_FIRST_PAINT_BYTES = 256 * 1024;
|
|
16
|
+
/** A host-grid ask plan ordered for first paint (see the module doc). */
|
|
17
|
+
export function wrunRowLaneFirstPaintAsks(asks, window, budget, acquisition = {}, sessionGrid) {
|
|
18
|
+
if (budget === undefined || asks.length === 0)
|
|
19
|
+
return [...asks];
|
|
20
|
+
const asked = [];
|
|
21
|
+
for (const ask of asks) {
|
|
22
|
+
for (const stampMs of window.barOpens) {
|
|
23
|
+
const span = wrunHostBarSpanOf(stampMs, window.intervalMs, sessionGrid);
|
|
24
|
+
if (span.fromMs < ask.fromMs || span.fromMs >= ask.toMs)
|
|
25
|
+
continue;
|
|
26
|
+
asked.push({ fromMs: span.fromMs, toMs: span.toMs, tier: ask.tier });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
asked.sort((a, b) => b.fromMs - a.fromMs);
|
|
30
|
+
let bytes = 0;
|
|
31
|
+
let sliceFrom = Number.POSITIVE_INFINITY;
|
|
32
|
+
for (let at = 0; at < asked.length && at < WRUN_ROW_LANE_FIRST_PAINT_BARS; at += 1) {
|
|
33
|
+
const bar = asked[at];
|
|
34
|
+
const projected = budget.barRows({ openMs: bar.fromMs, endMs: bar.toMs, tier: bar.tier }, window.nowMs, acquisition);
|
|
35
|
+
const barRows = Number.isFinite(projected) && projected > 0 ? projected : 0;
|
|
36
|
+
const barBytes = barRows * budget.cellsPerRow * KSCRIPT_SOURCE_CELL_BYTES;
|
|
37
|
+
if (at > 0 && bytes + barBytes > WRUN_ROW_LANE_FIRST_PAINT_BYTES)
|
|
38
|
+
break;
|
|
39
|
+
bytes += barBytes;
|
|
40
|
+
sliceFrom = bar.fromMs;
|
|
41
|
+
}
|
|
42
|
+
if (!Number.isFinite(sliceFrom) || asked.every((bar) => bar.fromMs >= sliceFrom))
|
|
43
|
+
return [...asks];
|
|
44
|
+
const first = [];
|
|
45
|
+
const older = [];
|
|
46
|
+
for (const ask of asks) {
|
|
47
|
+
if (ask.fromMs >= sliceFrom)
|
|
48
|
+
first.push(ask);
|
|
49
|
+
else if (ask.toMs <= sliceFrom)
|
|
50
|
+
older.push(ask);
|
|
51
|
+
else {
|
|
52
|
+
older.push({ ...ask, toMs: sliceFrom });
|
|
53
|
+
first.push({ ...ask, fromMs: sliceFrom });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return [...first, ...older.sort((a, b) => b.fromMs - a.fromMs)];
|
|
57
|
+
}
|
|
@@ -9,13 +9,18 @@
|
|
|
9
9
|
* undemanded one is planned nowhere): the OPRA wall, the chart's admission, the lane's identity (once per lane) and
|
|
10
10
|
* each input's facets, grouped into instances (equal facets share one fetch and one buffer; an
|
|
11
11
|
* `acquisitions: 'one'` lane refuses two that differ), a chain lane's instance meeting its own plane's wall,
|
|
12
|
-
* refusals by name.
|
|
12
|
+
* refusals by name. Each input's facets read the run beside the chart (`WrunRowLanePlanFacts`): its own `max_cells`,
|
|
13
|
+
* the most `max_cells` among the package's inputs of its class, the sheet's settings and the run's values.
|
|
13
14
|
* - a chain lane's plane per instance (`wrunRowLaneChainPlane`) and the fields its asks name for it
|
|
14
15
|
* (`wrunRowLaneChainAsk`): the run's and the reconcile's one rule.
|
|
15
16
|
* - `wrunRowLaneRequired`: the empty-answer rule (a `degrades` lane must answer rows unless every reader declares
|
|
16
17
|
* `missing: "empty"`).
|
|
17
18
|
* - `fetchWrunRowLaneRows`: a lane's rows over a chart window: its asks under the tier rule, landed on the host
|
|
18
|
-
* bars, the partial bars marked (a `latest` lane asked once, its rows as they come)
|
|
19
|
+
* bars, the partial bars marked (a `latest` lane asked once, its rows as they come), a row-budget lane's newest bars
|
|
20
|
+
* first (wrun-row-lane-first-paint.util), and so an instance's whose facets ask a per-bar word (OPTLOAD G5); every
|
|
21
|
+
* packed block a worker transferred split into plain tuples of the instance's width as it lands
|
|
22
|
+
* (`wrunRowLanePlainRow`).
|
|
23
|
+
* - an option knob naming a setting read as its value before a lane's facets judge it (`resolveWrunOptionSettingKnobs`).
|
|
19
24
|
* - `wrunRowLaneCellRows`: the row builder's read of one input: the lane's host-bar rows as cell blocks on the
|
|
20
25
|
* chart's grid (exact width, finite values or NaN outside a lane's `finiteColumns`, the lane's per-input
|
|
21
26
|
* projection with a partial bar kept partial unless the class carries no `present` mask; a `latest` lane on the
|
|
@@ -24,7 +29,7 @@
|
|
|
24
29
|
* longest-kept tier), and where a run's history sources begin, which the warm-up decider reads so a first value a
|
|
25
30
|
* source's history explains never buys a page of older candles.
|
|
26
31
|
*/
|
|
27
|
-
import type { WrunIndicatorMetadata, WrunInputSource } from '../../../interfaces/wrun-runtime.interface.js';
|
|
32
|
+
import type { WrunIndicatorMetadata, WrunInputSource, WrunMetadataParam } from '../../../interfaces/wrun-runtime.interface.js';
|
|
28
33
|
import type { LiveBucketVenue } from '../../chart/live-bucket.util.js';
|
|
29
34
|
import type { OpraReadFacts } from '../../chart/opra-read-access.leaf.js';
|
|
30
35
|
import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
|
|
@@ -43,7 +48,9 @@ export interface WrunRowLaneInput {
|
|
|
43
48
|
/**
|
|
44
49
|
* The static plan: every input whose class a row lane serves, in declaration order, with its lane. Refused by
|
|
45
50
|
* name: a scalar input (a row lane serves cell blocks) and a celled one with no `max_cells` (the bound its blocks
|
|
46
|
-
* are packed under). Empty when the sheet reads no row-lane class.
|
|
51
|
+
* are packed under). Empty when the sheet reads no row-lane class. The lane's width follows the input's own words
|
|
52
|
+
* (wrun-option-views.util `wrunOptionInputTupleWidth`, the SDK's one rule: the strike kit fold's 14-value rows), so
|
|
53
|
+
* the row builder reads and hands on the block each input's words make.
|
|
47
54
|
*/
|
|
48
55
|
export declare function planWrunRowLaneInputs(metadata: WrunIndicatorMetadata): WrunRowLaneInput[];
|
|
49
56
|
/** The id of the instance `extras` names: `row:<laneKey>` when the ask carries no extras, else the extras'
|
|
@@ -95,7 +102,9 @@ export interface WrunRowLanePlan {
|
|
|
95
102
|
* reason (`opraPlaneStop`: the `opra` flag dark, an index chart) says that reason instead (`options-stopped`, the
|
|
96
103
|
* note and the refusal alike);
|
|
97
104
|
* 3. the lane's identity, once per lane (the first admitted input's context names a refusal), then the input's
|
|
98
|
-
* facets (awaited, in declaration order)
|
|
105
|
+
* facets (awaited, in declaration order), each knob naming a setting first read as the setting's current value
|
|
106
|
+
* (`resolveWrunOptionSettingKnobs` over `run.paramValues`), the context carrying the plan's facts beside the chart
|
|
107
|
+
* (`WrunRowLanePlanFacts`); the instance is the identity and the facets together. A lane with
|
|
99
108
|
* `acquisitions: 'one'` refuses a second input whose acquisition differs (one fetch, one live fold per package). A
|
|
100
109
|
* chart with no option chain (an identity or facets refusal seeded `no-options` / `chain`, `wrunLaneNoChainRefusal`:
|
|
101
110
|
* a LINK perp, a forex pair) does not serve the feed either: the same one rule, its note naming the feed with the
|
|
@@ -103,7 +112,29 @@ export interface WrunRowLanePlan {
|
|
|
103
112
|
* (`assertWrunLaneChainPlaneReadable`, the one rule a chain poll lane meets too): OPRA's, or the CME display wall
|
|
104
113
|
* (OpenMarket's own packages only); a plain chain (a crypto venue) none.
|
|
105
114
|
*/
|
|
106
|
-
export declare function planWrunRowLanes(metadata: WrunIndicatorMetadata, chart: WrunRowLaneChart, run?:
|
|
115
|
+
export declare function planWrunRowLanes(metadata: WrunIndicatorMetadata, chart: WrunRowLaneChart, run?: WrunRowLaneRunFacts): Promise<WrunRowLanePlan>;
|
|
116
|
+
/** The run facts the row-lane planner reads: the OPRA facts and the run's setting values by name (wrun-param-values.util
|
|
117
|
+
* `wrunParamValuesFromSettings` over the overlay's settings; absent: a knob naming a setting is refused by name). */
|
|
118
|
+
export interface WrunRowLaneRunFacts extends OpraReadFacts {
|
|
119
|
+
paramValues?: Readonly<Record<string, number>>;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* What the planner hands an input's facets beside the chart (on its context):
|
|
123
|
+
* - `maxCells`: the input's own `max_cells` from the static plan, the bound its blocks are packed under (the strike kit
|
|
124
|
+
* fold asks the gateway to refuse a bar past it, OPTLOAD G5 `strikeMaxCells`);
|
|
125
|
+
* - `laneMaxCells`: the most `max_cells` among the package's inputs of the class, the bound a cut that ONE acquisition
|
|
126
|
+
* asks for every input reading it must keep (`option_prints`' per-bar cut asks one more, OPTLOAD G4);
|
|
127
|
+
* - `params` and `paramValues`: the sheet's settings and the run's current values (`WrunRowLaneRunFacts`; absent values
|
|
128
|
+
* when the run read none). Every option knob of the one table naming a setting was already read by them before the
|
|
129
|
+
* facets run (`resolveWrunOptionSettingKnobs`), so a lane never reads such a knob itself
|
|
130
|
+
* (tests/utility/wrun/sources/wrun-row-lanes.setting-knobs.spec.ts).
|
|
131
|
+
*/
|
|
132
|
+
export interface WrunRowLanePlanFacts {
|
|
133
|
+
maxCells?: number;
|
|
134
|
+
laneMaxCells?: number;
|
|
135
|
+
params?: readonly WrunMetadataParam[];
|
|
136
|
+
paramValues?: Readonly<Record<string, number>>;
|
|
137
|
+
}
|
|
107
138
|
/** The exchange a chain-lane instance's chain lists on (the payload field its `chain` names); '' for any other lane
|
|
108
139
|
* or a payload naming none. The chain poll lanes' one rule (`wrunPollLaneChainExchange`: the mark is the same). */
|
|
109
140
|
export declare function wrunRowLaneChainExchange(lane: Pick<WrunRowLaneDescriptor, 'chain'>, extras: Readonly<Record<string, unknown>>): string;
|
|
@@ -171,6 +202,15 @@ export declare function fetchWrunRowLaneRows(lane: WrunRowLaneDescriptor, extras
|
|
|
171
202
|
fromTs: number;
|
|
172
203
|
toTs: number;
|
|
173
204
|
}, ask: (extras: Readonly<Record<string, unknown>>, fromTs: number, toTs: number) => Promise<ReadonlyArray<ReadonlyArray<unknown>>>): Promise<unknown[][]>;
|
|
205
|
+
/**
|
|
206
|
+
* A landed row with every packed block (a Float64Array a worker handed the page by transfer, `count x width` values back
|
|
207
|
+
* to back: OPTLOAD G5 O6) split into plain tuples of `width` values, every other cell as it is; a new array. The one
|
|
208
|
+
* point a lane's rows enter its buffer, so every reader of them reads arrays: the partial marks (which keep array
|
|
209
|
+
* tuples), the live reconcile's comparison of a re-asked bar (a typed block compares by identity, so an unchanged bar
|
|
210
|
+
* would read revised on every poll and reseed the session), the row builder. A block that is no whole number of tuples
|
|
211
|
+
* stays as it is (`exactTuples` skips it).
|
|
212
|
+
*/
|
|
213
|
+
export declare function wrunRowLanePlainRow(row: ReadonlyArray<unknown>, width: number): unknown[];
|
|
174
214
|
/**
|
|
175
215
|
* A host-grid ask plan cut to a lane's horizon for one acquisition (`WrunRowLaneHorizon`): every window bar that
|
|
176
216
|
* opens before `completeFromMs` joins the partial bars, and the asks start at the first bar that ends after
|
|
@@ -185,6 +225,20 @@ export declare function wrunRowLaneAsksWithinHorizon(plan: {
|
|
|
185
225
|
asks: WrunHostGridAsk[];
|
|
186
226
|
partialBars: number[];
|
|
187
227
|
};
|
|
228
|
+
/**
|
|
229
|
+
* The acquisition a row lane's budget projects the window's bars under (`wrunRowLaneAsksWithinRowBudget` and the
|
|
230
|
+
* first-paint slice, both from `fetchWrunRowLaneRows`): the instance's payload, and for a chain instance under the flow
|
|
231
|
+
* lanes' `history` "today" the first instant of today named off the window's NEWEST bar exactly as each ask's K control
|
|
232
|
+
* names it (option-flow-bars.util `optionFlowTodayFields`: the trade date of the chart's newest bar on the chain's venue
|
|
233
|
+
* clock, option-trade-date.util `optionTodayStartMsByClock`, under `WRUN_OPTION_FLOW_TODAY_FIELD`), so the projection
|
|
234
|
+
* (wrun-option-contract-flow.util `wrunOptionFlowBarBeforeToday`) budgets exactly the bars the worker reads. The payload
|
|
235
|
+
* names no today (the control adds it per ask, off the chart): projected without it, every bar before today was
|
|
236
|
+
* projected in full though it reads nothing, and once the budget filled the older bars were cut and marked partial. The
|
|
237
|
+
* window's newest bar is the chart's on a full run and a reconcile, and never newer than it on a clamped window, so this
|
|
238
|
+
* today is never later than the worker's: a bar the worker reads is never projected at nothing. The trade-date rules
|
|
239
|
+
* load only for such an instance (they stay off the boot path).
|
|
240
|
+
*/
|
|
241
|
+
export declare function wrunRowLaneBudgetAcquisition(lane: Pick<WrunRowLaneDescriptor, 'chain'>, extras: Readonly<Record<string, unknown>>, window: Pick<WrunRowLaneWindow, 'barOpens' | 'intervalMs'>): Promise<Readonly<Record<string, unknown>>>;
|
|
188
242
|
/** A row budget's cap in rows: the source answer budget (kscript-source-answer-budget.leaf) in rows of the lane's
|
|
189
243
|
* answered width. One number for every lane, the row cache and the worker's cap; a lane never picks its own. */
|
|
190
244
|
export declare function wrunRowLaneMaxRows(budget: Pick<WrunRowLaneRowBudget, 'cellsPerRow'>): number;
|