@orangecharts/wrun-chart-host 0.3.0 → 0.4.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 +11 -5
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +133 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +451 -0
- package/dist/host-env.d.ts +8 -6
- package/dist/host-ports.types.d.ts +7 -22
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/utility/chart/date-labelled-interval.leaf.d.ts +15 -0
- package/dist/utility/chart/date-labelled-interval.leaf.js +19 -0
- package/dist/utility/chart/indicator-run-interval.util.d.ts +130 -0
- package/dist/utility/chart/indicator-run-interval.util.js +268 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +119 -0
- package/dist/utility/chart/window-geometry.leaf.js +391 -0
- package/dist/utility/chart/window-owner.leaf.d.ts +19 -0
- package/dist/utility/chart/window-owner.leaf.js +24 -0
- package/dist/utility/html-escape.leaf.d.ts +11 -0
- package/dist/utility/html-escape.leaf.js +20 -0
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +43 -15
- package/dist/utility/wrun/sources/lanes/option_daily.js +78 -20
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +14 -10
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +5 -4
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +22 -3
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +38 -7
- package/dist/utility/wrun/sources/registry.js +31 -1
- package/dist/utility/wrun/sources/row-lane-registry.js +5 -5
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +74 -18
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +49 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +57 -47
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +36 -4
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +6 -12
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +37 -3
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +128 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +233 -51
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +0 -8
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +26 -24
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +85 -104
- package/dist/utility/wrun/wrun-opra-stats.leaf.d.ts +29 -10
- package/dist/utility/wrun/wrun-opra-stats.leaf.js +29 -10
- package/dist/utility/wrun/wrun-panel-mount.lazy.d.ts +10 -0
- package/dist/utility/wrun/wrun-panel-mount.lazy.js +68 -0
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +377 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +2251 -0
- package/dist/utility/wrun/wrun-pause-dim.util.d.ts +52 -0
- package/dist/utility/wrun/wrun-pause-dim.util.js +153 -0
- package/dist/utility/wrun/wrun-plot-gate.types.d.ts +23 -0
- package/dist/utility/wrun/wrun-plot-gate.types.js +7 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.d.ts +14 -0
- package/dist/utility/wrun/wrun-run-interval-projection.types.js +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `option_strikes`: the chart's options chain measured by strike on EVERY bar (UW-PARITY S1, adopting om's class as
|
|
3
|
+
* the om worktree `feat/wrun-option-strikes` defines it: `WRUN_OPTION_STRIKES_TUPLE_WIDTH`, wrun-host cells.ts
|
|
4
|
+
* `kscriptStrikeCells` / `wrunOptionStrikesBlock`, docs "Option strikes"), on every chain the strike job writes
|
|
5
|
+
* (OPTIONS-PORT P5: OPRA, CME, the crypto venues).
|
|
6
|
+
*
|
|
7
|
+
* - Tuple, width 12, NO `present` mask: `[strike, expiry_ms, net_gex, call_gex, put_gex, net_dex, net_vex, call_oi,
|
|
8
|
+
* put_oi, call_iv, put_iv, underlying]`. A side the strike does not list reads NaN in its own fields, and so does an
|
|
9
|
+
* IV the side does not report: only a strike or an expiry that is not a finite number drops the tuple (om's adapter;
|
|
10
|
+
* `finiteColumns`), and nothing reads bit 14 off the last column (`presentMask: false`). On a crypto chain `call_oi`
|
|
11
|
+
* and `put_oi` are in coin (OPTIONS-PORT C3), contracts on OPRA and CME.
|
|
12
|
+
* - Per bar: ONE snapshot, the newest minute of strike rows inside the bar (every expiry and strike of that minute),
|
|
13
|
+
* stamped at the bar's open: a snapshot landing with no tier rule (`landing: { kind: 'snapshot' }`, the newest row of
|
|
14
|
+
* each host bar, any chart interval), its rows read off OPTION_STRIKE_AGG (pb-common 12.67.0, MINUTE, by the chain's
|
|
15
|
+
* exchange and underlying; the K_OPTION_STRIKES control and its worker twin). A bar holding no minute (outside the
|
|
16
|
+
* session, a minute the backend missed, history past its about seven days) is an EMPTY block; an empty answer is
|
|
17
|
+
* quiet (om's `absence: "empty"`).
|
|
18
|
+
* - A CHAIN lane (`chain`): the chain is the one chain resolver's (opra-option-lanes.util `decideWrunLaneChain`), per
|
|
19
|
+
* input, and its plane is per instance: OPRA's rules on a US stock or OPRA contract chart (unchanged: the wall, native
|
|
20
|
+
* rows, the provenance stamp, the routed tier), CME's on a CME futures chart (a continuous chart reads its lead
|
|
21
|
+
* contract's rows, and a live session rebuilds once the lead rolls: `acquisitionMoved`), none on a crypto chain.
|
|
22
|
+
* Every chain the decision resolves is read.
|
|
23
|
+
* - ONE book per input (D11): the `book` knob (`auto`, the chain's default book off its directory, or one series name)
|
|
24
|
+
* decided when the run plans and named in the acquisition (`strikeBook`) unless it is the underlying's own series. A
|
|
25
|
+
* strike read by coin answers every book of the chain (a row's book rides its synthetic symbol's `|<series>` tail), so
|
|
26
|
+
* the worker keeps the asked book's rows and keys its store by the book.
|
|
27
|
+
* - Knobs, the options chain's words: `venue` ("auto" by default) through the venue decision every chain class shares
|
|
28
|
+
* (`decideWrunLaneChainIdentity`: a pinned word, the flag, the listing, the directory, the OPRA wall), `book`, and
|
|
29
|
+
* `expiries` ("all", or "nearest:N": the N earliest expiries each bar's snapshot lists, kept per input before the
|
|
30
|
+
* packer judges `max_cells`, never a fetch facet). A market pin, `history` and `min_size` are refused by name; a
|
|
31
|
+
* block over `max_cells` refuses the run (wrun_cell_block_too_large, never truncated). One chain per package.
|
|
32
|
+
*
|
|
33
|
+
* LIGHT at module load: the chain resolver's directory, listing and lead reads run inside `identity` and `facets`.
|
|
34
|
+
*/
|
|
35
|
+
import { type WrunLaneChain } from '../opra-option-lanes.util.js';
|
|
1
36
|
import type { WrunRowLaneDescriptor } from '../wrun-row-lane.types.js';
|
|
2
37
|
/** f64s per tuple (om's `WRUN_OPTION_STRIKES_TUPLE_WIDTH`). */
|
|
3
38
|
export declare const WRUN_OPTION_STRIKES_WIDTH = 12;
|
|
@@ -5,9 +40,23 @@ export declare const WRUN_OPTION_STRIKES_WIDTH = 12;
|
|
|
5
40
|
export declare const WRUN_OPTION_STRIKES_FINITE_COLUMNS: readonly number[];
|
|
6
41
|
/** om's code for a market pin on the chain classes. */
|
|
7
42
|
export declare const WRUN_OPTIONS_CHAIN_MARKET_PINNED_CODE = "wrun_options_chain_market_pinned";
|
|
43
|
+
/** The payload field an instance names its chain's exchange in (its plane follows it). */
|
|
44
|
+
export declare const WRUN_OPTION_STRIKES_EXCHANGE_FIELD = "strikeExchange";
|
|
8
45
|
/** Test seam: forget every resolved chart. */
|
|
9
46
|
export declare function __resetWrunStrikesChartsForTests(): void;
|
|
10
47
|
/** The tuples an input keeps under its `expiries` word: every one, or ("nearest:N") the tuples of the N earliest
|
|
11
48
|
* distinct expiries the bar's snapshot lists (om's `wrunOptionsChainKept`, the expiry being the second member). */
|
|
12
49
|
export declare function wrunOptionStrikesKept(tuples: ReadonlyArray<ReadonlyArray<number>>, expiriesWord: unknown): ReadonlyArray<ReadonlyArray<number>>;
|
|
50
|
+
/**
|
|
51
|
+
* An input's chain as the ask's fields (the acquisition key: the class, the plane its exchange names, the exchange,
|
|
52
|
+
* the underlying, the book): `strikeExchange` and `strikeUnderlying` always (an OPRA chain's exactly as before),
|
|
53
|
+
* `strikeBook` for a book other than the underlying's own series (Deribit's BTC_USDC, OKX's BTC-USD: the strike job
|
|
54
|
+
* writes a `|<series>` tail for those alone), and `strikeContinuous` for a CME chain read off a continuous alias
|
|
55
|
+
* (`wrunOptionStrikesAcquisitionMoved` reads it).
|
|
56
|
+
*/
|
|
57
|
+
export declare function wrunOptionStrikesExtras(chain: WrunLaneChain): Record<string, unknown>;
|
|
58
|
+
/** Whether an acquisition no longer names the contract the lane would plan now (D12): a CME chain read off a
|
|
59
|
+
* continuous alias whose lead rolled since the run planned it (`wrunLaneChainLeadMoved`). A live session holding it
|
|
60
|
+
* rebuilds, so no store or buffer joins the old contract's strikes to the new one's. */
|
|
61
|
+
export declare function wrunOptionStrikesAcquisitionMoved(acquisition: Readonly<Record<string, unknown>>): boolean;
|
|
13
62
|
export declare const rowLane: WrunRowLaneDescriptor;
|
|
@@ -1,33 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `option_strikes`: the chart's options chain measured by strike on EVERY bar (UW-PARITY S1, adopting om's class as
|
|
3
3
|
* the om worktree `feat/wrun-option-strikes` defines it: `WRUN_OPTION_STRIKES_TUPLE_WIDTH`, wrun-host cells.ts
|
|
4
|
-
* `kscriptStrikeCells` / `wrunOptionStrikesBlock`, docs "Option strikes")
|
|
4
|
+
* `kscriptStrikeCells` / `wrunOptionStrikesBlock`, docs "Option strikes"), on every chain the strike job writes
|
|
5
|
+
* (OPTIONS-PORT P5: OPRA, CME, the crypto venues).
|
|
5
6
|
*
|
|
6
7
|
* - Tuple, width 12, NO `present` mask: `[strike, expiry_ms, net_gex, call_gex, put_gex, net_dex, net_vex, call_oi,
|
|
7
8
|
* put_oi, call_iv, put_iv, underlying]`. A side the strike does not list reads NaN in its own fields, and so does an
|
|
8
9
|
* IV the side does not report: only a strike or an expiry that is not a finite number drops the tuple (om's adapter;
|
|
9
|
-
* `finiteColumns`), and nothing reads bit 14 off the last column (`presentMask: false`).
|
|
10
|
+
* `finiteColumns`), and nothing reads bit 14 off the last column (`presentMask: false`). On a crypto chain `call_oi`
|
|
11
|
+
* and `put_oi` are in coin (OPTIONS-PORT C3), contracts on OPRA and CME.
|
|
10
12
|
* - Per bar: ONE snapshot, the newest minute of strike rows inside the bar (every expiry and strike of that minute),
|
|
11
13
|
* stamped at the bar's open: a snapshot landing with no tier rule (`landing: { kind: 'snapshot' }`, the newest row of
|
|
12
|
-
* each host bar, any chart interval), its rows read off OPTION_STRIKE_AGG (pb-common 12.67.0, MINUTE, by the
|
|
13
|
-
*
|
|
14
|
+
* each host bar, any chart interval), its rows read off OPTION_STRIKE_AGG (pb-common 12.67.0, MINUTE, by the chain's
|
|
15
|
+
* exchange and underlying; the K_OPTION_STRIKES control and its worker twin). A bar holding no minute (outside the
|
|
14
16
|
* session, a minute the backend missed, history past its about seven days) is an EMPTY block; an empty answer is
|
|
15
17
|
* quiet (om's `absence: "empty"`).
|
|
16
|
-
* -
|
|
17
|
-
*
|
|
18
|
+
* - A CHAIN lane (`chain`): the chain is the one chain resolver's (opra-option-lanes.util `decideWrunLaneChain`), per
|
|
19
|
+
* input, and its plane is per instance: OPRA's rules on a US stock or OPRA contract chart (unchanged: the wall, native
|
|
20
|
+
* rows, the provenance stamp, the routed tier), CME's on a CME futures chart (a continuous chart reads its lead
|
|
21
|
+
* contract's rows, and a live session rebuilds once the lead rolls: `acquisitionMoved`), none on a crypto chain.
|
|
22
|
+
* Every chain the decision resolves is read.
|
|
23
|
+
* - ONE book per input (D11): the `book` knob (`auto`, the chain's default book off its directory, or one series name)
|
|
24
|
+
* decided when the run plans and named in the acquisition (`strikeBook`) unless it is the underlying's own series. A
|
|
25
|
+
* strike read by coin answers every book of the chain (a row's book rides its synthetic symbol's `|<series>` tail), so
|
|
26
|
+
* the worker keeps the asked book's rows and keys its store by the book.
|
|
27
|
+
* - Knobs, the options chain's words: `venue` ("auto" by default) through the venue decision every chain class shares
|
|
28
|
+
* (`decideWrunLaneChainIdentity`: a pinned word, the flag, the listing, the directory, the OPRA wall), `book`, and
|
|
18
29
|
* `expiries` ("all", or "nearest:N": the N earliest expiries each bar's snapshot lists, kept per input before the
|
|
19
30
|
* packer judges `max_cells`, never a fetch facet). A market pin, `history` and `min_size` are refused by name; a
|
|
20
31
|
* block over `max_cells` refuses the run (wrun_cell_block_too_large, never truncated). One chain per package.
|
|
21
|
-
* - The strike rows exist for OPRA chains only: on a chart whose options ride the OPRA plane the lane is governed
|
|
22
|
-
* (the wall, native rows, the provenance stamp, the routed tier); anywhere else (`offPlane: 'empty'`) the decision
|
|
23
|
-
* still refuses by name, and a chain it resolves (Deribit, CME, a crypto venue) reads empty blocks with no fetch.
|
|
24
32
|
*
|
|
25
|
-
* LIGHT at module load: the chain resolver and
|
|
33
|
+
* LIGHT at module load: the chain resolver's directory, listing and lead reads run inside `identity` and `facets`.
|
|
26
34
|
*/
|
|
27
|
-
import {
|
|
28
|
-
import { refuseWrunLaneStrayKnob, resolveWrunLaneChartChain, resolveWrunLaneCryptoVenues, wrunLaneChainRefusalError, wrunLaneChartKey, } from '../opra-option-lanes.util.js';
|
|
35
|
+
import { decideWrunLaneChain, decideWrunLaneChainIdentity, refuseWrunLaneStrayKnob, resolveWrunLaneChainChart, wrunLaneChainLeadMoved, wrunLaneChainRefusalError, wrunLaneChartKey, } from '../opra-option-lanes.util.js';
|
|
29
36
|
import { refuseWrunPollInput } from '../wrun-poll-lane.types.js';
|
|
30
|
-
import {
|
|
37
|
+
import { WRUN_OPTIONS_CHAIN_EXPIRIES_CODE, wrunOptionsChainExpiries, wrunOptionsChainIdentityKey, } from '../../wrun-options-chain.util.js';
|
|
31
38
|
import { attachWrunRefusal } from '../../wrun-refusal.util.js';
|
|
32
39
|
/** f64s per tuple (om's `WRUN_OPTION_STRIKES_TUPLE_WIDTH`). */
|
|
33
40
|
export const WRUN_OPTION_STRIKES_WIDTH = 12;
|
|
@@ -35,6 +42,10 @@ export const WRUN_OPTION_STRIKES_WIDTH = 12;
|
|
|
35
42
|
export const WRUN_OPTION_STRIKES_FINITE_COLUMNS = Object.freeze([0, 1]);
|
|
36
43
|
/** om's code for a market pin on the chain classes. */
|
|
37
44
|
export const WRUN_OPTIONS_CHAIN_MARKET_PINNED_CODE = 'wrun_options_chain_market_pinned';
|
|
45
|
+
/** The payload field an instance names its chain's exchange in (its plane follows it). */
|
|
46
|
+
export const WRUN_OPTION_STRIKES_EXCHANGE_FIELD = 'strikeExchange';
|
|
47
|
+
/** What `identity` resolved for a chart (the one chain resolver's chart), read back by `facets`. Keyed by the chart
|
|
48
|
+
* market; the newest entries kept. */
|
|
38
49
|
const STRIKES_CHARTS_KEPT = 16;
|
|
39
50
|
const strikesCharts = new Map();
|
|
40
51
|
function rememberStrikesChart(key, chart) {
|
|
@@ -57,6 +68,28 @@ export function wrunOptionStrikesKept(tuples, expiriesWord) {
|
|
|
57
68
|
const nearest = new Set(distinct.slice(0, expiries.count));
|
|
58
69
|
return tuples.filter((tuple) => nearest.has(Number(tuple[1])));
|
|
59
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* An input's chain as the ask's fields (the acquisition key: the class, the plane its exchange names, the exchange,
|
|
73
|
+
* the underlying, the book): `strikeExchange` and `strikeUnderlying` always (an OPRA chain's exactly as before),
|
|
74
|
+
* `strikeBook` for a book other than the underlying's own series (Deribit's BTC_USDC, OKX's BTC-USD: the strike job
|
|
75
|
+
* writes a `|<series>` tail for those alone), and `strikeContinuous` for a CME chain read off a continuous alias
|
|
76
|
+
* (`wrunOptionStrikesAcquisitionMoved` reads it).
|
|
77
|
+
*/
|
|
78
|
+
export function wrunOptionStrikesExtras(chain) {
|
|
79
|
+
const book = chain.book.toUpperCase();
|
|
80
|
+
return {
|
|
81
|
+
[WRUN_OPTION_STRIKES_EXCHANGE_FIELD]: chain.exchange,
|
|
82
|
+
strikeUnderlying: chain.underlying,
|
|
83
|
+
...(book !== chain.underlying.toUpperCase() ? { strikeBook: book } : {}),
|
|
84
|
+
...(chain.continuous !== undefined ? { strikeContinuous: chain.continuous } : {}),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** Whether an acquisition no longer names the contract the lane would plan now (D12): a CME chain read off a
|
|
88
|
+
* continuous alias whose lead rolled since the run planned it (`wrunLaneChainLeadMoved`). A live session holding it
|
|
89
|
+
* rebuilds, so no store or buffer joins the old contract's strikes to the new one's. */
|
|
90
|
+
export function wrunOptionStrikesAcquisitionMoved(acquisition) {
|
|
91
|
+
return wrunLaneChainLeadMoved(acquisition[WRUN_OPTION_STRIKES_EXCHANGE_FIELD], acquisition.strikeContinuous, acquisition.strikeUnderlying);
|
|
92
|
+
}
|
|
60
93
|
export const rowLane = {
|
|
61
94
|
sourceClass: 'option_strikes',
|
|
62
95
|
laneKey: 'option_strikes',
|
|
@@ -66,20 +99,15 @@ export const rowLane = {
|
|
|
66
99
|
width: WRUN_OPTION_STRIKES_WIDTH,
|
|
67
100
|
finiteColumns: WRUN_OPTION_STRIKES_FINITE_COLUMNS,
|
|
68
101
|
presentMask: false,
|
|
69
|
-
|
|
70
|
-
offPlane: 'empty',
|
|
102
|
+
chain: { exchangeField: WRUN_OPTION_STRIKES_EXCHANGE_FIELD },
|
|
71
103
|
acquisitions: 'one',
|
|
72
104
|
emptyAnswer: 'quiet',
|
|
73
105
|
landing: { kind: 'snapshot' },
|
|
106
|
+
acquisitionMoved: wrunOptionStrikesAcquisitionMoved,
|
|
74
107
|
identity: async (ctx) => {
|
|
75
|
-
|
|
76
|
-
const [cryptoVenues, { hasDeribitOptions }] = await Promise.all([
|
|
77
|
-
resolveWrunLaneCryptoVenues(chain, ctx.coin),
|
|
78
|
-
wrunChartHostEnv().market.loadDeribitOptions(),
|
|
79
|
-
]);
|
|
80
|
-
rememberStrikesChart(wrunLaneChartKey(ctx), { chain, cryptoVenues, deribitListed: hasDeribitOptions });
|
|
108
|
+
rememberStrikesChart(wrunLaneChartKey(ctx), await resolveWrunLaneChainChart(ctx));
|
|
81
109
|
},
|
|
82
|
-
facets: (source, ctx) => {
|
|
110
|
+
facets: async (source, ctx) => {
|
|
83
111
|
for (const knob of ['history', 'min_size']) {
|
|
84
112
|
if (source[knob] !== undefined)
|
|
85
113
|
refuseWrunLaneStrayKnob(ctx, knob, "'tape' celled");
|
|
@@ -94,25 +122,11 @@ export const rowLane = {
|
|
|
94
122
|
variant: 'generic',
|
|
95
123
|
});
|
|
96
124
|
}
|
|
97
|
-
const decision = decideWrunOptionsChainIdentity({
|
|
98
|
-
venue: source.venue === undefined ? undefined : String(source.venue),
|
|
99
|
-
chartSource: chart.chain.chartSource,
|
|
100
|
-
chartCoin: ctx.coin,
|
|
101
|
-
deribitListed: chart.deribitListed,
|
|
102
|
-
cryptoVenues: chart.cryptoVenues,
|
|
103
|
-
marketLabel: `${ctx.exchange}/${ctx.symbol}`,
|
|
104
|
-
inputName: ctx.inputName,
|
|
105
|
-
official: ctx.official === true,
|
|
106
|
-
opraUserScripts: ctx.opraUserScripts === true,
|
|
107
|
-
...(chart.chain.directoryFailed !== undefined ? { directoryFailed: chart.chain.directoryFailed } : {}),
|
|
108
|
-
// The known reason the chart's OPRA options ride no plane (the flag, the router): the refusal says it.
|
|
109
|
-
...(chart.chain.opraStop !== undefined ? { opraStop: chart.chain.opraStop } : {}),
|
|
110
|
-
// Another screen holds the session of the chain's plane: the refusal says so, with Resume here.
|
|
111
|
-
...(chart.chain.heldElsewhere !== undefined ? { heldElsewhere: chart.chain.heldElsewhere } : {}),
|
|
112
|
-
});
|
|
113
125
|
// om's order: the venue word, then the expiries word, then the chain the word resolves.
|
|
114
|
-
|
|
126
|
+
const decision = decideWrunLaneChainIdentity(chart, source.venue, ctx);
|
|
127
|
+
if (!decision.ok && decision.reason === 'bad-venue-word') {
|
|
115
128
|
throw wrunLaneChainRefusalError(decision, 'option_strikes');
|
|
129
|
+
}
|
|
116
130
|
const expiries = source.expiries;
|
|
117
131
|
const expiriesRead = expiries === undefined || (typeof expiries === 'string' && wrunOptionsChainExpiries(expiries) !== undefined);
|
|
118
132
|
if (!expiriesRead) {
|
|
@@ -120,15 +134,11 @@ export const rowLane = {
|
|
|
120
134
|
}
|
|
121
135
|
if (!decision.ok)
|
|
122
136
|
throw wrunLaneChainRefusalError(decision, 'option_strikes');
|
|
123
|
-
const {
|
|
124
|
-
const strikeChain = wrunOptionsChainIdentityKey(identity);
|
|
125
|
-
// Only an OPRA chain lists strike rows; any other chain the word resolves (off the plane) is never fetched.
|
|
126
|
-
if (identity.venue !== 'opra')
|
|
127
|
-
return { strikeChain };
|
|
137
|
+
const chain = await decideWrunLaneChain(chart, { venue: source.venue, book: source.book }, ctx);
|
|
128
138
|
return {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
139
|
+
// The chain's identity as the options chain keys it (one chain per package: `acquisitions: 'one'`).
|
|
140
|
+
strikeChain: wrunOptionsChainIdentityKey(decision.identity),
|
|
141
|
+
...wrunOptionStrikesExtras(chain),
|
|
132
142
|
// The run's bar span: the worker keeps the newest minute of each of these bars.
|
|
133
143
|
hostIntervalMs: ctx.intervalMs,
|
|
134
144
|
};
|
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `option_surface`: the volatility surface of the chart's options chain, one tuple per expiry on every bar (UW-PARITY S9,
|
|
3
|
+
* `contracts/sources.md`), on every chain the surface job samples (OPTIONS-PORT P1: the crypto venues, CME, OPRA).
|
|
4
|
+
*
|
|
5
|
+
* - Tuple, width 9: `[expiry_ms, dte_days, forward, atm_iv, iv_p25, iv_c25, iv_p10, iv_c10, present]`; bits 1 to 7 of
|
|
6
|
+
* `present` for dte_days through iv_c10 (each bit its column, 0 with the bit clear when the sample leaves it out),
|
|
7
|
+
* bit 8 when the forward came from put-call parity, bit 14 a partial bar.
|
|
8
|
+
* - Backend: OPTION_SURFACE (type 251, kiyotaka-go !62), venue-agnostic, by the chain's exchange and underlying (a
|
|
9
|
+
* crypto venue's root coin, a CME futures contract, an OPRA ticker), one surface per BOOK (a chain's series: Deribit's
|
|
10
|
+
* BTC and BTC_USDC, OKX's BTC-USD and BTC-USD_UM), sampled by the option-surface job into two tiers: 5m kept 30 days
|
|
11
|
+
* and 1d (the session's last sample, or a CME settlement, stamped at its UTC date) kept for good. pb-common 12.68.0
|
|
12
|
+
* names the type; under a pin that does not, every input refuses by name before any fetch
|
|
13
|
+
* (`protocol-pending:OPTION_SURFACE`, the one protocol gate every lane reading a type by name shares:
|
|
14
|
+
* wrun-protocol-pending.util).
|
|
15
|
+
* - Per bar, a snapshot under the tier rule (rule 9): each host bar reads the finest tier that fits it and still
|
|
16
|
+
* retains it (a 09:30-anchored stock bar of 5m or more reads 5m buckets within 30 days, a daily bar past them the 1d
|
|
17
|
+
* row), its newest SEALED bucket, and a bar its tier answered nothing for reads the next coarser tier (D12: a CME
|
|
18
|
+
* daily bar whose 5m tier holds no session reads its settlement DAY row); a bar no fitting tier retains (an intraday
|
|
19
|
+
* bar older than 30 days, a bar finer than 5m) is partial (bit 14, the marker tuple when it holds none).
|
|
20
|
+
* - A CHAIN lane (`chain`): the chain is the one chain resolver's (opra-option-lanes.util `decideWrunLaneChain`), per
|
|
21
|
+
* input, and its plane is per instance: OPRA's rules on a US stock or OPRA contract chart (unchanged), CME's on a CME
|
|
22
|
+
* futures chart (a continuous chart reads its lead contract, and a live session rebuilds once the lead rolls:
|
|
23
|
+
* `acquisitionMoved`), none on a crypto chain.
|
|
24
|
+
* - Knobs: `venue` (the options chain's words, decided by the venue decision `options_chain` reads, so `auto` reads
|
|
25
|
+
* the chain `options_chain`'s `auto` reads on the same chart: the chart's own options market, else the coin's
|
|
26
|
+
* Deribit chain, else the first venue that lists it), `book` (`auto` or one series name: ONE series per input,
|
|
27
|
+
* decided when the run plans and named in the acquisition, `auto` the chain's default book over the series its
|
|
28
|
+
* directory lists, opra-option-lanes.util `resolveWrunLaneChainAutoBook`; an answer never picks it) and `max_cells`
|
|
29
|
+
* (a block over it refuses the run); a market pin and the other options classes' knobs refuse by name.
|
|
30
|
+
*
|
|
31
|
+
* LIGHT at module load: pb-common and the chain resolver are imported inside `identity`.
|
|
32
|
+
*/
|
|
1
33
|
import { type WrunLaneChain } from '../opra-option-lanes.util.js';
|
|
2
34
|
import type { WrunRowLaneDescriptor } from '../wrun-row-lane.types.js';
|
|
3
35
|
import type { WrunBackendTier } from '../../wrun-tier-grid.util.js';
|
|
@@ -23,10 +55,10 @@ export declare function __resetWrunSurfaceChartsForTests(): void;
|
|
|
23
55
|
export declare function wrunOptionSurfaceExtras(chain: WrunLaneChain): Record<string, unknown>;
|
|
24
56
|
/**
|
|
25
57
|
* Whether an acquisition no longer names the chain the lane would plan now (D12): a CME chain read off a continuous
|
|
26
|
-
* alias whose lead contract rolled since the run planned it (`
|
|
27
|
-
* last answer
|
|
28
|
-
* plans the lead contract and its own series, and drops every buffered row), so no ask, cache
|
|
29
|
-
* old contract's surfaces to the new one's. A lead not resolved yet moves nothing.
|
|
58
|
+
* alias whose lead contract rolled since the run planned it (`wrunLaneChainLeadMoved`, every chain lane's one rule:
|
|
59
|
+
* the lead resolver's last answer names another contract than `surfaceUnderlying`). A live session holding it
|
|
60
|
+
* rebuilds (the full run plans the lead contract and its own series, and drops every buffered row), so no ask, cache
|
|
61
|
+
* or buffer joins the old contract's surfaces to the new one's. A lead not resolved yet moves nothing.
|
|
30
62
|
*/
|
|
31
63
|
export declare function wrunOptionSurfaceAcquisitionMoved(acquisition: Readonly<Record<string, unknown>>): boolean;
|
|
32
64
|
/**
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
*
|
|
31
31
|
* LIGHT at module load: pb-common and the chain resolver are imported inside `identity`.
|
|
32
32
|
*/
|
|
33
|
-
import {
|
|
34
|
-
import { decideWrunLaneChain, refuseWrunLaneStrayKnob, resolveWrunLaneChainChart, wrunLaneChainPlaneOf, wrunLaneChartKey, } from '../opra-option-lanes.util.js';
|
|
33
|
+
import { decideWrunLaneChain, refuseWrunLaneStrayKnob, resolveWrunLaneChainChart, wrunLaneChainLeadMoved, wrunLaneChainPlaneOf, wrunLaneChartKey, } from '../opra-option-lanes.util.js';
|
|
35
34
|
import { refuseWrunPollInput } from '../wrun-poll-lane.types.js';
|
|
36
35
|
import { assertWrunProtocolType } from '../../wrun-protocol-pending.util.js';
|
|
37
36
|
const MINUTE_MS = 60_000;
|
|
@@ -94,18 +93,13 @@ export function wrunOptionSurfaceExtras(chain) {
|
|
|
94
93
|
}
|
|
95
94
|
/**
|
|
96
95
|
* Whether an acquisition no longer names the chain the lane would plan now (D12): a CME chain read off a continuous
|
|
97
|
-
* alias whose lead contract rolled since the run planned it (`
|
|
98
|
-
* last answer
|
|
99
|
-
* plans the lead contract and its own series, and drops every buffered row), so no ask, cache
|
|
100
|
-
* old contract's surfaces to the new one's. A lead not resolved yet moves nothing.
|
|
96
|
+
* alias whose lead contract rolled since the run planned it (`wrunLaneChainLeadMoved`, every chain lane's one rule:
|
|
97
|
+
* the lead resolver's last answer names another contract than `surfaceUnderlying`). A live session holding it
|
|
98
|
+
* rebuilds (the full run plans the lead contract and its own series, and drops every buffered row), so no ask, cache
|
|
99
|
+
* or buffer joins the old contract's surfaces to the new one's. A lead not resolved yet moves nothing.
|
|
101
100
|
*/
|
|
102
101
|
export function wrunOptionSurfaceAcquisitionMoved(acquisition) {
|
|
103
|
-
|
|
104
|
-
const exchange = acquisition[WRUN_OPTION_SURFACE_EXCHANGE_FIELD];
|
|
105
|
-
if (typeof alias !== 'string' || alias === '' || typeof exchange !== 'string')
|
|
106
|
-
return false;
|
|
107
|
-
const lead = peekRegisteredContinuousLead(exchange, alias)?.symbol;
|
|
108
|
-
return typeof lead === 'string' && lead !== '' && lead !== acquisition.surfaceUnderlying;
|
|
102
|
+
return wrunLaneChainLeadMoved(acquisition[WRUN_OPTION_SURFACE_EXCHANGE_FIELD], acquisition.surfaceContinuous, acquisition.surfaceUnderlying);
|
|
109
103
|
}
|
|
110
104
|
/**
|
|
111
105
|
* Whether an acquisition's bar its tier answered nothing for reads the next coarser tier (D12): a CME chain's, whose
|
|
@@ -42,6 +42,7 @@ import type { WrunInputSource } from '../../../interfaces/wrun-runtime.interface
|
|
|
42
42
|
import type { WrunDailyLanding } from '../wrun-daily-lane.util.js';
|
|
43
43
|
import { type WrunRefusalSeed } from '../wrun-refusal.util.js';
|
|
44
44
|
import type { WrunBackendTier, WrunTierLanding } from '../wrun-tier-grid.util.js';
|
|
45
|
+
import type { WrunRowLaneChain } from './wrun-row-lane.types.js';
|
|
45
46
|
/** An input's declaration as a lane reads it: the typed fields, and any knob the sheet carries
|
|
46
47
|
* that the interface does not name yet (`asset`, `publisher`, `series`, ...), as `unknown`. */
|
|
47
48
|
export type WrunPollLaneSource = WrunInputSource & Readonly<Record<string, unknown>>;
|
|
@@ -56,8 +57,8 @@ export interface WrunPollLaneContext {
|
|
|
56
57
|
exchange: string;
|
|
57
58
|
symbol: string;
|
|
58
59
|
/** The chart market's category as the chart holds it (pb-common `Category`: an option contract chart's `OPTION`),
|
|
59
|
-
* handed to a lane that resolves the chart's options chain (the chart's options controls read it
|
|
60
|
-
* unknown. */
|
|
60
|
+
* handed to a lane that resolves the chart's options chain (the chart's options controls read it, and so does a
|
|
61
|
+
* `chain` lane's plan); absent when unknown. */
|
|
61
62
|
category?: number;
|
|
62
63
|
/** The chart's bar interval in ms. */
|
|
63
64
|
intervalMs: number;
|
|
@@ -70,12 +71,23 @@ export interface WrunPollLaneContext {
|
|
|
70
71
|
* otherwise. */
|
|
71
72
|
cryptoVenue?: boolean;
|
|
72
73
|
/** The run is an OpenMarket package's (`isOfficialWrunOverlay`, read at the run's wall door), handed to an
|
|
73
|
-
* `opra` lane's plan (and every row lane's)
|
|
74
|
+
* `opra` lane's plan and a `chain` lane's (and every row lane's): the chain decision's `auto` reads the OPRA chain
|
|
75
|
+
* only for a run the plane is open to. Absent reads false (fail closed). */
|
|
74
76
|
official?: boolean;
|
|
75
77
|
/** The `opra-user-scripts` flag opened the OPRA plane to the run (`isOpraUserScriptRun`), handed like
|
|
76
78
|
* `official`. Absent reads false. With `official`, the one OPRA decision (`mayReadOpra`): an `opra` lane is
|
|
77
79
|
* refused before its `plan` runs for a run it says no to, so a lane reads these only for its own choices. */
|
|
78
80
|
opraUserScripts?: boolean;
|
|
81
|
+
/** The chart's options ride the OPRA plane (the run's `isOpraPlaneExchange`, the planner's one verdict), handed to a
|
|
82
|
+
* `chain` lane: its chain there is OPRA's chain of the chart's own underlying. Absent reads false. */
|
|
83
|
+
opraPlane?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* The run's plan as an identity: one object per `planWrunPollLanes` call, the same for every input it plans. A lane
|
|
86
|
+
* keys a resolution every input of the run shares by it (a `WeakMap`: a `chain` lane's chart, its chain and its
|
|
87
|
+
* book), so two inputs of one run never read two answers and the chart is resolved once. Absent outside a run's
|
|
88
|
+
* plan (a spec calling `plan` alone): nothing is shared.
|
|
89
|
+
*/
|
|
90
|
+
runScope?: object;
|
|
79
91
|
}
|
|
80
92
|
/**
|
|
81
93
|
* How a lane's rows land on the chart grid:
|
|
@@ -202,6 +214,28 @@ export interface WrunPollLane {
|
|
|
202
214
|
* the legend names a delayed tier.
|
|
203
215
|
*/
|
|
204
216
|
opra?: true;
|
|
217
|
+
/**
|
|
218
|
+
* A CHAIN lane (OPTIONS-PORT P5, the row lanes' mark, `WrunRowLaneChain`): it reads the chart's options chain on
|
|
219
|
+
* whichever plane that chain lists on, decided per INSTANCE by the one chain resolver (opra-option-lanes.util
|
|
220
|
+
* `resolveWrunLaneChainChart` then `decideWrunLaneChain`, in its `plan`), never per descriptor. Its `plan` answers
|
|
221
|
+
* the chain's exchange in the payload field `exchangeField`, and the instance's plane follows that exchange
|
|
222
|
+
* (`wrunLaneChainPlaneOf`):
|
|
223
|
+
* - `opra`: the OPRA wall (before the chain is resolved on a chart whose options ride the plane), the plane and its
|
|
224
|
+
* routed tier in the ask, the overlay's OPRA provenance and the legend's delayed-tier note, as an `opra` lane's;
|
|
225
|
+
* - `cme`: the CME display wall (OpenMarket's own packages only) and the routed tier in the ask (`servedTier`);
|
|
226
|
+
* - `plain` (a crypto options venue): nothing beside the lane's own fields.
|
|
227
|
+
* It is admitted on every chart (a chart with no chain refuses by name in its `plan`) and rides the native-rows path
|
|
228
|
+
* on every plane (`nativeRows`: its rows are its chain's, never the chart market's). The registry refuses it beside
|
|
229
|
+
* `opra`, `global`, an own `fetch` or a `live` channel.
|
|
230
|
+
*/
|
|
231
|
+
chain?: WrunRowLaneChain;
|
|
232
|
+
/**
|
|
233
|
+
* Whether an instance's acquisition (the full run's record of its payload) no longer names the read the lane would
|
|
234
|
+
* plan now (a CME chain read off a continuous alias whose lead contract rolled). A live session holding such an
|
|
235
|
+
* instance rebuilds (the row lanes' rule, `WrunRowLaneDescriptor.acquisitionMoved`), so no ask, cache or buffer joins
|
|
236
|
+
* two reads. Synchronous, read on every drain. Absent: an acquisition never moves.
|
|
237
|
+
*/
|
|
238
|
+
acquisitionMoved?: (acquisition: Readonly<Record<string, unknown>>) => boolean;
|
|
205
239
|
/**
|
|
206
240
|
* The record each refusal BY NAME its K control's worker twin may answer (wrun-lane-refusal.leaf: a backend switch
|
|
207
241
|
* that keeps the read off, a series the data plane samples for a configured list only), by its code. The run
|
|
@@ -26,11 +26,21 @@
|
|
|
26
26
|
* (`wrunPollLaneFetchOptions`), the full run's window start and end
|
|
27
27
|
* (`wrunPollLaneFetchFrom`, `wrunPollLaneFetchTo`) and the reconcile's start
|
|
28
28
|
* (`wrunPollLaneReconcileFrom`).
|
|
29
|
+
* - a `chain` lane's plane per instance (`wrunPollLaneChainPlane`), the fields its asks name for it
|
|
30
|
+
* (`wrunPollLaneChainAsk`), the governed exchange its reconcile window and stop read
|
|
31
|
+
* (`wrunPollLaneChainGovernedExchange`), whether it reads OPRA (`wrunPollLaneInstanceReadsOpra`, the provenance
|
|
32
|
+
* stamp) and whether its acquisition moved (`wrunPollLaneMovedInstance`): the run's and the live tick's one rule.
|
|
33
|
+
* - the rules both planners keep (this one and wrun-row-lanes.util `planWrunRowLanes`), written once here: the chart's
|
|
34
|
+
* OPRA plane facts (`wrunChartOpraPlane`), a chain lane's OPRA wall and stop before its chain is resolved
|
|
35
|
+
* (`wrunChainLaneStop`), a lane's refusal that the chart has no option chain (`wrunLaneNoChainRefusal`), and what an
|
|
36
|
+
* input the chart does not serve does (`wrunUnservedLaneInput`: a declared fill drops it with a note, any other
|
|
37
|
+
* refuses by name).
|
|
29
38
|
*/
|
|
30
39
|
import type { WrunIndicatorMetadata, WrunInputSource } from '../../../interfaces/wrun-runtime.interface.js';
|
|
31
40
|
import type { OpraReadFacts } from '../../chart/opra-read-access.leaf.js';
|
|
32
41
|
import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
|
|
33
42
|
import { type WrunPollLane, type WrunPollLaneContext, type WrunPollLaneId, type WrunPollLaneInstance } from './wrun-poll-lane.types.js';
|
|
43
|
+
import { type WrunLaneChainPlane } from './wrun-row-lane.types.js';
|
|
34
44
|
import type { WrunMissingFeed } from '../wrun-run-health.util.js';
|
|
35
45
|
import type { LiveBucketVenue } from '../../chart/live-bucket.util.js';
|
|
36
46
|
/** One input of a registry class under the static plan. */
|
|
@@ -73,6 +83,69 @@ export interface WrunPollLaneRunFacts extends OpraReadFacts {
|
|
|
73
83
|
}
|
|
74
84
|
/** The technical words of an OPRA lane a known stop keeps off the chart (Copy details), by the stop's reason. */
|
|
75
85
|
export declare function wrunOpraPlaneStopDetail(stop: OpraOptionPlaneStop): string;
|
|
86
|
+
/** The chart's OPRA plane facts as both planners read them, once per plan (`wrunChartOpraPlane`). */
|
|
87
|
+
export interface WrunChartOpraPlane {
|
|
88
|
+
/** The chart's options ride the OPRA plane (a US stock or ETF chart while the `opra` flag is lit, an OPRA contract
|
|
89
|
+
* chart). */
|
|
90
|
+
onPlane: boolean;
|
|
91
|
+
/** Off the plane, the known reason a chart whose options list on OPRA rides none (opra-options-gate.util
|
|
92
|
+
* `opraOptionPlaneStop`: the flag check's `flag-off`, the plane router's `chart-kind`); absent, none is known. */
|
|
93
|
+
stop?: OpraOptionPlaneStop;
|
|
94
|
+
}
|
|
95
|
+
/** The chart's OPRA plane facts, off the predicates the run injects (`isOpraPlaneExchange`: absent, no chart rides
|
|
96
|
+
* the plane; `opraPlaneStop`, asked only off the plane). */
|
|
97
|
+
export declare function wrunChartOpraPlane(exchange: string, facts: Pick<WrunPollLaneRunFacts, 'isOpraPlaneExchange' | 'opraPlaneStop'> | undefined): WrunChartOpraPlane;
|
|
98
|
+
/**
|
|
99
|
+
* Why one input of a lane the chart does not serve is not served, as `wrunUnservedLaneInput` reads it: the planner's
|
|
100
|
+
* own words after the input's label (`words`, with the `stop` when a known stop keeps the chart's OPRA options off the
|
|
101
|
+
* plane), or the lane's own refusal that the chart has no option chain (`noChain`, `wrunLaneNoChainRefusal`).
|
|
102
|
+
*/
|
|
103
|
+
export type WrunUnservedLaneWhy = {
|
|
104
|
+
words: string;
|
|
105
|
+
stop?: OpraOptionPlaneStop;
|
|
106
|
+
} | {
|
|
107
|
+
noChain: Error;
|
|
108
|
+
};
|
|
109
|
+
/** One input the chart does not serve: its name and class (every note and refusal names them), the feed its note
|
|
110
|
+
* names (the lane key) and its declared `missing` policy. */
|
|
111
|
+
export interface WrunUnservedLaneInput {
|
|
112
|
+
inputName: string;
|
|
113
|
+
sourceClass: string;
|
|
114
|
+
feed: string;
|
|
115
|
+
missing: unknown;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* The ONE rule for an input of a lane the chart does not serve, both planners' (`planWrunPollLanes` with
|
|
119
|
+
* `WRUN_POLL_LANE_UNSERVED_FILLS`, wrun-row-lanes.util `planWrunRowLanes` with a celled input's `empty`), whatever keeps
|
|
120
|
+
* it unserved (an index-mode chart, an OPRA lane off the plane, a chain lane stopped off it, a chart with no option
|
|
121
|
+
* chain): an input that declared one of `fills` is dropped from planning and named in `missing` under its feed, one
|
|
122
|
+
* entry per feed with its inputs in declaration order (the run draws, the row builder hands it an empty lane, a note
|
|
123
|
+
* says which feed and why); any other refuses by name (the default `carry` policy has nothing to carry). Throws, or
|
|
124
|
+
* records the note.
|
|
125
|
+
*
|
|
126
|
+
* The words: a known stop (`stop`) says that reason, the note and the refusal alike (`options-stopped`), never "this
|
|
127
|
+
* market has no such feed"; a chart with no option chain (`noChain`) puts the chain decision's own words in the note's
|
|
128
|
+
* details under the market's note (an options feed is missing on every market alike, a crypto one too), and an input
|
|
129
|
+
* with no fill refuses with that decision itself (`no-options` / `chain`); any other is the feed-missing record, saying
|
|
130
|
+
* "it comes from crypto markets" only on a chart provably no crypto venue (`cryptoVenue` false).
|
|
131
|
+
*/
|
|
132
|
+
export declare function wrunUnservedLaneInput(missing: Map<string, WrunMissingFeed>, input: WrunUnservedLaneInput, fills: readonly string[], why: WrunUnservedLaneWhy, cryptoVenue: boolean | undefined): void;
|
|
133
|
+
/**
|
|
134
|
+
* Whether a lane's refusal says the chart has no option chain: its record's seed is `no-options` / `chain` (the chain
|
|
135
|
+
* decision's `no-chain`, opra-option-lanes.util `wrunLaneChainRefusalSeed`, and the OPRA-only lanes' "OPRA lists no
|
|
136
|
+
* options here"), read off the seed, never the words. Such a chart (a LINK perp, a forex pair, a stock listing no
|
|
137
|
+
* options) does not serve the feed: both planners hand the refusal to `wrunUnservedLaneInput`, so a declared fill reads.
|
|
138
|
+
*/
|
|
139
|
+
export declare function wrunLaneNoChainRefusal(error: unknown): error is Error;
|
|
140
|
+
/**
|
|
141
|
+
* A chain lane's input before its chain is resolved, both planners' one rule: where the chart's options list on OPRA
|
|
142
|
+
* (riding the plane, or kept off it by a known stop) the OPRA wall first (`opra-official-only:<class>`), every chain it
|
|
143
|
+
* would read there being OPRA's; then, kept off the plane by a known stop (the `opra` flag dark, an index chart), why
|
|
144
|
+
* the input is unserved (the stop's words and the stop, for `wrunUnservedLaneInput`), so no chain is resolved past the
|
|
145
|
+
* stop. Undefined: the lane resolves its chain (its instance then meets its own plane's wall,
|
|
146
|
+
* `assertWrunLaneChainPlaneReadable`).
|
|
147
|
+
*/
|
|
148
|
+
export declare function wrunChainLaneStop(plane: WrunChartOpraPlane, run: OpraReadFacts | undefined, ctx: Pick<WrunPollLaneContext, 'inputName' | 'sourceClass'>): WrunUnservedLaneWhy | undefined;
|
|
76
149
|
/** The run's plan against the chart (WRUN-REFUSALS contract): the lane instances to fetch, and
|
|
77
150
|
* the feeds the chart's fetch never serves to inputs that declared a missing fill (one entry per
|
|
78
151
|
* lane key, its inputs in declaration order). */
|
|
@@ -125,6 +198,21 @@ export type WrunPollLanePlanResult = WrunPollLanePlan & WrunPollLaneInstance[];
|
|
|
125
198
|
* note and in the refusal (`options-stopped`), never "this market has no such feed".
|
|
126
199
|
* The run's facts reach an `opra` lane's `plan` as `ctx.official` and `ctx.opraUserScripts`.
|
|
127
200
|
*
|
|
201
|
+
* A `chain` lane (the chart's options chain on whichever plane it lists on) is admitted on every chart its options are
|
|
202
|
+
* not stopped on: its `plan` resolves the chain through the one chain resolver. It meets the OPRA wall before its
|
|
203
|
+
* `plan` runs where the chart's options list on OPRA (every chain it reads there is OPRA's), and each instance then
|
|
204
|
+
* meets its own plane's wall (`assertWrunLaneChainPlaneReadable`: OPRA's, the CME display wall, none for a crypto
|
|
205
|
+
* chain). On a chart whose options list on OPRA but ride no plane for a known reason (`run.opraPlaneStop`) it keeps an
|
|
206
|
+
* `opra` lane's rules (`wrunChainLaneStop`, the row lanes' one rule): a declared fill drops the input with the stop's
|
|
207
|
+
* note, any other input refuses with it, and no chain is resolved past the stop. Its context carries the run's OPRA
|
|
208
|
+
* facts (the chain decision's `auto` reads them), the chart's category, the plane verdict (`opraPlane`: a lane reading
|
|
209
|
+
* by coin there reads no chain directory) and the plan's `runScope` (its inputs share one chart resolution).
|
|
210
|
+
*
|
|
211
|
+
* A chart with no option chain (a LINK perp, a forex pair, a stock listing no options) does not serve an options feed:
|
|
212
|
+
* an input whose lane's `plan` refuses so (`wrunLaneNoChainRefusal`: the record's `no-options` / `chain`) meets the
|
|
213
|
+
* same rule as an input an index-mode chart does not serve (`wrunUnservedLaneInput`), its note naming the feed with the
|
|
214
|
+
* chain decision's words, its refusal the decision's own.
|
|
215
|
+
*
|
|
128
216
|
* An input the market leaves undemanded (its `needed_by` leaves the market out, wrunSheetWithLaneDemand) is planned
|
|
129
217
|
* nowhere, before all of the above: no wall, no admission, no `plan`, no fetch, no note; the row builder reads its
|
|
130
218
|
* fill on every bar.
|
|
@@ -134,11 +222,49 @@ export type WrunPollLanePlanResult = WrunPollLanePlan & WrunPollLaneInstance[];
|
|
|
134
222
|
* import graphs; without one no chart reads as index-mode, and without the other the venue is
|
|
135
223
|
* unknown (the neutral words).
|
|
136
224
|
*/
|
|
137
|
-
export declare function planWrunPollLanes(metadata: WrunIndicatorMetadata, chart: Pick<WrunPollLaneContext, 'coin' | 'exchange' | 'symbol' | 'intervalMs'
|
|
225
|
+
export declare function planWrunPollLanes(metadata: WrunIndicatorMetadata, chart: Pick<WrunPollLaneContext, 'coin' | 'exchange' | 'symbol' | 'intervalMs'> & {
|
|
226
|
+
category?: unknown;
|
|
227
|
+
}, isIndexModeExchange?: (exchange: string) => boolean, isCryptoVenueExchange?: (exchange: string) => boolean, run?: WrunPollLaneRunFacts): Promise<WrunPollLanePlanResult>;
|
|
138
228
|
/** The lane instances of `planWrunPollLanes` alone (the array every caller that plans no notes
|
|
139
229
|
* reads): the same plan, the same refusals by name, an input that declared a missing fill on an
|
|
140
230
|
* index-mode chart dropped. */
|
|
141
|
-
export declare function planWrunPollLaneInstances(metadata: WrunIndicatorMetadata, chart: Pick<WrunPollLaneContext, 'coin' | 'exchange' | 'symbol' | 'intervalMs'
|
|
231
|
+
export declare function planWrunPollLaneInstances(metadata: WrunIndicatorMetadata, chart: Pick<WrunPollLaneContext, 'coin' | 'exchange' | 'symbol' | 'intervalMs'> & {
|
|
232
|
+
category?: unknown;
|
|
233
|
+
}, isIndexModeExchange?: (exchange: string) => boolean, isCryptoVenueExchange?: (exchange: string) => boolean, run?: WrunPollLaneRunFacts): Promise<WrunPollLaneInstance[]>;
|
|
234
|
+
/**
|
|
235
|
+
* A chain instance against its own plane's wall, by the plane and the exchange its chain lists on: an OPRA chain the
|
|
236
|
+
* OPRA wall (`mayReadOpra`), a CME chain the CME display wall (OpenMarket's own packages only, the run door's rule on
|
|
237
|
+
* a CME chart, kscript-venue-policy.util; the `opra-user-scripts` flag never opens it), a crypto chain (`plain`)
|
|
238
|
+
* none. The row lanes keep the same rule (wrun-row-lanes.util), in the same words.
|
|
239
|
+
*/
|
|
240
|
+
export declare function assertWrunLaneChainPlaneReadable(plane: WrunLaneChainPlane | undefined, exchange: string, run: OpraReadFacts | undefined, ctx: Pick<WrunPollLaneContext, 'inputName' | 'sourceClass'>): void;
|
|
241
|
+
/** The exchange a chain-lane instance's chain lists on (the payload field its `chain` names); '' for any other lane
|
|
242
|
+
* or a payload naming none. */
|
|
243
|
+
export declare function wrunPollLaneChainExchange(lane: Pick<WrunPollLane, 'chain'>, extras: Readonly<Record<string, unknown>>): string;
|
|
244
|
+
/** The plane a chain-lane instance reads, by its chain's exchange (`wrunLaneChainPlaneOf`, off the governed exchange
|
|
245
|
+
* sets); undefined for any other lane (its plane, if any, is its descriptor's `opra`). */
|
|
246
|
+
export declare function wrunPollLaneChainPlane(lane: Pick<WrunPollLane, 'chain'>, extras: Readonly<Record<string, unknown>>): WrunLaneChainPlane | undefined;
|
|
247
|
+
/** Whether one poll-lane instance reads the OPRA plane (the provenance stamp and the legend note follow it): every
|
|
248
|
+
* instance of an `opra` lane, a chain lane's whose chain lists on OPRA. */
|
|
249
|
+
export declare function wrunPollLaneInstanceReadsOpra(lane: Pick<WrunPollLane, 'opra' | 'chain'>, extras: Readonly<Record<string, unknown>>): boolean;
|
|
250
|
+
/** The governed exchange a chain-lane instance reads beside its chart's own market (the exchange its served access,
|
|
251
|
+
* and so its delayed window and its gate session, is read under): its chain's when a gate governs it (OPRA, a CME
|
|
252
|
+
* Group exchange); null for a crypto chain and for any other lane. */
|
|
253
|
+
export declare function wrunPollLaneChainGovernedExchange(lane: Pick<WrunPollLane, 'chain'>, extras: Readonly<Record<string, unknown>>): string | null;
|
|
254
|
+
/**
|
|
255
|
+
* A chain instance's ask (the full run's and the reconcile's, re-read on every ask): its payload with the fields its
|
|
256
|
+
* plane names beside it. An OPRA chain names the plane and its routed tier (`wrunOpraLanePayloadFields`: Door C judges
|
|
257
|
+
* it an OPRA ask, the legend names a delayed tier); a CME chain its routed tier alone (`servedTier`, so no source cache
|
|
258
|
+
* serves one tier's rows to the other; the chart's own badge names the delay); a crypto chain nothing. Any other
|
|
259
|
+
* lane's payload as it is. `tierOf` is the routing's rule (governed-route.util `governedMarketDataTier`), handed in so
|
|
260
|
+
* this module stays off the routing graph, and asked only for a governed exchange: it answers delayed for any
|
|
261
|
+
* exchange no gate governs.
|
|
262
|
+
*/
|
|
263
|
+
export declare function wrunPollLaneChainAsk(lane: Pick<WrunPollLane, 'chain'>, extras: Readonly<Record<string, unknown>>, tierOf: (exchange: string) => 'realtime' | 'delayed'): Readonly<Record<string, unknown>>;
|
|
264
|
+
/** The first poll-lane instance of a session whose acquisition moved since the run planned it (its lane's
|
|
265
|
+
* `acquisitionMoved` over the run's record of it, else over the instance's payload), or undefined: the live tick
|
|
266
|
+
* rebuilds the session then, as for a row lane's (wrun-row-lanes.util `wrunRowLaneMovedInstance`). */
|
|
267
|
+
export declare function wrunPollLaneMovedInstance(instances: ReadonlyArray<Pick<WrunPollLaneInstance, 'key' | 'laneKey' | 'extras'>> | undefined, acquisition: Readonly<Partial<Record<WrunPollLaneId, Readonly<Record<string, unknown>>>>>): WrunPollLaneId | undefined;
|
|
142
268
|
/**
|
|
143
269
|
* Whether a lane must answer rows for the package: true when any input reading it (`reads`)
|
|
144
270
|
* rides the default carry policy (an absent series has nothing to carry, so an empty lane
|