@orangecharts/wrun-chart-host 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/constants/feature-flags.constants.d.ts +9 -0
- package/dist/constants/feature-flags.constants.js +67 -4
- package/dist/constants/governed-exchanges.constants.d.ts +12 -0
- package/dist/constants/governed-exchanges.constants.js +16 -0
- package/dist/constants/option-venues.constants.d.ts +2 -2
- package/dist/host-env.d.ts +1 -9
- package/dist/host-ports.types.d.ts +36 -7
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -1
- package/dist/interfaces/cancel-reason.interface.d.ts +1 -1
- package/dist/interfaces/cme-realtime.interface.d.ts +16 -9
- package/dist/interfaces/cme-realtime.interface.js +6 -3
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +1 -5
- package/dist/interfaces/prediction-market.interface.d.ts +7 -0
- package/dist/interfaces/stocks-realtime.interface.d.ts +57 -0
- package/dist/interfaces/stocks-realtime.interface.js +32 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +48 -117
- package/dist/kscript-data/controls/live-trades-merge.util.js +97 -207
- package/dist/market-data/billing.interface.d.ts +86 -12
- package/dist/market-data/billing.interface.js +23 -4
- package/dist/market-data/venue.d.ts +65 -2
- package/dist/market-data/venues/index.d.ts +135 -5
- package/dist/market-data/venues/index.js +2 -1
- package/dist/market-data/venues/opra.contract.copy.json +3 -2
- package/dist/market-data/venues/opra.d.ts +2 -2
- package/dist/market-data/venues/opra.js +5 -2
- package/dist/market-data/venues/stocks.contract.copy.json +64 -0
- package/dist/market-data/venues/stocks.d.ts +130 -0
- package/dist/market-data/venues/stocks.js +117 -0
- package/dist/settings-templates/footprint-rows.js +35 -2
- package/dist/settings-templates/form-rows.d.ts +2 -1
- package/dist/settings-templates/indicator-fields.js +34 -4
- package/dist/settings-templates/tool-rules.d.ts +12 -5
- package/dist/settings-templates/tool-rules.js +11 -5
- package/dist/settings-templates/tool-tables.generated.js +4 -0
- package/dist/utility/chart/cme-cache-context.util.d.ts +5 -3
- package/dist/utility/chart/cme-cache-context.util.js +10 -6
- package/dist/utility/chart/cme-realtime.util.js +10 -0
- package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +83 -0
- package/dist/utility/chart/cme-user-scripts-gate.util.js +142 -0
- package/dist/utility/chart/effective-chart-session.util.d.ts +14 -0
- package/dist/utility/chart/effective-chart-session.util.js +39 -0
- package/dist/utility/chart/host-bar-placement.util.d.ts +28 -0
- package/dist/utility/chart/host-bar-placement.util.js +170 -30
- package/dist/utility/chart/index-host-tier.util.d.ts +3 -1
- package/dist/utility/chart/index-host-tier.util.js +7 -2
- package/dist/utility/chart/index-mode-admission.util.js +25 -11
- package/dist/utility/chart/kscript-apply-fingerprint.util.js +1 -1
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +6 -9
- package/dist/utility/chart/kscript-live-coalesce.util.js +8 -9
- package/dist/utility/chart/kscript-live-source-identity.util.d.ts +9 -0
- package/dist/utility/chart/kscript-live-source-identity.util.js +10 -1
- package/dist/utility/chart/kscript-provenance-keys.util.js +7 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +115 -21
- package/dist/utility/chart/kscript-venue-policy.util.js +194 -40
- package/dist/utility/chart/live-bucket.util.d.ts +24 -8
- package/dist/utility/chart/live-bucket.util.js +85 -27
- package/dist/utility/chart/marketKind.util.js +5 -0
- package/dist/utility/chart/mixed-mode.util.d.ts +7 -0
- package/dist/utility/chart/mixed-mode.util.js +14 -0
- package/dist/utility/chart/opra-user-scripts-gate.util.d.ts +11 -16
- package/dist/utility/chart/opra-user-scripts-gate.util.js +12 -28
- package/dist/utility/chart/rth-session.util.d.ts +9 -8
- package/dist/utility/chart/rth-session.util.js +23 -20
- package/dist/utility/chart/trading-day.util.d.ts +17 -0
- package/dist/utility/chart/trading-day.util.js +59 -0
- package/dist/utility/chart/window-owner.leaf.d.ts +23 -2
- package/dist/utility/chart/window-owner.leaf.js +45 -3
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +33 -15
- package/dist/utility/chart/wrun-bar-session-facts.util.js +70 -20
- package/dist/utility/intl-locale.util.js +5 -0
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
- package/dist/utility/v2/gate-plane.util.d.ts +12 -3
- package/dist/utility/v2/gate-plane.util.js +30 -4
- package/dist/utility/v2/gate-session-latch.util.js +1 -1
- package/dist/utility/v2/stocks-governed.util.d.ts +16 -0
- package/dist/utility/v2/stocks-governed.util.js +34 -0
- package/dist/utility/wrun/derived-roots.leaf.d.ts +13 -0
- package/dist/utility/wrun/derived-roots.leaf.js +27 -0
- package/dist/utility/wrun/derived-roots.util.d.ts +1 -9
- package/dist/utility/wrun/derived-roots.util.js +3 -23
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +4 -3
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +24 -3
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +46 -10
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +2 -0
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +63 -16
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +58 -14
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +34 -11
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +106 -30
- package/dist/utility/wrun/wrun-browser-sources.leaf.js +1 -2
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +7 -4
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +12 -8
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +33 -0
- package/dist/utility/wrun/wrun-handles.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-handles.util.js +9 -8
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +68 -0
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +163 -7
- package/dist/utility/wrun/wrun-leg-close.util.d.ts +59 -23
- package/dist/utility/wrun/wrun-leg-close.util.js +186 -28
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +26 -12
- package/dist/utility/wrun/wrun-live-intake.util.js +219 -155
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +9 -5
- package/dist/utility/wrun/wrun-live-tick.util.js +130 -94
- package/dist/utility/wrun/wrun-market-facts.util.d.ts +13 -3
- package/dist/utility/wrun/wrun-market-facts.util.js +13 -3
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +20 -10
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +10 -5
- package/dist/utility/wrun/wrun-option-book-rows.util.d.ts +56 -0
- package/dist/utility/wrun/wrun-option-book-rows.util.js +96 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +281 -20
- package/dist/utility/wrun/wrun-option-views.util.js +391 -50
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-options-chain.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +15 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +13 -3
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +3 -1
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +60 -11
- package/dist/utility/wrun/wrun-overlay-run.util.js +529 -113
- package/dist/utility/wrun/wrun-panel-mount.util.js +51 -6
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +15 -2
- package/dist/utility/wrun/wrun-pin-spelling.util.js +27 -3
- package/dist/utility/wrun/wrun-refusal.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-refusal.util.js +22 -0
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +26 -0
- package/dist/utility/wrun/wrun-registry-errors.util.js +34 -0
- package/dist/utility/wrun/wrun-replay-lane.util.js +3 -2
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +20 -6
- package/dist/utility/wrun/wrun-run-interval-session.util.js +22 -7
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +39 -7
- package/dist/utility/wrun/wrun-run-interval.util.js +49 -9
- package/dist/utility/wrun/wrun-socket-row-source.js +7 -2
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +29 -22
- package/dist/utility/wrun/wrun-source-rows.util.js +62 -41
- package/dist/utility/wrun/wrun-tape-per-order.util.js +1 -20
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +17 -9
- package/dist/utility/wrun/wrun-tape-source.util.js +20 -12
- package/dist/workers/constants/socket-slots.d.ts +91 -6
- package/dist/workers/constants/socket-slots.js +85 -6
- package/package.json +11 -11
- package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +0 -56
- package/dist/kscript-data/controls/live-trades-order-gate.util.js +0 -107
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* One
|
|
3
|
-
* `addMemo`).
|
|
4
|
-
*
|
|
5
|
-
* same add
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
2
|
+
* One record per ADD of what its reads landed (OPTLOAD W3, after R2 and FE-FOLD-CAP; wrun-row-lanes.util
|
|
3
|
+
* `fetchWrunRowLaneRows` `addMemo`). Every read of one row lane instance of a mounted indicator (its runs, its live
|
|
4
|
+
* start, each live reconcile) leaves the add a memo: the bars it landed whole and final with their rows. Every later
|
|
5
|
+
* read of the same add reuses the landed bars and asks only the bars the memo does not hold (a new bar at the head, a
|
|
6
|
+
* bar still forming). The reuse is unconditional: it never waits on the download budget (`wrun-download-budget-cut`).
|
|
7
|
+
* Gated on it, an add's live start and every live reconcile asked their whole window again: ES1! 1h Interval Flow on
|
|
8
|
+
* INT (2026-10-27, after the close) read its newest regular hour and the 26 h before it (0.68 MB), then its live row
|
|
9
|
+
* read that hour and the 6 h before it again, at +3.6 s and at +17 s (0.50 MB each), every bar of them final.
|
|
10
|
+
*
|
|
11
|
+
* The budget's cut alone stays behind its flag: a budgeted read also leaves the bars its budget cut (kept partial,
|
|
12
|
+
* never asked again by the add) and what it downloaded within which share (a later budgeted run reads what is left), so
|
|
13
|
+
* the add spends its budget once, not once a read. INT 2026-10-23, Premium by Strike 0.3.0 on ES1! 1h: the refresh run,
|
|
14
|
+
* the live start and a live reconcile each folded the same 3 newest bars again, 1.21 MB a read. A whole run (no budget
|
|
15
|
+
* applies) reads the add's memo with the budget's record dropped (`wrunRowLaneAddMemoWhole`).
|
|
9
16
|
*
|
|
10
17
|
* Off the boot path: wrun-row-lanes.util loads it only for a read that names an add.
|
|
11
18
|
*/
|
|
@@ -14,6 +21,38 @@ import { type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
|
|
|
14
21
|
/** A landed bar is final once it ended this long before the read: a delayed route serves a bar's last buckets up to 15
|
|
15
22
|
* minutes after its close, so a bar closer to the clock is asked again by the add's next read. */
|
|
16
23
|
export declare const WRUN_ROW_LANE_FINAL_LAG_MS: number;
|
|
24
|
+
/**
|
|
25
|
+
* What one host bar's landed row depends on beyond its own span: the add memo's one eligibility rule, decided per row
|
|
26
|
+
* lane instance off its acquisition (wrun-row-lanes.util `wrunRowLaneRowDependencyOf`), so the memo never freezes a row
|
|
27
|
+
* a later read would answer otherwise (LIVE-REREAD review 2026-10-28: a whole session's sum, a carried next bar, a
|
|
28
|
+
* window-wide cut, the chart's newest trade date):
|
|
29
|
+
* - `bar`: the bar's own span and the data up to its end: final `WRUN_ROW_LANE_FINAL_LAG_MS` after the bar ends;
|
|
30
|
+
* - `session`: the whole trade date the bar falls on (`span: "session"`: one sum per contract per trade date, landed on
|
|
31
|
+
* the session's first bar and growing all session): final the lag after that trade date ends (`sessionEndMs`, on the
|
|
32
|
+
* chain's trade-date clock);
|
|
33
|
+
* - `next-bar`: the next bar with rows (a kit fold carrying the next bar's strikes): final once every bar after it, up
|
|
34
|
+
* to and including the next one with rows (`hasRows`), is whole and final too;
|
|
35
|
+
* - `never`: what no bar's clock settles (the window's newest cut, the chart's newest trade date under `history`
|
|
36
|
+
* "today"): the read neither reuses nor records a memo.
|
|
37
|
+
* Beside it, `emptyIsQuiet`: whether a bar the answer left with no row can be final at all. A flow's empty bar is quiet
|
|
38
|
+
* (nothing traded in it). A snapshot's is a picture not shown yet, asked again by every read: a read its worker failed
|
|
39
|
+
* and answered empty (option_strikes, option_surface), the older bars a folded strike kit read leaves unread past its
|
|
40
|
+
* cap, a CME surface bar whose settlement row is published after the bar's own end.
|
|
41
|
+
*/
|
|
42
|
+
export type WrunRowLaneRowDependency = (({
|
|
43
|
+
kind: 'bar';
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'session';
|
|
46
|
+
sessionEndMs: (stampMs: number) => number;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'next-bar';
|
|
49
|
+
hasRows: (row: ReadonlyArray<unknown>) => boolean;
|
|
50
|
+
}) & {
|
|
51
|
+
emptyIsQuiet: boolean;
|
|
52
|
+
}) | {
|
|
53
|
+
kind: 'never';
|
|
54
|
+
why: string;
|
|
55
|
+
};
|
|
17
56
|
/** What the add's reads of one row lane instance hold (`wrunRowLaneAddMemoAfter`). */
|
|
18
57
|
export interface WrunRowLaneAddMemo {
|
|
19
58
|
/** The lane, its acquisition without any per-ask field, and the bar span: a read printing another reads another add
|
|
@@ -21,17 +60,19 @@ export interface WrunRowLaneAddMemo {
|
|
|
21
60
|
readonly fingerprint: string;
|
|
22
61
|
/** The bars read whole and final, each with its landed row (undefined: the bar answered nothing, an empty bar). */
|
|
23
62
|
readonly landed: ReadonlyMap<number, ReadonlyArray<unknown> | undefined>;
|
|
24
|
-
/** The bars the add's budget left partial: never asked again by the add. */
|
|
63
|
+
/** The bars the add's budget left partial: never asked again by the add (none without a budgeted read). */
|
|
25
64
|
readonly cut: ReadonlySet<number>;
|
|
26
|
-
/** What the add's budgeted reads downloaded, and the share they read within (a later run reads what is left).
|
|
65
|
+
/** What the add's budgeted reads downloaded, and the share they read within (a later budgeted run reads what is left).
|
|
66
|
+
* No share before a budgeted read names one: a later budgeted run then reads its own whole share. */
|
|
27
67
|
readonly spentBytes: number;
|
|
28
|
-
readonly shareBytes: number;
|
|
68
|
+
readonly shareBytes: number | undefined;
|
|
29
69
|
}
|
|
30
70
|
/** The add's memo, or undefined when it holds none or one of another fingerprint (dropped then). */
|
|
31
71
|
export declare function wrunRowLaneAddMemoOf(key: string, fingerprint: string): WrunRowLaneAddMemo | undefined;
|
|
32
72
|
export declare function rememberWrunRowLaneAdd(key: string, memo: WrunRowLaneAddMemo): void;
|
|
33
|
-
/**
|
|
34
|
-
|
|
73
|
+
/** The memo a whole run of the add reads (no budget applies: its plan fits, or the cut is off): the landed bars are
|
|
74
|
+
* still reused, the bars a budgeted read cut are asked again, and the add's spend and share start over. */
|
|
75
|
+
export declare function wrunRowLaneAddMemoWhole(memo: WrunRowLaneAddMemo): WrunRowLaneAddMemo;
|
|
35
76
|
/** Test seam: forget every memo. */
|
|
36
77
|
export declare function __resetWrunRowLaneAddMemosForTests(): void;
|
|
37
78
|
/** The asks over the bars `keep` keeps: each ask cut into the runs of its kept bars (a bar belongs to the ask its span
|
|
@@ -41,17 +82,23 @@ export declare function wrunRowLaneAsksOverBars(asks: readonly WrunHostGridAsk[]
|
|
|
41
82
|
intervalMs: number;
|
|
42
83
|
}, sessionGrid: LiveBucketVenue | null | undefined): WrunHostGridAsk[];
|
|
43
84
|
/**
|
|
44
|
-
* The add's memo after one of its reads
|
|
45
|
-
* partial mark on its row
|
|
46
|
-
*
|
|
47
|
-
*
|
|
85
|
+
* The add's memo after one of its reads, whatever its role and whether or not a budget applies: every bar the read
|
|
86
|
+
* asked that landed whole (not partial for the read, no partial mark on its row, and a row at all unless an empty bar
|
|
87
|
+
* is quiet for the instance) and final under the instance's dependency (`WrunRowLaneRowDependency`: the lag after the
|
|
88
|
+
* bar's own end, its trade date's end, or its next bar with rows' being whole and final too) joins the landed bars and
|
|
89
|
+
* leaves the cut; every bar the read's budget cut joins the cut unless it is landed; a budgeted read adds what it
|
|
90
|
+
* downloaded and names its share (a whole run and a live read add nothing: the add's budget is its budgeted runs').
|
|
48
91
|
*/
|
|
49
92
|
export declare function wrunRowLaneAddMemoAfter(args: {
|
|
50
93
|
previous: WrunRowLaneAddMemo | undefined;
|
|
51
94
|
fingerprint: string;
|
|
95
|
+
dependency: Exclude<WrunRowLaneRowDependency, {
|
|
96
|
+
kind: 'never';
|
|
97
|
+
}>;
|
|
52
98
|
window: {
|
|
53
99
|
intervalMs: number;
|
|
54
100
|
nowMs: number;
|
|
101
|
+
barOpens: readonly number[];
|
|
55
102
|
};
|
|
56
103
|
sessionGrid: LiveBucketVenue | null | undefined;
|
|
57
104
|
askedBars: Iterable<number>;
|
|
@@ -3,7 +3,8 @@ const MINUTE_MS = 60_000;
|
|
|
3
3
|
/** A landed bar is final once it ended this long before the read: a delayed route serves a bar's last buckets up to 15
|
|
4
4
|
* minutes after its close, so a bar closer to the clock is asked again by the add's next read. */
|
|
5
5
|
export const WRUN_ROW_LANE_FINAL_LAG_MS = 20 * MINUTE_MS;
|
|
6
|
-
/** The memos kept, the oldest dropped first: one for each
|
|
6
|
+
/** The memos kept, the oldest dropped first: one for each row lane instance of a mounted indicator. An add whose memo
|
|
7
|
+
* went asks its window whole on its next read and leaves a new one. */
|
|
7
8
|
const MEMOS_KEPT = 32;
|
|
8
9
|
const memos = new Map();
|
|
9
10
|
/** The add's memo, or undefined when it holds none or one of another fingerprint (dropped then). */
|
|
@@ -23,9 +24,18 @@ export function rememberWrunRowLaneAdd(key, memo) {
|
|
|
23
24
|
while (memos.size > MEMOS_KEPT)
|
|
24
25
|
memos.delete(memos.keys().next().value);
|
|
25
26
|
}
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
/** The memo a whole run of the add reads (no budget applies: its plan fits, or the cut is off): the landed bars are
|
|
28
|
+
* still reused, the bars a budgeted read cut are asked again, and the add's spend and share start over. */
|
|
29
|
+
export function wrunRowLaneAddMemoWhole(memo) {
|
|
30
|
+
if (memo.cut.size === 0 && memo.spentBytes === 0 && memo.shareBytes === undefined)
|
|
31
|
+
return memo;
|
|
32
|
+
return {
|
|
33
|
+
fingerprint: memo.fingerprint,
|
|
34
|
+
landed: memo.landed,
|
|
35
|
+
cut: new Set(),
|
|
36
|
+
spentBytes: 0,
|
|
37
|
+
shareBytes: undefined,
|
|
38
|
+
};
|
|
29
39
|
}
|
|
30
40
|
/** Test seam: forget every memo. */
|
|
31
41
|
export function __resetWrunRowLaneAddMemosForTests() {
|
|
@@ -58,22 +68,56 @@ export function wrunRowLaneAsksOverBars(asks, keep, window, sessionGrid) {
|
|
|
58
68
|
return out;
|
|
59
69
|
}
|
|
60
70
|
/**
|
|
61
|
-
* The add's memo after one of its reads
|
|
62
|
-
* partial mark on its row
|
|
63
|
-
*
|
|
64
|
-
*
|
|
71
|
+
* The add's memo after one of its reads, whatever its role and whether or not a budget applies: every bar the read
|
|
72
|
+
* asked that landed whole (not partial for the read, no partial mark on its row, and a row at all unless an empty bar
|
|
73
|
+
* is quiet for the instance) and final under the instance's dependency (`WrunRowLaneRowDependency`: the lag after the
|
|
74
|
+
* bar's own end, its trade date's end, or its next bar with rows' being whole and final too) joins the landed bars and
|
|
75
|
+
* leaves the cut; every bar the read's budget cut joins the cut unless it is landed; a budgeted read adds what it
|
|
76
|
+
* downloaded and names its share (a whole run and a live read add nothing: the add's budget is its budgeted runs').
|
|
65
77
|
*/
|
|
66
78
|
export function wrunRowLaneAddMemoAfter(args) {
|
|
67
79
|
const landed = new Map(args.previous?.landed ?? []);
|
|
68
80
|
const cut = new Set(args.previous?.cut ?? []);
|
|
81
|
+
const { dependency } = args;
|
|
69
82
|
const finalBefore = args.window.nowMs - WRUN_ROW_LANE_FINAL_LAG_MS;
|
|
70
|
-
|
|
83
|
+
const asked = new Set(args.askedBars);
|
|
84
|
+
const endOf = (stampMs) => wrunHostBarSpanOf(stampMs, args.window.intervalMs, args.sessionGrid).toMs;
|
|
85
|
+
/** A bar this read landed whole, or one the add's memo already held (whole when it was admitted). A bar the answer
|
|
86
|
+
* left with no row is whole only where an empty bar is quiet (`emptyIsQuiet`: a flow's, never a snapshot's). */
|
|
87
|
+
const wholeAt = (stampMs) => {
|
|
88
|
+
if (!asked.has(stampMs))
|
|
89
|
+
return args.previous?.landed.has(stampMs) === true;
|
|
90
|
+
if (args.partialBars.has(stampMs))
|
|
91
|
+
return false;
|
|
71
92
|
const row = args.landedRows.get(stampMs);
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
93
|
+
return row === undefined || row.length <= 1 ? dependency.emptyIsQuiet : !args.marked(row);
|
|
94
|
+
};
|
|
95
|
+
const bars = [...args.window.barOpens].sort((a, b) => a - b);
|
|
96
|
+
const indexOf = new Map(bars.map((stampMs, at) => [stampMs, at]));
|
|
97
|
+
/** Whether a bar's row can no longer change: its own end, then what it depends on, the lag behind the read's clock. */
|
|
98
|
+
const finalAt = (stampMs) => {
|
|
99
|
+
if (endOf(stampMs) > finalBefore)
|
|
100
|
+
return false;
|
|
101
|
+
if (dependency.kind === 'bar')
|
|
102
|
+
return true;
|
|
103
|
+
if (dependency.kind === 'session')
|
|
104
|
+
return dependency.sessionEndMs(stampMs) <= finalBefore;
|
|
105
|
+
// The next bar with rows decides what this bar carries: every bar up to it must be whole and final, and it must be
|
|
106
|
+
// in the window (a bar whose next rows the read cannot see stays asked).
|
|
107
|
+
for (let at = (indexOf.get(stampMs) ?? bars.length) + 1; at < bars.length; at += 1) {
|
|
108
|
+
const next = bars[at];
|
|
109
|
+
if (endOf(next) > finalBefore || !wholeAt(next))
|
|
110
|
+
return false;
|
|
111
|
+
const row = args.landedRows.get(next);
|
|
112
|
+
if (row !== undefined && dependency.hasRows(row))
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
};
|
|
117
|
+
for (const stampMs of asked) {
|
|
118
|
+
if (!wholeAt(stampMs) || !finalAt(stampMs))
|
|
75
119
|
continue;
|
|
76
|
-
landed.set(stampMs,
|
|
120
|
+
landed.set(stampMs, args.landedRows.get(stampMs));
|
|
77
121
|
cut.delete(stampMs);
|
|
78
122
|
}
|
|
79
123
|
for (const stampMs of args.cutBars)
|
|
@@ -84,6 +128,6 @@ export function wrunRowLaneAddMemoAfter(args) {
|
|
|
84
128
|
landed,
|
|
85
129
|
cut,
|
|
86
130
|
spentBytes: (args.previous?.spentBytes ?? 0) + Math.max(0, args.spentBytes),
|
|
87
|
-
shareBytes: args.shareBytes ?? args.previous?.shareBytes
|
|
131
|
+
shareBytes: args.shareBytes ?? args.previous?.shareBytes,
|
|
88
132
|
};
|
|
89
133
|
}
|
|
@@ -44,6 +44,7 @@ import type { OpraOptionPlaneStop } from '../../../host-ports.types.js';
|
|
|
44
44
|
import type { WrunPollLaneFetchAsk } from './wrun-poll-lane.types.js';
|
|
45
45
|
import { type WrunLaneChainPlane, type WrunRowLaneCellInput, type WrunRowLaneDescriptor, type WrunRowLaneHorizon, type WrunRowLaneId, type WrunRowLaneInstance, type WrunRowLaneRowBudget } from './wrun-row-lane.types.js';
|
|
46
46
|
import { type WrunRunOptionsMarket } from '../derived-roots.util.js';
|
|
47
|
+
import type { WrunRowLaneRowDependency } from './wrun-row-lane-add-memo.util.js';
|
|
47
48
|
import type { WrunMissingFeed } from '../wrun-run-health.util.js';
|
|
48
49
|
import type { WrunLaneDownloadMeter } from '../wrun-download-plan.util.js';
|
|
49
50
|
import { type WrunBackendTier, type WrunHostGridAsk } from '../wrun-tier-grid.util.js';
|
|
@@ -263,19 +264,21 @@ export interface WrunRowLaneFetchOptions {
|
|
|
263
264
|
* A budgeted run's hold on this read (OPTLOAD W3 R2, `WrunRowLaneDownload`; wrun-download-plan.util): the newest slice
|
|
264
265
|
* is asked first and alone, then the newest older bars the read's share fits by the slice's own wire bytes, and no
|
|
265
266
|
* others; every bar it leaves unasked reads partial and the cut is named (`onBudgetCut`, `budget: 'download'`) once
|
|
266
|
-
* the asks landed. Absent (a whole run, the flag off):
|
|
267
|
+
* the asks landed. Absent (a whole run, the flag off): the plan's asks, over the bars the add's memo does not hold.
|
|
267
268
|
*/
|
|
268
269
|
download?: WrunRowLaneDownload;
|
|
269
270
|
/**
|
|
270
|
-
* The add this read belongs to (OPTLOAD W3
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
* add's
|
|
277
|
-
*
|
|
278
|
-
*
|
|
271
|
+
* The add this read belongs to (OPTLOAD W3; wrun-row-lane-add-memo.util): `key` names the chart, the mounted
|
|
272
|
+
* indicator and the instance (`wrunRowLaneAddKey`), `role` the read. Every read that names its add leaves the add a
|
|
273
|
+
* memo of the bars it landed whole and final, and every later read of the add (a run's, the live start, a live
|
|
274
|
+
* reconcile) reuses them and asks only the rest: a new bar at the head, a bar still forming. Whether a download
|
|
275
|
+
* budget applies changes none of that; a budgeted run's read also leaves the bars its budget cut (kept partial by
|
|
276
|
+
* every later read) and what it downloaded (a later budgeted run reads within what is left of the add's share), and a
|
|
277
|
+
* run with no `download` (the add's plan is whole, or the cut is off) asks the cut bars again and starts the add's
|
|
278
|
+
* spend over. Absent (a read of no add: a spec, a probe): no memo is read or left. A replay's read (`replayCursorMs`)
|
|
279
|
+
* never reads or leaves the add's memo: it keeps one of its own (`role: 'replay'`, keyed by the lane, the acquisition
|
|
280
|
+
* and the bar span), so a later read at the same or a later cursor reuses the bars it landed and asks the rest. Every
|
|
281
|
+
* memo admits only the bars of asks the chart's fetch confirmed whole (`ask`'s verdict).
|
|
279
282
|
*/
|
|
280
283
|
addMemo?: {
|
|
281
284
|
key: string;
|
|
@@ -364,7 +367,8 @@ export interface WrunRowLaneBudgetCut {
|
|
|
364
367
|
* row budget (the smaller cut wins), the read asks its newest slice first and alone, then the newest older bars its
|
|
365
368
|
* share fits by the slice's own wire bytes, and no others; every bar it leaves unasked reads partial (bit 14 with the
|
|
366
369
|
* marker tuple; an empty block on a class with no `present` mask), and the cut is named once the asks landed
|
|
367
|
-
* (`onBudgetCut`, `budget: 'download'`). No early handover in that mode. Absent:
|
|
370
|
+
* (`onBudgetCut`, `budget: 'download'`). No early handover in that mode. Absent: the plan's asks, over the bars the
|
|
371
|
+
* add's memo does not hold (`opts.addMemo`).
|
|
368
372
|
*
|
|
369
373
|
* A replay's window (`window.replayCursorMs`, plan L6a): a flow or snapshot lane's bars end at the replay's cursor
|
|
370
374
|
* (`wrunRowLaneWindowAtReplayCursor`), so nothing after it is asked, and the read keeps a replay memo (the add memo's
|
|
@@ -381,6 +385,25 @@ export declare function fetchWrunRowLaneRows(lane: WrunRowLaneDescriptor, extras
|
|
|
381
385
|
fromTs: number;
|
|
382
386
|
toTs: number;
|
|
383
387
|
}, ask: (extras: Readonly<Record<string, unknown>>, fromTs: number, toTs: number, whole?: (whole: boolean) => void) => Promise<ReadonlyArray<ReadonlyArray<unknown>>>, opts?: WrunRowLaneFetchOptions): Promise<unknown[][]>;
|
|
388
|
+
/**
|
|
389
|
+
* What one host bar's landed row depends on beyond its own span, read off a row lane instance's acquisition: the add
|
|
390
|
+
* memo's ONE eligibility rule (wrun-row-lane-add-memo.util `WrunRowLaneRowDependency`), so no read reuses a row a later
|
|
391
|
+
* read would answer otherwise (LIVE-REREAD review 2026-10-28). By the acquisition's own words, whatever the lane:
|
|
392
|
+
* - a window-wide cut (`newest`, and `newestTailMs` beside it: the window's N newest prints, option_prints): a bar's
|
|
393
|
+
* rows depend on every newer print of the read's window: `never`;
|
|
394
|
+
* - `history: "today"` (the flow lanes): which bars hold rows depends on the trade date of the chart's newest bar (the K
|
|
395
|
+
* control's `todayFromMs`), which no bar's clock settles: `never`;
|
|
396
|
+
* - `span: "session"` (the flow lanes): one sum per contract per trade date on the session's first bar, growing all
|
|
397
|
+
* session: `session`, its trade date's end on the chain's clock (`optionTradeDateClockOf`, the clock the worker
|
|
398
|
+
* twins group by); `never` for a chain the acquisition names no exchange of;
|
|
399
|
+
* - a kit fold carrying the next bar's strikes (`wrunOptionLaneCarriesNext`): `next-bar`, its rows read as the paging
|
|
400
|
+
* seam reads them (`wrunOptionKitBarHasRows`);
|
|
401
|
+
* - anything else: `bar`, final the lag after its own end.
|
|
402
|
+
* And by the lane's landing, an empty bar: quiet on a flow (nothing traded), never final on a snapshot (`emptyIsQuiet`
|
|
403
|
+
* false: a picture not shown yet, a failed read answered empty, a folded kit read's older bars past its cap, a CME
|
|
404
|
+
* surface bar whose settlement row is not published yet; LIVE-REREAD sweep 2026-10-28).
|
|
405
|
+
*/
|
|
406
|
+
export declare function wrunRowLaneRowDependencyOf(lane: Pick<WrunRowLaneDescriptor, 'sourceClass' | 'chain' | 'landing'>, extras: Readonly<Record<string, unknown>>): WrunRowLaneRowDependency;
|
|
384
407
|
/**
|
|
385
408
|
* A landed row with every packed block (a Float64Array a worker handed the page by transfer, `count x width` values back
|
|
386
409
|
* to back: OPTLOAD G5 O6) split into plain tuples of `width` values, every other cell as it is; a new array. The one
|
|
@@ -6,6 +6,7 @@ import { WRUN_ROW_LANE_ID_PREFIX, } from './wrun-row-lane.types.js';
|
|
|
6
6
|
import { assertWrunOpraLaneReadable } from '../wrun-opra-lane.util.js';
|
|
7
7
|
import { resolveWrunUnderlyingMarket, resolveWrunUnderlyingSettingKnob, wrunTakesUnderlying, wrunUnderlyingKnob, wrunUnderlyingLaneContext, wrunUnderlyingRootOf, wrunUnderlyingVenueWord, } from '../derived-roots.util.js';
|
|
8
8
|
import { wrunSheetCellBlockTuples } from '../wrun-cell-capacity.leaf.js';
|
|
9
|
+
import { optionTradeDateClockOf, optionTradeDayByClock, optionTradeDayStartMsByClock, } from '../../options/option-trade-date.util.js';
|
|
9
10
|
import { WRUN_OPTION_FLOW_TODAY_FIELD, wrunOptionFlowTodayFromOf } from '../wrun-option-contract-flow.util.js';
|
|
10
11
|
import { wrunOptionInputTupleWidth, wrunOptionKitBarHasRows, wrunOptionLaneCarriesNext, wrunOptionLaneFirstPaintBudget, wrunOptionLaneTupleWidth, } from '../wrun-option-views.util.js';
|
|
11
12
|
import { wrunPartialMarkerTuple, wrunPresentIsPartial, wrunTuplesMarkedPartial } from '../wrun-present-bits.util.js';
|
|
@@ -250,7 +251,8 @@ async function planWrunRowLaneUnderlying(source, ctx, run) {
|
|
|
250
251
|
return undefined;
|
|
251
252
|
const market = await resolveWrunUnderlyingMarket(root, ctx, run);
|
|
252
253
|
// A CME root's chain is CME options data whatever the chart: the display wall before any read (and after the facets,
|
|
253
|
-
// as for every chain instance).
|
|
254
|
+
// as for every chain instance). OpenMarket's own packages only, whatever the `cme-user-scripts` gate says (no implied
|
|
255
|
+
// expansion to CME options).
|
|
254
256
|
if (market.family === 'cme')
|
|
255
257
|
assertWrunLaneChainPlaneReadable('cme', market.exchange, run, ctx);
|
|
256
258
|
if (market.family === 'opra') {
|
|
@@ -445,7 +447,8 @@ export function wrunRowLaneAddKey(chartIndex, indicatorId, instanceKey) {
|
|
|
445
447
|
* row budget (the smaller cut wins), the read asks its newest slice first and alone, then the newest older bars its
|
|
446
448
|
* share fits by the slice's own wire bytes, and no others; every bar it leaves unasked reads partial (bit 14 with the
|
|
447
449
|
* marker tuple; an empty block on a class with no `present` mask), and the cut is named once the asks landed
|
|
448
|
-
* (`onBudgetCut`, `budget: 'download'`). No early handover in that mode. Absent:
|
|
450
|
+
* (`onBudgetCut`, `budget: 'download'`). No early handover in that mode. Absent: the plan's asks, over the bars the
|
|
451
|
+
* add's memo does not hold (`opts.addMemo`).
|
|
449
452
|
*
|
|
450
453
|
* A replay's window (`window.replayCursorMs`, plan L6a): a flow or snapshot lane's bars end at the replay's cursor
|
|
451
454
|
* (`wrunRowLaneWindowAtReplayCursor`), so nothing after it is asked, and the read keeps a replay memo (the add memo's
|
|
@@ -490,20 +493,28 @@ export async function fetchWrunRowLaneRows(lane, extras, askedWindow, fallback,
|
|
|
490
493
|
const cut = wrunRowLaneBudgetCutOf(lane.laneKey, lane.rowBudget, withinHorizon, budgeted, window, sessionGrid);
|
|
491
494
|
reportWrunRowLaneBudgetCut(cut, window.intervalMs, opts.onBudgetCut);
|
|
492
495
|
}
|
|
493
|
-
// One
|
|
494
|
-
//
|
|
495
|
-
// replay's read keeps its own memo, never the add's, so a later read at its cursor asks only the bars it
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
496
|
+
// One record per add (`opts.addMemo`, wrun-row-lane-add-memo.util): the bars a read of this add already landed whole
|
|
497
|
+
// and final are reused and only the rest is asked, whether or not a budget applies; the bars a budgeted read cut stay
|
|
498
|
+
// partial. A replay's read keeps its own memo, never the add's, so a later read at its cursor asks only the bars it
|
|
499
|
+
// lacks. When a bar's row is final is the acquisition's (`wrunRowLaneRowDependencyOf`): one whose rows no bar's clock
|
|
500
|
+
// settles keeps no memo at all.
|
|
501
|
+
const dependency = wrunRowLaneRowDependencyOf(lane, extras);
|
|
502
|
+
const memoDependency = dependency.kind === 'never' ? undefined : dependency;
|
|
503
|
+
const addMemo = memoDependency === undefined
|
|
504
|
+
? undefined
|
|
505
|
+
: window.replayCursorMs !== undefined && Number.isFinite(window.replayCursorMs)
|
|
506
|
+
? { key: `replay|${wrunRowLaneAddFingerprintOf(lane, extras, window)}`, role: 'replay' }
|
|
507
|
+
: opts.addMemo;
|
|
499
508
|
const memoUtil = addMemo === undefined ? undefined : await import('./wrun-row-lane-add-memo.util.js');
|
|
500
509
|
const memoFingerprint = addMemo === undefined ? '' : wrunRowLaneAddFingerprintOf(lane, extras, window);
|
|
501
|
-
const
|
|
502
|
-
if (wholeRun && memoUtil !== undefined && addMemo !== undefined)
|
|
503
|
-
memoUtil.forgetWrunRowLaneAdd(addMemo.key);
|
|
504
|
-
const memo = memoUtil === undefined || addMemo === undefined || wholeRun
|
|
510
|
+
const held = memoUtil === undefined || addMemo === undefined
|
|
505
511
|
? undefined
|
|
506
512
|
: memoUtil.wrunRowLaneAddMemoOf(addMemo.key, memoFingerprint);
|
|
513
|
+
// A whole run (no `download`: its plan fits the budget, or the cut is off) still reuses the add's landed bars; it
|
|
514
|
+
// asks the bars a budgeted read cut and owes the budget nothing.
|
|
515
|
+
const memo = held !== undefined && memoUtil !== undefined && addMemo?.role === 'run' && opts.download === undefined
|
|
516
|
+
? memoUtil.wrunRowLaneAddMemoWhole(held)
|
|
517
|
+
: held;
|
|
507
518
|
const heldCut = memo === undefined ? [] : window.barOpens.filter((stampMs) => memo.cut.has(stampMs) && !memo.landed.has(stampMs));
|
|
508
519
|
const freshAsks = memo === undefined || memoUtil === undefined
|
|
509
520
|
? asks
|
|
@@ -513,10 +524,11 @@ export async function fetchWrunRowLaneRows(lane, extras, askedWindow, fallback,
|
|
|
513
524
|
// and so are an instance's whose facets ask a per-bar word of the gateway (OPTLOAD G5: a surface pick, the strike kit
|
|
514
525
|
// fold), sized by the rows its answer holds; every other instance asks as the tier rule made it.
|
|
515
526
|
const sliceBudget = rowBudget ?? wrunOptionLaneFirstPaintBudget(lane.sourceClass, extras, lane.width);
|
|
516
|
-
// A budgeted run of an add that already spent reads within what is left of the add's share.
|
|
517
|
-
const
|
|
527
|
+
// A budgeted run of an add that already spent reads within what is left of the add's share (none named yet: its own).
|
|
528
|
+
const memoShareBytes = memo?.shareBytes;
|
|
529
|
+
const download = opts.download === undefined || memo === undefined || memoShareBytes === undefined
|
|
518
530
|
? opts.download
|
|
519
|
-
: { ...opts.download, share: Math.max(0,
|
|
531
|
+
: { ...opts.download, share: Math.max(0, memoShareBytes - memo.spentBytes) };
|
|
520
532
|
const firstPaint = sliceBudget === undefined && download === undefined ? undefined : await import('./wrun-row-lane-first-paint.util.js');
|
|
521
533
|
// The slice is cut on a trade date's first bar wherever the chart reads trade dates (`window.tradeDateOf`), so it
|
|
522
534
|
// holds whole sessions, on every run alike: a first paint asks the windows a later run asks (one cache entry each).
|
|
@@ -562,11 +574,14 @@ export async function fetchWrunRowLaneRows(lane, extras, askedWindow, fallback,
|
|
|
562
574
|
return wrunLandCellRowsOnHostBars(rows, landing.kind, { intervalMs: window.intervalMs, barGrid: window.barGrid, tierMs: gridAsk.tier?.ms, nowMs: window.nowMs }, fold === undefined ? undefined : (group) => fold(group, askExtras)).map((row) => wrunRowLanePlainRow(row, width));
|
|
563
575
|
};
|
|
564
576
|
const byBar = new Map();
|
|
565
|
-
// The add's landed bars come back as they landed (a copy: the memo's rows are never handed out to be written)
|
|
577
|
+
// The add's landed bars come back as they landed (a copy: the memo's rows are never handed out to be written), each
|
|
578
|
+
// standing in for an ask only: never for a bar this read's plan leaves partial (past the lane's horizon or its row
|
|
579
|
+
// budget now), which a fresh read shows as a marker alone.
|
|
566
580
|
if (memo !== undefined) {
|
|
567
581
|
const inWindow = new Set(window.barOpens);
|
|
582
|
+
const leftPartial = new Set(planPartial);
|
|
568
583
|
for (const [stampMs, row] of memo.landed) {
|
|
569
|
-
if (row !== undefined && inWindow.has(stampMs)) {
|
|
584
|
+
if (row !== undefined && inWindow.has(stampMs) && !leftPartial.has(stampMs)) {
|
|
570
585
|
byBar.set(stampMs, row.map((cell) => (Array.isArray(cell) ? cell.slice() : cell)));
|
|
571
586
|
}
|
|
572
587
|
}
|
|
@@ -729,11 +744,9 @@ export async function fetchWrunRowLaneRows(lane, extras, askedWindow, fallback,
|
|
|
729
744
|
// The asks the chart's fetch did not confirm whole, named once they all landed.
|
|
730
745
|
if (unconfirmed.size > 0)
|
|
731
746
|
opts.onUnconfirmed?.([...unconfirmed].sort((a, b) => a - b));
|
|
732
|
-
// The add's memo after this read:
|
|
733
|
-
//
|
|
734
|
-
if (memoUtil !== undefined &&
|
|
735
|
-
addMemo !== undefined &&
|
|
736
|
-
(opts.download !== undefined || memo !== undefined || addMemo.role === 'replay')) {
|
|
747
|
+
// The add's memo after this read: every read that names its add (a run's, a live read's, a replay's) leaves one,
|
|
748
|
+
// budgeted or not; a bar an unconfirmed ask answered joins none (asked again by the next read).
|
|
749
|
+
if (memoUtil !== undefined && addMemo !== undefined && memoDependency !== undefined) {
|
|
737
750
|
const asked = (stampMs) => {
|
|
738
751
|
const { fromMs } = wrunHostBarSpanOf(stampMs, window.intervalMs, sessionGrid);
|
|
739
752
|
return sentAsks.some((gridAsk) => fromMs >= gridAsk.fromMs && fromMs < gridAsk.toMs);
|
|
@@ -742,6 +755,7 @@ export async function fetchWrunRowLaneRows(lane, extras, askedWindow, fallback,
|
|
|
742
755
|
memoUtil.rememberWrunRowLaneAdd(addMemo.key, memoUtil.wrunRowLaneAddMemoAfter({
|
|
743
756
|
previous: memo,
|
|
744
757
|
fingerprint: memoFingerprint,
|
|
758
|
+
dependency: memoDependency,
|
|
745
759
|
window,
|
|
746
760
|
sessionGrid,
|
|
747
761
|
askedBars,
|
|
@@ -769,18 +783,71 @@ export async function fetchWrunRowLaneRows(lane, extras, askedWindow, fallback,
|
|
|
769
783
|
function wrunRowLaneRowMarkedPartial(row) {
|
|
770
784
|
return row.slice(1).some((tuple) => Array.isArray(tuple) && wrunPresentIsPartial(Number(tuple[tuple.length - 1])));
|
|
771
785
|
}
|
|
786
|
+
/**
|
|
787
|
+
* What one host bar's landed row depends on beyond its own span, read off a row lane instance's acquisition: the add
|
|
788
|
+
* memo's ONE eligibility rule (wrun-row-lane-add-memo.util `WrunRowLaneRowDependency`), so no read reuses a row a later
|
|
789
|
+
* read would answer otherwise (LIVE-REREAD review 2026-10-28). By the acquisition's own words, whatever the lane:
|
|
790
|
+
* - a window-wide cut (`newest`, and `newestTailMs` beside it: the window's N newest prints, option_prints): a bar's
|
|
791
|
+
* rows depend on every newer print of the read's window: `never`;
|
|
792
|
+
* - `history: "today"` (the flow lanes): which bars hold rows depends on the trade date of the chart's newest bar (the K
|
|
793
|
+
* control's `todayFromMs`), which no bar's clock settles: `never`;
|
|
794
|
+
* - `span: "session"` (the flow lanes): one sum per contract per trade date on the session's first bar, growing all
|
|
795
|
+
* session: `session`, its trade date's end on the chain's clock (`optionTradeDateClockOf`, the clock the worker
|
|
796
|
+
* twins group by); `never` for a chain the acquisition names no exchange of;
|
|
797
|
+
* - a kit fold carrying the next bar's strikes (`wrunOptionLaneCarriesNext`): `next-bar`, its rows read as the paging
|
|
798
|
+
* seam reads them (`wrunOptionKitBarHasRows`);
|
|
799
|
+
* - anything else: `bar`, final the lag after its own end.
|
|
800
|
+
* And by the lane's landing, an empty bar: quiet on a flow (nothing traded), never final on a snapshot (`emptyIsQuiet`
|
|
801
|
+
* false: a picture not shown yet, a failed read answered empty, a folded kit read's older bars past its cap, a CME
|
|
802
|
+
* surface bar whose settlement row is not published yet; LIVE-REREAD sweep 2026-10-28).
|
|
803
|
+
*/
|
|
804
|
+
export function wrunRowLaneRowDependencyOf(lane, extras) {
|
|
805
|
+
if (extras.newest !== undefined || extras.newestTailMs !== undefined)
|
|
806
|
+
return { kind: 'never', why: 'window-newest' };
|
|
807
|
+
if (extras.history === 'today')
|
|
808
|
+
return { kind: 'never', why: 'history-today' };
|
|
809
|
+
const emptyIsQuiet = lane.landing.kind !== 'snapshot';
|
|
810
|
+
if (extras.span === 'session') {
|
|
811
|
+
const field = lane.chain?.exchangeField;
|
|
812
|
+
const exchange = field === undefined ? undefined : extras[field];
|
|
813
|
+
if (typeof exchange !== 'string' || exchange === '')
|
|
814
|
+
return { kind: 'never', why: 'session-without-clock' };
|
|
815
|
+
const clock = optionTradeDateClockOf({ exchange, coin: typeof extras.coin === 'string' ? extras.coin : '' });
|
|
816
|
+
return {
|
|
817
|
+
kind: 'session',
|
|
818
|
+
emptyIsQuiet,
|
|
819
|
+
// The first instant of the next trade date a bar's falls before (a weekend or a holiday skipped), else never.
|
|
820
|
+
sessionEndMs: (stampMs) => {
|
|
821
|
+
const day = optionTradeDayByClock(clock, stampMs);
|
|
822
|
+
for (let next = day + 1; next <= day + 4; next += 1) {
|
|
823
|
+
const startMs = optionTradeDayStartMsByClock(clock, next);
|
|
824
|
+
if (Number.isFinite(startMs))
|
|
825
|
+
return startMs;
|
|
826
|
+
}
|
|
827
|
+
return Number.POSITIVE_INFINITY;
|
|
828
|
+
},
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
if (wrunOptionLaneCarriesNext(lane.sourceClass, extras)) {
|
|
832
|
+
return { kind: 'next-bar', emptyIsQuiet, hasRows: (row) => wrunOptionKitBarHasRows(row.slice(1)) };
|
|
833
|
+
}
|
|
834
|
+
return { kind: 'bar', emptyIsQuiet };
|
|
835
|
+
}
|
|
772
836
|
/** The add memo's fingerprint (wrun-row-lane-add-memo.util): the lane, the acquisition without a per-ask field (the
|
|
773
|
-
* measured key's skips and the lane's fold cap) and the bar
|
|
774
|
-
* of the same instance print the same. Never the bar grid's record: the live
|
|
775
|
-
* `transformations` where the chart's metadata does (INT 2026-10-23: every reconcile missed
|
|
776
|
-
* memo's
|
|
837
|
+
* measured key's skips and the lane's fold cap), the bar span and the bar grid's session. A run's extras and a
|
|
838
|
+
* reconcile's recorded acquisition of the same instance print the same. Never the bar grid's whole record: the live
|
|
839
|
+
* session's market names no `transformations` where the chart's metadata does (INT 2026-10-23: every reconcile missed
|
|
840
|
+
* the run's memo). Its session, though, both name alike (the live market's is the chart's), and it decides what a bar
|
|
841
|
+
* holds under one stamp: a session switch (regular hours to the whole session) keeps the add, and a CME day bar keeps
|
|
842
|
+
* its stamp while its span moves, so a memo of one session never serves the other's bars. */
|
|
777
843
|
function wrunRowLaneAddFingerprintOf(lane, extras, window) {
|
|
778
844
|
const foldField = lane.download?.fold?.field;
|
|
779
845
|
const fields = {};
|
|
780
846
|
for (const [key, value] of Object.entries(extras))
|
|
781
847
|
if (key !== foldField)
|
|
782
848
|
fields[key] = value;
|
|
783
|
-
|
|
849
|
+
const session = window.barGrid?.sessionType;
|
|
850
|
+
return `${measuredKeyOf(lane.laneKey, fields, undefined, window.intervalMs)}|${typeof session === 'string' ? session : ''}`;
|
|
784
851
|
}
|
|
785
852
|
/** The newest projection a budgeted read measured (`landWithinDownloadShare`), by lane and acquisition: its wire bytes a
|
|
786
853
|
* millisecond of bars. In memory, the newest `MEASURED_KEPT`. */
|
|
@@ -1140,13 +1207,19 @@ const measuredBars = new Map();
|
|
|
1140
1207
|
const MEASURED_KEPT = 64;
|
|
1141
1208
|
const MEASURED_BARS = 500;
|
|
1142
1209
|
/** The ask's fields that never change what a bar holds: its tier (keyed apart), the routed tier and plane, the market
|
|
1143
|
-
* placeholders a recorded acquisition carries, today's first instant and the instance's own bound.
|
|
1210
|
+
* placeholders a recorded acquisition carries, today's first instant and the instance's own bound. Also the fields the
|
|
1211
|
+
* chart's fetch writes on the payload it is handed, which the run records as the lane's acquisition (titan-charts
|
|
1212
|
+
* `acquireKScriptSourceData`: the resolved market, and `interval`, the source's own interval; the bar span is keyed
|
|
1213
|
+
* apart): a run's extras and a reconcile's recorded acquisition print the same. With `interval` printed, the live start
|
|
1214
|
+
* missed the add's memo whenever a run had asked the lane (LIVE-REREAD 2026-10-28, ES1! 1h whole session, Premium by
|
|
1215
|
+
* Expiry: the forming bar's ask recorded `interval: '1h'`, and the live start read the window's 8 final bars again). */
|
|
1144
1216
|
const MEASURED_SKIP = new Set([
|
|
1145
1217
|
WRUN_ROW_LANE_TIER_FIELD,
|
|
1146
1218
|
'servedTier',
|
|
1147
1219
|
'wrunPlane',
|
|
1148
1220
|
'symbol',
|
|
1149
1221
|
'exchange',
|
|
1222
|
+
'interval',
|
|
1150
1223
|
WRUN_OPTION_FLOW_TODAY_FIELD,
|
|
1151
1224
|
'maxCells',
|
|
1152
1225
|
]);
|
|
@@ -1204,8 +1277,11 @@ function noteWrunRowLaneMeasured(laneKey, extras, asks, landed, partialBars, win
|
|
|
1204
1277
|
continue;
|
|
1205
1278
|
if (presentMask !== false && tuples.some(marked))
|
|
1206
1279
|
continue;
|
|
1207
|
-
|
|
1208
|
-
const
|
|
1280
|
+
// A bar no ask of this read named came from the add's memo: the read that landed it measured it.
|
|
1281
|
+
const ask = asks.find((gridAsk) => span.fromMs >= gridAsk.fromMs && span.fromMs < gridAsk.toMs);
|
|
1282
|
+
if (ask === undefined)
|
|
1283
|
+
continue;
|
|
1284
|
+
const key = measuredKeyOf(laneKey, extras, ask.tier?.key, span.toMs - span.fromMs);
|
|
1209
1285
|
const read = reads.get(key) ?? { bars: 0, tuples: 0 };
|
|
1210
1286
|
reads.set(key, { bars: read.bars + 1, tuples: read.tuples + tuples.length });
|
|
1211
1287
|
}
|
|
@@ -40,8 +40,7 @@ export const WRUN_BROWSER_BUILTIN_SOURCE_CLASSES = [
|
|
|
40
40
|
'options_chain',
|
|
41
41
|
// USD order-size bucketed flow per bar over the chart's K_TRADE_VOLUME_BY_SIZE lane (celled).
|
|
42
42
|
'trade_volume_by_size',
|
|
43
|
-
// The
|
|
44
|
-
// the raw TRADE channel (wrun-tape-source.util).
|
|
43
|
+
// The big trades per bar (celled): TRADE_LARGE rows, history and live (wrun-tape-source.util).
|
|
45
44
|
'tape',
|
|
46
45
|
];
|
|
47
46
|
/**
|
|
@@ -30,9 +30,10 @@
|
|
|
30
30
|
* other market the chart serves, all priced per unit (spot,
|
|
31
31
|
* perpetuals, stocks, ETFs, forex, indices, metals, prediction
|
|
32
32
|
* markets, economic series).
|
|
33
|
-
* zone om's venue rule: US listings
|
|
34
|
-
* the CME family Chicago, LBMA
|
|
35
|
-
* venue 0 (UTC, the clock every
|
|
33
|
+
* zone om's venue rule: US listings, POLYGON_INDICES and forex
|
|
34
|
+
* (FX_OTC, POLYGON_FX) New York, the CME family Chicago, LBMA
|
|
35
|
+
* and LME London, every other venue 0 (UTC, the clock every
|
|
36
|
+
* 24/7 market keeps).
|
|
36
37
|
* quote_is_usd the row's quote (`quoteAssetId`, else `quoteCoinName`): USD
|
|
37
38
|
* 1, anything else 2, a dollar stablecoin included; without
|
|
38
39
|
* one, US listings and POLYGON_INDICES 1, then the market's
|
|
@@ -41,7 +42,9 @@
|
|
|
41
42
|
* tail of the directory's normalized symbol `BTC-USDT`), else 0.
|
|
42
43
|
* session_open om's venue rule: the minute on the venue's clock its trade day
|
|
43
44
|
* opens, 1020 (17:00 Chicago, WRUN_MARKET_SESSION_OPEN_CME) for
|
|
44
|
-
* the CME family, the zone's Chicago branch,
|
|
45
|
+
* the CME family, the zone's Chicago branch, 1020 (17:00 New
|
|
46
|
+
* York, WRUN_MARKET_SESSION_OPEN_FOREX) for forex, whose day
|
|
47
|
+
* runs 17:00 to 17:00 New York, else 0 (midnight).
|
|
45
48
|
*
|
|
46
49
|
* Beside the five the host fill carries `market.option_multiplier()` (kit 0.87.0,
|
|
47
50
|
* om WRUN_OPTION_FACT_FILLS, which only the chart's browser lane fills): the US
|