@orangecharts/wrun-chart-host 0.5.0 → 0.7.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 +17 -8
- package/dist/constants/feature-flags.constants.js +7 -2
- package/dist/constants/marketCapabilities.constants.d.ts +5 -0
- package/dist/constants/marketCapabilities.constants.js +16 -0
- package/dist/host-env.d.ts +3 -19
- package/dist/host-ports.types.d.ts +36 -17
- package/dist/index.d.ts +12 -1
- package/dist/index.js +12 -1
- package/dist/indicators/controls/tpo-session.util.js +42 -18
- package/dist/interfaces/wrun-runtime.interface.d.ts +88 -13
- package/dist/interfaces/wrun-runtime.interface.js +17 -3
- package/dist/market-data/billing.interface.d.ts +2 -1
- package/dist/settings-templates/indicator-fields.js +10 -0
- package/dist/utility/chart/chart-mount-epoch.util.d.ts +12 -0
- package/dist/utility/chart/chart-mount-epoch.util.js +32 -0
- package/dist/utility/chart/crypto-index.leaf.d.ts +16 -0
- package/dist/utility/chart/crypto-index.leaf.js +19 -0
- package/dist/utility/chart/index-mode-admission.util.js +9 -1
- package/dist/utility/chart/index-mode.util.d.ts +11 -5
- package/dist/utility/chart/index-mode.util.js +22 -10
- package/dist/utility/chart/kscript-source-answer-budget.leaf.d.ts +36 -0
- package/dist/utility/chart/kscript-source-answer-budget.leaf.js +39 -0
- package/dist/utility/chart/kscript-source-degrade.leaf.d.ts +38 -1
- package/dist/utility/chart/kscript-source-degrade.leaf.js +39 -1
- package/dist/utility/chart/live-bucket.util.d.ts +2 -1
- package/dist/utility/chart/live-bucket.util.js +47 -15
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +15 -1
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +9 -0
- package/dist/utility/chart/market-session-schedule.util.d.ts +3 -1
- package/dist/utility/chart/market-session-schedule.util.js +24 -2
- package/dist/utility/chart/marketKind.util.d.ts +12 -7
- package/dist/utility/chart/marketKind.util.js +15 -5
- package/dist/utility/chart/ny-calendar.util.d.ts +104 -0
- package/dist/utility/chart/ny-calendar.util.js +346 -0
- package/dist/utility/chart/om-panel.util.d.ts +14 -2
- package/dist/utility/chart/om-panel.util.js +108 -40
- package/dist/utility/chart/rth-session.util.d.ts +10 -7
- package/dist/utility/chart/rth-session.util.js +17 -22
- package/dist/utility/chart/trading-day.util.js +90 -18
- package/dist/utility/chart/us-equities-session.util.js +20 -67
- package/dist/utility/chart/wrun-bar-session-facts.util.js +14 -1
- package/dist/utility/common/time.util.d.ts +7 -1
- package/dist/utility/common/time.util.js +11 -41
- package/dist/utility/number-format.util.d.ts +17 -7
- package/dist/utility/number-format.util.js +18 -8
- package/dist/utility/options/option-symbol.util.js +13 -2
- package/dist/utility/symbol-selection/contract-expiry.util.js +9 -1
- package/dist/utility/watchlist/import/import-request.leaf.d.ts +4 -1
- package/dist/utility/watchlist/import/import-request.leaf.js +5 -2
- package/dist/utility/watchlist/import/tradingview-symbols.leaf.d.ts +25 -4
- package/dist/utility/watchlist/import/tradingview-symbols.leaf.js +62 -4
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.d.ts +19 -0
- package/dist/utility/wrun/run-schedule/wrun-chart-gate-reader.util.js +57 -0
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.d.ts +23 -0
- package/dist/utility/wrun/run-schedule/wrun-gate-reader-warm.util.js +90 -0
- package/dist/utility/wrun/run-schedule/wrun-lane-groups.util.d.ts +39 -0
- package/dist/utility/wrun/run-schedule/wrun-lane-groups.util.js +60 -0
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +77 -0
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +195 -0
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.d.ts +56 -0
- package/dist/utility/wrun/run-schedule/wrun-own-candles.util.js +70 -0
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +53 -0
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +239 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.d.ts +16 -0
- package/dist/utility/wrun/sources/lanes/option_stats_10m.js +14 -0
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +43 -18
- package/dist/utility/wrun/sources/lanes/options_flow.js +209 -72
- package/dist/utility/wrun/sources/lanes/token_supply.js +5 -31
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -18
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +12 -57
- package/dist/utility/wrun/sources/row-lane-registry.d.ts +1 -1
- package/dist/utility/wrun/sources/row-lane-registry.js +22 -8
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +61 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +103 -8
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +5 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +24 -12
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +55 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +95 -18
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +15 -1
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +23 -8
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +11 -11
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +14 -2
- package/dist/utility/wrun/sources/wrun-poll-lane.types.js +6 -3
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +43 -8
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +77 -11
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +31 -16
- package/dist/utility/wrun/sources/wrun-row-lane.types.js +2 -0
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +52 -12
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +110 -46
- package/dist/utility/wrun/wrun-bar-count.util.d.ts +17 -6
- package/dist/utility/wrun/wrun-bar-count.util.js +27 -12
- package/dist/utility/wrun/wrun-browser-sources.leaf.d.ts +10 -0
- package/dist/utility/wrun/wrun-browser-sources.leaf.js +12 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.d.ts +3 -3
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +53 -18
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -0
- package/dist/utility/wrun/wrun-color-settings.util.js +45 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.js +14 -8
- package/dist/utility/wrun/wrun-failure-cause.d.ts +1 -1
- package/dist/utility/wrun/wrun-failure-cause.js +14 -0
- package/dist/utility/wrun/wrun-frames.js +6 -2
- package/dist/utility/wrun/wrun-host.service.d.ts +131 -59
- package/dist/utility/wrun/wrun-host.service.js +391 -194
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +1 -1
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +2 -0
- package/dist/utility/wrun/wrun-hover.util.d.ts +3 -0
- package/dist/utility/wrun/wrun-hover.util.js +25 -4
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +7 -4
- package/dist/utility/wrun/wrun-kit-run-tables.util.d.ts +24 -0
- package/dist/utility/wrun/wrun-kit-run-tables.util.js +87 -0
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +2 -1
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +8 -2
- package/dist/utility/wrun/wrun-live-tick.util.js +35 -16
- package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +40 -13
- package/dist/utility/wrun/wrun-opra-flow.leaf.js +39 -12
- package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +70 -21
- package/dist/utility/wrun/wrun-option-contract-flow.util.js +257 -112
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +62 -22
- package/dist/utility/wrun/wrun-option-prints.util.js +148 -46
- package/dist/utility/wrun/wrun-option-views.util.d.ts +262 -0
- package/dist/utility/wrun/wrun-option-views.util.js +356 -0
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +23 -2
- package/dist/utility/wrun/wrun-options-chain.util.js +37 -3
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +20 -5
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +32 -7
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +9 -3
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +146 -18
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +52 -8
- package/dist/utility/wrun/wrun-overlay-run.util.js +816 -243
- package/dist/utility/wrun/wrun-pack.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +28 -12
- package/dist/utility/wrun/wrun-pin-venues.util.js +4 -6
- package/dist/utility/wrun/wrun-prefix-cohort.util.d.ts +1 -1
- package/dist/utility/wrun/wrun-prefix-cohort.util.js +1 -1
- package/dist/utility/wrun/wrun-present-bits.util.d.ts +9 -0
- package/dist/utility/wrun/wrun-present-bits.util.js +39 -0
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-refusal-surface.util.js +5 -4
- package/dist/utility/wrun/wrun-refusal.util.d.ts +66 -6
- package/dist/utility/wrun/wrun-refusal.util.js +335 -40
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +5 -3
- package/dist/utility/wrun/wrun-sandbox-row-source.d.ts +2 -2
- package/dist/utility/wrun/wrun-sha256.leaf.d.ts +13 -0
- package/dist/utility/wrun/wrun-sha256.leaf.js +84 -0
- package/dist/utility/wrun/wrun-source-rows.util.js +11 -0
- package/dist/utility/wrun/wrun-tier-grid.util.d.ts +28 -3
- package/dist/utility/wrun/wrun-tier-grid.util.js +79 -19
- package/dist/utility/wrun/wrun-transient-rerun.util.d.ts +14 -3
- package/dist/utility/wrun/wrun-transient-rerun.util.js +33 -8
- package/dist/workers/wrun/wrun-abi-host.d.ts +15 -2
- package/dist/workers/wrun/wrun-abi-host.js +31 -12
- package/dist/workers/wrun/wrun-engine-handler.d.ts +11 -28
- package/dist/workers/wrun/wrun-engine-handler.js +181 -12
- package/package.json +5 -5
- package/dist/utility/wrun/wrun-opra-underlying.util.d.ts +0 -12
- package/dist/utility/wrun/wrun-opra-underlying.util.js +0 -1
|
@@ -341,7 +341,7 @@ export declare function wrunFrameRefusalMemory(text: string): 'window' | 'identi
|
|
|
341
341
|
*/
|
|
342
342
|
export declare const WRUN_KIT_REFUSAL_STAGES: {
|
|
343
343
|
readonly validate: readonly ["wrun_abi_unsupported", "wrun_pin_venue_unknown", "wrun_sheet_over_cap", "wrun_abi_channel_missing", "wrun_intrabar_interval_required", "wrun_intrabar_primary", "wrun_candles_interval_required", "wrun_candles_primary", "wrun_options_chain_venue", "wrun_options_chain_expiries", "wrun_options_chain_market_pinned", "wrun_offset_needs_view", "wrun_offset_count_required", "wrun_bars_needs_leg", "wrun_chart_interval_below_needs_candles", "wrun_chart_interval_below_primary", "wrun_chart_interval_below_forming", "wrun_pin_venue_refused", "wrun_pin_symbol_literal", "wrun_tape_history_unavailable", "wrun_strategy_feed_not_ohlcv", "wrun_strategy_slippage_model_unsupported", "wrun_strategy_reserved_output", "wrun_tape_min_size_invalid", "wrun_option_knob_invalid", "wrun_option_market_pinned", "wrun_option_prints_min_premium_required", "wrun_options_flow_venue_field", "wrun_options_flow_venue_required", "wrun_options_flow_venue_scope", "wrun_oi_candles_interval_required", "wrun_oi_candles_primary", "wrun_volume_profile_candles_interval_required", "wrun_volume_profile_candles_primary"];
|
|
344
|
-
readonly plan: readonly ["wrun_options_coin_unknown", "wrun_source_unsupported", "wrun_not_in_10m_universe", "wrun_opra_lane_refused", "wrun_opra_official_only", "wrun_option_contract_flow_unsupported", "wrun_option_contract_state_unsupported", "wrun_option_daily_unsupported", "wrun_option_prints_one_acquisition", "wrun_option_prints_unsupported", "wrun_option_stats_10m_unsupported", "wrun_option_surface_unsupported", "wrun_options_flow_unsupported", "wrun_field_unsupported", "wrun_tenor_unsupported", "wrun_view_unsupported", "wrun_family_unsupported", "wrun_displacement_needs_cap", "wrun_options_chain_venue_unavailable", "wrun_options_chain_unavailable", "wrun_options_chain_one_venue", "wrun_lane_input_refused", "wrun_permission_denied", "wrun_coin_leg_unsupported", "wrun_coin_leg_unresolved", "wrun_pin_unsupported", "wrun_custom_interval_unsupported", "wrun_intrabar_leg_off_grid", "wrun_intrabar_ratio_over_cap", "wrun_intrabar_unsupported", "wrun_candles_bars_over_cap", "wrun_candles_ratio_over_cap", "wrun_oi_candles_unsupported", "wrun_volume_profile_candles_unsupported", "wrun_trade_volume_by_size_unsupported", "wrun_view_leg_off_grid", "wrun_view_leg_equal", "wrun_time_facts_unsupported", "wrun_etf_flow_unsupported", "wrun_volatility_index_unsupported", "wrun_long_short_ratio_unsupported", "wrun_options_oi_unsupported", "wrun_options_volume_unsupported", "wrun_ethena_positions_unsupported", "wrun_etf_holdings_unsupported", "wrun_etf_premium_unsupported", "wrun_economic_unsupported", "wrun_treasury_balance_unsupported", "wrun_bitfinex_funding_unsupported", "wrun_strategy_costs_in_sheet", "wrun_window_bars_invalid", "wrun_cells_unavailable", "wrun_tape_unavailable", "wrun_tape_interval_unsupported", "wrun_metric_source_missing_policy", "wrun_series_source_primary", "wrun_series_source_densification", "wrun_metric_pin_coarser_than_primary", "wrun_forming_primary_not_own_candles", "wrun_package_lock_invalid", "wrun_package_lock_missing", "wrun_package_not_installed", "wrun_package_lock_mismatch", "wrun_composition_cycle", "wrun_composition_depth", "wrun_options_chain_unsupported", "wrun_volume_profile_ticks_unsupported", "wrun_celled_metric_unsupported", "wrun_series_source_missing", "wrun_series_source_invalid", "wrun_params_invalid", "wrun_source_bindings_invalid", "wrun_output_displaced", "wrun_pin_unresolvable"];
|
|
344
|
+
readonly plan: readonly ["wrun_options_coin_unknown", "wrun_source_unsupported", "wrun_not_in_10m_universe", "wrun_opra_lane_refused", "wrun_opra_official_only", "wrun_option_contract_flow_unsupported", "wrun_option_contract_state_unsupported", "wrun_option_daily_unsupported", "wrun_option_prints_one_acquisition", "wrun_option_prints_unsupported", "wrun_option_prints_v2_unsupported", "wrun_option_stats_10m_unsupported", "wrun_option_surface_unsupported", "wrun_options_flow_unsupported", "wrun_field_unsupported", "wrun_tenor_unsupported", "wrun_view_unsupported", "wrun_family_unsupported", "wrun_displacement_needs_cap", "wrun_options_chain_venue_unavailable", "wrun_options_chain_unavailable", "wrun_options_chain_one_venue", "wrun_lane_input_refused", "wrun_permission_denied", "wrun_coin_leg_unsupported", "wrun_coin_leg_unresolved", "wrun_pin_unsupported", "wrun_custom_interval_unsupported", "wrun_intrabar_leg_off_grid", "wrun_intrabar_ratio_over_cap", "wrun_intrabar_unsupported", "wrun_candles_bars_over_cap", "wrun_candles_ratio_over_cap", "wrun_oi_candles_unsupported", "wrun_volume_profile_candles_unsupported", "wrun_trade_volume_by_size_unsupported", "wrun_view_leg_off_grid", "wrun_view_leg_equal", "wrun_time_facts_unsupported", "wrun_etf_flow_unsupported", "wrun_volatility_index_unsupported", "wrun_long_short_ratio_unsupported", "wrun_options_oi_unsupported", "wrun_options_volume_unsupported", "wrun_ethena_positions_unsupported", "wrun_etf_holdings_unsupported", "wrun_etf_premium_unsupported", "wrun_economic_unsupported", "wrun_treasury_balance_unsupported", "wrun_bitfinex_funding_unsupported", "wrun_strategy_costs_in_sheet", "wrun_window_bars_invalid", "wrun_cells_unavailable", "wrun_tape_unavailable", "wrun_tape_interval_unsupported", "wrun_metric_source_missing_policy", "wrun_series_source_primary", "wrun_series_source_densification", "wrun_metric_pin_coarser_than_primary", "wrun_forming_primary_not_own_candles", "wrun_package_lock_invalid", "wrun_package_lock_missing", "wrun_package_not_installed", "wrun_package_lock_mismatch", "wrun_composition_cycle", "wrun_composition_depth", "wrun_options_chain_unsupported", "wrun_volume_profile_ticks_unsupported", "wrun_celled_metric_unsupported", "wrun_series_source_missing", "wrun_series_source_invalid", "wrun_params_invalid", "wrun_source_bindings_invalid", "wrun_output_displaced", "wrun_pin_unresolvable"];
|
|
345
345
|
readonly shape: readonly ["wrun_draw_kind_limit", "wrun_draw_total_limit", "wrun_draw_polyline_too_large", "wrun_draw_calls_per_row", "wrun_render_result_too_large", "wrun_draw_kind_mismatch", "wrun_draw_handle_missing", "wrun_draw_label_slot_absent", "wrun_draw_non_finite", "wrun_draw_phase", "wrun_draw_id_negative", "wrun_draw_kind_undeclared", "wrun_draw_prop_unknown", "wrun_draw_prop_unsupported", "wrun_draw_style_out_of_range", "wrun_draw_polyline_empty", "wrun_draw_polyline_out_of_bounds", "wrun_draw_label_slot_undeclared", "wrun_draw_polyline_budget", "wrun_strategy_id_limit", "wrun_strategy_id_too_long", "wrun_strategy_id_invalid_utf8", "wrun_strategy_calls_per_row", "wrun_strategy_trade_limit", "wrun_strategy_non_finite", "wrun_strategy_bad_direction", "wrun_strategy_not_declared", "wrun_strategy_phase", "wrun_strategy_id_out_of_bounds", "wrun_text_param_phase", "wrun_text_param_memory", "wrun_bar_count_phase", "wrun_frame_invalid", "wrun_frame_phase", "wrun_frame_undeclared", "wrun_frame_length", "wrun_frame_too_large", "wrun_frame_run_too_large", "wrun_frame_memory", "wrun_frame_utf8"];
|
|
346
346
|
readonly pack: readonly ["wrun_cell_block_invalid", "wrun_run_cells_too_large", "wrun_cell_block_too_large"];
|
|
347
347
|
readonly align: readonly ["wrun_densify_empty_fetch", "wrun_densify_mixed_phase", "wrun_liquidation_side_unmatched", "wrun_bound_series_empty", "wrun_cell_data_malformed"];
|
|
@@ -533,6 +533,8 @@ export const WRUN_KIT_REFUSAL_STAGES = {
|
|
|
533
533
|
'wrun_option_daily_unsupported',
|
|
534
534
|
'wrun_option_prints_one_acquisition',
|
|
535
535
|
'wrun_option_prints_unsupported',
|
|
536
|
+
// kit 0.88.0 (OPTIONS-PORT P7): the prints with their block and RFQ identity, a host that does not serve them.
|
|
537
|
+
'wrun_option_prints_v2_unsupported',
|
|
536
538
|
'wrun_option_stats_10m_unsupported',
|
|
537
539
|
'wrun_option_surface_unsupported',
|
|
538
540
|
'wrun_options_flow_unsupported',
|
|
@@ -119,6 +119,9 @@ export interface WrunTemplateSelf {
|
|
|
119
119
|
}
|
|
120
120
|
/** The sparkline's default window when a block declares no `bars`. */
|
|
121
121
|
export declare const WRUN_SPARK_DEFAULT_BARS = 32;
|
|
122
|
+
/** `value` as written when a style reads it as a colour and nothing else (a hex, or a numeric rgb()/hsl() form),
|
|
123
|
+
* else undefined. The gate paintColor and every block view sink (WrunBlocks) share. */
|
|
124
|
+
export declare function wrunPaintColor(value: unknown): string | undefined;
|
|
122
125
|
/** An output's display label: the declared `label`, else its name read as
|
|
123
126
|
* words (the legend's own rule, wrunLegendName). */
|
|
124
127
|
export declare function wrunOutputDisplayLabel(output: Pick<WrunMetadataOutput, 'name' | 'label'>): string;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import { wrunLegendName } from '../chart/wrun-legend-name.util.js';
|
|
26
26
|
import { WRUN_MAX_BLOCK_HEIGHT_PX, WRUN_MAX_HUD_FONT_SIZE_PX, WRUN_MAX_HUD_RINGS, WRUN_MIN_BLOCK_HEIGHT_PX, WRUN_MIN_HUD_FONT_SIZE_PX, isWrunRowLeader, wrunBlockDraw, } from './wrun-hud-looks.util.js';
|
|
27
27
|
import { formatWrunLegendValue, formatWrunValue, isWrunValueFormat, } from './wrun-pane-format.util.js';
|
|
28
|
-
import { resolveWrunColorWord } from './wrun-style-words.util.js';
|
|
28
|
+
import { isWrunColorWord, parseWrunThemeToken, resolveWrunColorWord, } from './wrun-style-words.util.js';
|
|
29
29
|
/** The sparkline's default window when a block declares no `bars`. */
|
|
30
30
|
export const WRUN_SPARK_DEFAULT_BARS = 32;
|
|
31
31
|
/** The chip separator inside one string slot ("Overbought|Rising"). */
|
|
@@ -96,14 +96,35 @@ function formatPlacedSignedValue(value, name, format, placement, options) {
|
|
|
96
96
|
return '-';
|
|
97
97
|
return `${value < 0 ? '-' : '+'}${formatPlacedValue(Math.abs(value), name, format, placement, options)}`;
|
|
98
98
|
}
|
|
99
|
+
// The colours a block view may paint (HTML sink audit L15): only what a style can read as a colour and nothing
|
|
100
|
+
// else. Any hex (the sheet words are #rrggbb and #rrggbbaa), and a comma rgb()/rgba()/hsl()/hsla() of plain numbers
|
|
101
|
+
// (official sheets carry `rgba(120, 123, 134, 0.7)`). No url(), no var(), no `;`, no word: a sheet comes from a
|
|
102
|
+
// registry tarball with only its id and outputs type-checked, and its colours reach `background` in the HUD tiles.
|
|
103
|
+
const WRUN_PAINT_HEX_RE = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
|
|
104
|
+
const WRUN_PAINT_NUMBER = String.raw `[-+]?(?:\d+(?:\.\d+)?|\.\d+)`;
|
|
105
|
+
const WRUN_PAINT_FUNCTION_RE = new RegExp(String.raw `^(?:rgba?|hsla?)\(\s*${WRUN_PAINT_NUMBER}(?:deg|%)?\s*,\s*${WRUN_PAINT_NUMBER}%?\s*,\s*${WRUN_PAINT_NUMBER}%?\s*(?:,\s*${WRUN_PAINT_NUMBER}%?\s*)?\)$`, 'i');
|
|
106
|
+
/** `value` as written when a style reads it as a colour and nothing else (a hex, or a numeric rgb()/hsl() form),
|
|
107
|
+
* else undefined. The gate paintColor and every block view sink (WrunBlocks) share. */
|
|
108
|
+
export function wrunPaintColor(value) {
|
|
109
|
+
if (typeof value !== 'string')
|
|
110
|
+
return undefined;
|
|
111
|
+
const color = value.trim();
|
|
112
|
+
return WRUN_PAINT_HEX_RE.test(color) || WRUN_PAINT_FUNCTION_RE.test(color) ? value : undefined;
|
|
113
|
+
}
|
|
99
114
|
/** A colour word painted for the placement's chart: a theme token resolves
|
|
100
|
-
* against the palette (DW13)
|
|
101
|
-
*
|
|
115
|
+
* against the palette (DW13) and paints only when the palette answers with a
|
|
116
|
+
* colour; any other word paints as written when it is a sheet colour word
|
|
117
|
+
* (isWrunColorWord, the HUD card gate: a theme token stays as written without
|
|
118
|
+
* a palette) or a plain colour (wrunPaintColor). Anything else (a url(), a
|
|
119
|
+
* declaration list) paints nothing. */
|
|
102
120
|
function paintColor(word, placement) {
|
|
103
121
|
if (word === undefined)
|
|
104
122
|
return undefined;
|
|
105
123
|
const theme = placement?.colorTheme;
|
|
106
|
-
|
|
124
|
+
if (theme !== undefined && parseWrunThemeToken(word) !== null) {
|
|
125
|
+
return wrunPaintColor(resolveWrunColorWord(word, theme));
|
|
126
|
+
}
|
|
127
|
+
return isWrunColorWord(word) || wrunPaintColor(word) !== undefined ? word : undefined;
|
|
107
128
|
}
|
|
108
129
|
/** An output's display label: the declared `label`, else its name read as
|
|
109
130
|
* words (the legend's own rule, wrunLegendName). */
|
|
@@ -151,10 +151,13 @@ const REQUIREMENT_ROWS = {
|
|
|
151
151
|
coins: BTC_ETH,
|
|
152
152
|
}),
|
|
153
153
|
volatility_index: () => ({ kind: 'provider', sourceClass: 'volatility_index', provider: 'DERIBIT', coins: BTC_ETH }),
|
|
154
|
-
//
|
|
155
|
-
//
|
|
156
|
-
//
|
|
157
|
-
|
|
154
|
+
// The options flow of the chart's options chain (a chain poll lane, sources/lanes/options_flow): its ticker, market and
|
|
155
|
+
// venue scopes read the chain the options chain's `auto` decides, on whichever plane it lists on (its `venue` names a
|
|
156
|
+
// scope's venue, never the chain); `equity`, `etf` and `index` (the leaf's WRUN_OPTIONS_FLOW_OPRA_SCOPES) read US
|
|
157
|
+
// listed options alone, the OPRA plane's governed row.
|
|
158
|
+
options_flow: (source) => ['equity', 'etf', 'index'].includes(text(source.scope))
|
|
159
|
+
? { kind: 'governed', sourceClass: 'options_flow', plane: 'opra' }
|
|
160
|
+
: wrunChainLaneRequirement('options_flow', undefined),
|
|
158
161
|
// The daily options statistics of the chart's options chain (a chain poll lane, sources/lanes/option_daily): read on
|
|
159
162
|
// whichever plane the chain lists on, through the options chain's own venue decision (`wrunChainLaneRequirement`).
|
|
160
163
|
option_daily: (source) => wrunChainLaneRequirement('option_daily', source),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The indicator kit's tables a chart run reads on the main thread, copied verbatim and import-free (OPTLOAD g1
|
|
3
|
+
* round 3, 2026-10-21). A run read each off the kit bundle (transport.loadWrunKit): 3.6 MB of authoring code whose
|
|
4
|
+
* evaluation held the main thread 836 ms on a measured first add of IV Rank, for two small tables (the daemon-only
|
|
5
|
+
* one ships empty in kit 0.87.0). The kit's authoring code runs in the compile and language workers, which load
|
|
6
|
+
* their own copy; nothing on the main thread loads it for a run.
|
|
7
|
+
*
|
|
8
|
+
* The values never drift from the kit's: tests/utility/wrun/wrun-kit-run-tables.kit-mirror.spec.ts pins every table
|
|
9
|
+
* here to the kit's own export, so a re-vendor that changes one fails there by name instead of drifting.
|
|
10
|
+
* tests/structure/wrun-engine-off-main-thread.spec.ts holds the main thread to no kit load at all.
|
|
11
|
+
*/
|
|
12
|
+
/** The sentence a source class the kit lists in its daemon-only Set is refused with. */
|
|
13
|
+
export declare const WRUN_DAEMON_ONLY_DEFAULT_DISCLOSURE = "computed on your daemon, not in the tab";
|
|
14
|
+
/**
|
|
15
|
+
* The source classes the kit marks daemon-only (`WRUN_DAEMON_ONLY_SOURCES`) with the words a browser run refuses each
|
|
16
|
+
* with: the daemon computes such a class and owns its dependencies, so the first input declaring one refuses the
|
|
17
|
+
* browser run by name (WrunBrowserHost's source gate, assertWrunBrowserSources). The kit ships a Set (every class
|
|
18
|
+
* refused with the sentence above) and may ship a record of per-class wording instead; this copy holds the words
|
|
19
|
+
* either way. Kit 0.87.0: none.
|
|
20
|
+
*/
|
|
21
|
+
export declare const WRUN_DAEMON_ONLY_SOURCE_DISCLOSURES: Readonly<Record<string, string>>;
|
|
22
|
+
/** The kit's address book for the `token_supply` lane (`WRUN_TOKEN_NAMES`): coin ticker to the gateway's display
|
|
23
|
+
* name, in the kit's order. */
|
|
24
|
+
export declare const WRUN_KIT_TOKEN_NAMES: Readonly<Record<string, string>>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The indicator kit's tables a chart run reads on the main thread, copied verbatim and import-free (OPTLOAD g1
|
|
3
|
+
* round 3, 2026-10-21). A run read each off the kit bundle (transport.loadWrunKit): 3.6 MB of authoring code whose
|
|
4
|
+
* evaluation held the main thread 836 ms on a measured first add of IV Rank, for two small tables (the daemon-only
|
|
5
|
+
* one ships empty in kit 0.87.0). The kit's authoring code runs in the compile and language workers, which load
|
|
6
|
+
* their own copy; nothing on the main thread loads it for a run.
|
|
7
|
+
*
|
|
8
|
+
* The values never drift from the kit's: tests/utility/wrun/wrun-kit-run-tables.kit-mirror.spec.ts pins every table
|
|
9
|
+
* here to the kit's own export, so a re-vendor that changes one fails there by name instead of drifting.
|
|
10
|
+
* tests/structure/wrun-engine-off-main-thread.spec.ts holds the main thread to no kit load at all.
|
|
11
|
+
*/
|
|
12
|
+
/** The sentence a source class the kit lists in its daemon-only Set is refused with. */
|
|
13
|
+
export const WRUN_DAEMON_ONLY_DEFAULT_DISCLOSURE = 'computed on your daemon, not in the tab';
|
|
14
|
+
/**
|
|
15
|
+
* The source classes the kit marks daemon-only (`WRUN_DAEMON_ONLY_SOURCES`) with the words a browser run refuses each
|
|
16
|
+
* with: the daemon computes such a class and owns its dependencies, so the first input declaring one refuses the
|
|
17
|
+
* browser run by name (WrunBrowserHost's source gate, assertWrunBrowserSources). The kit ships a Set (every class
|
|
18
|
+
* refused with the sentence above) and may ship a record of per-class wording instead; this copy holds the words
|
|
19
|
+
* either way. Kit 0.87.0: none.
|
|
20
|
+
*/
|
|
21
|
+
export const WRUN_DAEMON_ONLY_SOURCE_DISCLOSURES = Object.freeze({});
|
|
22
|
+
/** The kit's address book for the `token_supply` lane (`WRUN_TOKEN_NAMES`): coin ticker to the gateway's display
|
|
23
|
+
* name, in the kit's order. */
|
|
24
|
+
export const WRUN_KIT_TOKEN_NAMES = Object.freeze({
|
|
25
|
+
AAVE: 'Aave',
|
|
26
|
+
ADA: 'Cardano',
|
|
27
|
+
ALGO: 'Algorand',
|
|
28
|
+
APT: 'Aptos',
|
|
29
|
+
ARB: 'Arbitrum',
|
|
30
|
+
ASTER: 'Aster',
|
|
31
|
+
ATOM: 'Cosmos Hub',
|
|
32
|
+
AVAX: 'Avalanche',
|
|
33
|
+
BCH: 'Bitcoin Cash',
|
|
34
|
+
BNB: 'BNB',
|
|
35
|
+
BONK: 'Bonk',
|
|
36
|
+
BTC: 'Bitcoin',
|
|
37
|
+
CRV: 'Curve DAO',
|
|
38
|
+
DOGE: 'Dogecoin',
|
|
39
|
+
DOT: 'Polkadot',
|
|
40
|
+
ENA: 'Ethena',
|
|
41
|
+
ETC: 'Ethereum Classic',
|
|
42
|
+
ETH: 'Ethereum',
|
|
43
|
+
FET: 'Artificial Superintelligence Alliance',
|
|
44
|
+
FIL: 'Filecoin',
|
|
45
|
+
FLOKI: 'FLOKI',
|
|
46
|
+
GRT: 'The Graph',
|
|
47
|
+
HBAR: 'Hedera',
|
|
48
|
+
HYPE: 'Hyperliquid',
|
|
49
|
+
ICP: 'Internet Computer',
|
|
50
|
+
IMX: 'Immutable',
|
|
51
|
+
INJ: 'Injective',
|
|
52
|
+
JUP: 'Jupiter',
|
|
53
|
+
KAS: 'Kaspa',
|
|
54
|
+
LDO: 'Lido DAO',
|
|
55
|
+
LINK: 'Chainlink',
|
|
56
|
+
LTC: 'Litecoin',
|
|
57
|
+
MKR: 'Maker',
|
|
58
|
+
NEAR: 'NEAR Protocol',
|
|
59
|
+
ONDO: 'Ondo',
|
|
60
|
+
OP: 'Optimism',
|
|
61
|
+
PENDLE: 'Pendle',
|
|
62
|
+
PEPE: 'Pepe',
|
|
63
|
+
POL: 'POL (ex-MATIC)',
|
|
64
|
+
RENDER: 'Render',
|
|
65
|
+
RUNE: 'THORChain',
|
|
66
|
+
SEI: 'Sei',
|
|
67
|
+
SHIB: 'Shiba Inu',
|
|
68
|
+
SOL: 'Solana',
|
|
69
|
+
STX: 'Stacks',
|
|
70
|
+
SUI: 'Sui',
|
|
71
|
+
TAO: 'Bittensor',
|
|
72
|
+
TIA: 'Celestia',
|
|
73
|
+
TON: 'Toncoin',
|
|
74
|
+
TRUMP: 'Official Trump',
|
|
75
|
+
TRX: 'TRON',
|
|
76
|
+
UNI: 'Uniswap',
|
|
77
|
+
USDC: 'USDC',
|
|
78
|
+
USDT: 'Tether',
|
|
79
|
+
VET: 'VeChain',
|
|
80
|
+
VIRTUAL: 'Virtuals Protocol',
|
|
81
|
+
WIF: 'dogwifhat',
|
|
82
|
+
WLD: 'Worldcoin',
|
|
83
|
+
XLM: 'Stellar',
|
|
84
|
+
XMR: 'Monero',
|
|
85
|
+
XRP: 'XRP',
|
|
86
|
+
ZEC: 'Zcash',
|
|
87
|
+
});
|
|
@@ -54,7 +54,8 @@ export interface WrunRunFailedIdentity {
|
|
|
54
54
|
windowLastTs: number;
|
|
55
55
|
settingsSignature: string;
|
|
56
56
|
}
|
|
57
|
-
/** One settled executor run, as `onWrunOverlayRunSettled` reports it
|
|
57
|
+
/** One settled executor run, as `onWrunOverlayRunSettled` reports it: a run of an overlay that still stands (a run
|
|
58
|
+
* that settles after its overlay's teardown is never reported, so a same-id remount hears its own runs only). */
|
|
58
59
|
export interface WrunRunSettledEvent {
|
|
59
60
|
indicatorId: string;
|
|
60
61
|
chartIndex: number;
|
|
@@ -403,8 +403,14 @@ export declare class WrunTapeLiveRefusal extends Error {
|
|
|
403
403
|
* The note a tick's failure leaves, or null when the record does not classify
|
|
404
404
|
* it (a generic failure, or a class the full run owns: no bars, a deadline).
|
|
405
405
|
* A tick drew before, so its record is a note wherever the C2 table leaves the
|
|
406
|
-
* severity to the raiser (too-big: paused for a run, a note for a tick)
|
|
407
|
-
*
|
|
406
|
+
* severity to the raiser (too-big: paused for a run, a note for a tick). The
|
|
407
|
+
* note re-words the record and keeps everything else the record read off the
|
|
408
|
+
* failure: the raiser's technical text (its details), its cause
|
|
409
|
+
* (`telemetry.cause`, which `wrun_failure_shown` reports and the transient
|
|
410
|
+
* grace reads, as for the run's own record), the run attempt and the answer's
|
|
411
|
+
* flags. Only the ask's own stamp (`clientRequestId`) stays off: every drain
|
|
412
|
+
* is a new ask, and the note's key (one write per session) must not change
|
|
413
|
+
* with it.
|
|
408
414
|
*/
|
|
409
415
|
export declare function wrunLiveTickRefusalOf(error: unknown, ctx: WrunRefusalContext): WrunRefusal | null;
|
|
410
416
|
/**
|
|
@@ -182,6 +182,7 @@ import { hostBucketResolverFor } from '../chart/host-bar-placement.util.js';
|
|
|
182
182
|
import { attachWrunStrategy, isWrunStrategySheet, wrunStrategyOf } from './wrun-box-segment.util.js';
|
|
183
183
|
import { wrunDailyLaneDayStart, wrunDailyLaneHeadEqual, wrunDailyLaneReconcileTo, } from './wrun-daily-lane.util.js';
|
|
184
184
|
import { withWrunDeadline, WRUN_SOURCE_FETCH_DEADLINE_MS } from './wrun-deadline.util.js';
|
|
185
|
+
import { wrunAnswerKeepsHeldOverMarkers } from './wrun-present-bits.util.js';
|
|
185
186
|
import { wrunParamValuesFromSettings } from './wrun-script-inputs.util.js';
|
|
186
187
|
import { wrunOverlayLegendNote } from './wrun-draft-legend-note.util.js';
|
|
187
188
|
import { wrunTextParamValuesFromSettings } from './wrun-text-params.util.js';
|
|
@@ -1996,22 +1997,33 @@ async function wrunEditorTabProbe() {
|
|
|
1996
1997
|
* The note a tick's failure leaves, or null when the record does not classify
|
|
1997
1998
|
* it (a generic failure, or a class the full run owns: no bars, a deadline).
|
|
1998
1999
|
* A tick drew before, so its record is a note wherever the C2 table leaves the
|
|
1999
|
-
* severity to the raiser (too-big: paused for a run, a note for a tick)
|
|
2000
|
-
*
|
|
2000
|
+
* severity to the raiser (too-big: paused for a run, a note for a tick). The
|
|
2001
|
+
* note re-words the record and keeps everything else the record read off the
|
|
2002
|
+
* failure: the raiser's technical text (its details), its cause
|
|
2003
|
+
* (`telemetry.cause`, which `wrun_failure_shown` reports and the transient
|
|
2004
|
+
* grace reads, as for the run's own record), the run attempt and the answer's
|
|
2005
|
+
* flags. Only the ask's own stamp (`clientRequestId`) stays off: every drain
|
|
2006
|
+
* is a new ask, and the note's key (one write per session) must not change
|
|
2007
|
+
* with it.
|
|
2001
2008
|
*/
|
|
2002
2009
|
export function wrunLiveTickRefusalOf(error, ctx) {
|
|
2003
2010
|
const record = wrunRefusalFor(error, ctx);
|
|
2004
2011
|
if (WRUN_TICK_QUIET_REFUSAL_CLASSES.has(record.cls))
|
|
2005
2012
|
return null;
|
|
2006
|
-
const note =
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2013
|
+
const note = {
|
|
2014
|
+
...record,
|
|
2015
|
+
...wrunRefusalFor({
|
|
2016
|
+
cls: record.cls,
|
|
2017
|
+
variant: record.variant,
|
|
2018
|
+
params: { ...record.params },
|
|
2019
|
+
...(record.market ? { market: record.market } : {}),
|
|
2020
|
+
out: record.out,
|
|
2021
|
+
severity: 'note',
|
|
2022
|
+
}, ctx),
|
|
2023
|
+
details: record.details,
|
|
2024
|
+
};
|
|
2025
|
+
delete note.clientRequestId;
|
|
2026
|
+
return note;
|
|
2015
2027
|
}
|
|
2016
2028
|
/** Say a drain's classified failure once, as a note for the `tick` owner (no
|
|
2017
2029
|
* toast; the last good result stays drawn), while the session the drain ran
|
|
@@ -3174,6 +3186,7 @@ async function askWrunReconcileSourceAnswer(context, ledger, ask, meta) {
|
|
|
3174
3186
|
// (the chart's, or a session's run interval).
|
|
3175
3187
|
...(ask.interval === undefined ? wrunReconcileRunIntervalOption(context) : { interval: ask.interval }),
|
|
3176
3188
|
...(ask.nativeRows === true ? { nativeRows: true } : {}),
|
|
3189
|
+
...(ask.endExclusive === true ? { endExclusive: true } : {}),
|
|
3177
3190
|
}), WRUN_SOURCE_FETCH_DEADLINE_MS, `wrun live reconcile fetch '${ask.type}' (${ask.key}) for '${context.fetchKey}'`);
|
|
3178
3191
|
return Array.isArray(fetched) ? fetched : null;
|
|
3179
3192
|
}
|
|
@@ -3811,13 +3824,19 @@ function wrunRowLaneKeepsHeld(context, lane) {
|
|
|
3811
3824
|
return instance !== undefined && wrunRowLaneByKey(instance.laneKey)?.liveByCoin?.reconcile !== undefined;
|
|
3812
3825
|
}
|
|
3813
3826
|
/** A row lane's answer merged over the rows it held by its lane's own rule (a `liveByCoin` lane's `reconcile`:
|
|
3814
|
-
* a print shown live never vanishes on the next poll), else the answer as it came
|
|
3827
|
+
* a print shown live never vanishes on the next poll), else the answer as it came; then, on a lane with a `present`
|
|
3828
|
+
* mask, a held row that carries data stands where the answer names its bar only with the partial marker
|
|
3829
|
+
* (`wrunAnswerKeepsHeldOverMarkers`). */
|
|
3815
3830
|
function wrunRowLaneReconcileAnswer(context, lane, held, answer) {
|
|
3816
3831
|
const instance = context.rowLanes?.find((candidate) => candidate.key === lane);
|
|
3817
|
-
const
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3832
|
+
const descriptor = instance === undefined ? undefined : wrunRowLaneByKey(instance.laneKey);
|
|
3833
|
+
const reconcile = descriptor?.liveByCoin?.reconcile;
|
|
3834
|
+
const merged = reconcile === undefined
|
|
3835
|
+
? answer
|
|
3836
|
+
: reconcile(held, answer);
|
|
3837
|
+
return descriptor === undefined || descriptor.presentMask === false
|
|
3838
|
+
? merged
|
|
3839
|
+
: wrunAnswerKeepsHeldOverMarkers(held, merged);
|
|
3821
3840
|
}
|
|
3822
3841
|
function laneRowsOf(context, lane) {
|
|
3823
3842
|
if (isWrunPollLaneId(lane))
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `options_flow` source class (UW-PARITY source S2) as both threads read it:
|
|
3
|
-
* lane row's columns after the stamp), the knob words,
|
|
4
|
-
* bar sums. The lane file (main thread), the K control and
|
|
2
|
+
* The `options_flow` source class (UW-PARITY source S2, on every chain since OPTIONS-PORT P7) as both threads read it:
|
|
3
|
+
* the field list and its order (the lane row's columns after the stamp), the knob words, the acquisition's fields, and
|
|
4
|
+
* how each ask names the OPTION_PRINT_AGG flow scope rows a bar sums. The lane file (main thread), the K control and
|
|
5
|
+
* its worker twin read this one table, never copies.
|
|
5
6
|
*
|
|
6
7
|
* The rows (tsdb-gateway `pkg/tsdb/selects/option_print_agg.go`, U4; columns `contracts/flow-scope-columns.md`; the
|
|
7
|
-
* dimensions U6's `1792198478_add_option_print_agg_scopes` migration computes):
|
|
8
|
-
* -
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
8
|
+
* dimensions U6's `1792198478_add_option_print_agg_scopes` migration computes; on crypto and CME R7c's contract C7-1):
|
|
9
|
+
* - COIN rows of one underlying on the ask's exchange or venues (raw symbol `COIN`, the coin beside it): an OPRA
|
|
10
|
+
* ticker read, a CME ticker read (the future), and a crypto chain's every read (its ticker names its ONE book as
|
|
11
|
+
* `COIN:<book>`; `market` and `venue` read the coin across venues, every book);
|
|
12
|
+
* - MARKET rows of one exchange (`MARKET`): OPRA's every issue type, or one (`EQUITY` stock 4, `ETF` 3, `INDEX` 7), and
|
|
13
|
+
* a CME exchange's;
|
|
14
|
+
* - VENUE rows of one OPRA venue (`VENUE:<publisher id>`, the Databento publisher id the rows carry);
|
|
12
15
|
* - a COIN or MARKET row is keyed by option type, `dte_bucket` (1 the print's trade date, 2 one to seven days, 3 eight
|
|
13
16
|
* to thirty-five, 4 later; 0 a print past its expiry) and `moneyness` (+1 out of the money, -1 in the money, unset
|
|
14
17
|
* without an underlying price); a VENUE row by option type and issue type. Side is never a dimension: every row
|
|
15
|
-
* splits its totals by side in its `_ask`, `_bid`, `_mid` and `_none` columns.
|
|
18
|
+
* splits its totals by side in its `_ask`, `_bid`, `_mid` and `_none` columns (off OPRA the taker's side: no mid).
|
|
16
19
|
*
|
|
17
20
|
* Import-free: a lane file stays light at module load and the worker twin reads it too.
|
|
18
21
|
*/
|
|
@@ -25,6 +28,8 @@ export declare const WRUN_OPTIONS_FLOW_VENUE_FIELDS: readonly WrunOptionsFlowFie
|
|
|
25
28
|
/** `scope` (om `WRUN_OPTIONS_FLOW_SCOPES`); an absent knob reads `ticker`. */
|
|
26
29
|
export declare const WRUN_OPTIONS_FLOW_SCOPES: readonly ["ticker", "market", "equity", "etf", "index", "venue"];
|
|
27
30
|
export type WrunOptionsFlowScope = (typeof WRUN_OPTIONS_FLOW_SCOPES)[number];
|
|
31
|
+
/** The scopes US listed options alone serve (an issue type of the US market, R7c C7-2): unserved off the OPRA plane. */
|
|
32
|
+
export declare const WRUN_OPTIONS_FLOW_OPRA_SCOPES: readonly WrunOptionsFlowScope[];
|
|
28
33
|
/** `dte` (om `WRUN_OPTIONS_FLOW_DTE`); an absent knob reads `all`. */
|
|
29
34
|
export declare const WRUN_OPTIONS_FLOW_DTE: readonly ["all", "0dte", "week", "month", "later"];
|
|
30
35
|
export type WrunOptionsFlowDte = (typeof WRUN_OPTIONS_FLOW_DTE)[number];
|
|
@@ -50,16 +55,38 @@ export declare const WRUN_OPTION_SCOPE_READS_OFF_CODE = "option-scope-reads-off"
|
|
|
50
55
|
* good. The keys are the intervals the K control asks. */
|
|
51
56
|
export declare const WRUN_OPTIONS_FLOW_TIER_KEYS: readonly ["1m", "5m", "1d"];
|
|
52
57
|
export type WrunOptionsFlowTier = (typeof WRUN_OPTIONS_FLOW_TIER_KEYS)[number];
|
|
58
|
+
/** Each tier's bucket width, ms (a row's stamp is its bucket's start, on the UTC floor). */
|
|
59
|
+
export declare const WRUN_OPTIONS_FLOW_TIER_MS: Readonly<Record<WrunOptionsFlowTier, number>>;
|
|
60
|
+
/**
|
|
61
|
+
* The acquisition's fields beside `scope`, `coin`, `venueId`, `dte` and `moneyness` (the lane's plan answers them, the
|
|
62
|
+
* K control forwards them): the exchange the chart's chain lists on (the lane's `chain` mark: its plane decides the
|
|
63
|
+
* walls, the tier and the fold), a crypto ticker read's ONE book, the venues a crypto scope across venues reads, and a
|
|
64
|
+
* CME chain's continuous alias (`acquisitionMoved` reads it).
|
|
65
|
+
*/
|
|
66
|
+
export declare const WRUN_OPTIONS_FLOW_EXCHANGE_FIELD = "flowExchange";
|
|
67
|
+
export declare const WRUN_OPTIONS_FLOW_BOOK_FIELD = "flowBook";
|
|
68
|
+
export declare const WRUN_OPTIONS_FLOW_VENUES_FIELD = "flowVenues";
|
|
69
|
+
export declare const WRUN_OPTIONS_FLOW_CONTINUOUS_FIELD = "flowContinuous";
|
|
53
70
|
/** One acquisition: the payload the lane's plan answers and the K control forwards (plus the tier it is asked at). */
|
|
54
71
|
export interface WrunOptionsFlowAsk {
|
|
55
72
|
scope: WrunOptionsFlowScope;
|
|
56
|
-
/**
|
|
73
|
+
/** The exchange the chart's chain lists on (pb-common `Exchange` name): the read's venue unless `venues` names them. */
|
|
74
|
+
exchange: string;
|
|
75
|
+
/** A COIN read's underlying, upper case: every ticker read's, a crypto scope across venues' (the chart's coin). */
|
|
57
76
|
coin?: string;
|
|
58
|
-
/**
|
|
77
|
+
/** A crypto ticker read's ONE book (a series name, upper case), read as `COIN:<book>`; absent: every book. */
|
|
78
|
+
book?: string;
|
|
79
|
+
/** A crypto scope across venues (`market`, `venue`): the venues its COIN rows are read on. */
|
|
80
|
+
venues?: readonly string[];
|
|
81
|
+
/** Scope `venue` on OPRA: the venue's Databento publisher id. */
|
|
59
82
|
venueId?: number;
|
|
60
83
|
dte: WrunOptionsFlowDte;
|
|
61
84
|
moneyness: WrunOptionsFlowMoneyness;
|
|
62
85
|
tier: WrunOptionsFlowTier;
|
|
63
86
|
}
|
|
64
|
-
/**
|
|
65
|
-
|
|
87
|
+
/** Whether an ask reads VENUE rows (scope `venue` on OPRA, by publisher id: no side, DTE or moneyness split); a crypto
|
|
88
|
+
* scope `venue` reads its venue's COIN rows. */
|
|
89
|
+
export declare function wrunOptionsFlowReadsVenueRows(ask: Pick<WrunOptionsFlowAsk, 'scope' | 'coin'>): boolean;
|
|
90
|
+
/** The raw symbol an ask's read names: `COIN` for a read of one underlying (`COIN:<book>` when it names its ONE book),
|
|
91
|
+
* `VENUE:<publisher id>` for an OPRA venue, else the scope's MARKET word. */
|
|
92
|
+
export declare function wrunOptionsFlowScopeSymbol(ask: Pick<WrunOptionsFlowAsk, 'scope' | 'coin' | 'book' | 'venueId'>): string;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `options_flow` source class (UW-PARITY source S2) as both threads read it:
|
|
3
|
-
* lane row's columns after the stamp), the knob words,
|
|
4
|
-
* bar sums. The lane file (main thread), the K control and
|
|
2
|
+
* The `options_flow` source class (UW-PARITY source S2, on every chain since OPTIONS-PORT P7) as both threads read it:
|
|
3
|
+
* the field list and its order (the lane row's columns after the stamp), the knob words, the acquisition's fields, and
|
|
4
|
+
* how each ask names the OPTION_PRINT_AGG flow scope rows a bar sums. The lane file (main thread), the K control and
|
|
5
|
+
* its worker twin read this one table, never copies.
|
|
5
6
|
*
|
|
6
7
|
* The rows (tsdb-gateway `pkg/tsdb/selects/option_print_agg.go`, U4; columns `contracts/flow-scope-columns.md`; the
|
|
7
|
-
* dimensions U6's `1792198478_add_option_print_agg_scopes` migration computes):
|
|
8
|
-
* -
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
8
|
+
* dimensions U6's `1792198478_add_option_print_agg_scopes` migration computes; on crypto and CME R7c's contract C7-1):
|
|
9
|
+
* - COIN rows of one underlying on the ask's exchange or venues (raw symbol `COIN`, the coin beside it): an OPRA
|
|
10
|
+
* ticker read, a CME ticker read (the future), and a crypto chain's every read (its ticker names its ONE book as
|
|
11
|
+
* `COIN:<book>`; `market` and `venue` read the coin across venues, every book);
|
|
12
|
+
* - MARKET rows of one exchange (`MARKET`): OPRA's every issue type, or one (`EQUITY` stock 4, `ETF` 3, `INDEX` 7), and
|
|
13
|
+
* a CME exchange's;
|
|
14
|
+
* - VENUE rows of one OPRA venue (`VENUE:<publisher id>`, the Databento publisher id the rows carry);
|
|
12
15
|
* - a COIN or MARKET row is keyed by option type, `dte_bucket` (1 the print's trade date, 2 one to seven days, 3 eight
|
|
13
16
|
* to thirty-five, 4 later; 0 a print past its expiry) and `moneyness` (+1 out of the money, -1 in the money, unset
|
|
14
17
|
* without an underlying price); a VENUE row by option type and issue type. Side is never a dimension: every row
|
|
15
|
-
* splits its totals by side in its `_ask`, `_bid`, `_mid` and `_none` columns.
|
|
18
|
+
* splits its totals by side in its `_ask`, `_bid`, `_mid` and `_none` columns (off OPRA the taker's side: no mid).
|
|
16
19
|
*
|
|
17
20
|
* Import-free: a lane file stays light at module load and the worker twin reads it too.
|
|
18
21
|
*/
|
|
@@ -62,6 +65,8 @@ export const WRUN_OPTIONS_FLOW_VENUE_FIELDS = Object.freeze([
|
|
|
62
65
|
]);
|
|
63
66
|
/** `scope` (om `WRUN_OPTIONS_FLOW_SCOPES`); an absent knob reads `ticker`. */
|
|
64
67
|
export const WRUN_OPTIONS_FLOW_SCOPES = Object.freeze(['ticker', 'market', 'equity', 'etf', 'index', 'venue']);
|
|
68
|
+
/** The scopes US listed options alone serve (an issue type of the US market, R7c C7-2): unserved off the OPRA plane. */
|
|
69
|
+
export const WRUN_OPTIONS_FLOW_OPRA_SCOPES = Object.freeze(['equity', 'etf', 'index']);
|
|
65
70
|
/** `dte` (om `WRUN_OPTIONS_FLOW_DTE`); an absent knob reads `all`. */
|
|
66
71
|
export const WRUN_OPTIONS_FLOW_DTE = Object.freeze(['all', '0dte', 'week', 'month', 'later']);
|
|
67
72
|
/** `moneyness` (om `WRUN_OPTIONS_FLOW_MONEYNESS`); an absent knob reads `all`. */
|
|
@@ -84,10 +89,32 @@ export const WRUN_OPTION_SCOPE_READS_OFF_CODE = 'option-scope-reads-off';
|
|
|
84
89
|
/** The backend tiers a bar is read from (UW-PARITY rule 9, ADDENDUM-2 B3): 1m kept 7 days, 5m kept 30, 1d kept for
|
|
85
90
|
* good. The keys are the intervals the K control asks. */
|
|
86
91
|
export const WRUN_OPTIONS_FLOW_TIER_KEYS = Object.freeze(['1m', '5m', '1d']);
|
|
87
|
-
/**
|
|
92
|
+
/** Each tier's bucket width, ms (a row's stamp is its bucket's start, on the UTC floor). */
|
|
93
|
+
export const WRUN_OPTIONS_FLOW_TIER_MS = Object.freeze({
|
|
94
|
+
'1m': 60_000,
|
|
95
|
+
'5m': 300_000,
|
|
96
|
+
'1d': 86_400_000,
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* The acquisition's fields beside `scope`, `coin`, `venueId`, `dte` and `moneyness` (the lane's plan answers them, the
|
|
100
|
+
* K control forwards them): the exchange the chart's chain lists on (the lane's `chain` mark: its plane decides the
|
|
101
|
+
* walls, the tier and the fold), a crypto ticker read's ONE book, the venues a crypto scope across venues reads, and a
|
|
102
|
+
* CME chain's continuous alias (`acquisitionMoved` reads it).
|
|
103
|
+
*/
|
|
104
|
+
export const WRUN_OPTIONS_FLOW_EXCHANGE_FIELD = 'flowExchange';
|
|
105
|
+
export const WRUN_OPTIONS_FLOW_BOOK_FIELD = 'flowBook';
|
|
106
|
+
export const WRUN_OPTIONS_FLOW_VENUES_FIELD = 'flowVenues';
|
|
107
|
+
export const WRUN_OPTIONS_FLOW_CONTINUOUS_FIELD = 'flowContinuous';
|
|
108
|
+
/** Whether an ask reads VENUE rows (scope `venue` on OPRA, by publisher id: no side, DTE or moneyness split); a crypto
|
|
109
|
+
* scope `venue` reads its venue's COIN rows. */
|
|
110
|
+
export function wrunOptionsFlowReadsVenueRows(ask) {
|
|
111
|
+
return ask.scope === 'venue' && ask.coin === undefined;
|
|
112
|
+
}
|
|
113
|
+
/** The raw symbol an ask's read names: `COIN` for a read of one underlying (`COIN:<book>` when it names its ONE book),
|
|
114
|
+
* `VENUE:<publisher id>` for an OPRA venue, else the scope's MARKET word. */
|
|
88
115
|
export function wrunOptionsFlowScopeSymbol(ask) {
|
|
89
|
-
if (ask.scope === 'ticker')
|
|
90
|
-
return 'COIN';
|
|
116
|
+
if (ask.scope === 'ticker' || ask.coin !== undefined)
|
|
117
|
+
return ask.book !== undefined ? `COIN:${ask.book}` : 'COIN';
|
|
91
118
|
if (ask.scope === 'venue')
|
|
92
119
|
return `VENUE:${ask.venueId}`;
|
|
93
120
|
return WRUN_OPTIONS_FLOW_MARKET_WORDS[ask.scope];
|