@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,8 +1,10 @@
|
|
|
1
1
|
import { WRUN_MARKET_SIZE_UNITS } from './wrun-market-facts.util.js';
|
|
2
|
+
import { tradesLargeServesCmeRoot } from '../../kscript-data/controls/live-trades-merge.util.js';
|
|
2
3
|
/**
|
|
3
4
|
* Big Trades' Min size in contracts on a CME Group market whose prints are judged per aggressor order, by product root:
|
|
4
5
|
* the smallest 1, 2 or 5 floor with at most 30 orders an hour on Friday 2026-10-23's open hour (at a flat 10, NQ showed
|
|
5
|
-
* 652 orders an hour and ES 5,827). A root the table lacks reads `WRUN_CME_ROOT_MIN_CONTRACTS_OTHER
|
|
6
|
+
* 652 orders an hour and ES 5,827). A root the table lacks reads `WRUN_CME_ROOT_MIN_CONTRACTS_OTHER` where the
|
|
7
|
+
* large-print table holds it; a root the large-print table does not hold is judged per fill (`wrunMarketContractsVerdict`).
|
|
6
8
|
*/
|
|
7
9
|
export const WRUN_CME_ROOT_MIN_CONTRACTS = Object.freeze({
|
|
8
10
|
NQ: 50,
|
|
@@ -272,12 +274,15 @@ export function wrunMarketOptionVerdict(rules, facts) {
|
|
|
272
274
|
}
|
|
273
275
|
/**
|
|
274
276
|
* The verdict of a market's facts on a package's CONTRACTS rules (the head passes `wrunMarketScaledFamilies(...).
|
|
275
|
-
* contracts`). It reads no candles: where prints are judged per order
|
|
276
|
-
*
|
|
277
|
-
*
|
|
277
|
+
* contracts`). It reads no candles: where prints are judged per order (the switch holds and the large-print table
|
|
278
|
+
* holds the root, `tradesLargeServesCmeRoot`: its tape reads the collector's one row per order), each root contracts
|
|
279
|
+
* rule's row for the root (its `other` for a root the table lacks) and each multiple of one (`market`); where they are
|
|
280
|
+
* judged per fill (the switch off, or a root the large-print table does not hold, whose tape rides the raw fills), the
|
|
281
|
+
* package's own defaults (`package`, `per-fill`), so a record never keeps a per-order default once its tape is no
|
|
282
|
+
* longer judged per order.
|
|
278
283
|
*/
|
|
279
284
|
export function wrunMarketContractsVerdict(rules, facts) {
|
|
280
|
-
if (!facts.perOrder)
|
|
285
|
+
if (!facts.perOrder || !tradesLargeServesCmeRoot(facts.root))
|
|
281
286
|
return { kind: 'package', reason: 'per-fill' };
|
|
282
287
|
const defaults = {};
|
|
283
288
|
for (const [name, rule] of Object.entries(rules)) {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** A book fold's row layouts (pb-common `OptionChainRowLayout` 10 and 12 to 19; 11, the greek projection's, is not
|
|
2
|
+
* served), column 0 of their rows on a view block (the kit's `WRUN_OPTION_BOOK_LAYOUTS`). */
|
|
3
|
+
export declare const WRUN_OPTION_BOOK_LAYOUTS: Readonly<{
|
|
4
|
+
readonly numbers: 10;
|
|
5
|
+
readonly book_stamp: 12;
|
|
6
|
+
readonly vol_term: 13;
|
|
7
|
+
readonly smile_series: 14;
|
|
8
|
+
readonly smile_point: 15;
|
|
9
|
+
readonly surface_cell: 16;
|
|
10
|
+
readonly profile_strike: 17;
|
|
11
|
+
readonly profile_levels: 18;
|
|
12
|
+
readonly profile_point: 19;
|
|
13
|
+
}>;
|
|
14
|
+
export type WrunOptionBookLayout = keyof typeof WRUN_OPTION_BOOK_LAYOUTS;
|
|
15
|
+
/** The cells of one row of each book layout as the data plane answers it, the layout column not counted (the kit's
|
|
16
|
+
* `WRUN_OPTION_BOOK_LAYOUT_WIDTHS`, the data plane's `bookLayoutWidths`): rows of another width are refused. */
|
|
17
|
+
export declare const WRUN_OPTION_BOOK_LAYOUT_WIDTHS: Readonly<{
|
|
18
|
+
readonly numbers: 11;
|
|
19
|
+
readonly book_stamp: 10;
|
|
20
|
+
readonly vol_term: 15;
|
|
21
|
+
readonly smile_series: 3;
|
|
22
|
+
readonly smile_point: 4;
|
|
23
|
+
readonly surface_cell: 3;
|
|
24
|
+
readonly profile_strike: 9;
|
|
25
|
+
readonly profile_levels: 12;
|
|
26
|
+
readonly profile_point: 2;
|
|
27
|
+
}>;
|
|
28
|
+
/** The book stamp version this host reads (the kit's `WRUN_OPTION_BOOK_STAMP_CODES.version`), and its field. */
|
|
29
|
+
export declare const WRUN_OPTION_BOOK_STAMP_VERSION = 1;
|
|
30
|
+
/** One entry of a data plane answer to a view ask (`OptionChainViewRows`, the kit's `WrunOptionViewAnswerRows`): its
|
|
31
|
+
* layout, where its rows start in the answer's packed cells, how many there are and how wide each is (a zero the wire
|
|
32
|
+
* leaves out reads 0), and the place in the ask of the view they answer. */
|
|
33
|
+
export interface WrunOptionViewAnswerRows {
|
|
34
|
+
readonly view?: number;
|
|
35
|
+
readonly layout: number;
|
|
36
|
+
readonly offset?: number;
|
|
37
|
+
readonly count?: number;
|
|
38
|
+
readonly width: number;
|
|
39
|
+
}
|
|
40
|
+
/** Whether an answer entry's layout is a book fold's (10 and 12 to 19, the book stamp included). */
|
|
41
|
+
export declare function wrunOptionIsBookLayout(layout: number): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The view block rows of a data plane answer's book fold entries (the kit's `wrunOptionBookViewRows`, the host's half
|
|
44
|
+
* of the book fold contract): each entry's rows as `[layout, ...cells]`, padded with 0 to `width` (the input's row
|
|
45
|
+
* width, `wrunOptionInputTupleWidth`), each layout's rows in the answer's order, every value the answer's own (NaN
|
|
46
|
+
* kept). A reader takes no order across layouts, so a host whose ask also names views of the block lays their rows
|
|
47
|
+
* beside these. Refused by name, never read in part: an entry of a layout no book fold answers, rows of another width
|
|
48
|
+
* than their layout's (`WRUN_OPTION_BOOK_LAYOUT_WIDTHS`), rows past the cells, a layout wider than the input's rows, no
|
|
49
|
+
* book stamp or more than one, and a stamp of another version than `WRUN_OPTION_BOOK_STAMP_VERSION`. An empty book
|
|
50
|
+
* answers its stamp alone (S0 NaN): the stamp row is the block, and the pane clears.
|
|
51
|
+
*/
|
|
52
|
+
export declare function wrunOptionBookViewRows(cells: ArrayLike<number>, entries: readonly WrunOptionViewAnswerRows[], width: number): {
|
|
53
|
+
rows: number[][];
|
|
54
|
+
} | {
|
|
55
|
+
refused: string;
|
|
56
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// The host's half of a book fold answer (D-DEDUPE phase 1b): the data plane's book fold rows, laid out on an
|
|
2
|
+
// options_chain input's view block. Only the worker that reads an answer loads this module; the book folds' words,
|
|
3
|
+
// knobs and row widths, which a declaration needs, are wrun-option-views.util.ts's. Every table here is the kit's,
|
|
4
|
+
// pinned by tests/utility/wrun/wrun-option-views.book.kit-pin.spec.ts.
|
|
5
|
+
/** A book fold's row layouts (pb-common `OptionChainRowLayout` 10 and 12 to 19; 11, the greek projection's, is not
|
|
6
|
+
* served), column 0 of their rows on a view block (the kit's `WRUN_OPTION_BOOK_LAYOUTS`). */
|
|
7
|
+
export const WRUN_OPTION_BOOK_LAYOUTS = Object.freeze({
|
|
8
|
+
numbers: 10,
|
|
9
|
+
book_stamp: 12,
|
|
10
|
+
vol_term: 13,
|
|
11
|
+
smile_series: 14,
|
|
12
|
+
smile_point: 15,
|
|
13
|
+
surface_cell: 16,
|
|
14
|
+
profile_strike: 17,
|
|
15
|
+
profile_levels: 18,
|
|
16
|
+
profile_point: 19,
|
|
17
|
+
});
|
|
18
|
+
/** The cells of one row of each book layout as the data plane answers it, the layout column not counted (the kit's
|
|
19
|
+
* `WRUN_OPTION_BOOK_LAYOUT_WIDTHS`, the data plane's `bookLayoutWidths`): rows of another width are refused. */
|
|
20
|
+
export const WRUN_OPTION_BOOK_LAYOUT_WIDTHS = Object.freeze({
|
|
21
|
+
numbers: 11,
|
|
22
|
+
book_stamp: 10,
|
|
23
|
+
vol_term: 15,
|
|
24
|
+
smile_series: 3,
|
|
25
|
+
smile_point: 4,
|
|
26
|
+
surface_cell: 3,
|
|
27
|
+
profile_strike: 9,
|
|
28
|
+
profile_levels: 12,
|
|
29
|
+
profile_point: 2,
|
|
30
|
+
});
|
|
31
|
+
/** The book stamp version this host reads (the kit's `WRUN_OPTION_BOOK_STAMP_CODES.version`), and its field. */
|
|
32
|
+
export const WRUN_OPTION_BOOK_STAMP_VERSION = 1;
|
|
33
|
+
const BOOK_STAMP_VERSION_FIELD = 9;
|
|
34
|
+
/** Each book layout's row cells by its number. */
|
|
35
|
+
const BOOK_LAYOUT_WIDTHS_BY_NUMBER = new Map(Object.keys(WRUN_OPTION_BOOK_LAYOUTS).map((layout) => [
|
|
36
|
+
WRUN_OPTION_BOOK_LAYOUTS[layout],
|
|
37
|
+
WRUN_OPTION_BOOK_LAYOUT_WIDTHS[layout],
|
|
38
|
+
]));
|
|
39
|
+
/** Whether an answer entry's layout is a book fold's (10 and 12 to 19, the book stamp included). */
|
|
40
|
+
export function wrunOptionIsBookLayout(layout) {
|
|
41
|
+
return BOOK_LAYOUT_WIDTHS_BY_NUMBER.has(layout);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The view block rows of a data plane answer's book fold entries (the kit's `wrunOptionBookViewRows`, the host's half
|
|
45
|
+
* of the book fold contract): each entry's rows as `[layout, ...cells]`, padded with 0 to `width` (the input's row
|
|
46
|
+
* width, `wrunOptionInputTupleWidth`), each layout's rows in the answer's order, every value the answer's own (NaN
|
|
47
|
+
* kept). A reader takes no order across layouts, so a host whose ask also names views of the block lays their rows
|
|
48
|
+
* beside these. Refused by name, never read in part: an entry of a layout no book fold answers, rows of another width
|
|
49
|
+
* than their layout's (`WRUN_OPTION_BOOK_LAYOUT_WIDTHS`), rows past the cells, a layout wider than the input's rows, no
|
|
50
|
+
* book stamp or more than one, and a stamp of another version than `WRUN_OPTION_BOOK_STAMP_VERSION`. An empty book
|
|
51
|
+
* answers its stamp alone (S0 NaN): the stamp row is the block, and the pane clears.
|
|
52
|
+
*/
|
|
53
|
+
export function wrunOptionBookViewRows(cells, entries, width) {
|
|
54
|
+
const rows = [];
|
|
55
|
+
let stamps = 0;
|
|
56
|
+
for (const entry of entries) {
|
|
57
|
+
const layoutWidth = BOOK_LAYOUT_WIDTHS_BY_NUMBER.get(entry.layout);
|
|
58
|
+
if (layoutWidth === undefined) {
|
|
59
|
+
return { refused: `the answer holds rows of layout ${entry.layout}, which no book fold answers` };
|
|
60
|
+
}
|
|
61
|
+
if (entry.width !== layoutWidth) {
|
|
62
|
+
return {
|
|
63
|
+
refused: `the answer's layout ${entry.layout} rows are ${entry.width} wide, the layout's ${layoutWidth}`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (1 + layoutWidth > width) {
|
|
67
|
+
return {
|
|
68
|
+
refused: `the answer's layout ${entry.layout} rows need ${1 + layoutWidth} values a row, and the input reads ${width}`,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const offset = entry.offset ?? 0;
|
|
72
|
+
const count = entry.count ?? 0;
|
|
73
|
+
if (!(offset >= 0 && count >= 0 && offset + count * layoutWidth <= cells.length)) {
|
|
74
|
+
return { refused: `the answer's layout ${entry.layout} rows reach past its ${cells.length} cells` };
|
|
75
|
+
}
|
|
76
|
+
if (entry.layout === WRUN_OPTION_BOOK_LAYOUTS.book_stamp) {
|
|
77
|
+
stamps += count;
|
|
78
|
+
const version = count === 1 ? Number(cells[offset + BOOK_STAMP_VERSION_FIELD]) : WRUN_OPTION_BOOK_STAMP_VERSION;
|
|
79
|
+
if (version !== WRUN_OPTION_BOOK_STAMP_VERSION) {
|
|
80
|
+
return { refused: `the book stamp is version ${version}, which this kit does not read` };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
for (let row = 0; row < count; row += 1) {
|
|
84
|
+
const out = new Array(width).fill(0);
|
|
85
|
+
out[0] = entry.layout;
|
|
86
|
+
for (let column = 0; column < layoutWidth; column += 1) {
|
|
87
|
+
out[1 + column] = Number(cells[offset + row * layoutWidth + column]);
|
|
88
|
+
}
|
|
89
|
+
rows.push(out);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (stamps !== 1) {
|
|
93
|
+
return { refused: stamps === 0 ? 'the answer holds no book stamp' : `the answer holds ${stamps} book stamps` };
|
|
94
|
+
}
|
|
95
|
+
return { rows };
|
|
96
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { WrunLaneChartChain } from './sources/opra-option-lanes.util.js';
|
|
2
2
|
import type { WrunRowLaneRowBudget } from './sources/wrun-row-lane.types.js';
|
|
3
|
+
import type { WrunOptionBookLayout } from './wrun-option-book-rows.util.js';
|
|
3
4
|
/** The classes whose inputs declare views (the cell class each view's block is built in). */
|
|
4
5
|
export type WrunOptionViewClass = 'options_chain' | 'option_contract_state';
|
|
5
6
|
/** One view word's contract (section 6.1). */
|
|
@@ -11,9 +12,13 @@ export interface WrunOptionViewSpec {
|
|
|
11
12
|
answer: 'tuples' | 'fold';
|
|
12
13
|
/** The view centres on the chart's close (`spotHint`) and covers every close inside the band. */
|
|
13
14
|
hinted?: true;
|
|
15
|
+
/** A book fold (`WRUN_OPTION_BOOK_VIEWS`): it folds the chain page's one book, never the block, so its ask carries
|
|
16
|
+
* its own params alone. Absent on every view of the block. */
|
|
17
|
+
book?: true;
|
|
14
18
|
}
|
|
15
|
-
/** Every view word, in section 6.1's order
|
|
16
|
-
* `
|
|
19
|
+
/** Every view word of the block, in section 6.1's order (the book folds follow on options_chain,
|
|
20
|
+
* `WRUN_OPTION_BOOK_VIEWS`). The worker names each by `OPTION_CHAIN_VIEW_<WORD>` (pb-common `OptionChainViewKind`;
|
|
21
|
+
* tests/utility/wrun/wrun-option-views.util.spec.ts pins every name). */
|
|
17
22
|
export declare const WRUN_OPTION_VIEWS: Readonly<{
|
|
18
23
|
readonly whole: {
|
|
19
24
|
readonly cls: "options_chain";
|
|
@@ -176,9 +181,11 @@ export declare const WRUN_OPTION_VIEWS: Readonly<{
|
|
|
176
181
|
};
|
|
177
182
|
}>;
|
|
178
183
|
export type WrunOptionViewWord = keyof typeof WRUN_OPTION_VIEWS;
|
|
184
|
+
/** Every word `page_view` and `page_views` take: the views of the block and the book folds. */
|
|
185
|
+
export type WrunOptionPageViewWord = WrunOptionViewWord | WrunOptionBookViewWord;
|
|
179
186
|
/** One view an ask names: its word and its params by wire name, each a finite number. */
|
|
180
187
|
export interface WrunOptionView {
|
|
181
|
-
view:
|
|
188
|
+
view: WrunOptionPageViewWord;
|
|
182
189
|
params: Readonly<Record<string, number>>;
|
|
183
190
|
}
|
|
184
191
|
/** The hint band each side of the hint, percent of it (section 12: 0.5% of the close). */
|
|
@@ -194,10 +201,11 @@ export declare const WRUN_OPTION_VIEWS_ONE_ASK_CODE = "wrun_option_views_one_ask
|
|
|
194
201
|
* B of the gateway, built for one `nearestExpiries`, so an input of another word would read views of another B (the
|
|
195
202
|
* SDK asks each word apart; one acquisition per word would serve them). */
|
|
196
203
|
export declare const WRUN_OPTION_VIEWS_ONE_EXPIRIES_CODE = "wrun_option_views_one_expiries";
|
|
197
|
-
/** A view's spec, or undefined for a word
|
|
204
|
+
/** A view's spec, a view of the block or a book fold (the kit's `wrunOptionPageViewSpec`), or undefined for a word
|
|
205
|
+
* that names none. */
|
|
198
206
|
export declare function wrunOptionViewSpec(word: unknown): WrunOptionViewSpec | undefined;
|
|
199
207
|
/** Why this host does not read a view yet, in a refusal's words, or undefined when it reads it (every projection,
|
|
200
|
-
* option_contract_state's folds but `oi_board`, which follows the chart's close). */
|
|
208
|
+
* options_chain's book folds, option_contract_state's folds but `oi_board`, which follows the chart's close). */
|
|
201
209
|
export declare function wrunOptionViewUnread(spec: WrunOptionViewSpec): string | undefined;
|
|
202
210
|
/**
|
|
203
211
|
* The knobs an input names its views in: `page_view` (one word) or `page_views` (a list), the chain page's views
|
|
@@ -217,13 +225,31 @@ export declare function wrunOptionViewParamKnobs(source: Readonly<Record<string,
|
|
|
217
225
|
* An input's views, validated (main thread, after the paint seam): undefined when it declares none (today's path),
|
|
218
226
|
* else the views in canonical order (`canonicalViews`). Refuses by name a word that names no view of the input's
|
|
219
227
|
* class, a view this host does not read yet (`wrunOptionViewUnread`), and a param that is no finite number (a
|
|
220
|
-
* `"@<param>"` the sheet declares no param of stays a string here).
|
|
228
|
+
* `"@<param>"` the sheet declares no param of stays a string here). An input naming a book fold has every word judged
|
|
229
|
+
* first, then its book knobs by the kit's rules (`wrunOptionBookViewIssue`: a value outside what a knob takes on a
|
|
230
|
+
* declared word, a book knob no declared word takes, `nearest` beside `days`, an `expiries` word other than "all"),
|
|
231
|
+
* each refused by its knob (`wrun_option_knob_invalid`) with the kit's words; an input of views of the block alone
|
|
232
|
+
* is read word by word, as before.
|
|
221
233
|
*/
|
|
222
234
|
export declare function wrunOptionViewsOfSource(input: object, ctx: {
|
|
223
235
|
inputName: string;
|
|
224
236
|
sourceClass: string;
|
|
225
237
|
}, cls: WrunOptionViewClass): WrunOptionView[] | undefined;
|
|
226
|
-
/** The
|
|
238
|
+
/** The most views one ask names: the data plane's `MaxViews` (it refuses an ask naming more). */
|
|
239
|
+
export declare const WRUN_OPTION_VIEWS_MAX_PER_ASK = 16;
|
|
240
|
+
/** The plan's refusal of one lane whose inputs' views make an ask of more views than the data plane answers. */
|
|
241
|
+
export declare const WRUN_OPTION_VIEWS_TOO_MANY_CODE = "wrun_option_views_too_many";
|
|
242
|
+
/** The plan's refusal of one options_chain lane whose view inputs read a book fold and different views: the lane asks
|
|
243
|
+
* their union ONCE, and a book fold's rows name no input, so each input would read every other input's book rows (two
|
|
244
|
+
* `numbers` asks' scope and expiry rows twice over), and an input narrower than the union's widest word would read
|
|
245
|
+
* none of them (an input's reader keeps the rows of its own width alone). */
|
|
246
|
+
export declare const WRUN_OPTION_BOOK_VIEWS_ONE_ASK_CODE = "wrun_option_book_views_one_ask";
|
|
247
|
+
/**
|
|
248
|
+
* The union of several inputs' views, canonical: the views one lane asks for every input it serves. Refused by name
|
|
249
|
+
* before any read: inputs that read a book fold and different views (`WRUN_OPTION_BOOK_VIEWS_ONE_ASK_CODE`; one input
|
|
250
|
+
* may name several words), and a union of more views than one ask may name (`WRUN_OPTION_VIEWS_MAX_PER_ASK`). One
|
|
251
|
+
* input's views never pass the cap (each word once).
|
|
252
|
+
*/
|
|
227
253
|
export declare function wrunOptionViewsUnion(sets: ReadonlyArray<readonly WrunOptionView[]>): WrunOptionView[];
|
|
228
254
|
/** The canonical text of a set of views (the payload's `<prefix>Views`). */
|
|
229
255
|
export declare function wrunOptionViewsText(views: readonly WrunOptionView[]): string;
|
|
@@ -243,7 +269,9 @@ export interface WrunOptionsChainViewScope {
|
|
|
243
269
|
/** The smallest `max_cells` over the lane's inputs; absent when none declares one. */
|
|
244
270
|
maxContracts?: number;
|
|
245
271
|
}
|
|
246
|
-
/** A view ask's payload fields (see the module doc).
|
|
272
|
+
/** A view ask's payload fields (see the module doc). The gateway's scope inputs size B: an options_chain ask naming
|
|
273
|
+
* book folds alone reads no B, so it carries neither (`wrunOptionViewsReadBlock`), nor the hint margin (no book fold
|
|
274
|
+
* is hinted); a mixed ask keeps them for the views of the block. */
|
|
247
275
|
export declare function wrunOptionViewLaneFields(cls: WrunOptionViewClass, views: readonly WrunOptionView[], scope?: WrunOptionsChainViewScope): Record<string, unknown>;
|
|
248
276
|
/** The view fields of a payload, as they ride (a K control copies them onto the request it builds). */
|
|
249
277
|
export declare function wrunOptionViewPayloadFields(cls: WrunOptionViewClass, payload: Readonly<Record<string, unknown>> | undefined): Record<string, unknown>;
|
|
@@ -304,10 +332,11 @@ export declare const WRUN_OPTION_LANE_WORDS: Readonly<Record<WrunOptionLaneClass
|
|
|
304
332
|
words: readonly string[];
|
|
305
333
|
}>>;
|
|
306
334
|
/**
|
|
307
|
-
* What one per-bar param knob takes (the SDK's `WrunOptionKnobSpec`): a number in min..max (`above`
|
|
308
|
-
* `below` excludes max), a whole number, or (`codes`) one of a few numbers, each naming a choice (a
|
|
309
|
-
* picked index);
|
|
310
|
-
*
|
|
335
|
+
* What one per-bar or book fold param knob takes (the SDK's `WrunOptionKnobSpec`): a number in min..max (`above`
|
|
336
|
+
* excludes min, `below` excludes max), a whole number, or (`codes`) one of a few numbers, each naming a choice (a
|
|
337
|
+
* select setting's picked index); `zero` takes 0 beside the range (a book fold's part turned off: strike_profile's
|
|
338
|
+
* `points` 0 answers no curve); a flag takes true or false, never a setting. `what` names it in a refusal; `fallback`
|
|
339
|
+
* is what an absent per-bar knob reads (absent: the knob is required).
|
|
311
340
|
*/
|
|
312
341
|
export interface WrunOptionKnobSpec {
|
|
313
342
|
readonly kind: 'number' | 'whole' | 'time' | 'flag';
|
|
@@ -315,6 +344,7 @@ export interface WrunOptionKnobSpec {
|
|
|
315
344
|
readonly max?: number;
|
|
316
345
|
readonly above?: boolean;
|
|
317
346
|
readonly below?: boolean;
|
|
347
|
+
readonly zero?: true;
|
|
318
348
|
readonly codes?: Readonly<Record<number, string>>;
|
|
319
349
|
readonly what: string;
|
|
320
350
|
readonly fallback?: number;
|
|
@@ -336,10 +366,10 @@ export declare function wrunOptionLaneKnobSpecs(cls: WrunOptionLaneClass, word:
|
|
|
336
366
|
/** Every param knob a per-bar class takes, over its words, each once, in table order (the SDK's
|
|
337
367
|
* `wrunOptionViewParamKnobsOf`). */
|
|
338
368
|
export declare function wrunOptionLaneParamKnobs(cls: WrunOptionLaneClass): readonly string[];
|
|
339
|
-
/** Whether a number is a legal value of a per-bar knob, a flag's 0 or 1 included (the SDK's
|
|
369
|
+
/** Whether a number is a legal value of a per-bar or book fold knob, a flag's 0 or 1 included (the SDK's
|
|
340
370
|
* `wrunOptionKnobSpecLegal`). */
|
|
341
371
|
export declare function wrunOptionKnobSpecLegal(spec: WrunOptionKnobSpec, value: number): boolean;
|
|
342
|
-
/** What a per-bar knob takes, as a refusal spells it (the SDK's `wrunOptionKnobSpecTakes`). */
|
|
372
|
+
/** What a per-bar or book fold knob takes, as a refusal spells it (the SDK's `wrunOptionKnobSpecTakes`). */
|
|
343
373
|
export declare function wrunOptionKnobSpecTakes(spec: WrunOptionKnobSpec): string;
|
|
344
374
|
/** One input's per-bar ask: its class, its word and each param by knob, at its value (a flag's 1 or 0) or fallback. */
|
|
345
375
|
export interface WrunOptionLaneAsk {
|
|
@@ -347,7 +377,8 @@ export interface WrunOptionLaneAsk {
|
|
|
347
377
|
word: string;
|
|
348
378
|
params: Readonly<Record<string, number>>;
|
|
349
379
|
}
|
|
350
|
-
/** Why an input's per-bar knobs refuse: the knob, its value and what it takes (the SDK's
|
|
380
|
+
/** Why an input's per-bar or book fold knobs refuse: the knob, its value and what it takes (the SDK's
|
|
381
|
+
* `WrunOptionViewIssue`). */
|
|
351
382
|
export interface WrunOptionLaneIssue {
|
|
352
383
|
knob: string;
|
|
353
384
|
value: unknown;
|
|
@@ -372,6 +403,222 @@ export declare function wrunOptionLaneAskOfSource(source: object, ctx: {
|
|
|
372
403
|
inputName: string;
|
|
373
404
|
sourceClass: string;
|
|
374
405
|
}): WrunOptionLaneAsk | undefined;
|
|
406
|
+
/** One book fold's contract (the kit's `WrunOptionBookViewSpec`): an options_chain fold of the book, its wire kind
|
|
407
|
+
* (pb-common `OptionChainViewKind`), its params (the input's knob, then the wire name), what each knob takes, what the
|
|
408
|
+
* data plane reads for a param the ask leaves out (by wire name; a `days` of 0 is none, and no ask carries it) and
|
|
409
|
+
* the layouts it answers, in their order. No book fold is hinted and none has a required param. */
|
|
410
|
+
export interface WrunOptionBookViewSpec extends WrunOptionViewSpec {
|
|
411
|
+
cls: 'options_chain';
|
|
412
|
+
answer: 'fold';
|
|
413
|
+
book: true;
|
|
414
|
+
kind: number;
|
|
415
|
+
knobs: Readonly<Record<string, WrunOptionKnobSpec>>;
|
|
416
|
+
defaults: Readonly<Record<string, number>>;
|
|
417
|
+
layouts: readonly WrunOptionBookLayout[];
|
|
418
|
+
}
|
|
419
|
+
/** Every book fold, in kind order (the kit's `WRUN_OPTION_BOOK_VIEWS`): the wire's kind is OPTION_CHAIN_VIEW_<WORD>
|
|
420
|
+
* (numbers 20, vol_term 22, smile 23, surface 24, strike_profile 25). Their words follow the views of the block on
|
|
421
|
+
* options_chain. */
|
|
422
|
+
export declare const WRUN_OPTION_BOOK_VIEWS: Readonly<{
|
|
423
|
+
readonly numbers: {
|
|
424
|
+
readonly cls: "options_chain";
|
|
425
|
+
readonly answer: "fold";
|
|
426
|
+
readonly book: true;
|
|
427
|
+
readonly kind: 20;
|
|
428
|
+
readonly params: {
|
|
429
|
+
readonly nearest: "nearest";
|
|
430
|
+
readonly days: "days";
|
|
431
|
+
};
|
|
432
|
+
readonly knobs: {
|
|
433
|
+
readonly nearest: WrunOptionKnobSpec;
|
|
434
|
+
readonly days: WrunOptionKnobSpec;
|
|
435
|
+
};
|
|
436
|
+
readonly defaults: {
|
|
437
|
+
readonly nearest: 0;
|
|
438
|
+
readonly days: 0;
|
|
439
|
+
};
|
|
440
|
+
readonly layouts: readonly ["numbers"];
|
|
441
|
+
};
|
|
442
|
+
readonly vol_term: {
|
|
443
|
+
readonly cls: "options_chain";
|
|
444
|
+
readonly answer: "fold";
|
|
445
|
+
readonly book: true;
|
|
446
|
+
readonly kind: 22;
|
|
447
|
+
readonly params: {};
|
|
448
|
+
readonly knobs: {};
|
|
449
|
+
readonly defaults: {};
|
|
450
|
+
readonly layouts: readonly ["vol_term"];
|
|
451
|
+
};
|
|
452
|
+
readonly smile: {
|
|
453
|
+
readonly cls: "options_chain";
|
|
454
|
+
readonly answer: "fold";
|
|
455
|
+
readonly book: true;
|
|
456
|
+
readonly kind: 23;
|
|
457
|
+
readonly params: {
|
|
458
|
+
readonly count: "count";
|
|
459
|
+
readonly window_pct: "windowPct";
|
|
460
|
+
};
|
|
461
|
+
readonly knobs: {
|
|
462
|
+
readonly count: Readonly<{
|
|
463
|
+
kind: "whole";
|
|
464
|
+
min: 1;
|
|
465
|
+
max: 3;
|
|
466
|
+
what: "the smile's series (the expiries nearest today, 7 and 30 days out, the first N)";
|
|
467
|
+
}>;
|
|
468
|
+
readonly window_pct: WrunOptionKnobSpec;
|
|
469
|
+
};
|
|
470
|
+
readonly defaults: {
|
|
471
|
+
readonly count: 3;
|
|
472
|
+
readonly windowPct: 40;
|
|
473
|
+
};
|
|
474
|
+
readonly layouts: readonly ["smile_series", "smile_point"];
|
|
475
|
+
};
|
|
476
|
+
readonly surface: {
|
|
477
|
+
readonly cls: "options_chain";
|
|
478
|
+
readonly answer: "fold";
|
|
479
|
+
readonly book: true;
|
|
480
|
+
readonly kind: 24;
|
|
481
|
+
readonly params: {
|
|
482
|
+
readonly lens: "lens";
|
|
483
|
+
readonly window_pct: "windowPct";
|
|
484
|
+
readonly columns: "columns";
|
|
485
|
+
readonly rows: "rows";
|
|
486
|
+
};
|
|
487
|
+
readonly knobs: {
|
|
488
|
+
readonly lens: Readonly<{
|
|
489
|
+
kind: "whole";
|
|
490
|
+
codes: Readonly<{
|
|
491
|
+
0: "gex";
|
|
492
|
+
1: "oi";
|
|
493
|
+
2: "iv";
|
|
494
|
+
3: "dex";
|
|
495
|
+
4: "vex";
|
|
496
|
+
}>;
|
|
497
|
+
what: "the lens";
|
|
498
|
+
}>;
|
|
499
|
+
readonly window_pct: WrunOptionKnobSpec;
|
|
500
|
+
readonly columns: Readonly<{
|
|
501
|
+
kind: "whole";
|
|
502
|
+
min: 1;
|
|
503
|
+
max: 16;
|
|
504
|
+
what: "the expiry columns";
|
|
505
|
+
}>;
|
|
506
|
+
readonly rows: Readonly<{
|
|
507
|
+
kind: "whole";
|
|
508
|
+
min: 1;
|
|
509
|
+
max: 64;
|
|
510
|
+
what: "the strike rows";
|
|
511
|
+
}>;
|
|
512
|
+
};
|
|
513
|
+
readonly defaults: {
|
|
514
|
+
readonly lens: 0;
|
|
515
|
+
readonly windowPct: 20;
|
|
516
|
+
readonly columns: 8;
|
|
517
|
+
readonly rows: 21;
|
|
518
|
+
};
|
|
519
|
+
readonly layouts: readonly ["surface_cell"];
|
|
520
|
+
};
|
|
521
|
+
readonly strike_profile: {
|
|
522
|
+
readonly cls: "options_chain";
|
|
523
|
+
readonly answer: "fold";
|
|
524
|
+
readonly book: true;
|
|
525
|
+
readonly kind: 25;
|
|
526
|
+
readonly params: {
|
|
527
|
+
readonly nearest: "nearest";
|
|
528
|
+
readonly days: "days";
|
|
529
|
+
readonly window_pct: "windowPct";
|
|
530
|
+
readonly strikes: "strikes";
|
|
531
|
+
readonly points: "points";
|
|
532
|
+
readonly half_pct: "halfPct";
|
|
533
|
+
};
|
|
534
|
+
readonly knobs: {
|
|
535
|
+
readonly nearest: WrunOptionKnobSpec;
|
|
536
|
+
readonly days: WrunOptionKnobSpec;
|
|
537
|
+
readonly window_pct: Readonly<{
|
|
538
|
+
kind: "number";
|
|
539
|
+
min: 0;
|
|
540
|
+
max: 100;
|
|
541
|
+
what: "the strike rows within this percent of S0 (0: every strike)";
|
|
542
|
+
}>;
|
|
543
|
+
readonly strikes: Readonly<{
|
|
544
|
+
kind: "whole";
|
|
545
|
+
codes: Readonly<{
|
|
546
|
+
0: "no strike rows";
|
|
547
|
+
1: "a row a strike";
|
|
548
|
+
}>;
|
|
549
|
+
what: "the strike rows";
|
|
550
|
+
}>;
|
|
551
|
+
readonly points: Readonly<{
|
|
552
|
+
kind: "whole";
|
|
553
|
+
min: 2;
|
|
554
|
+
max: 1000;
|
|
555
|
+
zero: true;
|
|
556
|
+
what: "the curve's points (0: no curve)";
|
|
557
|
+
}>;
|
|
558
|
+
readonly half_pct: Readonly<{
|
|
559
|
+
kind: "number";
|
|
560
|
+
min: 0;
|
|
561
|
+
max: 50;
|
|
562
|
+
above: true;
|
|
563
|
+
what: "the curve's reach, a percent of S0 each side";
|
|
564
|
+
}>;
|
|
565
|
+
};
|
|
566
|
+
readonly defaults: {
|
|
567
|
+
readonly nearest: 0;
|
|
568
|
+
readonly days: 0;
|
|
569
|
+
readonly windowPct: 0;
|
|
570
|
+
readonly strikes: 1;
|
|
571
|
+
readonly points: 0;
|
|
572
|
+
readonly halfPct: 15;
|
|
573
|
+
};
|
|
574
|
+
readonly layouts: readonly ["profile_strike", "profile_levels", "profile_point"];
|
|
575
|
+
};
|
|
576
|
+
}>;
|
|
577
|
+
export type WrunOptionBookViewWord = keyof typeof WRUN_OPTION_BOOK_VIEWS;
|
|
578
|
+
/** The book folds' words, in kind order. */
|
|
579
|
+
export declare const WRUN_OPTION_BOOK_VIEW_WORDS: readonly WrunOptionBookViewWord[];
|
|
580
|
+
/** f64s per view block row of each book word (the kit's `WRUN_OPTION_BOOK_VIEW_ROW_WIDTHS`): the layout column, then
|
|
581
|
+
* the wider of its widest layout and the book stamp (ten cells, riding every book answer). An input's rows are the
|
|
582
|
+
* widest of its words (`wrunOptionViewWordsRowWidth`), never narrower than the class's view row. */
|
|
583
|
+
export declare const WRUN_OPTION_BOOK_VIEW_ROW_WIDTHS: Readonly<{
|
|
584
|
+
readonly numbers: 12;
|
|
585
|
+
readonly vol_term: 16;
|
|
586
|
+
readonly smile: 11;
|
|
587
|
+
readonly surface: 11;
|
|
588
|
+
readonly strike_profile: 13;
|
|
589
|
+
}>;
|
|
590
|
+
/** What options_chain's `expiries` takes beside a book fold (the kit's `WRUN_OPTION_BOOK_EXPIRIES_TAKES`): its default
|
|
591
|
+
* alone. A book fold reads the whole book, so any other word would be dropped unseen. */
|
|
592
|
+
export declare const WRUN_OPTION_BOOK_EXPIRIES_TAKES = "\"all\" (or no expiries) beside a book fold (numbers, vol_term, smile, surface, strike_profile): it reads the whole book; a fold's own nearest or days scopes it";
|
|
593
|
+
/** What a book fold's `days` takes beside `nearest` on a word that takes both (the kit's
|
|
594
|
+
* `WRUN_OPTION_BOOK_SCOPE_TAKES`): nothing (the data plane refuses two scopes). */
|
|
595
|
+
export declare const WRUN_OPTION_BOOK_SCOPE_TAKES = "one scope of a book fold's expiries, \"nearest\" or \"days\", never both";
|
|
596
|
+
/** The knobs a view of the block shares with a book fold on options_chain, as that view takes them (the kit's
|
|
597
|
+
* `WRUN_OPTION_PAGE_VIEW_KNOBS` rows): a shared knob takes one value for every declared word and must be legal on
|
|
598
|
+
* each (`wrunOptionBookViewIssue`), so `nearest` 0 refuses beside `exposure`, `lens` 5 and 6 beside `surface`, and
|
|
599
|
+
* `points` 0 beside `horizon_otm` and `gex_curve`. */
|
|
600
|
+
export declare const WRUN_OPTION_BOOK_SHARED_KNOBS: Readonly<Record<string, Readonly<Record<string, WrunOptionKnobSpec>>>>;
|
|
601
|
+
/** A book fold's spec, or undefined for a word that names none. */
|
|
602
|
+
export declare function wrunOptionBookViewSpec(word: unknown): WrunOptionBookViewSpec | undefined;
|
|
603
|
+
/** Whether a word names a book fold. */
|
|
604
|
+
export declare function wrunOptionPageViewIsBook(word: unknown): word is WrunOptionBookViewWord;
|
|
605
|
+
/** Whether an ask's views read the block B (the kit's `wrunOptionViewsReadBlock`): any view but a book fold. Only such
|
|
606
|
+
* an ask carries B's facts (the live bar's open on each view of B, the expiries word and the max-contracts size B is
|
|
607
|
+
* shaped by, the spot hint of a hinted view); an ask naming book folds alone carries each view's kind and its own
|
|
608
|
+
* params, nothing else. */
|
|
609
|
+
export declare function wrunOptionViewsReadBlock(views: ReadonlyArray<{
|
|
610
|
+
readonly view: string;
|
|
611
|
+
}>): boolean;
|
|
612
|
+
/**
|
|
613
|
+
* The first issue of an options_chain input's book knobs, the kit's rules (`wrunOptionViewAskOf`) in its order, or
|
|
614
|
+
* undefined (also for words naming no book fold: an input of views of the block alone keeps its reads): each declared
|
|
615
|
+
* knob a book fold takes, legal on every declared word that takes it (a book fold's own spec, a view of the block's
|
|
616
|
+
* shared one, `WRUN_OPTION_BOOK_SHARED_KNOBS`), else refused with what it takes there and the word; such a knob beside
|
|
617
|
+
* no declared word that takes it (`a param of "<word>" only`); `nearest` beside `days` on a word that takes both
|
|
618
|
+
* (`WRUN_OPTION_BOOK_SCOPE_TAKES`); the class's `expiries` other than "all" (`WRUN_OPTION_BOOK_EXPIRIES_TAKES`). A
|
|
619
|
+
* view of the block's own knobs are the kit planner's where the rows are built.
|
|
620
|
+
*/
|
|
621
|
+
export declare function wrunOptionBookViewIssue(source: Readonly<Record<string, unknown>>, words: readonly string[]): WrunOptionLaneIssue | undefined;
|
|
375
622
|
/** f64s per row of a view block (the page views' folds) and of the strike kit fold (the SDK's
|
|
376
623
|
* `WRUN_OPTION_VIEW_ROW_WIDTHS`): the layout, then the widest layout's fields. */
|
|
377
624
|
export declare const WRUN_OPTION_VIEW_ROW_WIDTHS: Readonly<{
|
|
@@ -411,12 +658,25 @@ export declare const WRUN_OPTION_STRIKES_VELOCITY_LISTS: readonly string[];
|
|
|
411
658
|
export declare function wrunOptionStrikesVelocityWindows(value: unknown): number[] | undefined;
|
|
412
659
|
/** The f64s per tuple of a velocity read: the class's tuple, then one value per list per window. */
|
|
413
660
|
export declare function wrunOptionStrikesVelocityWidth(classWidth: number, windows: readonly number[]): number;
|
|
661
|
+
/**
|
|
662
|
+
* The f64s per row of a block whose words are `words` (the kit's `wrunOptionViewWordsRowWidth`, each a word of the
|
|
663
|
+
* class or not): the class's own width (`classWidth`) when no word names a fold; else the widest row a declared word
|
|
664
|
+
* answers, the class's view row (`WRUN_OPTION_VIEW_ROW_WIDTHS`) widened to a declared book fold's own
|
|
665
|
+
* (`WRUN_OPTION_BOOK_VIEW_ROW_WIDTHS`). The words alone decide it, never a param, so a setting never resizes a block:
|
|
666
|
+
* the one rule an input's width (`wrunOptionInputTupleWidth`) and an instance's (`wrunOptionLaneTupleWidth`) read.
|
|
667
|
+
*/
|
|
668
|
+
export declare function wrunOptionViewWordsRowWidth(sourceClass: WrunOptionViewClass | WrunOptionLaneClass, words: readonly unknown[], classWidth: number): number;
|
|
669
|
+
/** The f64s per row a class's view block may take, ascending (the kit's `wrunOptionViewRowWidthsOf`): its view row,
|
|
670
|
+
* and on options_chain each book fold's own (never the class's tuple width). A host tells a view block from class
|
|
671
|
+
* tuples by the width alone (the kit's `wrunCellBlockIsViewRows`). */
|
|
672
|
+
export declare function wrunOptionViewRowWidthsOf(sourceClass: WrunOptionViewClass | WrunOptionLaneClass): readonly number[];
|
|
414
673
|
/**
|
|
415
674
|
* The f64s per tuple one input's block carries (the SDK's `wrunOptionInputTupleWidth`, the one rule every host sizes
|
|
416
|
-
* by): a view block's row width when its words name a fold (a page view fold,
|
|
417
|
-
* and its velocity lists when an `option_strikes`
|
|
418
|
-
* the kit sizes it so from the om schema's knob on,
|
|
419
|
-
* width. The words alone decide it, never a param, so a
|
|
675
|
+
* by): a view block's row width when its words name a fold (`wrunOptionViewWordsRowWidth`: a page view fold, a book
|
|
676
|
+
* fold's own width when wider, the strike kit fold), the class's tuple and its velocity lists when an `option_strikes`
|
|
677
|
+
* input names `velocity_windows` (`wrunOptionStrikesVelocityWidth`; the kit sizes it so from the om schema's knob on,
|
|
678
|
+
* `WRUN_OPTION_STRIKES_VELOCITY_SERVED`), else the class's own width. The words alone decide it, never a param, so a
|
|
679
|
+
* setting never resizes a block.
|
|
420
680
|
*/
|
|
421
681
|
export declare function wrunOptionInputTupleWidth(source: Readonly<Record<string, unknown>>, classWidth: number): number;
|
|
422
682
|
/** pb-common `OptionSurfacePick` by word (the gateway decodes numbers, never names). */
|
|
@@ -481,7 +741,8 @@ export declare function wrunOptionKitBarHasRows(tuples: ReadonlyArray<unknown>):
|
|
|
481
741
|
* `wrunOptionInputTupleWidth`: the views ride the instance's key, so every input it serves shares its width): the kit
|
|
482
742
|
* fold's rows on an instance asking it, the class's tuple and its velocity lists on an `option_strikes` instance asking
|
|
483
743
|
* velocity windows (`WRUN_OPTION_STRIKES_VELOCITY_FIELD`), a view block's rows on one whose views (`<prefix>Views`) name
|
|
484
|
-
* a fold of its class (Top Contracts' totals
|
|
744
|
+
* a fold of its class (Top Contracts' totals; a book fold, at the widest of its words,
|
|
745
|
+
* `wrunOptionViewWordsRowWidth`), else the class's own tuple (`classWidth`).
|
|
485
746
|
*/
|
|
486
747
|
export declare function wrunOptionLaneTupleWidth(sourceClass: string, acquisition: Readonly<Record<string, unknown>>, classWidth: number): number;
|
|
487
748
|
/**
|