@orangecharts/wrun-chart-host 0.6.0 → 0.7.1
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 +14 -5
- package/dist/constants/marketCapabilities.constants.d.ts +5 -0
- package/dist/constants/marketCapabilities.constants.js +16 -0
- package/dist/host-ports.types.d.ts +35 -3
- package/dist/index.d.ts +11 -1
- package/dist/index.js +11 -1
- package/dist/indicators/controls/tpo-session.util.js +42 -18
- package/dist/market-data/billing.interface.d.ts +2 -1
- package/dist/settings-templates/index.d.ts +2 -0
- package/dist/settings-templates/index.js +19 -5
- package/dist/settings-templates/indicator-fields.d.ts +2 -0
- package/dist/settings-templates/indicator-fields.js +10 -0
- package/dist/settings-templates/tool-rules.d.ts +12 -2
- package/dist/settings-templates/tool-rules.js +9 -2
- package/dist/settings-templates/tool-tables.generated.js +9 -0
- package/dist/utility/chart/crypto-index.leaf.d.ts +16 -0
- package/dist/utility/chart/crypto-index.leaf.js +19 -0
- package/dist/utility/chart/index-mode-admission.util.js +9 -1
- package/dist/utility/chart/index-mode.util.d.ts +11 -5
- package/dist/utility/chart/index-mode.util.js +22 -10
- package/dist/utility/chart/kscript-source-answer-budget.leaf.d.ts +36 -0
- package/dist/utility/chart/kscript-source-answer-budget.leaf.js +39 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +38 -1
- package/dist/utility/chart/kscript-source-degrade.leaf.js +39 -1
- package/dist/utility/chart/live-bucket.util.d.ts +2 -1
- package/dist/utility/chart/live-bucket.util.js +47 -15
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +15 -1
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +9 -0
- package/dist/utility/chart/market-session-schedule.util.d.ts +3 -1
- package/dist/utility/chart/market-session-schedule.util.js +24 -2
- package/dist/utility/chart/marketKind.util.d.ts +12 -7
- package/dist/utility/chart/marketKind.util.js +15 -5
- package/dist/utility/chart/ny-calendar.util.d.ts +104 -0
- package/dist/utility/chart/ny-calendar.util.js +346 -0
- package/dist/utility/chart/om-panel.util.d.ts +14 -2
- package/dist/utility/chart/om-panel.util.js +108 -40
- package/dist/utility/chart/rth-session.util.d.ts +10 -7
- package/dist/utility/chart/rth-session.util.js +17 -22
- package/dist/utility/chart/trading-day.util.js +90 -18
- package/dist/utility/chart/us-equities-session.util.js +20 -67
- package/dist/utility/chart/wrun-bar-session-facts.util.js +14 -1
- package/dist/utility/common/time.util.d.ts +7 -1
- package/dist/utility/common/time.util.js +11 -41
- package/dist/utility/number-format.util.d.ts +17 -7
- package/dist/utility/number-format.util.js +18 -8
- package/dist/utility/options/option-symbol.util.js +13 -2
- package/dist/utility/symbol-selection/contract-expiry.util.js +9 -1
- package/dist/utility/watchlist/import/import-request.leaf.d.ts +4 -1
- package/dist/utility/watchlist/import/import-request.leaf.js +5 -2
- package/dist/utility/watchlist/import/tradingview-symbols.leaf.d.ts +25 -4
- package/dist/utility/watchlist/import/tradingview-symbols.leaf.js +62 -4
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +19 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +57 -0
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +23 -0
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +90 -0
- package/dist/utility/wrun/run-schedule/wrun-lane-groups.util.d.ts +39 -0
- package/dist/utility/wrun/run-schedule/wrun-lane-groups.util.js +60 -0
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +77 -0
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +195 -0
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +56 -0
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +70 -0
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +53 -0
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +239 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +16 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +14 -0
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +43 -18
- package/dist/utility/wrun/sources/lanes/options_flow.js +209 -72
- package/dist/utility/wrun/sources/lanes/token_supply.js +5 -31
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -18
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +12 -57
- package/dist/utility/wrun/sources/row-lane-registry.d.ts +1 -1
- package/dist/utility/wrun/sources/row-lane-registry.js +22 -8
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +61 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +103 -8
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +5 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +24 -12
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +55 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +95 -18
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +15 -1
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +23 -8
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +11 -11
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +14 -2
- package/dist/utility/wrun/sources/wrun-poll-lane.types.js +6 -3
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +43 -8
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +77 -11
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -16
- package/dist/utility/wrun/sources/wrun-row-lane.types.js +2 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +52 -12
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +110 -46
- package/dist/utility/wrun/wrun-browser-sources.leaf.d.ts +10 -0
- package/dist/utility/wrun/wrun-browser-sources.leaf.js +12 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +53 -18
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +45 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.js +14 -8
- package/dist/utility/wrun/wrun-failure-cause.d.ts +1 -1
- package/dist/utility/wrun/wrun-failure-cause.js +14 -0
- package/dist/utility/wrun/wrun-frames.js +6 -2
- package/dist/utility/wrun/wrun-host.service.d.ts +26 -18
- package/dist/utility/wrun/wrun-host.service.js +49 -52
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +1 -1
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +2 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +7 -4
- package/dist/utility/wrun/wrun-kit-run-tables.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-kit-run-tables.util.js +87 -0
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +2 -1
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +8 -2
- package/dist/utility/wrun/wrun-live-tick.util.js +35 -16
- package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +40 -13
- package/dist/utility/wrun/wrun-opra-flow.leaf.js +39 -12
- package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +70 -21
- package/dist/utility/wrun/wrun-option-contract-flow.util.js +257 -112
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +62 -22
- package/dist/utility/wrun/wrun-option-prints.util.js +148 -46
- package/dist/utility/wrun/wrun-option-views.util.d.ts +262 -0
- package/dist/utility/wrun/wrun-option-views.util.js +356 -0
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +23 -2
- package/dist/utility/wrun/wrun-options-chain.util.js +37 -3
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +18 -3
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +32 -7
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +9 -3
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +146 -18
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +50 -6
- package/dist/utility/wrun/wrun-overlay-run.util.js +816 -243
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +28 -12
- package/dist/utility/wrun/wrun-pin-venues.util.js +4 -6
- package/dist/utility/wrun/wrun-present-bits.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-present-bits.util.js +39 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-refusal-surface.util.js +5 -4
- package/dist/utility/wrun/wrun-refusal.util.d.ts +66 -6
- package/dist/utility/wrun/wrun-refusal.util.js +335 -40
- package/dist/utility/wrun/wrun-source-rows.util.js +11 -0
- package/dist/utility/wrun/wrun-tier-grid.util.d.ts +28 -3
- package/dist/utility/wrun/wrun-tier-grid.util.js +79 -19
- package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +14 -3
- package/dist/utility/wrun/wrun-transient-rerun.util.js +33 -8
- package/package.json +5 -5
- package/dist/utility/wrun/wrun-opra-underlying.util.d.ts +0 -12
- package/dist/utility/wrun/wrun-opra-underlying.util.js +0 -1
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `options_flow` source class (UW-PARITY source S2) as both threads read it:
|
|
3
|
-
* lane row's columns after the stamp), the knob words,
|
|
4
|
-
* bar sums. The lane file (main thread), the K control and
|
|
2
|
+
* The `options_flow` source class (UW-PARITY source S2, on every chain since OPTIONS-PORT P7) as both threads read it:
|
|
3
|
+
* the field list and its order (the lane row's columns after the stamp), the knob words, the acquisition's fields, and
|
|
4
|
+
* how each ask names the OPTION_PRINT_AGG flow scope rows a bar sums. The lane file (main thread), the K control and
|
|
5
|
+
* its worker twin read this one table, never copies.
|
|
5
6
|
*
|
|
6
7
|
* The rows (tsdb-gateway `pkg/tsdb/selects/option_print_agg.go`, U4; columns `contracts/flow-scope-columns.md`; the
|
|
7
|
-
* dimensions U6's `1792198478_add_option_print_agg_scopes` migration computes):
|
|
8
|
-
* -
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
8
|
+
* dimensions U6's `1792198478_add_option_print_agg_scopes` migration computes; on crypto and CME R7c's contract C7-1):
|
|
9
|
+
* - COIN rows of one underlying on the ask's exchange or venues (raw symbol `COIN`, the coin beside it): an OPRA
|
|
10
|
+
* ticker read, a CME ticker read (the future), and a crypto chain's every read (its ticker names its ONE book as
|
|
11
|
+
* `COIN:<book>`; `market` and `venue` read the coin across venues, every book);
|
|
12
|
+
* - MARKET rows of one exchange (`MARKET`): OPRA's every issue type, or one (`EQUITY` stock 4, `ETF` 3, `INDEX` 7), and
|
|
13
|
+
* a CME exchange's;
|
|
14
|
+
* - VENUE rows of one OPRA venue (`VENUE:<publisher id>`, the Databento publisher id the rows carry);
|
|
12
15
|
* - a COIN or MARKET row is keyed by option type, `dte_bucket` (1 the print's trade date, 2 one to seven days, 3 eight
|
|
13
16
|
* to thirty-five, 4 later; 0 a print past its expiry) and `moneyness` (+1 out of the money, -1 in the money, unset
|
|
14
17
|
* without an underlying price); a VENUE row by option type and issue type. Side is never a dimension: every row
|
|
15
|
-
* splits its totals by side in its `_ask`, `_bid`, `_mid` and `_none` columns.
|
|
18
|
+
* splits its totals by side in its `_ask`, `_bid`, `_mid` and `_none` columns (off OPRA the taker's side: no mid).
|
|
16
19
|
*
|
|
17
20
|
* Import-free: a lane file stays light at module load and the worker twin reads it too.
|
|
18
21
|
*/
|
|
@@ -25,6 +28,8 @@ export declare const WRUN_OPTIONS_FLOW_VENUE_FIELDS: readonly WrunOptionsFlowFie
|
|
|
25
28
|
/** `scope` (om `WRUN_OPTIONS_FLOW_SCOPES`); an absent knob reads `ticker`. */
|
|
26
29
|
export declare const WRUN_OPTIONS_FLOW_SCOPES: readonly ["ticker", "market", "equity", "etf", "index", "venue"];
|
|
27
30
|
export type WrunOptionsFlowScope = (typeof WRUN_OPTIONS_FLOW_SCOPES)[number];
|
|
31
|
+
/** The scopes US listed options alone serve (an issue type of the US market, R7c C7-2): unserved off the OPRA plane. */
|
|
32
|
+
export declare const WRUN_OPTIONS_FLOW_OPRA_SCOPES: readonly WrunOptionsFlowScope[];
|
|
28
33
|
/** `dte` (om `WRUN_OPTIONS_FLOW_DTE`); an absent knob reads `all`. */
|
|
29
34
|
export declare const WRUN_OPTIONS_FLOW_DTE: readonly ["all", "0dte", "week", "month", "later"];
|
|
30
35
|
export type WrunOptionsFlowDte = (typeof WRUN_OPTIONS_FLOW_DTE)[number];
|
|
@@ -50,16 +55,38 @@ export declare const WRUN_OPTION_SCOPE_READS_OFF_CODE = "option-scope-reads-off"
|
|
|
50
55
|
* good. The keys are the intervals the K control asks. */
|
|
51
56
|
export declare const WRUN_OPTIONS_FLOW_TIER_KEYS: readonly ["1m", "5m", "1d"];
|
|
52
57
|
export type WrunOptionsFlowTier = (typeof WRUN_OPTIONS_FLOW_TIER_KEYS)[number];
|
|
58
|
+
/** Each tier's bucket width, ms (a row's stamp is its bucket's start, on the UTC floor). */
|
|
59
|
+
export declare const WRUN_OPTIONS_FLOW_TIER_MS: Readonly<Record<WrunOptionsFlowTier, number>>;
|
|
60
|
+
/**
|
|
61
|
+
* The acquisition's fields beside `scope`, `coin`, `venueId`, `dte` and `moneyness` (the lane's plan answers them, the
|
|
62
|
+
* K control forwards them): the exchange the chart's chain lists on (the lane's `chain` mark: its plane decides the
|
|
63
|
+
* walls, the tier and the fold), a crypto ticker read's ONE book, the venues a crypto scope across venues reads, and a
|
|
64
|
+
* CME chain's continuous alias (`acquisitionMoved` reads it).
|
|
65
|
+
*/
|
|
66
|
+
export declare const WRUN_OPTIONS_FLOW_EXCHANGE_FIELD = "flowExchange";
|
|
67
|
+
export declare const WRUN_OPTIONS_FLOW_BOOK_FIELD = "flowBook";
|
|
68
|
+
export declare const WRUN_OPTIONS_FLOW_VENUES_FIELD = "flowVenues";
|
|
69
|
+
export declare const WRUN_OPTIONS_FLOW_CONTINUOUS_FIELD = "flowContinuous";
|
|
53
70
|
/** One acquisition: the payload the lane's plan answers and the K control forwards (plus the tier it is asked at). */
|
|
54
71
|
export interface WrunOptionsFlowAsk {
|
|
55
72
|
scope: WrunOptionsFlowScope;
|
|
56
|
-
/**
|
|
73
|
+
/** The exchange the chart's chain lists on (pb-common `Exchange` name): the read's venue unless `venues` names them. */
|
|
74
|
+
exchange: string;
|
|
75
|
+
/** A COIN read's underlying, upper case: every ticker read's, a crypto scope across venues' (the chart's coin). */
|
|
57
76
|
coin?: string;
|
|
58
|
-
/**
|
|
77
|
+
/** A crypto ticker read's ONE book (a series name, upper case), read as `COIN:<book>`; absent: every book. */
|
|
78
|
+
book?: string;
|
|
79
|
+
/** A crypto scope across venues (`market`, `venue`): the venues its COIN rows are read on. */
|
|
80
|
+
venues?: readonly string[];
|
|
81
|
+
/** Scope `venue` on OPRA: the venue's Databento publisher id. */
|
|
59
82
|
venueId?: number;
|
|
60
83
|
dte: WrunOptionsFlowDte;
|
|
61
84
|
moneyness: WrunOptionsFlowMoneyness;
|
|
62
85
|
tier: WrunOptionsFlowTier;
|
|
63
86
|
}
|
|
64
|
-
/**
|
|
65
|
-
|
|
87
|
+
/** Whether an ask reads VENUE rows (scope `venue` on OPRA, by publisher id: no side, DTE or moneyness split); a crypto
|
|
88
|
+
* scope `venue` reads its venue's COIN rows. */
|
|
89
|
+
export declare function wrunOptionsFlowReadsVenueRows(ask: Pick<WrunOptionsFlowAsk, 'scope' | 'coin'>): boolean;
|
|
90
|
+
/** The raw symbol an ask's read names: `COIN` for a read of one underlying (`COIN:<book>` when it names its ONE book),
|
|
91
|
+
* `VENUE:<publisher id>` for an OPRA venue, else the scope's MARKET word. */
|
|
92
|
+
export declare function wrunOptionsFlowScopeSymbol(ask: Pick<WrunOptionsFlowAsk, 'scope' | 'coin' | 'book' | 'venueId'>): string;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `options_flow` source class (UW-PARITY source S2) as both threads read it:
|
|
3
|
-
* lane row's columns after the stamp), the knob words,
|
|
4
|
-
* bar sums. The lane file (main thread), the K control and
|
|
2
|
+
* The `options_flow` source class (UW-PARITY source S2, on every chain since OPTIONS-PORT P7) as both threads read it:
|
|
3
|
+
* the field list and its order (the lane row's columns after the stamp), the knob words, the acquisition's fields, and
|
|
4
|
+
* how each ask names the OPTION_PRINT_AGG flow scope rows a bar sums. The lane file (main thread), the K control and
|
|
5
|
+
* its worker twin read this one table, never copies.
|
|
5
6
|
*
|
|
6
7
|
* The rows (tsdb-gateway `pkg/tsdb/selects/option_print_agg.go`, U4; columns `contracts/flow-scope-columns.md`; the
|
|
7
|
-
* dimensions U6's `1792198478_add_option_print_agg_scopes` migration computes):
|
|
8
|
-
* -
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
8
|
+
* dimensions U6's `1792198478_add_option_print_agg_scopes` migration computes; on crypto and CME R7c's contract C7-1):
|
|
9
|
+
* - COIN rows of one underlying on the ask's exchange or venues (raw symbol `COIN`, the coin beside it): an OPRA
|
|
10
|
+
* ticker read, a CME ticker read (the future), and a crypto chain's every read (its ticker names its ONE book as
|
|
11
|
+
* `COIN:<book>`; `market` and `venue` read the coin across venues, every book);
|
|
12
|
+
* - MARKET rows of one exchange (`MARKET`): OPRA's every issue type, or one (`EQUITY` stock 4, `ETF` 3, `INDEX` 7), and
|
|
13
|
+
* a CME exchange's;
|
|
14
|
+
* - VENUE rows of one OPRA venue (`VENUE:<publisher id>`, the Databento publisher id the rows carry);
|
|
12
15
|
* - a COIN or MARKET row is keyed by option type, `dte_bucket` (1 the print's trade date, 2 one to seven days, 3 eight
|
|
13
16
|
* to thirty-five, 4 later; 0 a print past its expiry) and `moneyness` (+1 out of the money, -1 in the money, unset
|
|
14
17
|
* without an underlying price); a VENUE row by option type and issue type. Side is never a dimension: every row
|
|
15
|
-
* splits its totals by side in its `_ask`, `_bid`, `_mid` and `_none` columns.
|
|
18
|
+
* splits its totals by side in its `_ask`, `_bid`, `_mid` and `_none` columns (off OPRA the taker's side: no mid).
|
|
16
19
|
*
|
|
17
20
|
* Import-free: a lane file stays light at module load and the worker twin reads it too.
|
|
18
21
|
*/
|
|
@@ -62,6 +65,8 @@ export const WRUN_OPTIONS_FLOW_VENUE_FIELDS = Object.freeze([
|
|
|
62
65
|
]);
|
|
63
66
|
/** `scope` (om `WRUN_OPTIONS_FLOW_SCOPES`); an absent knob reads `ticker`. */
|
|
64
67
|
export const WRUN_OPTIONS_FLOW_SCOPES = Object.freeze(['ticker', 'market', 'equity', 'etf', 'index', 'venue']);
|
|
68
|
+
/** The scopes US listed options alone serve (an issue type of the US market, R7c C7-2): unserved off the OPRA plane. */
|
|
69
|
+
export const WRUN_OPTIONS_FLOW_OPRA_SCOPES = Object.freeze(['equity', 'etf', 'index']);
|
|
65
70
|
/** `dte` (om `WRUN_OPTIONS_FLOW_DTE`); an absent knob reads `all`. */
|
|
66
71
|
export const WRUN_OPTIONS_FLOW_DTE = Object.freeze(['all', '0dte', 'week', 'month', 'later']);
|
|
67
72
|
/** `moneyness` (om `WRUN_OPTIONS_FLOW_MONEYNESS`); an absent knob reads `all`. */
|
|
@@ -84,10 +89,32 @@ export const WRUN_OPTION_SCOPE_READS_OFF_CODE = 'option-scope-reads-off';
|
|
|
84
89
|
/** The backend tiers a bar is read from (UW-PARITY rule 9, ADDENDUM-2 B3): 1m kept 7 days, 5m kept 30, 1d kept for
|
|
85
90
|
* good. The keys are the intervals the K control asks. */
|
|
86
91
|
export const WRUN_OPTIONS_FLOW_TIER_KEYS = Object.freeze(['1m', '5m', '1d']);
|
|
87
|
-
/**
|
|
92
|
+
/** Each tier's bucket width, ms (a row's stamp is its bucket's start, on the UTC floor). */
|
|
93
|
+
export const WRUN_OPTIONS_FLOW_TIER_MS = Object.freeze({
|
|
94
|
+
'1m': 60_000,
|
|
95
|
+
'5m': 300_000,
|
|
96
|
+
'1d': 86_400_000,
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* The acquisition's fields beside `scope`, `coin`, `venueId`, `dte` and `moneyness` (the lane's plan answers them, the
|
|
100
|
+
* K control forwards them): the exchange the chart's chain lists on (the lane's `chain` mark: its plane decides the
|
|
101
|
+
* walls, the tier and the fold), a crypto ticker read's ONE book, the venues a crypto scope across venues reads, and a
|
|
102
|
+
* CME chain's continuous alias (`acquisitionMoved` reads it).
|
|
103
|
+
*/
|
|
104
|
+
export const WRUN_OPTIONS_FLOW_EXCHANGE_FIELD = 'flowExchange';
|
|
105
|
+
export const WRUN_OPTIONS_FLOW_BOOK_FIELD = 'flowBook';
|
|
106
|
+
export const WRUN_OPTIONS_FLOW_VENUES_FIELD = 'flowVenues';
|
|
107
|
+
export const WRUN_OPTIONS_FLOW_CONTINUOUS_FIELD = 'flowContinuous';
|
|
108
|
+
/** Whether an ask reads VENUE rows (scope `venue` on OPRA, by publisher id: no side, DTE or moneyness split); a crypto
|
|
109
|
+
* scope `venue` reads its venue's COIN rows. */
|
|
110
|
+
export function wrunOptionsFlowReadsVenueRows(ask) {
|
|
111
|
+
return ask.scope === 'venue' && ask.coin === undefined;
|
|
112
|
+
}
|
|
113
|
+
/** The raw symbol an ask's read names: `COIN` for a read of one underlying (`COIN:<book>` when it names its ONE book),
|
|
114
|
+
* `VENUE:<publisher id>` for an OPRA venue, else the scope's MARKET word. */
|
|
88
115
|
export function wrunOptionsFlowScopeSymbol(ask) {
|
|
89
|
-
if (ask.scope === 'ticker')
|
|
90
|
-
return 'COIN';
|
|
116
|
+
if (ask.scope === 'ticker' || ask.coin !== undefined)
|
|
117
|
+
return ask.book !== undefined ? `COIN:${ask.book}` : 'COIN';
|
|
91
118
|
if (ask.scope === 'venue')
|
|
92
119
|
return `VENUE:${ask.venueId}`;
|
|
93
120
|
return WRUN_OPTIONS_FLOW_MARKET_WORDS[ask.scope];
|
|
@@ -29,8 +29,9 @@ export declare const WRUN_OPTION_CONTRACT_FLOW_BIT: Readonly<{
|
|
|
29
29
|
readonly iv: 1;
|
|
30
30
|
readonly shareDelta: 2;
|
|
31
31
|
}>;
|
|
32
|
-
/** OPTION_PRINT_AGG's contract tiers (tsdb-gateway `option_print_agg_{1m,5m,1h,1d}
|
|
33
|
-
* hour and the day for good. Each key is the interval word the K
|
|
32
|
+
/** OPTION_PRINT_AGG's contract tiers (tsdb-gateway `option_print_agg_{1m,5m,1h,1d}`, the same on the cme and ore
|
|
33
|
+
* planes, contract C7-1): 1m kept 7 days, 5m 30, the hour and the day for good. Each key is the interval word the K
|
|
34
|
+
* control asks the tier by.
|
|
34
35
|
* `servedLagMs` (read by the coarsest tier choice only: the 1m tier stays the fallback for every bar): how long after
|
|
35
36
|
* a bar ends a coarser tier may serve it.
|
|
36
37
|
* - Every coarser tier waits out the delayed window's lag, so a delayed read's end never falls inside one of its
|
|
@@ -41,27 +42,41 @@ export declare const WRUN_OPTION_CONTRACT_FLOW_BIT: Readonly<{
|
|
|
41
42
|
* minutes, 5 minutes back), the day by `option-print-slow` (hourly at :30, 4 hours back); the lags add a margin for
|
|
42
43
|
* the run. */
|
|
43
44
|
export declare const WRUN_OPTION_PRINT_AGG_TIERS: readonly WrunBackendTier[];
|
|
44
|
-
/** The most contract rows one read may hold: the worker twin fails a window past it loudly, never truncated, and the
|
|
45
|
-
* lane's row budget keeps its asks under it before any fetch. */
|
|
46
|
-
export declare const WRUN_OPTION_CONTRACT_FLOW_MAX_ROWS = 500000;
|
|
47
45
|
/**
|
|
48
|
-
* The contract rows one regular session holds at each tier (one row per contract per bucket it traded in), the row
|
|
49
|
-
* budget's projection for EVERY underlying: SPY's, measured on 2026-10-14 (120 of its 13,168 listed
|
|
50
|
-
* at random, every 1m trade bar of the session, scaled to the chain), the upper end of a bootstrap 90%
|
|
51
|
-
* point estimates: 169k, 84k, 23k and 6.0k). A smaller chain is projected as SPY's (its older bars go
|
|
52
|
-
* than they need to); a larger one could still reach the worker's cap, which then fails loudly.
|
|
46
|
+
* The contract rows one regular OPRA session holds at each tier (one row per contract per bucket it traded in), the row
|
|
47
|
+
* budget's projection for EVERY underlying on the OPRA plane: SPY's, measured on 2026-10-14 (120 of its 13,168 listed
|
|
48
|
+
* contracts sampled at random, every 1m trade bar of the session, scaled to the chain), the upper end of a bootstrap 90%
|
|
49
|
+
* interval (the point estimates: 169k, 84k, 23k and 6.0k). A smaller chain is projected as SPY's (its older bars go
|
|
50
|
+
* partial sooner than they need to); a larger one could still reach the worker's cap, which then fails loudly. A CME
|
|
51
|
+
* chain is projected with the same rows per Globex trade day until one is measured: its OPTION_PRINT_AGG rows start
|
|
52
|
+
* with the CME print producer, and the ore gateway carries no CME option trades to measure.
|
|
53
53
|
*/
|
|
54
54
|
export declare const WRUN_OPTION_CONTRACT_FLOW_SESSION_ROWS: Readonly<Record<string, number>>;
|
|
55
|
+
/**
|
|
56
|
+
* The contract rows one UTC day of a crypto chain holds at each tier, the projection for every crypto chain: measured on
|
|
57
|
+
* 2026-10-20 over the ore gateway's TRADE_AGG minute bars of the venues' option trades (one row per contract per bucket
|
|
58
|
+
* that traded, the rows the print rollups write), the busiest chain at each tier doubled: Bybit BTC at 1m, 5m and 1h
|
|
59
|
+
* (2026-10-16: 28,084, 15,754 and 4,283 rows), Deribit BTC at 1d (at most 756 over 13 days from 2026-09-22; Deribit's
|
|
60
|
+
* busiest 1m day 7,133, OKX BTC 5,678).
|
|
61
|
+
*/
|
|
62
|
+
export declare const WRUN_OPTION_CONTRACT_FLOW_CRYPTO_DAY_ROWS: Readonly<Record<string, number>>;
|
|
55
63
|
/** The regular-session print minutes inside `[fromMs, toMs)`: each weekday's 09:30 to 16:15 New York (a holiday
|
|
56
64
|
* counts as a session, so the projection only errs high). */
|
|
57
65
|
export declare function wrunOptionPrintSessionMinutes(fromMs: number, toMs: number): number;
|
|
58
|
-
/** The
|
|
59
|
-
*
|
|
66
|
+
/** The CME Globex print minutes inside `[fromMs, toMs)`: Sunday 17:00 Chicago to Friday 16:00, less the daily 16:00
|
|
67
|
+
* to 17:00 halt (a holiday counts as a trade day, so the projection only errs high). */
|
|
68
|
+
export declare function wrunOptionGlobexPrintMinutes(fromMs: number, toMs: number): number;
|
|
69
|
+
/**
|
|
70
|
+
* The rows one host bar is projected to read at its tier, up to the clock (the lane's row budget), on the plane of the
|
|
71
|
+
* instance's chain (`acquisition`, its payload: the exchange it names, which the host hands every projection): the
|
|
72
|
+
* plane's rows per trade day at that tier in proportion to the print minutes the bar covers on the plane's calendar.
|
|
73
|
+
* No tier: none.
|
|
74
|
+
*/
|
|
60
75
|
export declare function wrunOptionContractFlowBarRows(bar: {
|
|
61
76
|
openMs: number;
|
|
62
77
|
endMs: number;
|
|
63
78
|
tier?: WrunBackendTier;
|
|
64
|
-
}, nowMs: number): number;
|
|
79
|
+
}, nowMs: number, acquisition: Readonly<Record<string, unknown>>): number;
|
|
65
80
|
/** One bucket's sums for one contract, as the worker hands them to the fold. */
|
|
66
81
|
export declare const WRUN_OPTION_CONTRACT_FLOW_RAW: Readonly<{
|
|
67
82
|
readonly root: 0;
|
|
@@ -89,9 +104,34 @@ export declare const WRUN_OPTION_CONTRACT_FLOW_RAW: Readonly<{
|
|
|
89
104
|
readonly sizePriced: 20;
|
|
90
105
|
}>;
|
|
91
106
|
export declare const WRUN_OPTION_CONTRACT_FLOW_RAW_WIDTH = 21;
|
|
107
|
+
/** The most contract rows one read may hold: the source answer CEILING (kscript-source-answer-budget.leaf) in raw
|
|
108
|
+
* tuples, about 99,900. The worker twin fails a window past it loudly, never truncated; the lane's row budget plans
|
|
109
|
+
* its asks to half of it (the budget), so only a session busier than twice its projection reaches it. */
|
|
110
|
+
export declare const WRUN_OPTION_CONTRACT_FLOW_MAX_ROWS: number;
|
|
111
|
+
/**
|
|
112
|
+
* A bucket's raw tuples packed as the worker hands them over: one Float64Array of `count x RAW_WIDTH` values, the
|
|
113
|
+
* tuples back to back. The page receives the block by transfer (no structured clone walks it), the row cache copies
|
|
114
|
+
* and weighs it by its bytes, and the fold reads it in place; a raw tuple as a plain array (a spec's, a JSON shape)
|
|
115
|
+
* reads the same.
|
|
116
|
+
*/
|
|
117
|
+
export declare function packWrunOptionContractFlowRaws(raws: ReadonlyArray<ReadonlyArray<number>>): Float64Array;
|
|
118
|
+
/**
|
|
119
|
+
* The payload fields an instance names its chain in (the lane's acquisition, and the K control's request to the worker
|
|
120
|
+
* twin under the same names): the exchange the chain lists on (its plane follows it), the ONE book when it is not the
|
|
121
|
+
* underlying's own series, and the continuous alias a CME chain was read off (its lead contract is `coin`).
|
|
122
|
+
*/
|
|
123
|
+
export declare const WRUN_OPTION_CONTRACT_FLOW_EXCHANGE_FIELD = "flowExchange";
|
|
124
|
+
export declare const WRUN_OPTION_CONTRACT_FLOW_BOOK_FIELD = "flowBook";
|
|
125
|
+
export declare const WRUN_OPTION_CONTRACT_FLOW_CONTINUOUS_FIELD = "flowContinuous";
|
|
92
126
|
/** The acquisition an `option_contract_flow` instance asks with. */
|
|
93
127
|
export interface WrunOptionContractFlowAcquisition {
|
|
128
|
+
/** The chain's underlying, upper case: the key its plane files the rows under (the OPRA ticker, a crypto venue's
|
|
129
|
+
* root coin, the CME futures contract). */
|
|
94
130
|
coin: string;
|
|
131
|
+
/** The exchange the chain lists on, upper case ('' when the payload names none: no read is served then). */
|
|
132
|
+
exchange: string;
|
|
133
|
+
/** The ONE book read, upper case: the payload's book, else the underlying's own series. */
|
|
134
|
+
book: string;
|
|
95
135
|
/** "nearest:N" or "0dte"; absent is "all". */
|
|
96
136
|
expiries?: string;
|
|
97
137
|
strikeWindowPct?: number;
|
|
@@ -101,8 +141,9 @@ export interface WrunOptionContractFlowAcquisition {
|
|
|
101
141
|
}
|
|
102
142
|
/** An instance's payload as its acquisition (knob fields that are not valid read absent). */
|
|
103
143
|
export declare function wrunOptionContractFlowAcquisitionOf(extras: Readonly<Record<string, unknown>> | null | undefined): WrunOptionContractFlowAcquisition;
|
|
104
|
-
/** Whether a payload is an `option_contract_flow` lane ask the K control serves:
|
|
105
|
-
*
|
|
144
|
+
/** Whether a payload is an `option_contract_flow` lane ask the K control serves: a coin, one of the contract tiers
|
|
145
|
+
* and a chain whose OPRA stamp holds (the print classes' one rule, wrun-option-prints.util
|
|
146
|
+
* `wrunOptionChainAskStampHolds`); any other caller is declined, fail closed. */
|
|
106
147
|
export declare function isWrunOptionContractFlowAsk(payload: Readonly<Record<string, unknown>> | null | undefined): boolean;
|
|
107
148
|
/** The tier a key names (one of the contract tiers), or undefined. */
|
|
108
149
|
export declare function wrunOptionPrintAggTierOf(key: unknown): WrunBackendTier | undefined;
|
|
@@ -119,14 +160,22 @@ export interface WrunOptionContractFlowRow {
|
|
|
119
160
|
}
|
|
120
161
|
/**
|
|
121
162
|
* One OPTION_PRINT_AGG CONTRACT row as a raw tuple (the history shape: a reshaped protobuf-es message, int64 as
|
|
122
|
-
* bigint, unset optionals undefined; a JSON shape reads the same). `series` names the contract (its
|
|
123
|
-
* option type). A scope row, a row missing its time or contract
|
|
124
|
-
*
|
|
163
|
+
* bigint, unset optionals undefined; a JSON shape reads the same). `series` names the contract (its exchange, by name
|
|
164
|
+
* or pb-common id, its raw symbol, parsed by the venue of the exchange, and the option type). A scope row, a row missing its time or contract
|
|
165
|
+
* (a series naming no exchange, or a symbol its venue does not spell), or one whose root the codec refuses is dropped
|
|
166
|
+
* and counted.
|
|
125
167
|
*/
|
|
126
168
|
export declare function wrunOptionContractFlowRowOf(point: Readonly<Record<string, unknown>> | null | undefined, series: Readonly<Record<string, unknown>> | null | undefined): WrunOptionContractFlowRow | WrunOptionContractFlowDrop;
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
129
|
-
|
|
169
|
+
/**
|
|
170
|
+
* Whether a contract row is a "0dte" row: its expiry falls on the trade date of its bucket, on the clock of the chain's
|
|
171
|
+
* market (`tradeDay`, the trade date an instant falls on in days: the worker hands the chain summary's one rule,
|
|
172
|
+
* option-contract-state.worker.util `optionChainTradeDay` over the chain's exchange: OPRA's New York date, a CME Group
|
|
173
|
+
* exchange's Globex session date, a crypto venue's UTC date), read at the bucket's middle so a UTC day bucket reads its
|
|
174
|
+
* own session's date.
|
|
175
|
+
*/
|
|
176
|
+
export declare function wrunOptionContractFlowRowIsZeroDte(row: WrunOptionContractFlowRow, tierMs: number, tradeDay: (instantMs: number) => number): boolean;
|
|
177
|
+
/** The raw tuples a bucket row holds (a packed block counts each of its tuples). */
|
|
178
|
+
export declare function wrunOptionContractFlowRawCount(row: ReadonlyArray<unknown>): number;
|
|
130
179
|
/**
|
|
131
180
|
* One host bar's contract tuples from its buckets' raw rows (in bucket order), under the acquisition's knobs:
|
|
132
181
|
* - every contract's sums over the bar, its last price from its newest bucket and its IV from its newest bucket that
|