@orangecharts/wrun-chart-host 0.8.0 → 0.10.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 +3 -1
- package/dist/constants/feature-flags.constants.d.ts +9 -0
- package/dist/constants/feature-flags.constants.js +86 -16
- package/dist/constants/marketCapabilities.constants.d.ts +14 -9
- package/dist/constants/marketCapabilities.constants.js +36 -13
- package/dist/constants/opra-compliance.constants.d.ts +15 -0
- package/dist/constants/opra-compliance.constants.js +15 -0
- package/dist/constants/option-venues.constants.d.ts +11 -6
- package/dist/constants/option-venues.constants.js +5 -2
- package/dist/constants/scriptEditor/builtin-script-snippets.d.ts +26 -0
- package/dist/constants/scriptEditor/builtin-script-snippets.js +6 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.d.ts +15 -0
- package/dist/constants/scriptEditor/technicalIndicatorScriptKeys.constants.js +17 -0
- package/dist/constants/venue-presets.constants.d.ts +20 -20
- package/dist/constants/venue-presets.constants.js +24 -26
- package/dist/host-env.d.ts +39 -9
- package/dist/host-env.js +6 -0
- package/dist/host-ports.types.d.ts +108 -18
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -0
- package/dist/interfaces/kscript-diagnostics.interface.d.ts +6 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
- package/dist/interfaces/opra-realtime.interface.js +10 -10
- package/dist/interfaces/replay.interface.d.ts +8 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +52 -15
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +94 -14
- package/dist/kscript-data/controls/live-trades-merge.util.js +132 -22
- package/dist/kscript-data/controls/live-trades-order-gate.util.d.ts +56 -0
- package/dist/kscript-data/controls/live-trades-order-gate.util.js +107 -0
- package/dist/market-data/billing.interface.d.ts +227 -42
- package/dist/market-data/billing.interface.js +60 -12
- package/dist/market-data/venue.d.ts +88 -6
- package/dist/market-data/venues/cme.contract.copy.json +66 -0
- package/dist/market-data/venues/cme.d.ts +126 -0
- package/dist/market-data/venues/cme.js +133 -0
- package/dist/market-data/venues/index.d.ts +165 -8
- package/dist/market-data/venues/index.js +48 -6
- package/dist/market-data/venues/opra.contract.copy.json +5 -3
- package/dist/market-data/venues/opra.d.ts +3 -3
- package/dist/market-data/venues/opra.js +5 -4
- package/dist/replay/replayLadder.js +3 -1
- package/dist/settings-templates/index.js +7 -3
- package/dist/settings-templates/indicator-fields.d.ts +5 -4
- package/dist/settings-templates/indicator-fields.js +45 -6
- package/dist/settings-templates/tool-rules.d.ts +27 -17
- package/dist/settings-templates/tool-rules.js +27 -11
- package/dist/settings-templates/tool-tables.generated.js +91 -31
- package/dist/utility/chart/book-live-bucket.util.d.ts +15 -0
- package/dist/utility/chart/book-live-bucket.util.js +47 -0
- package/dist/utility/chart/crypto-index.leaf.d.ts +2 -2
- package/dist/utility/chart/crypto-index.leaf.js +2 -2
- package/dist/utility/chart/index-mode-admission.util.js +24 -3
- package/dist/utility/chart/index-mode.util.d.ts +5 -2
- package/dist/utility/chart/index-mode.util.js +23 -13
- package/dist/utility/chart/kscript-drawing-safe-area.util.d.ts +35 -11
- package/dist/utility/chart/kscript-drawing-safe-area.util.js +145 -35
- package/dist/utility/chart/kscript-live-coalesce.util.d.ts +7 -2
- package/dist/utility/chart/kscript-live-coalesce.util.js +9 -3
- package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
- package/dist/utility/chart/kscript-standin-identity.leaf.d.ts +3 -1
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.d.ts +32 -2
- package/dist/utility/chart/kscript-titancharts-render-keys.constants.js +45 -0
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -27
- package/dist/utility/chart/kscript-venue-policy.util.js +74 -32
- package/dist/utility/chart/market-session-schedule.util.d.ts +10 -0
- package/dist/utility/chart/market-session-schedule.util.js +16 -0
- package/dist/utility/chart/marketKind.util.d.ts +12 -10
- package/dist/utility/chart/marketKind.util.js +17 -7
- package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
- package/dist/utility/chart/om-panel-push-style.util.js +17 -15
- package/dist/utility/chart/om-panel.util.js +6 -6
- package/dist/utility/chart/opra-read-access.leaf.d.ts +5 -3
- package/dist/utility/chart/opra-read-access.leaf.js +5 -3
- package/dist/utility/chart/profile-block-size.util.d.ts +16 -0
- package/dist/utility/chart/profile-block-size.util.js +7 -0
- package/dist/utility/chart/quote-perp.leaf.d.ts +17 -0
- package/dist/utility/chart/quote-perp.leaf.js +20 -0
- package/dist/utility/chart/rth-session.util.d.ts +3 -2
- package/dist/utility/chart/rth-session.util.js +2 -1
- package/dist/utility/chart/window-geometry.leaf.d.ts +8 -0
- package/dist/utility/chart/window-geometry.leaf.js +22 -6
- package/dist/utility/chart/wrun-run-result.util.d.ts +17 -0
- package/dist/utility/chart/wrun-run-result.util.js +145 -7
- package/dist/utility/common/transformations.util.d.ts +7 -0
- package/dist/utility/common/transformations.util.js +11 -0
- package/dist/utility/options/option-bar-anchor.util.d.ts +145 -0
- package/dist/utility/options/option-bar-anchor.util.js +340 -0
- package/dist/utility/options/option-venue.util.d.ts +21 -3
- package/dist/utility/options/option-venue.util.js +30 -3
- package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
- package/dist/utility/wrun/derived-roots.util.d.ts +213 -0
- package/dist/utility/wrun/derived-roots.util.js +471 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +41 -6
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +89 -19
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +9 -4
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +47 -6
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +5 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +6 -4
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +2 -2
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +5 -1
- package/dist/utility/wrun/sources/lanes/option_daily.js +5 -2
- package/dist/utility/wrun/sources/lanes/options_flow.js +5 -2
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +64 -19
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +105 -35
- package/dist/utility/wrun/sources/row-lane-registry.js +3 -2
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +2 -1
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +9 -3
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +15 -6
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +14 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +82 -13
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +17 -4
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +55 -8
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +95 -14
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +5 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +7 -3
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -0
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +35 -14
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +70 -20
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.d.ts +64 -0
- package/dist/utility/wrun/sources/wrun-row-lane-add-memo.util.js +89 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +45 -1
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +114 -6
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +56 -5
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +224 -26
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +822 -58
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +16 -3
- package/dist/utility/wrun/wrun-batched-marks.util.js +30 -19
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +37 -9
- package/dist/utility/wrun/wrun-batched-readout.util.js +61 -15
- package/dist/utility/wrun/wrun-builtin-twin.util.d.ts +12 -0
- package/dist/utility/wrun/wrun-builtin-twin.util.js +21 -0
- package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.d.ts +66 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.js +86 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +192 -13
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +437 -55
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +15 -4
- package/dist/utility/wrun/wrun-color-settings.util.js +31 -12
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +107 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +134 -0
- package/dist/utility/wrun/wrun-download-plan.util.d.ts +99 -0
- package/dist/utility/wrun/wrun-download-plan.util.js +118 -0
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +11 -3
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +26 -4
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-draft-overlay.util.js +23 -3
- package/dist/utility/wrun/wrun-frames.d.ts +27 -6
- package/dist/utility/wrun/wrun-frames.js +78 -15
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +7 -0
- package/dist/utility/wrun/wrun-hosted-wire.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-hosted-wire.util.js +12 -2
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +51 -21
- package/dist/utility/wrun/wrun-hud-looks.util.js +74 -28
- package/dist/utility/wrun/wrun-latest-snapshot.d.ts +11 -0
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +8 -6
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +8 -6
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -2
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-live-intake.util.js +213 -45
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-live-tick.util.js +246 -49
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.d.ts +53 -0
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.js +162 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +205 -48
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +277 -34
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +51 -7
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +340 -56
- package/dist/utility/wrun/wrun-opra-lane.util.d.ts +17 -4
- package/dist/utility/wrun/wrun-opra-lane.util.js +6 -4
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +41 -2
- package/dist/utility/wrun/wrun-option-prints.util.js +80 -13
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.d.ts +31 -0
- package/dist/utility/wrun/wrun-option-strike-flow-forecast.util.js +119 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +26 -6
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +50 -11
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +109 -19
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +222 -61
- package/dist/utility/wrun/wrun-option-views.util.d.ts +96 -18
- package/dist/utility/wrun/wrun-option-views.util.js +246 -51
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-options-stop.util.js +3 -2
- package/dist/utility/wrun/wrun-output-style.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-output-style.util.js +20 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +20 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +31 -14
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +22 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.d.ts +10 -1
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +52 -4
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +7 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +25 -1
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +134 -37
- package/dist/utility/wrun/wrun-overlay-run.util.js +1118 -254
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +4 -4
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +4 -4
- package/dist/utility/wrun/wrun-pack.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-pack.util.js +20 -9
- package/dist/utility/wrun/wrun-pane-format.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-pane-format.util.js +7 -3
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +63 -13
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +37 -24
- package/dist/utility/wrun/wrun-panel-style.util.js +100 -29
- package/dist/utility/wrun/wrun-param-map.util.d.ts +15 -11
- package/dist/utility/wrun/wrun-param-map.util.js +13 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +21 -3
- package/dist/utility/wrun/wrun-param-values.util.js +6 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +12 -11
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +50 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.js +68 -0
- package/dist/utility/wrun/wrun-refusal.util.js +10 -1
- package/dist/utility/wrun/wrun-refused-latest.util.d.ts +10 -0
- package/dist/utility/wrun/wrun-refused-latest.util.js +12 -0
- package/dist/utility/wrun/wrun-row-source.d.ts +11 -0
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-run-interval.util.js +9 -6
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +52 -1
- package/dist/utility/wrun/wrun-script-inputs.util.js +112 -4
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-setting-words.util.js +13 -5
- package/dist/utility/wrun/wrun-socket-row-source.d.ts +27 -2
- package/dist/utility/wrun/wrun-socket-row-source.js +113 -8
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-source-rows.util.js +108 -43
- package/dist/utility/wrun/wrun-style-words.util.js +6 -4
- package/dist/utility/wrun/wrun-table-chrome.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-table-chrome.util.js +19 -11
- package/dist/utility/wrun/wrun-tape-per-order.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-tape-per-order.util.js +26 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +126 -50
- package/dist/utility/wrun/wrun-tape-source.util.js +193 -68
- package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
- package/dist/utils/replay/replay-buffer-math.d.ts +53 -2
- package/dist/utils/replay/replay-buffer-math.js +227 -20
- package/dist/workers/utils/volume-profile.worker.util.d.ts +4 -1
- package/dist/workers/utils/volume-profile.worker.util.js +5 -2
- package/dist/workers/wrun/wrun-abi-host.js +3 -2
- package/package.json +5 -5
|
@@ -46,8 +46,15 @@
|
|
|
46
46
|
* Beside the five the host fill carries `market.option_multiplier()` (kit 0.87.0,
|
|
47
47
|
* om WRUN_OPTION_FACT_FILLS, which only the chart's browser lane fills): the US
|
|
48
48
|
* dollars one price unit times one size unit of an option on the chart's options
|
|
49
|
-
* chain is worth, 100 on OPRA
|
|
50
|
-
*
|
|
49
|
+
* chain is worth, 100 on OPRA (a stock twin reading its stock's OPRA chain too:
|
|
50
|
+
* the `optionsExchange` fact), the CME root's point value, 1 on a crypto chart,
|
|
51
|
+
* else 0 (wrunChartOptionMultiplier); `market.dollar_multiplier()` (kit 0.95.0):
|
|
52
|
+
* the US dollars one size unit of the market's own trades at one price unit is
|
|
53
|
+
* worth, the market's proven dollar unit (wrunMarketDollarUnit: the CME
|
|
54
|
+
* registry's point value, NQ 20; 1 on a market quoted in dollars), else 0; and
|
|
55
|
+
* `market.option_contract()` (C5, a kit word by 0.102.0): 1 when the chart's
|
|
56
|
+
* market is one option contract (an OPRA contract, a CME or crypto option), else
|
|
57
|
+
* 0 (wrunChartOptionContract), so no recipe guesses it from price distance.
|
|
51
58
|
*
|
|
52
59
|
* The 0 rule: a fact the chart does not know is 0, never a guess. Main thread
|
|
53
60
|
* only (the directory read goes through the markets service); the hosted lanes
|
|
@@ -56,11 +63,17 @@
|
|
|
56
63
|
import { AssetClass, Category, Exchange } from '@orangecharts/orange-v2-pb-common';
|
|
57
64
|
import { wrunChartHostEnv } from '../../host-env.js';
|
|
58
65
|
import { isCmeGoverned } from '../chart/cme-realtime.util.js';
|
|
66
|
+
import { isContinuousSymbol } from '../chart/continuous-contracts.util.js';
|
|
59
67
|
import { governedContractCoin } from '../chart/governed-contract-coin.util.js';
|
|
60
68
|
import { checkIsEconomic, getMarketKind } from '../chart/marketKind.util.js';
|
|
61
|
-
import {
|
|
69
|
+
import { optionsMarketUnderlyingVenue, optionVenueForExchange } from '../options/option-venue.util.js';
|
|
70
|
+
import { isPlainOptionContract } from '../options/option-trade-units.util.js';
|
|
71
|
+
import { isOpraGoverned } from '../v2/opra-governed.util.js';
|
|
62
72
|
import { WRUN_LANE_CURRENCY_AUTO, WRUN_MARKET_FACT_FILLS, WRUN_MARKET_KINDS, WRUN_MARKET_QUOTE_IS_USD, WRUN_MARKET_SESSION_OPEN_CME, wrunLaneCurrency, wrunMarketSizeUnit, wrunMarketZoneCode, wrunCoinLegSource, wrunFollowsCoin, wrunRowVisibleHere, wrunVisibleByNeedsKind, } from './wrun-market-facts.util.js';
|
|
63
73
|
import { isWrunLegStreamClass } from './wrun-leg-stream-classes.js';
|
|
74
|
+
import { isTradesDollarQuoteAsset } from '../../kscript-data/controls/live-trades-merge.util.js';
|
|
75
|
+
import { getExchangeFromSymbol } from '../../helpers/data.helpers.js';
|
|
76
|
+
import { bindWrunDollarUnitReader } from './wrun-dollar-unit-port.leaf.js';
|
|
64
77
|
// ---------------------------------------------------------------------------
|
|
65
78
|
// om's venue tables, mirrored (each names its om source): the chart must
|
|
66
79
|
// answer every market om knows the way om does.
|
|
@@ -167,54 +180,59 @@ const UNKNOWN_MULTIPLIER_EXCHANGES = new Set(['ICE', 'PLATTS']);
|
|
|
167
180
|
/** Read-only outside this module: the paper venue reads each contract's point value from it. */
|
|
168
181
|
export const CME_ROOT_SPECS = {
|
|
169
182
|
// Equity index futures, quoted in index points: the dollar multiplier.
|
|
170
|
-
ES: { kind: 'index', pointValue: 50, quote: 'usd' }, // $50 x S&P 500: equities/sp/e-mini-sandp500
|
|
171
|
-
MES: { kind: 'index', pointValue: 5, quote: 'usd' }, // $5 x S&P 500: equities/sp/micro-e-mini-sandp-500
|
|
172
|
-
NQ: { kind: 'index', pointValue: 20, quote: 'usd' }, // $20 x Nasdaq-100: equities/nasdaq/e-mini-nasdaq-100
|
|
173
|
-
MNQ: { kind: 'index', pointValue: 2, quote: 'usd' }, // $2 x Nasdaq-100: equities/nasdaq/micro-e-mini-nasdaq-100
|
|
174
|
-
RTY: { kind: 'index', pointValue: 50, quote: 'usd' }, // $50 x Russell 2000: equities/russell/e-mini-russell-2000
|
|
175
|
-
M2K: { kind: 'index', pointValue: 5, quote: 'usd' }, // $5 x Russell 2000: equities/russell/micro-e-mini-russell-2000
|
|
176
|
-
YM: { kind: 'index', pointValue: 5, quote: 'usd' }, // $5 x DJIA: equities/dow-jones/e-mini-dow
|
|
177
|
-
MYM: { kind: 'index', pointValue: 0.5, quote: 'usd' }, // $0.50 x DJIA: equities/dow-jones/micro-e-mini-dow
|
|
183
|
+
ES: { kind: 'index', pointValue: 50, quote: 'usd', exchange: 'CME' }, // $50 x S&P 500: equities/sp/e-mini-sandp500
|
|
184
|
+
MES: { kind: 'index', pointValue: 5, quote: 'usd', exchange: 'CME' }, // $5 x S&P 500: equities/sp/micro-e-mini-sandp-500
|
|
185
|
+
NQ: { kind: 'index', pointValue: 20, quote: 'usd', exchange: 'CME' }, // $20 x Nasdaq-100: equities/nasdaq/e-mini-nasdaq-100
|
|
186
|
+
MNQ: { kind: 'index', pointValue: 2, quote: 'usd', exchange: 'CME' }, // $2 x Nasdaq-100: equities/nasdaq/micro-e-mini-nasdaq-100
|
|
187
|
+
RTY: { kind: 'index', pointValue: 50, quote: 'usd', exchange: 'CME' }, // $50 x Russell 2000: equities/russell/e-mini-russell-2000
|
|
188
|
+
M2K: { kind: 'index', pointValue: 5, quote: 'usd', exchange: 'CME' }, // $5 x Russell 2000: equities/russell/micro-e-mini-russell-2000
|
|
189
|
+
YM: { kind: 'index', pointValue: 5, quote: 'usd', exchange: 'CBOT' }, // $5 x DJIA: equities/dow-jones/e-mini-dow
|
|
190
|
+
MYM: { kind: 'index', pointValue: 0.5, quote: 'usd', exchange: 'CBOT' }, // $0.50 x DJIA: equities/dow-jones/micro-e-mini-dow
|
|
178
191
|
// FX futures, quoted in US dollars per unit of the foreign currency (6J per yen, 0.00xxxx).
|
|
179
|
-
'6E': { kind: 'forex', pointValue: 125_000, quote: 'usd' }, // 125,000 euro: fx/g10/euro-fx
|
|
180
|
-
'6B': { kind: 'forex', pointValue: 62_500, quote: 'usd' }, // 62,500 pounds: fx/g10/british-pound
|
|
181
|
-
'6J': { kind: 'forex', pointValue: 12_500_000, quote: 'usd' }, // 12,500,000 yen: fx/g10/japanese-yen
|
|
182
|
-
'6C': { kind: 'forex', pointValue: 100_000, quote: 'usd' }, // 100,000 CAD: fx/g10/canadian-dollar
|
|
192
|
+
'6E': { kind: 'forex', pointValue: 125_000, quote: 'usd', exchange: 'CME' }, // 125,000 euro: fx/g10/euro-fx
|
|
193
|
+
'6B': { kind: 'forex', pointValue: 62_500, quote: 'usd', exchange: 'CME' }, // 62,500 pounds: fx/g10/british-pound
|
|
194
|
+
'6J': { kind: 'forex', pointValue: 12_500_000, quote: 'usd', exchange: 'CME' }, // 12,500,000 yen: fx/g10/japanese-yen
|
|
195
|
+
'6C': { kind: 'forex', pointValue: 100_000, quote: 'usd', exchange: 'CME' }, // 100,000 CAD: fx/g10/canadian-dollar
|
|
183
196
|
// US Treasury futures, quoted in points of par (100): the face value / 100 per point.
|
|
184
|
-
ZT: { kind: 'unknown', pointValue: 2_000, quote: 'usd' }, // $200,000 face: interest-rates/us-treasury/2-year-us-treasury-note
|
|
185
|
-
ZF: { kind: 'unknown', pointValue: 1_000, quote: 'usd' }, // $100,000 face: interest-rates/us-treasury/5-year-us-treasury-note
|
|
186
|
-
ZN: { kind: 'unknown', pointValue: 1_000, quote: 'usd' }, // $100,000 face: interest-rates/us-treasury/10-year-us-treasury-note
|
|
187
|
-
TN: { kind: 'unknown', pointValue: 1_000, quote: 'usd' }, // $100,000 face: interest-rates/us-treasury/ultra-10-year-us-treasury-note
|
|
188
|
-
ZB: { kind: 'unknown', pointValue: 1_000, quote: 'usd' }, // $100,000 face: interest-rates/us-treasury/30-year-us-treasury-bond
|
|
189
|
-
UB: { kind: 'unknown', pointValue: 1_000, quote: 'usd' }, // $100,000 face: interest-rates/us-treasury/ultra-t-bond
|
|
197
|
+
ZT: { kind: 'unknown', pointValue: 2_000, quote: 'usd', exchange: 'CBOT' }, // $200,000 face: interest-rates/us-treasury/2-year-us-treasury-note
|
|
198
|
+
ZF: { kind: 'unknown', pointValue: 1_000, quote: 'usd', exchange: 'CBOT' }, // $100,000 face: interest-rates/us-treasury/5-year-us-treasury-note
|
|
199
|
+
ZN: { kind: 'unknown', pointValue: 1_000, quote: 'usd', exchange: 'CBOT' }, // $100,000 face: interest-rates/us-treasury/10-year-us-treasury-note
|
|
200
|
+
TN: { kind: 'unknown', pointValue: 1_000, quote: 'usd', exchange: 'CBOT' }, // $100,000 face: interest-rates/us-treasury/ultra-10-year-us-treasury-note
|
|
201
|
+
ZB: { kind: 'unknown', pointValue: 1_000, quote: 'usd', exchange: 'CBOT' }, // $100,000 face: interest-rates/us-treasury/30-year-us-treasury-bond
|
|
202
|
+
UB: { kind: 'unknown', pointValue: 1_000, quote: 'usd', exchange: 'CBOT' }, // $100,000 face: interest-rates/us-treasury/ultra-t-bond
|
|
190
203
|
// Energy (NYMEX), quoted in US dollars per unit of the commodity.
|
|
191
|
-
CL: { kind: 'unknown', pointValue: 1_000, quote: 'usd' }, // 1,000 barrels: energy/crude-oil/light-sweet-crude
|
|
192
|
-
MCL: { kind: 'unknown', pointValue: 100, quote: 'usd' }, // 100 barrels: energy/crude-oil/micro-wti-crude-oil
|
|
193
|
-
NG: { kind: 'unknown', pointValue: 10_000, quote: 'usd' }, // 10,000 MMBtu: energy/natural-gas/natural-gas
|
|
194
|
-
RB: { kind: 'unknown', pointValue: 42_000, quote: 'usd' }, // 42,000 gallons: energy/refined-products/rbob-gasoline
|
|
195
|
-
HO: { kind: 'unknown', pointValue: 42_000, quote: 'usd' }, // 42,000 gallons: energy/refined-products/heating-oil
|
|
196
|
-
BZ: { kind: 'unknown', pointValue: 1_000, quote: 'usd' }, // 1,000 barrels: energy/crude-oil/brent-crude-oil-last-day
|
|
204
|
+
CL: { kind: 'unknown', pointValue: 1_000, quote: 'usd', exchange: 'NYMEX' }, // 1,000 barrels: energy/crude-oil/light-sweet-crude
|
|
205
|
+
MCL: { kind: 'unknown', pointValue: 100, quote: 'usd', exchange: 'NYMEX' }, // 100 barrels: energy/crude-oil/micro-wti-crude-oil
|
|
206
|
+
NG: { kind: 'unknown', pointValue: 10_000, quote: 'usd', exchange: 'NYMEX' }, // 10,000 MMBtu: energy/natural-gas/natural-gas
|
|
207
|
+
RB: { kind: 'unknown', pointValue: 42_000, quote: 'usd', exchange: 'NYMEX' }, // 42,000 gallons: energy/refined-products/rbob-gasoline
|
|
208
|
+
HO: { kind: 'unknown', pointValue: 42_000, quote: 'usd', exchange: 'NYMEX' }, // 42,000 gallons: energy/refined-products/heating-oil
|
|
209
|
+
BZ: { kind: 'unknown', pointValue: 1_000, quote: 'usd', exchange: 'NYMEX' }, // 1,000 barrels: energy/crude-oil/brent-crude-oil-last-day
|
|
197
210
|
// Metals (COMEX), quoted in US dollars per troy ounce (copper per pound).
|
|
198
|
-
GC: { kind: 'metal', pointValue: 100, quote: 'usd' }, // 100 troy ounces: metals/precious/gold
|
|
199
|
-
MGC: { kind: 'metal', pointValue: 10, quote: 'usd' }, // 10 troy ounces: metals/precious/e-micro-gold
|
|
200
|
-
SI: { kind: 'metal', pointValue: 5_000, quote: 'usd' }, // 5,000 troy ounces: metals/precious/silver
|
|
201
|
-
SIL: { kind: 'metal', pointValue: 1_000, quote: 'usd' }, // 1,000 troy ounces: metals/precious/1000-oz-silver
|
|
202
|
-
HG: { kind: 'metal', pointValue: 25_000, quote: 'usd' }, // 25,000 pounds: metals/base/copper
|
|
203
|
-
MHG: { kind: 'metal', pointValue: 2_500, quote: 'usd' }, // 2,500 pounds: metals/base/micro-copper
|
|
211
|
+
GC: { kind: 'metal', pointValue: 100, quote: 'usd', exchange: 'COMEX' }, // 100 troy ounces: metals/precious/gold
|
|
212
|
+
MGC: { kind: 'metal', pointValue: 10, quote: 'usd', exchange: 'COMEX' }, // 10 troy ounces: metals/precious/e-micro-gold
|
|
213
|
+
SI: { kind: 'metal', pointValue: 5_000, quote: 'usd', exchange: 'COMEX' }, // 5,000 troy ounces: metals/precious/silver
|
|
214
|
+
SIL: { kind: 'metal', pointValue: 1_000, quote: 'usd', exchange: 'COMEX' }, // 1,000 troy ounces: metals/precious/1000-oz-silver
|
|
215
|
+
HG: { kind: 'metal', pointValue: 25_000, quote: 'usd', exchange: 'COMEX' }, // 25,000 pounds: metals/base/copper
|
|
216
|
+
MHG: { kind: 'metal', pointValue: 2_500, quote: 'usd', exchange: 'COMEX' }, // 2,500 pounds: metals/base/micro-copper
|
|
204
217
|
// Grains (CBOT), quoted in US cents per bushel (soybean oil per pound), the unit the chart
|
|
205
218
|
// draws (corn near 460): a whole point is one cent, worth the contract size in cents, and
|
|
206
219
|
// the quote is US cents, not dollars (Pine reads `syminfo.currency` "USX" there).
|
|
207
|
-
ZC: { kind: 'unknown', pointValue: 5_000, quote: 'other' }, // 5,000 bushels: agriculture/grains/corn
|
|
208
|
-
ZW: { kind: 'unknown', pointValue: 5_000, quote: 'other' }, // 5,000 bushels: agriculture/grains/wheat
|
|
209
|
-
KE: { kind: 'unknown', pointValue: 5_000, quote: 'other' }, // 5,000 bushels: agriculture/grains/kc-wheat
|
|
210
|
-
ZS: { kind: 'unknown', pointValue: 5_000, quote: 'other' }, // 5,000 bushels: agriculture/oilseeds/soybean
|
|
211
|
-
ZL: { kind: 'unknown', pointValue: 60_000, quote: 'other' }, // 60,000 pounds: agriculture/oilseeds/soybean-oil
|
|
220
|
+
ZC: { kind: 'unknown', pointValue: 5_000, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels: agriculture/grains/corn
|
|
221
|
+
ZW: { kind: 'unknown', pointValue: 5_000, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels: agriculture/grains/wheat
|
|
222
|
+
KE: { kind: 'unknown', pointValue: 5_000, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels: agriculture/grains/kc-wheat
|
|
223
|
+
ZS: { kind: 'unknown', pointValue: 5_000, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels: agriculture/oilseeds/soybean
|
|
224
|
+
ZL: { kind: 'unknown', pointValue: 60_000, quote: 'other', exchange: 'CBOT' }, // 60,000 pounds: agriculture/oilseeds/soybean-oil
|
|
212
225
|
// Cryptocurrency futures (CME), quoted in US dollars per coin.
|
|
213
|
-
BTC: { kind: 'crypto', pointValue: 5, quote: 'usd' }, // 5 bitcoin: cryptocurrencies/bitcoin/bitcoin
|
|
214
|
-
MBT: { kind: 'crypto', pointValue: 0.1, quote: 'usd' }, // 0.1 bitcoin: cryptocurrencies/bitcoin/micro-bitcoin
|
|
215
|
-
ETH: { kind: 'crypto', pointValue: 50, quote: 'usd' }, // 50 ether: cryptocurrencies/ether/ether
|
|
216
|
-
MET: { kind: 'crypto', pointValue: 0.1, quote: 'usd' }, // 0.1 ether: cryptocurrencies/ether/micro-ether
|
|
226
|
+
BTC: { kind: 'crypto', pointValue: 5, quote: 'usd', exchange: 'CME' }, // 5 bitcoin: cryptocurrencies/bitcoin/bitcoin
|
|
227
|
+
MBT: { kind: 'crypto', pointValue: 0.1, quote: 'usd', exchange: 'CME' }, // 0.1 bitcoin: cryptocurrencies/bitcoin/micro-bitcoin
|
|
228
|
+
ETH: { kind: 'crypto', pointValue: 50, quote: 'usd', exchange: 'CME' }, // 50 ether: cryptocurrencies/ether/ether
|
|
229
|
+
MET: { kind: 'crypto', pointValue: 0.1, quote: 'usd', exchange: 'CME' }, // 0.1 ether: cryptocurrencies/ether/micro-ether
|
|
217
230
|
};
|
|
231
|
+
/** The CME Group exchange a futures root lists on (`CME_ROOT_SPECS`), or undefined for a root off the table. */
|
|
232
|
+
export function wrunCmeRootExchange(root) {
|
|
233
|
+
const key = root.trim().toUpperCase();
|
|
234
|
+
return Object.prototype.hasOwnProperty.call(CME_ROOT_SPECS, key) ? CME_ROOT_SPECS[key].exchange : undefined;
|
|
235
|
+
}
|
|
218
236
|
// ---------------------------------------------------------------------------
|
|
219
237
|
// The facts of one market
|
|
220
238
|
// ---------------------------------------------------------------------------
|
|
@@ -345,6 +363,11 @@ export function wrunChartMarketFacts(market, row) {
|
|
|
345
363
|
const sessionOpen = cme ? WRUN_MARKET_SESSION_OPEN_CME : 0;
|
|
346
364
|
return { kind: kindCode(kind), pointValue, zone, quoteIsUsd: quoteCode(quote), sessionOpen };
|
|
347
365
|
}
|
|
366
|
+
/** The host_fill word of `market.dollar_multiplier()` (kit 0.95.0). */
|
|
367
|
+
export const WRUN_DOLLAR_MULTIPLIER_FILL = 'dollar_multiplier';
|
|
368
|
+
/** A sheet reading `market.dollar_multiplier()` on a market whose dollar unit is not proven (wrunMarketDollarUnit):
|
|
369
|
+
* the run head's refusal by name, before any fetch (no trade could be valued). */
|
|
370
|
+
export const WRUN_DOLLAR_MULTIPLIER_UNPROVEN_CODE = 'wrun_dollar_multiplier_unproven';
|
|
348
371
|
/** An OPRA chain's multiplier: US listed options are priced per share and sized in contracts of 100 shares. */
|
|
349
372
|
const OPRA_OPTION_MULTIPLIER = 100;
|
|
350
373
|
/** A crypto chain's multiplier, on every venue: prices in US dollars per coin, sizes in coin. */
|
|
@@ -377,8 +400,9 @@ function cmeChainRootSpec(market) {
|
|
|
377
400
|
* CME a CME-governed chart reads the chain of its own root: the root's point value (CME_ROOT_SPECS, ES 50,
|
|
378
401
|
* NQ 20) when the root is quoted in US dollars; a root off the table, or quoted in another unit (a CBOT
|
|
379
402
|
* grain quotes US cents), is 0.
|
|
380
|
-
* OPRA a chart whose options list on OPRA (the venue table
|
|
381
|
-
*
|
|
403
|
+
* OPRA a chart whose options list on OPRA (the venue table over the options seam's market, `optionsExchange`
|
|
404
|
+
* else the chart's own: an OPRA contract chart, a US stock or ETF chart, a stock twin while the opra flag
|
|
405
|
+
* is lit): 100.
|
|
382
406
|
* crypto a chart on a crypto exchange, whichever venue and category (isCryptoChartVenue): its chain, when it has
|
|
383
407
|
* one, is a crypto chain (its own option venue's, the coin's Deribit chain, or another crypto venue's that
|
|
384
408
|
* lists the coin), priced in dollars per coin on every venue: 1. A crypto chart with no chain serves no
|
|
@@ -399,26 +423,76 @@ export function wrunChartOptionMultiplier(market) {
|
|
|
399
423
|
const spec = cmeChainRootSpec(market);
|
|
400
424
|
return spec?.quote === 'usd' ? spec.pointValue : 0;
|
|
401
425
|
}
|
|
402
|
-
|
|
426
|
+
// The family of the chain the chart reads: the options seam's market's (a stock twin's US stock) when the host named
|
|
427
|
+
// it, else the chart's own.
|
|
428
|
+
const optionsVenue = upperText(market.optionsExchange) ?? venue;
|
|
429
|
+
const options = optionVenueForExchange(optionsVenue) ?? optionsMarketUnderlyingVenue({ exchange: optionsVenue });
|
|
403
430
|
if (options?.plane === 'opra')
|
|
404
431
|
return OPRA_OPTION_MULTIPLIER;
|
|
405
432
|
return isCryptoChartVenue(venue) ? CRYPTO_OPTION_MULTIPLIER : 0;
|
|
406
433
|
}
|
|
434
|
+
/** The host_fill word of `market.option_contract()` (C5), a WrunParamHostFill word of the kit the chart pins
|
|
435
|
+
* (0.102.0). The host fills the hidden param `market_option_contract` by this word, never by a slot, so a package
|
|
436
|
+
* compiled without the word keeps every init slot and no scaffold bump is needed. */
|
|
437
|
+
export const WRUN_OPTION_CONTRACT_FILL = 'option_contract';
|
|
438
|
+
/**
|
|
439
|
+
* `market.option_contract()` of the chart market `market` (C5): 1 when the chart is one option contract, else 0. A
|
|
440
|
+
* recipe that marks the underlying's prices (Option Prints) reads it to draw no marks on a contract's own price axis,
|
|
441
|
+
* instead of guessing from price distance. The add door's identity (cme-option-indicator-availability.util
|
|
442
|
+
* isOptionContractChart, which the option-contract indicator refusals read), widened to the crypto option venues:
|
|
443
|
+
*
|
|
444
|
+
* OPRA every chart on the OPRA venue is one contract, a document saved without its category included.
|
|
445
|
+
* CME a chart whose category is OPTION (`ESZ6 C6000`): the category tells the contract from the future on the
|
|
446
|
+
* same venue (ESZ6, ES1!).
|
|
447
|
+
* crypto a chart whose category is OPTION, or one on a plain option venue whose symbol the venue's grammar parses
|
|
448
|
+
* (isPlainOptionContract: Deribit `BTC-25DEC26-100000-C`), so a contract saved without its category still
|
|
449
|
+
* reads 1 and the venue's perpetual (`BTC-PERPETUAL`) reads 0.
|
|
450
|
+
* else 0: a stock or ETF (SPY/USD, an options underlying), a future, a perpetual, spot, forex, an index, an
|
|
451
|
+
* economic series, a prediction market, an unknown venue, no market.
|
|
452
|
+
*
|
|
453
|
+
* The chart metadata alone decides, synchronously and with no read, like the option multiplier. Pure.
|
|
454
|
+
*/
|
|
455
|
+
export function wrunChartOptionContract(market) {
|
|
456
|
+
const venue = upperText(market?.exchange);
|
|
457
|
+
if (market === undefined || venue === undefined)
|
|
458
|
+
return 0;
|
|
459
|
+
const symbol = typeof market.symbol === 'string' ? market.symbol : '';
|
|
460
|
+
return isOpraGoverned(venue) || isOptionContract(market.category) || isPlainOptionContract(venue, symbol) ? 1 : 0;
|
|
461
|
+
}
|
|
407
462
|
/** The host_fill words whose values the host fill carries off the chart's market (wrunMarketFactsFor): the five
|
|
408
|
-
* market facts
|
|
409
|
-
* 0.87.0, which the kit exports no runtime list for).
|
|
463
|
+
* market facts, the option multiplier (om WRUN_OPTION_FACT_FILLS, a word of the kit's WrunParamHostFill since
|
|
464
|
+
* 0.87.0, which the kit exports no runtime list for), the dollar multiplier (kit 0.95.0) and the option contract
|
|
465
|
+
* (C5). They ride beside the five and never join WRUN_MARKET_FACT_FILLS, which mirrors the kit's own five. */
|
|
410
466
|
const WRUN_CHART_MARKET_FILLS = new Set([
|
|
411
467
|
...WRUN_MARKET_FACT_FILLS,
|
|
412
468
|
'option_multiplier',
|
|
469
|
+
WRUN_DOLLAR_MULTIPLIER_FILL,
|
|
470
|
+
WRUN_OPTION_CONTRACT_FILL,
|
|
413
471
|
]);
|
|
414
472
|
/** True when the sheet declares one of the market's facts (a host-filled
|
|
415
|
-
* param on `kind`, `point_value`, `zone`, `quote_is_usd`, `session_open
|
|
416
|
-
* `option_multiplier`): the runs
|
|
417
|
-
* Only a sheet that declares a
|
|
418
|
-
* (wrunMarketFactsNeedDirectory). */
|
|
473
|
+
* param on `kind`, `point_value`, `zone`, `quote_is_usd`, `session_open`,
|
|
474
|
+
* `option_multiplier`, `dollar_multiplier` or `option_contract`): the runs
|
|
475
|
+
* whose host fill carries the market's facts. Only a sheet that declares a
|
|
476
|
+
* directory fact waits for the read (wrunMarketFactsNeedDirectory). */
|
|
419
477
|
export function wrunReadsMarketFacts(metadata) {
|
|
420
478
|
return (metadata?.params ?? []).some((param) => param.host_fill !== undefined && WRUN_CHART_MARKET_FILLS.has(param.host_fill));
|
|
421
479
|
}
|
|
480
|
+
/** True when the sheet reads the market's dollar multiplier (a host-filled param on `dollar_multiplier`, kit
|
|
481
|
+
* 0.95.0): its run proves the market's dollar unit at its head before any fetch (wrun-overlay-run.util), so its
|
|
482
|
+
* module, its batched captions and its dollar tape read one number. */
|
|
483
|
+
export function wrunReadsDollarMultiplier(metadata) {
|
|
484
|
+
return (metadata?.params ?? []).some((param) => param.host_fill === WRUN_DOLLAR_MULTIPLIER_FILL);
|
|
485
|
+
}
|
|
486
|
+
/** The hidden param the kit generates for the dollar multiplier (`market_dollar_multiplier`). */
|
|
487
|
+
const WRUN_DOLLAR_MULTIPLIER_PARAM_NAME = `market_${WRUN_DOLLAR_MULTIPLIER_FILL}`;
|
|
488
|
+
/** wrunReadsDollarMultiplier over an overlay's declared inputs (`settings.scriptInputs`), for a lane that holds no
|
|
489
|
+
* sheet (the cloud payload): a row under the fact's generated name. */
|
|
490
|
+
export function wrunDeclaresDollarMultiplier(declarations) {
|
|
491
|
+
return (Array.isArray(declarations) &&
|
|
492
|
+
declarations.some((row) => row !== null &&
|
|
493
|
+
typeof row === 'object' &&
|
|
494
|
+
row.name === WRUN_DOLLAR_MULTIPLIER_PARAM_NAME));
|
|
495
|
+
}
|
|
422
496
|
/** The facts the directory row answers: wrunChartMarketFacts reads the row for
|
|
423
497
|
* `kind` (its asset class) and `quote_is_usd` (its quote) alone. The other
|
|
424
498
|
* three are the venue tables' (`point_value` the CME root's or the venue's
|
|
@@ -715,17 +789,325 @@ export function wrunMarketFactsSettled(market) {
|
|
|
715
789
|
return settledRows.has(key) || Date.now() < (retryAfter.get(key) ?? 0);
|
|
716
790
|
}
|
|
717
791
|
/** The facts the chart fills for `market` now (synchronous): the five over the
|
|
718
|
-
* directory row once warmWrunMarketFacts settled it, else without one,
|
|
719
|
-
*
|
|
720
|
-
* venue tables alone, no read)
|
|
792
|
+
* directory row once warmWrunMarketFacts settled it, else without one, the
|
|
793
|
+
* option multiplier of its options chain (wrunChartOptionMultiplier: the
|
|
794
|
+
* venue tables alone, no read), whether it is one option contract
|
|
795
|
+
* (wrunChartOptionContract: its metadata alone, no read) and the dollar
|
|
796
|
+
* multiplier of its own trades (wrunMarketDollarUnit over the reads
|
|
797
|
+
* warmWrunMarketDollarFacts settled; 0 while it is not proven). Every word is
|
|
798
|
+
* written on every market, 0 included, so the block keeps one shape. */
|
|
721
799
|
export function wrunMarketFactsFor(market) {
|
|
722
800
|
const parts = marketKeyParts(market);
|
|
723
801
|
const row = parts === undefined ? undefined : settledRows.get(directoryKey(parts.venue, parts.symbol));
|
|
724
|
-
|
|
802
|
+
const dollars = wrunMarketDollarUnit(market);
|
|
803
|
+
return {
|
|
804
|
+
...wrunChartMarketFacts(market, row ?? undefined),
|
|
805
|
+
optionMultiplier: wrunChartOptionMultiplier(market),
|
|
806
|
+
optionContract: wrunChartOptionContract(market),
|
|
807
|
+
dollarMultiplier: dollars.kind === 'dollars' ? dollars.unit : 0,
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
/** A registry field that is a finite number above zero, else null (absent, zero, negative or unreadable). */
|
|
811
|
+
function positiveUnit(value) {
|
|
812
|
+
const number = typeof value === 'number' ? value : typeof value === 'string' ? Number(value) : Number.NaN;
|
|
813
|
+
return Number.isFinite(number) && number > 0 ? number : null;
|
|
814
|
+
}
|
|
815
|
+
/** The trade units of one registry record (a `getSymbolMetadata` answer), null for no record. Pure. */
|
|
816
|
+
export function wrunMarketTradeUnitsOf(record) {
|
|
817
|
+
if (!isRecordLike(record))
|
|
818
|
+
return null;
|
|
819
|
+
const normalized = upperText(record.normalizedSymbol);
|
|
820
|
+
return {
|
|
821
|
+
pointValue: positiveUnit(record.pointValue),
|
|
822
|
+
quote: normalized === undefined ? undefined : /^[A-Z0-9.]+-([A-Z0-9]+)$/.exec(normalized)?.[1],
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
function isRecordLike(value) {
|
|
826
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
827
|
+
}
|
|
828
|
+
/** The registry's units by market (the chart market's `venue\0SYMBOL`) for the session: a record's units, or null
|
|
829
|
+
* for a market the registry holds no record of (or a host that reads none). */
|
|
830
|
+
const settledUnits = new Map();
|
|
831
|
+
/** Registry reads in flight by market. */
|
|
832
|
+
const pendingUnits = new Map();
|
|
833
|
+
/** When a market whose read failed (or whose continuous lead was not known yet) may be asked again (epoch ms). */
|
|
834
|
+
const unitsRetryAfter = new Map();
|
|
835
|
+
/** A read that cannot settle yet: retried after the window (a failed read, a continuous chart's lead not known). */
|
|
836
|
+
class TradeUnitsUnsettled extends Error {
|
|
837
|
+
}
|
|
838
|
+
/** The instrument a market's prints are of: the chart's own symbol, or a continuous CME chart's lead contract (the
|
|
839
|
+
* chart's stamp, else the continuous contracts service's answer). Throws when a continuous chart's lead is not known
|
|
840
|
+
* yet (retried). */
|
|
841
|
+
async function wrunTradeUnitsInstrument(venue, symbol, resolvedContract) {
|
|
842
|
+
if (!isCmeFamily(venue) || !isContinuousSymbol(symbol))
|
|
843
|
+
return symbol;
|
|
844
|
+
const stamped = typeof resolvedContract === 'string' ? resolvedContract.trim() : '';
|
|
845
|
+
if (stamped !== '')
|
|
846
|
+
return stamped;
|
|
847
|
+
const { default: contracts } = await wrunChartHostEnv().market.loadContinuousContracts();
|
|
848
|
+
const lead = await contracts.getResolvedLead(venue, symbol);
|
|
849
|
+
if (lead === null || typeof lead.symbol !== 'string' || lead.symbol === '') {
|
|
850
|
+
throw new TradeUnitsUnsettled(`${venue}:${symbol}`);
|
|
851
|
+
}
|
|
852
|
+
return lead.symbol;
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Ask the instrument registry for `market`'s trade units: once per market for the session, a definite answer (the
|
|
856
|
+
* record's units, or none) kept; concurrent callers share one read; a failed read, or a continuous chart whose lead is
|
|
857
|
+
* not known yet, is asked again a minute later. A host whose metadata service reads no registry record
|
|
858
|
+
* (`getSymbolMetadata` unbound) settles none. Never rejects. The read is fresh (`{ fresh: true }`, as the option units
|
|
859
|
+
* read is): a cached record can predate the registry's point value fill.
|
|
860
|
+
*/
|
|
861
|
+
export function warmWrunMarketTradeUnits(market) {
|
|
862
|
+
const parts = marketKeyParts(market);
|
|
863
|
+
if (parts === undefined)
|
|
864
|
+
return Promise.resolve();
|
|
865
|
+
const key = directoryKey(parts.venue, parts.symbol);
|
|
866
|
+
if (settledUnits.has(key))
|
|
867
|
+
return Promise.resolve();
|
|
868
|
+
if (Date.now() < (unitsRetryAfter.get(key) ?? 0))
|
|
869
|
+
return Promise.resolve();
|
|
870
|
+
let read = pendingUnits.get(key);
|
|
871
|
+
if (read === undefined) {
|
|
872
|
+
read = (async () => {
|
|
873
|
+
const instrument = await wrunTradeUnitsInstrument(parts.venue, parts.symbol, market?.resolvedContract);
|
|
874
|
+
const { default: metadataService } = await wrunChartHostEnv().market.loadMetadataService();
|
|
875
|
+
if (typeof metadataService.getSymbolMetadata !== 'function')
|
|
876
|
+
return null;
|
|
877
|
+
return wrunMarketTradeUnitsOf(await metadataService.getSymbolMetadata(parts.venue, instrument, { fresh: true }));
|
|
878
|
+
})()
|
|
879
|
+
.then((units) => {
|
|
880
|
+
settledUnits.set(key, units);
|
|
881
|
+
unitsRetryAfter.delete(key);
|
|
882
|
+
})
|
|
883
|
+
.catch(() => {
|
|
884
|
+
unitsRetryAfter.set(key, Date.now() + DIRECTORY_RETRY_MS);
|
|
885
|
+
})
|
|
886
|
+
.finally(() => pendingUnits.delete(key));
|
|
887
|
+
pendingUnits.set(key, read);
|
|
888
|
+
}
|
|
889
|
+
return read;
|
|
890
|
+
}
|
|
891
|
+
/** The registry's units of `market` once a read settled them: the units, null for no record, undefined while the
|
|
892
|
+
* registry can still answer (not asked yet, in flight, or a failed read that is retried). Synchronous. */
|
|
893
|
+
export function wrunMarketTradeUnitsNow(market) {
|
|
894
|
+
const parts = marketKeyParts(market);
|
|
895
|
+
if (parts === undefined)
|
|
896
|
+
return null;
|
|
897
|
+
const key = directoryKey(parts.venue, parts.symbol);
|
|
898
|
+
return settledUnits.has(key) ? (settledUnits.get(key) ?? null) : undefined;
|
|
899
|
+
}
|
|
900
|
+
/** Warm everything a market's dollar unit and stored unit read (C-DOLLAR): the directory row (a crypto market's quote)
|
|
901
|
+
* and the instrument registry's units. Never rejects. */
|
|
902
|
+
export function warmWrunMarketDollarFacts(market) {
|
|
903
|
+
return Promise.all([warmWrunMarketFacts(market), warmWrunMarketTradeUnits(market)]).then(() => undefined);
|
|
904
|
+
}
|
|
905
|
+
/** True when a read of `market`'s dollar unit now would wait on nothing (warmWrunMarketDollarFacts): the directory row
|
|
906
|
+
* (wrunMarketFactsSettled) and the registry's units each answered, failed recently, or are never asked. */
|
|
907
|
+
export function wrunMarketDollarFactsSettled(market) {
|
|
908
|
+
if (!wrunMarketFactsSettled(market))
|
|
909
|
+
return false;
|
|
910
|
+
const parts = marketKeyParts(market);
|
|
911
|
+
if (parts === undefined)
|
|
912
|
+
return true;
|
|
913
|
+
const key = directoryKey(parts.venue, parts.symbol);
|
|
914
|
+
return settledUnits.has(key) || Date.now() < (unitsRetryAfter.get(key) ?? 0);
|
|
915
|
+
}
|
|
916
|
+
/** The quote asset a crypto venue's raw symbol spells after its separator (`BTC_USDT`, `BTC-USDT-SWAP`): positive
|
|
917
|
+
* evidence only (a tail that is no dollar asset, `BTC-PERPETUAL`, proves nothing). */
|
|
918
|
+
function separatedQuote(symbol) {
|
|
919
|
+
const parts = symbol.trim().toUpperCase().split(/[_-]/);
|
|
920
|
+
return parts.length >= 2 && parts[0] !== '' ? parts[1] : undefined;
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Whether a market off the CME family is quoted in US dollars, a dollar stablecoin included (the gateway writer's
|
|
924
|
+
* pegged quotes, `isTradesDollarQuoteAsset`): US listings and POLYGON_INDICES yes; else the registry record's quote
|
|
925
|
+
* (its normalized symbol), then the directory row's quote, then the chart's own spelling of the pair
|
|
926
|
+
* (`spelledQuote`), then a raw symbol's separated quote when it is a dollar asset. Undefined when nothing says.
|
|
927
|
+
*/
|
|
928
|
+
function wrunMarketQuoteInDollars(market, venue, row, units) {
|
|
929
|
+
if (US_LISTING_EXCHANGES.has(venue) || INDEX_EXCHANGES.has(venue))
|
|
930
|
+
return true;
|
|
931
|
+
if (units?.quote !== undefined)
|
|
932
|
+
return isTradesDollarQuoteAsset(units.quote);
|
|
933
|
+
const rowQuoteWord = row === undefined ? undefined : (upperText(row.quoteAssetId) ?? upperText(row.quoteCoinName));
|
|
934
|
+
if (rowQuoteWord !== undefined)
|
|
935
|
+
return isTradesDollarQuoteAsset(rowQuoteWord);
|
|
936
|
+
const spelled = spelledQuote(venue, market);
|
|
937
|
+
if (spelled !== undefined)
|
|
938
|
+
return isTradesDollarQuoteAsset(spelled);
|
|
939
|
+
const separated = typeof market.symbol === 'string' ? separatedQuote(market.symbol) : undefined;
|
|
940
|
+
return separated !== undefined && isTradesDollarQuoteAsset(separated) ? true : undefined;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* The US dollars one price unit times one live-feed COIN-arm size unit is worth on `market` (C-DOLLAR's unit value).
|
|
944
|
+
* ONE rule for every market, read off the server's facts and never off a venue list or a table of ours:
|
|
945
|
+
*
|
|
946
|
+
* - A CME Group contract counts contracts on the COIN arm (live-feed never multiplies a point-valued product), so its
|
|
947
|
+
* unit is the instrument registry's point value, in US dollars per point (`warmWrunMarketTradeUnits`: ES 50, 6A
|
|
948
|
+
* 100,000, a cents-quoted grain per cent, ZC 50 and ZL 600), the number the large-print writer prices the table's
|
|
949
|
+
* copies with. An option contract, or a contract the registry holds no point value for, cannot be priced.
|
|
950
|
+
* - Every other market counts its base asset on the COIN arm (live-feed applied each instrument's contract multiplier
|
|
951
|
+
* and its inverse flag), so its unit is the market facts' point value (1, `market.point_value()`; 0 on ICE and
|
|
952
|
+
* PLATTS, whose multipliers no one serves) on a market quoted in dollars (`wrunMarketQuoteInDollars`).
|
|
953
|
+
*
|
|
954
|
+
* A candle's volume times its close times the unit is that candle's dollar volume (the dollar default,
|
|
955
|
+
* wrun-market-size-defaults), and a live print's price times its COIN-arm size times the unit is the print's dollar
|
|
956
|
+
* value (the tape's live fold). A fact that cannot be proven is a named reason, never a guess; `transient` while a read
|
|
957
|
+
* can still answer it. Synchronous: the reads are taken once `warmWrunMarketDollarFacts` settled them.
|
|
958
|
+
*/
|
|
959
|
+
export function wrunMarketDollarUnit(market) {
|
|
960
|
+
const parts = marketKeyParts(market);
|
|
961
|
+
if (market === undefined || parts === undefined)
|
|
962
|
+
return { kind: 'unproven', reason: 'quote', transient: false };
|
|
963
|
+
const key = directoryKey(parts.venue, parts.symbol);
|
|
964
|
+
const units = wrunMarketTradeUnitsNow(market);
|
|
965
|
+
if (isCmeFamily(parts.venue)) {
|
|
966
|
+
if (isOptionContract(market.category))
|
|
967
|
+
return { kind: 'unproven', reason: 'point-value', transient: false };
|
|
968
|
+
if (units === undefined)
|
|
969
|
+
return { kind: 'unproven', reason: 'point-value', transient: true };
|
|
970
|
+
return units?.pointValue != null
|
|
971
|
+
? { kind: 'dollars', unit: units.pointValue }
|
|
972
|
+
: { kind: 'unproven', reason: 'point-value', transient: false };
|
|
973
|
+
}
|
|
974
|
+
const row = settledRows.get(key) ?? undefined;
|
|
975
|
+
const { pointValue } = wrunChartMarketFacts(market, row);
|
|
976
|
+
if (!(Number.isFinite(pointValue) && pointValue > 0)) {
|
|
977
|
+
return { kind: 'unproven', reason: 'point-value', transient: false };
|
|
978
|
+
}
|
|
979
|
+
const dollars = wrunMarketQuoteInDollars(market, parts.venue, row, units);
|
|
980
|
+
if (dollars === true)
|
|
981
|
+
return { kind: 'dollars', unit: pointValue };
|
|
982
|
+
// Unknown while a read can still answer the quote (the registry record or the directory row: not asked yet, or a
|
|
983
|
+
// failed read that is retried); a quote an answer or the market's own spelling names is no dollar quote for good.
|
|
984
|
+
const answered = units !== undefined && (!directoryAnswers(parts.venue) || settledRows.has(key));
|
|
985
|
+
return { kind: 'unproven', reason: 'quote', transient: dollars === undefined && !answered };
|
|
986
|
+
}
|
|
987
|
+
/** The writer's dollars per stored unit by market for the session: a number, or null for a market with no large print
|
|
988
|
+
* in any window (or a host that reads no series). */
|
|
989
|
+
const settledStoredUnits = new Map();
|
|
990
|
+
/** Stored unit reads in flight by market. */
|
|
991
|
+
const pendingStoredUnits = new Map();
|
|
992
|
+
/** When a market whose stored unit read failed may be asked again (epoch ms). */
|
|
993
|
+
const storedUnitsRetryAfter = new Map();
|
|
994
|
+
/** How far back the newest large print is looked for: the large table's own retention (a week). The read asks one
|
|
995
|
+
* row, newest first, so a busy market answers one print, not a week of them (measured 2026-10-22: one row on
|
|
996
|
+
* BINANCE_FUTURES BTCUSDT, gate.io futures BTC_USDT and CME ESZ6 and ES1!). */
|
|
997
|
+
const STORED_UNIT_WINDOW_SEC = 7 * 86_400;
|
|
998
|
+
const STORED_UNIT_TIMEOUT_MS = 20_000;
|
|
999
|
+
/**
|
|
1000
|
+
* The large-print writer's dollars per STORED unit off a TRADE_LARGE answer (decoded series frames, the TRADES
|
|
1001
|
+
* columns): `quoteAmount / amount` of the newest row whose both are finite and above zero, undefined when no row is.
|
|
1002
|
+
* The writer prices each copy per instrument (contracts times the contract multiplier times the price on a linear
|
|
1003
|
+
* market, the contract's dollar face on an inverse one, contracts times the price times the point value on CME), so the
|
|
1004
|
+
* ratio is what one stored unit was worth at that print, on every venue, with no unit of ours. Pure.
|
|
1005
|
+
*/
|
|
1006
|
+
export function wrunStoredUnitDollarsOfRows(frames) {
|
|
1007
|
+
let newestTs = Number.NEGATIVE_INFINITY;
|
|
1008
|
+
let perUnit;
|
|
1009
|
+
for (const frame of frames) {
|
|
1010
|
+
const records = frame?.records;
|
|
1011
|
+
const length = Number(records?.length);
|
|
1012
|
+
if (records === undefined || !(length > 0) || !records.ts || !records.volume || !records.quoteAmount)
|
|
1013
|
+
continue;
|
|
1014
|
+
for (let at = 0; at < length; at += 1) {
|
|
1015
|
+
const ts = Number(records.ts[at]);
|
|
1016
|
+
const amount = Number(records.volume[at]);
|
|
1017
|
+
const quote = Number(records.quoteAmount[at]);
|
|
1018
|
+
if (!Number.isFinite(ts) || !(Number.isFinite(amount) && amount > 0) || !(Number.isFinite(quote) && quote > 0)) {
|
|
1019
|
+
continue;
|
|
1020
|
+
}
|
|
1021
|
+
if (ts > newestTs) {
|
|
1022
|
+
newestTs = ts;
|
|
1023
|
+
perUnit = quote / amount;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
return perUnit;
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Read what one STORED unit of `market` is worth in dollars off the large-print writer's own rows: the market's newest
|
|
1031
|
+
* TRADE_LARGE print (`wrunStoredUnitDollarsOfRows`), through the host's series read on the K_TRADES history's own wire
|
|
1032
|
+
* (the chart's market, its wire venue as the K_TRADES worker spells it; TRADE_LARGE is a v2-only read, never the /v3
|
|
1033
|
+
* catalog, whose crypto rows carry no unit): one row, newest first, over the table's week. Once per market for the
|
|
1034
|
+
* session; concurrent callers share one read; a failed read is asked again a minute later. A host whose v2 service
|
|
1035
|
+
* reads no series (`sendSeriesOneShot` unbound) settles none. Never rejects. Only a run head with a raw floor to carry
|
|
1036
|
+
* asks it (wrun-market-size-defaults.util).
|
|
1037
|
+
*/
|
|
1038
|
+
export function warmWrunMarketStoredUnit(market) {
|
|
1039
|
+
const parts = marketKeyParts(market);
|
|
1040
|
+
if (parts === undefined)
|
|
1041
|
+
return Promise.resolve();
|
|
1042
|
+
const key = directoryKey(parts.venue, parts.symbol);
|
|
1043
|
+
if (settledStoredUnits.has(key))
|
|
1044
|
+
return Promise.resolve();
|
|
1045
|
+
if (Date.now() < (storedUnitsRetryAfter.get(key) ?? 0))
|
|
1046
|
+
return Promise.resolve();
|
|
1047
|
+
let read = pendingStoredUnits.get(key);
|
|
1048
|
+
if (read === undefined) {
|
|
1049
|
+
read = (async () => {
|
|
1050
|
+
const { default: v2 } = await wrunChartHostEnv().transport.loadV2Service();
|
|
1051
|
+
if (typeof v2.sendSeriesOneShot !== 'function')
|
|
1052
|
+
return null;
|
|
1053
|
+
const toUnixS = Math.floor(Date.now() / 1000);
|
|
1054
|
+
const descriptor = {
|
|
1055
|
+
domain: 'CRYPTO',
|
|
1056
|
+
metric: 'TRADES',
|
|
1057
|
+
ref: { exchange: getExchangeFromSymbol(parts.venue, parts.symbol), symbol: parts.symbol },
|
|
1058
|
+
window: { fromUnixS: toUnixS - STORED_UNIT_WINDOW_SEC, toUnixS },
|
|
1059
|
+
paging: { limit: 1, direction: 'DESC' },
|
|
1060
|
+
v2Only: { type: 'TRADE_LARGE' },
|
|
1061
|
+
};
|
|
1062
|
+
const frames = await v2.sendSeriesOneShot(descriptor, { timeoutMs: STORED_UNIT_TIMEOUT_MS });
|
|
1063
|
+
return wrunStoredUnitDollarsOfRows(frames) ?? null;
|
|
1064
|
+
})()
|
|
1065
|
+
.then((perUnit) => {
|
|
1066
|
+
settledStoredUnits.set(key, perUnit);
|
|
1067
|
+
storedUnitsRetryAfter.delete(key);
|
|
1068
|
+
})
|
|
1069
|
+
.catch(() => {
|
|
1070
|
+
storedUnitsRetryAfter.set(key, Date.now() + DIRECTORY_RETRY_MS);
|
|
1071
|
+
})
|
|
1072
|
+
.finally(() => pendingStoredUnits.delete(key));
|
|
1073
|
+
pendingStoredUnits.set(key, read);
|
|
1074
|
+
}
|
|
1075
|
+
return read;
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* The US dollars one unit of `market`'s STORED trade amount is worth (the large-print table's `amount`, the unit a
|
|
1079
|
+
* 0.5.0 Big Trades Min size floored by: contracts of 0.0001 BTC on gate.io futures BTC_USDT, of 0.01 BTC on an OKX
|
|
1080
|
+
* swap, $100 contracts on Binance delivery BTCUSD_PERP, contracts on CME): the writer's own price of one, read off the
|
|
1081
|
+
* market's newest large print (`warmWrunMarketStoredUnit`), on a market whose dollar unit is proven (its quote
|
|
1082
|
+
* amounts are dollars). ONE rule for every venue, linear, inverse and CME alike, no venue list and no multiplier of
|
|
1083
|
+
* ours; a fact that cannot be proven is a named reason, `transient` while a read can still answer it. Synchronous over
|
|
1084
|
+
* `warmWrunMarketDollarFacts` and `warmWrunMarketStoredUnit`.
|
|
1085
|
+
*/
|
|
1086
|
+
export function wrunMarketStoredUnitDollars(market) {
|
|
1087
|
+
const unit = wrunMarketDollarUnit(market);
|
|
1088
|
+
if (unit.kind === 'unproven')
|
|
1089
|
+
return unit;
|
|
1090
|
+
const parts = marketKeyParts(market);
|
|
1091
|
+
const key = parts === undefined ? undefined : directoryKey(parts.venue, parts.symbol);
|
|
1092
|
+
if (key === undefined || !settledStoredUnits.has(key))
|
|
1093
|
+
return { kind: 'unproven', reason: 'rows', transient: true };
|
|
1094
|
+
const perUnit = settledStoredUnits.get(key);
|
|
1095
|
+
return perUnit === null || perUnit === undefined
|
|
1096
|
+
? { kind: 'unproven', reason: 'rows', transient: false }
|
|
1097
|
+
: { kind: 'dollars', perUnit };
|
|
725
1098
|
}
|
|
726
1099
|
/** Forget every kept answer (spec isolation). */
|
|
727
1100
|
export function clearWrunMarketFactsMemo() {
|
|
728
1101
|
settledRows.clear();
|
|
729
1102
|
pendingRows.clear();
|
|
730
1103
|
retryAfter.clear();
|
|
1104
|
+
settledUnits.clear();
|
|
1105
|
+
pendingUnits.clear();
|
|
1106
|
+
unitsRetryAfter.clear();
|
|
1107
|
+
settledStoredUnits.clear();
|
|
1108
|
+
pendingStoredUnits.clear();
|
|
1109
|
+
storedUnitsRetryAfter.clear();
|
|
731
1110
|
}
|
|
1111
|
+
// The live intake reads the dollar unit through its port (wrun-dollar-unit-port.leaf), so this module stays off the
|
|
1112
|
+
// pre-candle closure live-feed loads the intake in.
|
|
1113
|
+
bindWrunDollarUnitReader({ unit: wrunMarketDollarUnit, warm: warmWrunMarketDollarFacts });
|
|
@@ -10,24 +10,34 @@ export interface WrunRgba {
|
|
|
10
10
|
* renderer, heatmap, profile or levels declaration (C1, parseWrunStyleTarget). */
|
|
11
11
|
export declare const WRUN_STYLE_ROW_PREFIX = "__style__";
|
|
12
12
|
/** True for a Style page row key (never a sheet param, never sent to a host):
|
|
13
|
-
* an output property row or a viewer row (a HUD's
|
|
14
|
-
*
|
|
13
|
+
* an output property row or a viewer row (a HUD's rows, a heatmap's
|
|
14
|
+
* Sensitivity). */
|
|
15
15
|
export declare function isWrunStyleRowKey(key: string): boolean;
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
/** A HUD's viewer rows, `hud:<name>:<row>`: the Look pick (g3 addendum LK09),
|
|
17
|
+
* the place (the card moved by its title) and the dismissable HUD's collapsed
|
|
18
|
+
* and shown flags (C3), stored on the overlay beside the per-output style
|
|
19
|
+
* rows and never written into the sheet. The one list the key builder and
|
|
20
|
+
* every reader derive from: a row added here persists with the workspace row,
|
|
21
|
+
* rides a template and a twin conversion, and saves without a rerun. */
|
|
22
|
+
export declare const WRUN_HUD_VIEWER_ROWS: readonly ["look", "place", "collapsed", "shown"];
|
|
23
|
+
export type WrunHudViewerRow = (typeof WRUN_HUD_VIEWER_ROWS)[number];
|
|
19
24
|
export declare const WRUN_HUD_LOOK_ROW_PREFIX = "hud:";
|
|
20
|
-
export declare
|
|
25
|
+
export declare function wrunHudViewerRowKey(name: string, row: WrunHudViewerRow): string;
|
|
26
|
+
/** A HUD viewer row key read back: its HUD and its row; undefined for any other key. */
|
|
27
|
+
export declare function parseWrunHudViewerRowKey(key: string): {
|
|
28
|
+
name: string;
|
|
29
|
+
row: WrunHudViewerRow;
|
|
30
|
+
} | undefined;
|
|
21
31
|
export declare function isWrunHudLookRowKey(key: string): boolean;
|
|
22
32
|
export declare function isWrunHudPlaceRowKey(key: string): boolean;
|
|
23
|
-
/** A HUD's viewer rows (
|
|
33
|
+
/** A HUD's viewer rows (WRUN_HUD_VIEWER_ROWS): overlay settings that persist by key. */
|
|
24
34
|
export declare function isWrunHudViewerRowKey(key: string): boolean;
|
|
25
35
|
/** The viewer's Sensitivity for one heatmap (`heatmap:<name>:sensitivity`,
|
|
26
36
|
* wrunHeatmapSensitivityRowKey), stored on the overlay beside the HUD rows. */
|
|
27
37
|
export declare const WRUN_HEATMAP_SENSITIVITY_ROW_RE: RegExp;
|
|
28
38
|
export declare function isWrunHeatmapSensitivityRowKey(key: string): boolean;
|
|
29
|
-
/** Every viewer row of a browser-run Indicator (a HUD's
|
|
30
|
-
*
|
|
39
|
+
/** Every viewer row of a browser-run Indicator (a HUD's rows, a heatmap's
|
|
40
|
+
* Sensitivity, a child the reader hid on its own legend row):
|
|
31
41
|
* overlay settings that persist by key and are never a sheet param, an alert
|
|
32
42
|
* param or a host param. */
|
|
33
43
|
export declare function isWrunViewerRowKey(key: string): boolean;
|