@orangecharts/wrun-chart-host 0.11.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/constants/feature-flags.constants.d.ts +3 -4
- package/dist/constants/feature-flags.constants.js +34 -52
- package/dist/constants/feature-limits.constants.d.ts +1 -1
- package/dist/constants/feature-limits.constants.js +5 -4
- package/dist/constants/interval.constants.d.ts +7 -0
- package/dist/constants/interval.constants.js +7 -0
- package/dist/constants/scriptEditor/cme-official-scripts.constants.d.ts +20 -149
- package/dist/constants/scriptEditor/cme-official-scripts.constants.js +20 -309
- package/dist/constants/stocks-compliance.constants.d.ts +15 -0
- package/dist/constants/stocks-compliance.constants.js +15 -0
- package/dist/host-env.d.ts +55 -3
- package/dist/host-env.js +6 -0
- package/dist/host-ports.types.d.ts +36 -3
- package/dist/index.d.ts +18 -0
- package/dist/index.js +19 -0
- package/dist/indicators/controls/tpo-session.util.d.ts +78 -15
- package/dist/indicators/controls/tpo-session.util.js +320 -242
- package/dist/instances/script-engine-worker-ohlcv-transfer.d.ts +6 -0
- package/dist/instances/script-engine-worker-ohlcv-transfer.js +16 -0
- package/dist/interfaces/cme-realtime.interface.d.ts +8 -0
- package/dist/interfaces/cme-realtime.interface.js +2 -1
- package/dist/interfaces/feed.interface.d.ts +15 -1
- package/dist/interfaces/replay.interface.d.ts +5 -0
- package/dist/interfaces/stocks-realtime.interface.d.ts +4 -3
- package/dist/interfaces/stocks-realtime.interface.js +5 -4
- package/dist/interfaces/wrun-runtime.interface.d.ts +97 -19
- package/dist/kscript-data/controls/live-ohlcv-merge.util.d.ts +17 -0
- package/dist/kscript-data/controls/live-ohlcv-merge.util.js +22 -0
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +46 -40
- package/dist/kscript-data/controls/live-trades-merge.util.js +80 -107
- package/dist/market-data/billing.interface.d.ts +9 -1
- package/dist/market-data/venue.d.ts +1 -1
- package/dist/market-data/venues/index.d.ts +4 -4
- package/dist/market-data/venues/stocks.contract.copy.json +4 -4
- package/dist/market-data/venues/stocks.d.ts +4 -4
- package/dist/market-data/venues/stocks.js +15 -13
- package/dist/settings-templates/frvp-fields.d.ts +12 -1
- package/dist/settings-templates/frvp-fields.js +15 -4
- package/dist/settings-templates/index.js +12 -5
- package/dist/settings-templates/indicator-fields.js +28 -2
- package/dist/settings-templates/tool-rules.d.ts +17 -8
- package/dist/settings-templates/tool-rules.js +15 -8
- package/dist/settings-templates/tool-tables.generated.js +4 -2
- package/dist/utility/auth/server-clock.util.d.ts +3 -1
- package/dist/utility/auth/server-clock.util.js +3 -1
- package/dist/utility/chart/book-live-bucket.util.js +2 -2
- package/dist/utility/chart/cache-alignment.util.d.ts +15 -7
- package/dist/utility/chart/cache-alignment.util.js +14 -7
- package/dist/utility/chart/chart-data-fetch-generation.util.d.ts +2 -0
- package/dist/utility/chart/chart-data-fetch-generation.util.js +16 -0
- package/dist/utility/chart/cme-session-bucket.util.d.ts +18 -75
- package/dist/utility/chart/cme-session-bucket.util.js +25 -332
- package/dist/utility/chart/continuous-contracts.util.js +6 -5
- package/dist/utility/chart/display-offset.leaf.d.ts +24 -0
- package/dist/utility/chart/display-offset.leaf.js +41 -0
- package/dist/utility/chart/effective-chart-session.util.d.ts +2 -1
- package/dist/utility/chart/effective-chart-session.util.js +13 -5
- package/dist/utility/chart/feed-interval.util.d.ts +6 -20
- package/dist/utility/chart/feed-interval.util.js +13 -22
- package/dist/utility/chart/fetch-dedupe-policy.util.d.ts +27 -7
- package/dist/utility/chart/fetch-dedupe-policy.util.js +86 -11
- package/dist/utility/chart/host-bar-placement.util.d.ts +7 -4
- package/dist/utility/chart/host-bar-placement.util.js +8 -2
- package/dist/utility/chart/indicator-inflight-registry.util.d.ts +32 -0
- package/dist/utility/chart/indicator-inflight-registry.util.js +52 -0
- package/dist/utility/chart/indicator-run-interval.util.d.ts +10 -4
- package/dist/utility/chart/indicator-run-interval.util.js +21 -12
- package/dist/utility/chart/interval-registry.util.d.ts +1 -1
- package/dist/utility/chart/interval-registry.util.js +1 -1
- package/dist/utility/chart/kscript-legend-entries.util.d.ts +12 -0
- package/dist/utility/chart/kscript-legend-entries.util.js +16 -0
- package/dist/utility/chart/kscript-run-interval-projection.util.d.ts +1 -1
- package/dist/utility/chart/kscript-run-interval-projection.util.js +4 -2
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +53 -62
- package/dist/utility/chart/kscript-venue-policy.util.js +85 -94
- package/dist/utility/chart/live-bucket.util.d.ts +39 -17
- package/dist/utility/chart/live-bucket.util.js +103 -57
- package/dist/utility/chart/local-kscript-source-revalidation.util.d.ts +58 -20
- package/dist/utility/chart/local-kscript-source-revalidation.util.js +98 -23
- package/dist/utility/chart/local-kscript-warmup-depth.util.d.ts +35 -11
- package/dist/utility/chart/local-kscript-warmup-depth.util.js +24 -3
- package/dist/utility/chart/market-session-schedule.util.d.ts +8 -0
- package/dist/utility/chart/market-session-schedule.util.js +39 -1
- package/dist/utility/chart/market-session.util.d.ts +136 -0
- package/dist/utility/chart/market-session.util.js +341 -0
- package/dist/utility/chart/market-sessions.util.d.ts +83 -0
- package/dist/utility/chart/market-sessions.util.js +220 -0
- package/dist/utility/chart/om-panel.util.d.ts +5 -3
- package/dist/utility/chart/om-panel.util.js +42 -7
- package/dist/utility/chart/om-target.util.d.ts +14 -1
- package/dist/utility/chart/om-target.util.js +22 -5
- package/dist/utility/chart/opra-read-access.leaf.d.ts +16 -1
- package/dist/utility/chart/opra-read-access.leaf.js +22 -0
- package/dist/utility/chart/profile-row-height.util.d.ts +49 -16
- package/dist/utility/chart/profile-row-height.util.js +74 -37
- package/dist/utility/chart/rth-session.util.d.ts +55 -20
- package/dist/utility/chart/rth-session.util.js +94 -46
- package/dist/utility/chart/session-interval.util.d.ts +2 -1
- package/dist/utility/chart/session-interval.util.js +1 -3
- package/dist/utility/chart/session-lattice.util.d.ts +150 -0
- package/dist/utility/chart/session-lattice.util.js +488 -0
- package/dist/utility/chart/trading-day.util.d.ts +40 -2
- package/dist/utility/chart/trading-day.util.js +84 -7
- package/dist/utility/chart/us-equities-session.util.d.ts +32 -11
- package/dist/utility/chart/us-equities-session.util.js +44 -15
- package/dist/utility/chart/window-geometry.leaf.d.ts +28 -7
- package/dist/utility/chart/window-geometry.leaf.js +57 -8
- package/dist/utility/chart/wrun-bar-session-facts.util.d.ts +21 -14
- package/dist/utility/chart/wrun-bar-session-facts.util.js +32 -38
- package/dist/utility/chart/wrun-run-result.util.d.ts +29 -12
- package/dist/utility/chart/wrun-run-result.util.js +89 -25
- package/dist/utility/common/time.util.js +5 -4
- package/dist/utility/market-events/earnings-scope.util.d.ts +10 -5
- package/dist/utility/market-events/earnings-scope.util.js +17 -9
- package/dist/utility/market-events/market-events.util.d.ts +14 -7
- package/dist/utility/market-events/market-events.util.js +30 -17
- package/dist/utility/number-format.util.d.ts +14 -21
- package/dist/utility/number-format.util.js +38 -24
- package/dist/utility/options/option-venue-disclosure.util.d.ts +40 -6
- package/dist/utility/options/option-venue-disclosure.util.js +71 -11
- package/dist/utility/options/option-venue.util.d.ts +1 -1
- package/dist/utility/options/option-venue.util.js +1 -1
- package/dist/utility/pool-symbol.leaf.d.ts +7 -0
- package/dist/utility/pool-symbol.leaf.js +50 -5
- package/dist/utility/stocks/stock-display.util.d.ts +15 -0
- package/dist/utility/stocks/stock-display.util.js +37 -0
- package/dist/utility/symbol-selection/contract-expiry.util.js +5 -4
- package/dist/utility/v2/gate-plane.util.d.ts +6 -0
- package/dist/utility/v2/gate-plane.util.js +11 -1
- package/dist/utility/v2/gate-session-latch.util.d.ts +1 -1
- package/dist/utility/v2/gate-session-latch.util.js +3 -3
- package/dist/utility/v2/governed-tier.leaf.d.ts +17 -16
- package/dist/utility/v2/governed-tier.leaf.js +17 -16
- package/dist/utility/v2/stocks-governed.util.d.ts +5 -0
- package/dist/utility/v2/stocks-governed.util.js +14 -0
- package/dist/utility/v2/v2-enums.leaf.d.ts +13 -0
- package/dist/utility/v2/v2-enums.leaf.js +458 -0
- package/dist/utility/wrun/derived-roots.leaf.d.ts +21 -1
- package/dist/utility/wrun/derived-roots.leaf.js +27 -1
- package/dist/utility/wrun/derived-roots.util.d.ts +44 -32
- package/dist/utility/wrun/derived-roots.util.js +97 -56
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +4 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +4 -3
- package/dist/utility/wrun/sources/lanes/option_daily.d.ts +2 -1
- package/dist/utility/wrun/sources/lanes/option_daily.js +2 -1
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +3 -0
- package/dist/utility/wrun/sources/lanes/options_flow.js +23 -5
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +3 -4
- package/dist/utility/wrun/sources/row-lane-registry.js +9 -4
- package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +19 -0
- package/dist/utility/wrun/sources/row-lanes/dark_pool.js +104 -0
- package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
- package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.d.ts +20 -0
- package/dist/utility/wrun/sources/wrun-lane-fetch-abort.util.js +103 -0
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +19 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +15 -13
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +49 -23
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +14 -9
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +75 -27
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +139 -82
- package/dist/utility/wrun/wrun-app-layer.leaf.d.ts +78 -0
- package/dist/utility/wrun/wrun-app-layer.leaf.js +89 -0
- package/dist/utility/wrun/wrun-bar-count.util.d.ts +11 -7
- package/dist/utility/wrun/wrun-bar-count.util.js +12 -8
- package/dist/utility/wrun/wrun-batched-kinds.leaf.d.ts +13 -0
- package/dist/utility/wrun/wrun-batched-kinds.leaf.js +18 -0
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +41 -22
- package/dist/utility/wrun/wrun-batched-marks.util.js +255 -59
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +26 -19
- package/dist/utility/wrun/wrun-batched-readout.util.js +81 -27
- package/dist/utility/wrun/wrun-book-bands.leaf.d.ts +8 -0
- package/dist/utility/wrun/wrun-book-bands.leaf.js +7 -0
- package/dist/utility/wrun/wrun-candle-equal.leaf.d.ts +19 -0
- package/dist/utility/wrun/wrun-candle-equal.leaf.js +40 -0
- package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-canvases.util.js +7 -3
- package/dist/utility/wrun/wrun-chart-context-names.util.d.ts +6 -3
- package/dist/utility/wrun/wrun-chart-context-names.util.js +8 -4
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +47 -29
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +201 -201
- package/dist/utility/wrun/wrun-child-overlay-id.util.js +2 -1
- package/dist/utility/wrun/wrun-cme-legs-note.util.d.ts +15 -0
- package/dist/utility/wrun/wrun-cme-legs-note.util.js +49 -0
- package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +38 -0
- package/dist/utility/wrun/wrun-cme-root-specs.util.js +81 -0
- package/dist/utility/wrun/wrun-coin-lane-live.util.js +3 -0
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-color-settings.util.js +32 -7
- package/dist/utility/wrun/wrun-dark-pool.util.d.ts +50 -0
- package/dist/utility/wrun/wrun-dark-pool.util.js +127 -0
- package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +67 -12
- package/dist/utility/wrun/wrun-declared-warmup.util.js +165 -13
- package/dist/utility/wrun/wrun-draft-legend-note.util.d.ts +18 -8
- package/dist/utility/wrun/wrun-draft-legend-note.util.js +57 -11
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +14 -10
- package/dist/utility/wrun/wrun-draft-overlay.util.js +26 -14
- package/dist/utility/wrun/wrun-earnings-facts.util.js +3 -2
- package/dist/utility/wrun/wrun-etf-funds.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-etf-funds.util.js +4 -0
- package/dist/utility/wrun/wrun-held-lanes.util.js +8 -2
- package/dist/utility/wrun/wrun-history-as-of.util.d.ts +77 -0
- package/dist/utility/wrun/wrun-history-as-of.util.js +108 -0
- package/dist/utility/wrun/wrun-host.service.d.ts +64 -14
- package/dist/utility/wrun/wrun-host.service.js +137 -27
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +3 -3
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +12 -2
- package/dist/utility/wrun/wrun-inert-legend.util.d.ts +13 -0
- package/dist/utility/wrun/wrun-inert-legend.util.js +31 -3
- package/dist/utility/wrun/wrun-input-requirements.leaf.d.ts +7 -5
- package/dist/utility/wrun/wrun-input-requirements.leaf.js +16 -6
- package/dist/utility/wrun/wrun-install-pacer.util.d.ts +26 -0
- package/dist/utility/wrun/wrun-install-pacer.util.js +145 -0
- package/dist/utility/wrun/wrun-kit-refusal-stages.types.d.ts +22 -0
- package/dist/utility/wrun/wrun-kit-refusal-stages.types.js +1 -0
- package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +12 -5
- package/dist/utility/wrun/wrun-lane-refusal.leaf.js +23 -5
- package/dist/utility/wrun/wrun-lane-warmup.util.js +22 -4
- package/dist/utility/wrun/wrun-leg-close.util.d.ts +6 -5
- package/dist/utility/wrun/wrun-leg-close.util.js +11 -9
- package/dist/utility/wrun/wrun-leg-fetch.util.d.ts +3 -1
- package/dist/utility/wrun/wrun-leg-fetch.util.js +9 -2
- package/dist/utility/wrun/wrun-levels-child.util.d.ts +2 -0
- package/dist/utility/wrun/wrun-levels-child.util.js +6 -0
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -0
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +15 -6
- package/dist/utility/wrun/wrun-live-intake.util.js +167 -47
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +52 -8
- package/dist/utility/wrun/wrun-live-tick.util.js +648 -97
- package/dist/utility/wrun/wrun-market-facts.util.d.ts +16 -2
- package/dist/utility/wrun/wrun-market-facts.util.js +32 -3
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +27 -27
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +28 -16
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +34 -5
- package/dist/utility/wrun/wrun-oi-lane.util.d.ts +10 -7
- package/dist/utility/wrun/wrun-oi-lane.util.js +16 -10
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +1 -1
- package/dist/utility/wrun/wrun-option-views.util.d.ts +2 -2
- package/dist/utility/wrun/wrun-option-views.util.js +5 -2
- package/dist/utility/wrun/wrun-options-flow-underlying.leaf.d.ts +5 -0
- package/dist/utility/wrun/wrun-options-flow-underlying.leaf.js +16 -0
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +3 -2
- package/dist/utility/wrun/wrun-options-stop.util.js +6 -4
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +75 -11
- package/dist/utility/wrun/wrun-overlay-drivers.util.js +176 -43
- package/dist/utility/wrun/wrun-overlay-lifecycle.util.js +20 -10
- package/dist/utility/wrun/wrun-overlay-park.util.d.ts +84 -0
- package/dist/utility/wrun/wrun-overlay-park.util.js +135 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +37 -4
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +26 -14
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +239 -24
- package/dist/utility/wrun/wrun-overlay-run.util.js +2204 -405
- package/dist/utility/wrun/wrun-pack.util.d.ts +8 -5
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-panel-mount.util.js +20 -14
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +4 -2
- package/dist/utility/wrun/wrun-panel-style.util.js +3 -2
- package/dist/utility/wrun/wrun-pin-spelling.util.d.ts +7 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +18 -4
- package/dist/utility/wrun/wrun-pin-venues.util.d.ts +26 -17
- package/dist/utility/wrun/wrun-pin-venues.util.js +43 -36
- package/dist/utility/wrun/wrun-pinned-lanes.util.d.ts +58 -0
- package/dist/utility/wrun/wrun-pinned-lanes.util.js +72 -0
- package/dist/utility/wrun/wrun-prefix-cohort.util.js +2 -1
- package/dist/utility/wrun/wrun-prefix-lanes.util.d.ts +22 -9
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +145 -26
- package/dist/utility/wrun/wrun-prefix-proof.util.d.ts +29 -0
- package/dist/utility/wrun/wrun-prefix-proof.util.js +23 -5
- package/dist/utility/wrun/wrun-refusal-surface.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-refusal-surface.util.js +15 -1
- package/dist/utility/wrun/wrun-refusal.util.d.ts +19 -1
- package/dist/utility/wrun/wrun-refusal.util.js +103 -16
- package/dist/utility/wrun/wrun-registry-errors.util.d.ts +20 -6
- package/dist/utility/wrun/wrun-registry-errors.util.js +20 -6
- package/dist/utility/wrun/wrun-replay-rows.util.js +6 -10
- package/dist/utility/wrun/wrun-run-health.util.d.ts +89 -2
- package/dist/utility/wrun/wrun-run-health.util.js +204 -1
- package/dist/utility/wrun/wrun-run-interval-session.util.d.ts +2 -2
- package/dist/utility/wrun/wrun-run-interval-session.util.js +2 -2
- package/dist/utility/wrun/wrun-run-interval.util.d.ts +9 -8
- package/dist/utility/wrun/wrun-run-interval.util.js +13 -11
- package/dist/utility/wrun/wrun-sandbox-row-source.js +5 -2
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +13 -3
- package/dist/utility/wrun/wrun-script-inputs.util.js +51 -13
- package/dist/utility/wrun/wrun-session-composition.util.d.ts +81 -0
- package/dist/utility/wrun/wrun-session-composition.util.js +169 -0
- package/dist/utility/wrun/wrun-setting-words.util.d.ts +10 -7
- package/dist/utility/wrun/wrun-setting-words.util.js +25 -7
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +94 -28
- package/dist/utility/wrun/wrun-source-rows.util.js +738 -93
- package/dist/utility/wrun/wrun-stream-clock.util.d.ts +45 -0
- package/dist/utility/wrun/wrun-stream-clock.util.js +108 -0
- package/dist/utility/wrun/wrun-tape-coins.util.d.ts +116 -0
- package/dist/utility/wrun/wrun-tape-coins.util.js +110 -0
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +62 -32
- package/dist/utility/wrun/wrun-tape-source.util.js +72 -34
- package/dist/utility/wrun/wrun-tier-grid.util.d.ts +13 -5
- package/dist/utility/wrun/wrun-tier-grid.util.js +23 -13
- package/dist/utility/wrun/wrun-tpo-rows.util.js +2 -1
- package/dist/utility/wrun/wrun-trades-lane.util.d.ts +73 -0
- package/dist/utility/wrun/wrun-trades-lane.util.js +82 -0
- package/dist/utility/wrun/wrun-twin-compute-inputs.util.d.ts +5 -0
- package/dist/utility/wrun/wrun-twin-compute-inputs.util.js +9 -2
- package/dist/utility/wrun/wrun-visibility-table.d.ts +13 -0
- package/dist/utility/wrun/wrun-visibility-table.js +9 -0
- package/dist/utility/wrun/wrun-volume-profile.util.js +44 -32
- package/dist/utils/replay/replay-buffer-math.d.ts +16 -6
- package/dist/utils/replay/replay-buffer-math.js +60 -30
- package/dist/workers/constants/socket-slots.d.ts +11 -7
- package/dist/workers/constants/socket-slots.js +6 -5
- package/package.json +11 -11
|
@@ -73,11 +73,13 @@
|
|
|
73
73
|
import { findMonday, getDecimalPlaces } from '../chart/titan-constants.pin.js';
|
|
74
74
|
import { Intervals } from '../../constants/interval.constants.js';
|
|
75
75
|
import { FUNDING_INTERVAL_MAP } from '../../constants/overlay-data.constants.js';
|
|
76
|
-
import { mergeLiveOhlcvDataPoint } from '../../kscript-data/controls/live-ohlcv-merge.util.js';
|
|
76
|
+
import { liveCandleAtInterval, mergeLiveOhlcvDataPoint } from '../../kscript-data/controls/live-ohlcv-merge.util.js';
|
|
77
77
|
import { liveTradeOfPoint, mergeLiveTradesDataPoint, readLiveTradePrint, tradesBarStartMs, tradesTapeCellSize, tradesTapeFloorValuesPrints, } from '../../kscript-data/controls/live-trades-merge.util.js';
|
|
78
78
|
import { liveAmountUsd, peekOptionTradeUnits } from '../options/option-trade-units.util.js';
|
|
79
79
|
import { parseWrunTapeHistory, wrunTapeHistoryOf } from './wrun-tape-source.util.js';
|
|
80
|
+
import { noteWrunCoinTapePrice } from './wrun-tape-coins.util.js';
|
|
80
81
|
import { wrunDollarUnitReader } from './wrun-dollar-unit-port.leaf.js';
|
|
82
|
+
import { wrunCmeDollarPointValue } from './wrun-cme-root-specs.util.js';
|
|
81
83
|
import { wrunChartHostEnv } from '../../host-env.js';
|
|
82
84
|
import { v2LiveTradePrintBelowFloor } from '../chart/kscript-live-coalesce.util.js';
|
|
83
85
|
import { bookLiveBucketMs, bookLiveBucketRows } from '../chart/book-live-bucket.util.js';
|
|
@@ -97,6 +99,8 @@ import { getProfileBucketHeight, normalizeTicksPerBar } from '../../workers/util
|
|
|
97
99
|
import { WRUN_RUN_INTERVAL_ROWS_KEY, wrunRunIntervalSessionOf, } from './wrun-run-interval-session.util.js';
|
|
98
100
|
import { isWrunLegStreamClass } from './wrun-leg-stream-classes.js';
|
|
99
101
|
import { isWrunTradesLegLane, wrunTradesLegOf, } from './wrun-trades-lane.util.js';
|
|
102
|
+
import { WRUN_PINNED_LANE_SPECS, isWrunPinnedLaneId, wrunPinnedLaneOf, wrunPinnedLanesOfClass, } from './wrun-pinned-lanes.util.js';
|
|
103
|
+
import { WRUN_BROWSER_PINNED_LANE_CLASSES } from './wrun-input-requirements.leaf.js';
|
|
100
104
|
/** The `trades` SOURCE (K_TRADES) feeds the `tape` lane; the `trades` LANE is fed by `buy_sell_volume` (TRADE_AGG). */
|
|
101
105
|
export const WRUN_LIVE_LANE_OF_SCRIPT_SOURCE = {
|
|
102
106
|
ohlcv: 'ohlcv',
|
|
@@ -184,6 +188,7 @@ function intakeFor(indicatorId, chartIndex, intervalMs, generation) {
|
|
|
184
188
|
bookLive: new Map(),
|
|
185
189
|
bookReplay: new Map(),
|
|
186
190
|
funding: new Map(),
|
|
191
|
+
pinned: new Map(),
|
|
187
192
|
legs: new Map(),
|
|
188
193
|
rowLanes: new Map(),
|
|
189
194
|
droppedSinceDrain: 0,
|
|
@@ -209,6 +214,7 @@ function discardQueuesForGeneration(intake, generation) {
|
|
|
209
214
|
intake.bookLive = new Map();
|
|
210
215
|
intake.bookReplay = new Map();
|
|
211
216
|
intake.funding = new Map();
|
|
217
|
+
intake.pinned = new Map();
|
|
212
218
|
intake.legs = new Map();
|
|
213
219
|
intake.rowLanes = new Map();
|
|
214
220
|
intake.droppedSinceDrain = 0;
|
|
@@ -277,9 +283,17 @@ function tradesLegBucketMarket(context, lane) {
|
|
|
277
283
|
function frameLanesOf(context, lane) {
|
|
278
284
|
const declared = declaredLanesOf(context);
|
|
279
285
|
if (lane !== 'trades')
|
|
280
|
-
return declared.has(lane) ? [lane] : [];
|
|
286
|
+
return [...(declared.has(lane) ? [lane] : []), ...pinnedPushLanesOf(context, lane)];
|
|
281
287
|
return ['trades', 'trades_usd'].filter((tradesLane) => declared.has(tradesLane));
|
|
282
288
|
}
|
|
289
|
+
/** The pinned push lanes of a class the run asked (U9e: the context holds their buffers), in declaration order: each
|
|
290
|
+
* takes the frames of its own market (`pinnedLaneMarketOf`, off its acquisition). An oi lane is polled, never fed. */
|
|
291
|
+
function pinnedPushLanesOf(context, lane) {
|
|
292
|
+
const spec = WRUN_PINNED_LANE_SPECS[lane];
|
|
293
|
+
if (spec?.live !== 'push' || context.pinnedLaneRows === undefined)
|
|
294
|
+
return [];
|
|
295
|
+
return wrunPinnedLanesOfClass(declaredLanesOf(context), lane).filter((pinned) => context.pinnedLaneRows?.[pinned] !== undefined);
|
|
296
|
+
}
|
|
283
297
|
/** Count a refusal on the overlay's stats: a live overlay gets its record on
|
|
284
298
|
* the first verdict; an id without a context is counted only when a record
|
|
285
299
|
* already exists (no records for unknown ids). */
|
|
@@ -441,19 +455,24 @@ function foldSidedAdditive(base, points, intervalMs, lane, read, market) {
|
|
|
441
455
|
}
|
|
442
456
|
/** The USD of a coin-arm amount at `price` (`liveAmountUsd`): the frames are live-feed's COIN arm (the channels ask
|
|
443
457
|
* no quote), so an option contract's amount arrives in coin and its USD is the premium by the resolver's live-print
|
|
444
|
-
* rule, never amount x price; null while its units are unknown and on a coin-premium book.
|
|
445
|
-
* amount
|
|
446
|
-
*
|
|
458
|
+
* rule, never amount x price; null while its units are unknown and on a coin-premium book. A CME Group market's
|
|
459
|
+
* amount is contracts, worth amount x price x its root's dollar point value (`wrunCmeDollarPointValue`), null where
|
|
460
|
+
* none prices it. Every other market is amount x price. The point's own series names the market (its units are the
|
|
461
|
+
* ones the K_* control's read answered: `peekOptionTradeUnits`). */
|
|
447
462
|
function coinArmUsd(point, price, amount) {
|
|
448
463
|
const series = isRecord(point.series) ? point.series : undefined;
|
|
449
464
|
const exchange = typeof series?.exchange === 'string' ? series.exchange : '';
|
|
450
465
|
const symbol = typeof series?.symbol === 'string' ? series.symbol : '';
|
|
466
|
+
// The coin arm counts contracts on a CME Group market: no root point value, no dollars (never close x contracts).
|
|
467
|
+
const pointValue = wrunCmeDollarPointValue({ exchange, symbol });
|
|
468
|
+
if (pointValue !== undefined)
|
|
469
|
+
return pointValue === null ? null : price * amount * pointValue;
|
|
451
470
|
return liveAmountUsd(price, amount, peekOptionTradeUnits({ exchange, symbol }));
|
|
452
471
|
}
|
|
453
472
|
/** K_BUY_SELL_VOLUME.mergeLiveDataPoint's reading of a TRADE_AGG point: the
|
|
454
473
|
* volume in coins, or its USD when the acquisition asked for USD (`coinArmUsd`:
|
|
455
|
-
* volume x close,
|
|
456
|
-
* never scaled by a bad price). */
|
|
474
|
+
* volume x close, x the root's point value on CME, an option's premium; skipped
|
|
475
|
+
* without a usable close or a USD, never scaled by a bad price). */
|
|
457
476
|
function tradeReader(acquisition) {
|
|
458
477
|
const usdQuoted = String(acquisition.currency ?? '').toUpperCase() === 'USD';
|
|
459
478
|
return (point) => {
|
|
@@ -613,7 +632,7 @@ export function foldWrunLegCandleRows(base, points, intervalMs, market) {
|
|
|
613
632
|
slice.push(Array.from(predecessor));
|
|
614
633
|
if (existing !== undefined)
|
|
615
634
|
slice.push(Array.from(existing));
|
|
616
|
-
const merged = mergeLiveOhlcvDataPoint(slice, parsed.data, bucket);
|
|
635
|
+
const merged = mergeLiveOhlcvDataPoint(slice, liveCandleAtInterval(point, parsed.data, intervalMs), bucket);
|
|
617
636
|
const row = merged[merged.length - 1];
|
|
618
637
|
if (row === undefined || Number(row[0]) !== bucket)
|
|
619
638
|
continue;
|
|
@@ -663,8 +682,10 @@ rowMarket = market) {
|
|
|
663
682
|
* bar. Undefined where the history keeps the book's own bars (`wrunLaneHostGridsOf`: 30m and finer, ETH, a day and
|
|
664
683
|
* longer, a 24/7 market, a market served no book): every key is its own bar.
|
|
665
684
|
*/
|
|
666
|
-
export function wrunBookRowHostBarResolver(intervalMs, market
|
|
667
|
-
|
|
685
|
+
export function wrunBookRowHostBarResolver(intervalMs, market,
|
|
686
|
+
// The market the book's rows come from when it is not the chart's (a pinned book, U9e): its own wire bars.
|
|
687
|
+
rowMarket = market) {
|
|
688
|
+
const grids = wrunLaneHostGridsOf('orderbook', intervalMs, market, rowMarket);
|
|
668
689
|
return grids && sourceRowHostBarResolverFor(intervalMs, grids.hostBar, intervalMs, grids.row);
|
|
669
690
|
}
|
|
670
691
|
/**
|
|
@@ -712,7 +733,9 @@ export function wrunLiveBookRows(point, intervalMs, market) {
|
|
|
712
733
|
copy[0] = bookLiveBucketMs(copy[0], intervalMs, venue);
|
|
713
734
|
return [copy];
|
|
714
735
|
}
|
|
715
|
-
function foldBook(base, points, intervalMs, market
|
|
736
|
+
function foldBook(base, points, intervalMs, market,
|
|
737
|
+
// The market the rows come from (a pinned book's own, U9e): raw frames key its bars, the chart's bars hold them.
|
|
738
|
+
rowMarket = market) {
|
|
716
739
|
const indexByTs = new Map();
|
|
717
740
|
for (let at = 0; at < base.length; at += 1)
|
|
718
741
|
indexByTs.set(Number(base[at][0]), at);
|
|
@@ -722,11 +745,11 @@ function foldBook(base, points, intervalMs, market) {
|
|
|
722
745
|
// Each keyed row lands on the host bar the chart's history puts it in (judged now, once per fold), and a bar keeps
|
|
723
746
|
// the latest snapshot it holds: a row of an earlier key never replaces a later one there, a later point of the same
|
|
724
747
|
// key does (the replay-then-live order, a live snapshot of the bucket winning).
|
|
725
|
-
const barOf = wrunBookRowHostBarResolver(intervalMs, market);
|
|
748
|
+
const barOf = wrunBookRowHostBarResolver(intervalMs, market, rowMarket);
|
|
726
749
|
const nowMs = barOf === undefined ? 0 : serverNowMs();
|
|
727
750
|
const keyOnBar = new Map();
|
|
728
751
|
for (const point of points) {
|
|
729
|
-
for (const keyed of wrunLiveBookRows(point, intervalMs,
|
|
752
|
+
for (const keyed of wrunLiveBookRows(point, intervalMs, rowMarket)) {
|
|
730
753
|
const key = Number(keyed[0]);
|
|
731
754
|
const bucket = barOf === undefined ? key : barOf(key, nowMs);
|
|
732
755
|
// No chart bar holds the row (it closes past the session's close): nothing to fold.
|
|
@@ -955,13 +978,19 @@ rowMarket) {
|
|
|
955
978
|
case 'funding':
|
|
956
979
|
return foldFunding(base, points, intervalMs);
|
|
957
980
|
case 'book':
|
|
958
|
-
|
|
981
|
+
// A pinned book's rows come from its own market (U9e): they land on the chart's bars over both grids.
|
|
982
|
+
return foldBook(base, points, intervalMs, market, rowMarket ?? market);
|
|
959
983
|
case 'volume_profile':
|
|
960
984
|
return foldVolumeProfile(base, points, intervalMs, acquisition, market);
|
|
961
985
|
case 'tape':
|
|
962
986
|
// The print's own envelope names its venue (the CME lattice reads it), never the chart's.
|
|
963
987
|
return foldTape(base, points, intervalMs, acquisition, market, rowMarket);
|
|
964
988
|
default: {
|
|
989
|
+
// A pinned lane (U9e) folds as its class, its rows from its own market (`rowMarket`) on the chart's bars.
|
|
990
|
+
const pinned = wrunPinnedLaneOf(lane);
|
|
991
|
+
if (pinned !== undefined) {
|
|
992
|
+
return foldWrunLaneRows(pinned.cls, rows, points, intervalMs, acquisition, market, rowMarket);
|
|
993
|
+
}
|
|
965
994
|
// A trades leg folds as its quote's own lane, on its market; the poll lanes have no live fold.
|
|
966
995
|
const leg = wrunTradesLegOf(lane);
|
|
967
996
|
return leg === undefined
|
|
@@ -1007,8 +1036,10 @@ function isForeignToMarket(market, frame) {
|
|
|
1007
1036
|
}
|
|
1008
1037
|
/** The market a lane's acquisition names when it is not the chart's own (the run market: a Trades chart's tape). */
|
|
1009
1038
|
function pinnedLaneMarketOf(context, lane) {
|
|
1010
|
-
|
|
1011
|
-
const
|
|
1039
|
+
// A pinned lane (U9e) names its market in its id, whatever its acquisition record holds.
|
|
1040
|
+
const laned = wrunPinnedLaneOf(lane);
|
|
1041
|
+
const exchange = laned?.exchange ?? context.acquisition[lane]?.exchange;
|
|
1042
|
+
const symbol = laned?.symbol ?? context.acquisition[lane]?.symbol;
|
|
1012
1043
|
if (typeof exchange !== 'string' || typeof symbol !== 'string')
|
|
1013
1044
|
return undefined;
|
|
1014
1045
|
if (exchange === KSCRIPT_CURRENT_EXCHANGE_SENTINEL || symbol === KSCRIPT_CURRENT_SYMBOL_SENTINEL)
|
|
@@ -1017,10 +1048,12 @@ function pinnedLaneMarketOf(context, lane) {
|
|
|
1017
1048
|
const chart = chartMarketOf(context);
|
|
1018
1049
|
return chart && liveFeedSeriesMatchesChartStream(pinned, { ...chart, ...context.market }) ? undefined : pinned;
|
|
1019
1050
|
}
|
|
1020
|
-
/** Every market a push lane's acquisition names beside the chart's own, once each (the fan-out admits their frames)
|
|
1051
|
+
/** Every market a push lane's acquisition names beside the chart's own, once each (the fan-out admits their frames):
|
|
1052
|
+
* the run market of the chart's own lanes, and each pinned push lane's market (U9e). */
|
|
1021
1053
|
function pinnedLaneMarketsOf(context) {
|
|
1022
1054
|
const markets = new Map();
|
|
1023
|
-
|
|
1055
|
+
const pinnedPush = ['book', 'funding', 'liquidations'].flatMap((cls) => pinnedPushLanesOf(context, cls));
|
|
1056
|
+
for (const lane of [...WRUN_PUSH_LANES, ...pinnedPush]) {
|
|
1024
1057
|
const pinned = pinnedLaneMarketOf(context, lane);
|
|
1025
1058
|
if (pinned)
|
|
1026
1059
|
markets.set(`${pinned.exchange}|${pinned.symbol}`, pinned);
|
|
@@ -1143,6 +1176,15 @@ function wrunTapeLostRestorable(context) {
|
|
|
1143
1176
|
}
|
|
1144
1177
|
return historySec > 0;
|
|
1145
1178
|
}
|
|
1179
|
+
/** A pinned book or funding lane's slots (U9e), made on its first point. */
|
|
1180
|
+
function pinnedSlotOf(intake, lane) {
|
|
1181
|
+
let slot = intake.pinned.get(lane);
|
|
1182
|
+
if (slot === undefined) {
|
|
1183
|
+
slot = { live: new Map(), replay: new Map() };
|
|
1184
|
+
intake.pinned.set(lane, slot);
|
|
1185
|
+
}
|
|
1186
|
+
return slot;
|
|
1187
|
+
}
|
|
1146
1188
|
function pushAdditive(intake, lane, point, tapeContext) {
|
|
1147
1189
|
let queue = intake.additive[lane];
|
|
1148
1190
|
if (!queue) {
|
|
@@ -1188,6 +1230,8 @@ function takeAdditive(intake, lane) {
|
|
|
1188
1230
|
}
|
|
1189
1231
|
function pendingCount(intake) {
|
|
1190
1232
|
let count = intake.bookLive.size + intake.bookReplay.size + intake.funding.size;
|
|
1233
|
+
for (const slot of intake.pinned.values())
|
|
1234
|
+
count += slot.live.size + slot.replay.size;
|
|
1191
1235
|
for (const queue of Object.values(intake.additive)) {
|
|
1192
1236
|
if (queue)
|
|
1193
1237
|
count += queue.points.length - queue.head;
|
|
@@ -1385,7 +1429,13 @@ export function enqueueWrunLiveFrame(a) {
|
|
|
1385
1429
|
const candidates = lane !== undefined && lane !== 'ohlcv' && WRUN_PUSH_LANES.has(lane) ? frameLanesOf(context, lane) : [];
|
|
1386
1430
|
const takers = candidates.filter((fedLane) => {
|
|
1387
1431
|
const pinned = pinnedLaneMarketOf(context, fedLane);
|
|
1388
|
-
|
|
1432
|
+
if (pinned === undefined)
|
|
1433
|
+
return !isForeignFrame(context, a.frame);
|
|
1434
|
+
// A lane pinned to another market (U9e) takes only a frame naming that market: a rider's bucketed rows and a
|
|
1435
|
+
// frame without a series identity are the chart's own.
|
|
1436
|
+
if (isWrunPinnedLaneId(fedLane) && (!a.frame.incomingExchange || !a.frame.incomingSymbol))
|
|
1437
|
+
return false;
|
|
1438
|
+
return !isForeignToMarket(pinned, a.frame);
|
|
1389
1439
|
});
|
|
1390
1440
|
// A frame no lane could take is judged against the chart's market, as before.
|
|
1391
1441
|
const foreign = candidates.length > 0 ? takers.length === 0 : isForeignFrame(context, a.frame);
|
|
@@ -1428,37 +1478,56 @@ export function enqueueWrunLiveFrame(a) {
|
|
|
1428
1478
|
const intervalMs = context.intervalMs;
|
|
1429
1479
|
if (lane === 'book') {
|
|
1430
1480
|
const data = a.frame.data;
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1481
|
+
const replay = !a.frame.bucketed && isRecord(data) && isRecord(data.series) && data.series.isReplay === true;
|
|
1482
|
+
for (const fedLane of fed) {
|
|
1483
|
+
// A pinned book (U9e) keeps slots of its own, its rows keyed on its own market's bar as its history's are; the
|
|
1484
|
+
// drain lands them on the chart's bars (`foldBook` over the lane's market, the tape's host-bar model). The chart's
|
|
1485
|
+
// own book keys the chart market's bar, as the drain folds every lane (`chartMarketOf`).
|
|
1486
|
+
const pinnedSlot = isWrunPinnedLaneId(fedLane) ? pinnedSlotOf(intake, fedLane) : undefined;
|
|
1487
|
+
const liveSlot = pinnedSlot?.live ?? intake.bookLive;
|
|
1488
|
+
const replaySlot = pinnedSlot?.replay ?? intake.bookReplay;
|
|
1489
|
+
if (a.frame.bucketed) {
|
|
1490
|
+
const rows = Array.isArray(data) ? data : [data];
|
|
1491
|
+
for (const row of rows) {
|
|
1492
|
+
const bucket = Number(row?.[0]);
|
|
1493
|
+
if (Number.isFinite(bucket))
|
|
1494
|
+
liveSlot.set(bucket, row);
|
|
1495
|
+
}
|
|
1496
|
+
continue;
|
|
1437
1497
|
}
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
const
|
|
1442
|
-
|
|
1443
|
-
for (const row of wrunLiveBookRows(data, intervalMs, chartMarketOf(context))) {
|
|
1444
|
-
slot.set(Number(row[0]), row);
|
|
1498
|
+
const market = pinnedSlot !== undefined
|
|
1499
|
+
? (pinnedLaneMarketOf(context, fedLane) ?? chartMarketOf(context))
|
|
1500
|
+
: chartMarketOf(context);
|
|
1501
|
+
for (const row of wrunLiveBookRows(data, intervalMs, market)) {
|
|
1502
|
+
(replay ? replaySlot : liveSlot).set(Number(row[0]), row);
|
|
1445
1503
|
}
|
|
1446
1504
|
}
|
|
1447
1505
|
}
|
|
1448
1506
|
else if (lane === 'funding') {
|
|
1449
1507
|
const parsed = wrunLiveFundingValue(a.frame.data);
|
|
1450
1508
|
const bucket = parsed ? wrunLiveBucketTs('funding', parsed.tsMs, intervalMs) : null;
|
|
1451
|
-
if (bucket !== null)
|
|
1452
|
-
|
|
1509
|
+
if (bucket !== null) {
|
|
1510
|
+
for (const fedLane of fed) {
|
|
1511
|
+
// A pinned funding lane (U9e) keeps its own newest point per bucket.
|
|
1512
|
+
if (isWrunPinnedLaneId(fedLane))
|
|
1513
|
+
pinnedSlotOf(intake, fedLane).live.set(bucket, a.frame.data);
|
|
1514
|
+
else
|
|
1515
|
+
intake.funding.set(bucket, a.frame.data);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1453
1518
|
}
|
|
1454
1519
|
else if (lane === 'tape') {
|
|
1455
1520
|
// The router hands every trades source both channels: a print of the other one never counts or takes a slot.
|
|
1456
1521
|
const large = context.acquisition.tape?.large === true;
|
|
1457
|
-
|
|
1522
|
+
const trade = liveTradeOfPoint(a.frame.data, large);
|
|
1523
|
+
if (trade === undefined && liveTradeOfPoint(a.frame.data, !large) !== undefined) {
|
|
1458
1524
|
return noteVerdict(a.indicatorId, 'ignored:other-channel', context);
|
|
1459
1525
|
}
|
|
1460
1526
|
// Counts rows the floor turns away too: a floor that drops most of a busy tape must not read as a dead feed.
|
|
1461
1527
|
intake.stats.frames.tape = (intake.stats.frames.tape ?? 0) + 1;
|
|
1528
|
+
// A coins tape's live guard reads the market's prices off every print of its channel, before the floor turns any
|
|
1529
|
+
// away: the prints the floor passes thin out exactly as the price falls (wrun-tape-coins.util).
|
|
1530
|
+
noteWrunCoinTapePrice(context, Number(trade?.price));
|
|
1462
1531
|
// Floors at the door as the fold does, so a row that can never fold never crowds a qualifying one out of the queue.
|
|
1463
1532
|
const floor = wrunTapeLiveFloorOf(context.acquisition.tape, chartMarketOf(context));
|
|
1464
1533
|
if (!tradesTapeFloorValuesPrints(floor)) {
|
|
@@ -1516,7 +1585,9 @@ function laneRowsOf(context, lane) {
|
|
|
1516
1585
|
case 'options_chain':
|
|
1517
1586
|
return undefined;
|
|
1518
1587
|
default:
|
|
1519
|
-
// A trades leg lane or a registry poll lane instance: its one record.
|
|
1588
|
+
// A trades leg lane, a pinned lane or a registry poll lane instance: its one record.
|
|
1589
|
+
if (isWrunPinnedLaneId(lane))
|
|
1590
|
+
return context.pinnedLaneRows?.[lane];
|
|
1520
1591
|
return isWrunTradesLegLane(lane) ? context.tradeLegRows?.[lane] : context.pollLaneRows?.[lane];
|
|
1521
1592
|
}
|
|
1522
1593
|
}
|
|
@@ -1561,6 +1632,8 @@ function setLaneRows(context, lane, rows) {
|
|
|
1561
1632
|
default:
|
|
1562
1633
|
if (isWrunTradesLegLane(lane))
|
|
1563
1634
|
context.tradeLegRows = { ...context.tradeLegRows, [lane]: rows };
|
|
1635
|
+
else if (isWrunPinnedLaneId(lane))
|
|
1636
|
+
context.pinnedLaneRows = { ...context.pinnedLaneRows, [lane]: rows };
|
|
1564
1637
|
return;
|
|
1565
1638
|
}
|
|
1566
1639
|
}
|
|
@@ -1596,7 +1669,8 @@ export function drainWrunLiveIntake(ctx) {
|
|
|
1596
1669
|
if (points.length > 0)
|
|
1597
1670
|
batches.push([lane, points]);
|
|
1598
1671
|
}
|
|
1599
|
-
|
|
1672
|
+
// The trades legs and the pinned liquidations lanes (U9e), each its own additive queue.
|
|
1673
|
+
for (const lane of Object.keys(intake.additive).filter((key) => isWrunTradesLegLane(key) || isWrunPinnedLaneId(key))) {
|
|
1600
1674
|
const points = takeAdditive(intake, lane);
|
|
1601
1675
|
if (points.length > 0)
|
|
1602
1676
|
batches.push([lane, points]);
|
|
@@ -1611,6 +1685,12 @@ export function drainWrunLiveIntake(ctx) {
|
|
|
1611
1685
|
batches.push(['funding', [...intake.funding.values()]]);
|
|
1612
1686
|
intake.funding = new Map();
|
|
1613
1687
|
}
|
|
1688
|
+
// The pinned book and funding lanes (U9e): a book's replay rows first, so a live snapshot of the same bucket wins.
|
|
1689
|
+
for (const [lane, slot] of intake.pinned) {
|
|
1690
|
+
if (slot.live.size + slot.replay.size > 0)
|
|
1691
|
+
batches.push([lane, [...slot.replay.values(), ...slot.live.values()]]);
|
|
1692
|
+
}
|
|
1693
|
+
intake.pinned = new Map();
|
|
1614
1694
|
let dirtyFromTs = null;
|
|
1615
1695
|
// Every lane folds on the chart's own bars (a grid leg on its own), its rows from its acquisition's market.
|
|
1616
1696
|
const chartMarket = chartMarketOf(ctx);
|
|
@@ -1843,6 +1923,27 @@ export function dropWrunLiveQueuedBuckets(indicatorId, lane, buckets) {
|
|
|
1843
1923
|
return 0;
|
|
1844
1924
|
const drop = new Set(buckets);
|
|
1845
1925
|
let dropped = 0;
|
|
1926
|
+
const pinned = wrunPinnedLaneOf(lane);
|
|
1927
|
+
if (pinned !== undefined && pinned.cls !== 'liquidations') {
|
|
1928
|
+
// A pinned book or funding lane (U9e): a book row keyed on its own market's bar is dropped where it lands on a
|
|
1929
|
+
// covered chart bar (the fold's landing), a funding point by its bucket.
|
|
1930
|
+
const slot = intake.pinned.get(lane);
|
|
1931
|
+
if (slot === undefined)
|
|
1932
|
+
return 0;
|
|
1933
|
+
const pinnedContext = getWrunOverlayLiveContext(indicatorId);
|
|
1934
|
+
const barOf = pinned.cls === 'book' && pinnedContext
|
|
1935
|
+
? wrunBookRowHostBarResolver(intake.intervalMs, chartMarketOf(pinnedContext), pinned)
|
|
1936
|
+
: undefined;
|
|
1937
|
+
const nowMs = barOf === undefined ? 0 : serverNowMs();
|
|
1938
|
+
for (const map of [slot.live, slot.replay]) {
|
|
1939
|
+
for (const key of [...map.keys()]) {
|
|
1940
|
+
const bar = barOf === undefined ? key : barOf(key, nowMs);
|
|
1941
|
+
if (bar !== null && drop.has(bar) && map.delete(key))
|
|
1942
|
+
dropped += 1;
|
|
1943
|
+
}
|
|
1944
|
+
}
|
|
1945
|
+
return dropped;
|
|
1946
|
+
}
|
|
1846
1947
|
if (lane === 'book') {
|
|
1847
1948
|
// A queued row is keyed on its own bar and folds onto the host bar the chart's history puts it in
|
|
1848
1949
|
// (`wrunBookRowHostBarResolver`), the bar an answer names: the row a covered bar would take is dropped.
|
|
@@ -1901,6 +2002,7 @@ export function dropWrunLiveQueuedBuckets(indicatorId, lane, buckets) {
|
|
|
1901
2002
|
}
|
|
1902
2003
|
const leg = isWrunTradesLegLane(lane);
|
|
1903
2004
|
if (!leg &&
|
|
2005
|
+
pinned === undefined &&
|
|
1904
2006
|
lane !== 'trades' &&
|
|
1905
2007
|
lane !== 'trades_usd' &&
|
|
1906
2008
|
lane !== 'liquidations' &&
|
|
@@ -1911,10 +2013,11 @@ export function dropWrunLiveQueuedBuckets(indicatorId, lane, buckets) {
|
|
|
1911
2013
|
const queue = intake.additive[lane];
|
|
1912
2014
|
if (!queue)
|
|
1913
2015
|
return 0;
|
|
1914
|
-
// Bucketed exactly as the drain folds them (the chart's own market, a trades leg its own at its own tier
|
|
2016
|
+
// Bucketed exactly as the drain folds them (the chart's own market, a trades leg its own at its own tier, a pinned
|
|
2017
|
+
// liquidations lane as its class).
|
|
1915
2018
|
const context = getWrunOverlayLiveContext(indicatorId);
|
|
1916
2019
|
const market = context ? (leg ? tradesLegBucketMarket(context, lane) : chartMarketOf(context)) : null;
|
|
1917
|
-
const bucketLane = leg ? wrunTradesLegOf(lane).lane : lane;
|
|
2020
|
+
const bucketLane = leg ? wrunTradesLegOf(lane).lane : (pinned?.cls ?? lane);
|
|
1918
2021
|
const bucketIntervalMs = context ? laneFoldIntervalMs(context, lane, intake.intervalMs) : intake.intervalMs;
|
|
1919
2022
|
const tapeHostBarOf = lane === 'tape' && context ? wrunTapeLaneHostBarOf(context, intake.intervalMs) : undefined;
|
|
1920
2023
|
const bucketOf = (point) => {
|
|
@@ -2075,7 +2178,10 @@ function intervalMsOf(word) {
|
|
|
2075
2178
|
/**
|
|
2076
2179
|
* Whether the push intake may feed this package on a chart of
|
|
2077
2180
|
* `chartInterval`. False when any input pins something the lane cannot
|
|
2078
|
-
* ride: a market pin on
|
|
2181
|
+
* ride: a market pin on a class the one table leaves out
|
|
2182
|
+
* (`WRUN_BROWSER_PINNED_LANE_CLASSES`, the table the row builder's refusal
|
|
2183
|
+
* and the run's admission read) or on the primary input, a pinned lane
|
|
2184
|
+
* (trades, book, oi, funding, liquidations) with an interval of its own, an interval
|
|
2079
2185
|
* pin on a celled input or on a class other than `ohlcv`, `funding` or
|
|
2080
2186
|
* `oi`, a finer interval, one that is not a whole multiple of the chart's,
|
|
2081
2187
|
* or a word outside the vocabulary. An `ohlcv` pin COARSER than the chart
|
|
@@ -2089,7 +2195,11 @@ function intervalMsOf(word) {
|
|
|
2089
2195
|
* An `odds` input (the odds lane) is a poll-only leg outside the push set:
|
|
2090
2196
|
* its market (POLYMARKET|<condition id>) or interval pin never makes the
|
|
2091
2197
|
* package ineligible, even on the primary input, so a package pairing an
|
|
2092
|
-
* odds input with a pinned ohlcv leg keeps that leg's push feed.
|
|
2198
|
+
* odds input with a pinned ohlcv leg keeps that leg's push feed. A
|
|
2199
|
+
* secondary trades, book, oi, funding or liquidations input pinned to another
|
|
2200
|
+
* market is a lane of its own there (a trades leg, U9e's pinned lanes): its
|
|
2201
|
+
* class's channel on that market feeds it (an oi lane is polled), and the
|
|
2202
|
+
* chart's own push lanes stay valid.
|
|
2093
2203
|
* The full run refuses the ineligible pins by name before any fetch
|
|
2094
2204
|
* (`planWrunPinnedLegs`), so this only classifies.
|
|
2095
2205
|
*/
|
|
@@ -2111,14 +2221,23 @@ export function wrunPushEligible(m, chartInterval) {
|
|
|
2111
2221
|
if (source.source === 'odds')
|
|
2112
2222
|
continue;
|
|
2113
2223
|
const marketPinned = !!(source.symbol || source.exchange);
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
if (source.
|
|
2224
|
+
if (marketPinned) {
|
|
2225
|
+
// A pin on a class the one table leaves out, or on the primary input, is no lane the intake can ride.
|
|
2226
|
+
if (!WRUN_BROWSER_PINNED_LANE_CLASSES.has(source.source) || input.index === 0)
|
|
2227
|
+
return false;
|
|
2228
|
+
// A secondary trades pin (kit 0.77.0) and a pinned book, oi, funding or liquidations input (U9e) are lanes of
|
|
2229
|
+
// their own on that market, at the chart's interval (a trades leg takes no interval word at all).
|
|
2230
|
+
if (source.source !== 'ohlcv') {
|
|
2231
|
+
if (source.interval === undefined)
|
|
2232
|
+
continue;
|
|
2233
|
+
if (source.source === 'trades' || chartMs === undefined || intervalMsOf(source.interval) !== chartMs) {
|
|
2234
|
+
return false;
|
|
2235
|
+
}
|
|
2236
|
+
continue;
|
|
2237
|
+
}
|
|
2238
|
+
if (input.cellType === 'array')
|
|
2117
2239
|
return false;
|
|
2118
|
-
continue;
|
|
2119
2240
|
}
|
|
2120
|
-
if (marketPinned && (source.source !== 'ohlcv' || input.cellType === 'array' || input.index === 0))
|
|
2121
|
-
return false;
|
|
2122
2241
|
if (!source.interval)
|
|
2123
2242
|
continue;
|
|
2124
2243
|
if (source.interval === chartInterval)
|
|
@@ -2208,6 +2327,7 @@ export function wrunLiveContextSnapshot(indicatorId) {
|
|
|
2208
2327
|
for (const lane of [
|
|
2209
2328
|
...WRUN_LIVE_LANES,
|
|
2210
2329
|
...Object.keys(context.tradeLegRows ?? {}).filter(isWrunTradesLegLane),
|
|
2330
|
+
...Object.keys(context.pinnedLaneRows ?? {}).filter(isWrunPinnedLaneId),
|
|
2211
2331
|
...(context.pollLanes ?? []).map((instance) => instance.key),
|
|
2212
2332
|
]) {
|
|
2213
2333
|
const rows = laneRowsOf(context, lane);
|
|
@@ -98,7 +98,17 @@
|
|
|
98
98
|
* its old rows), or a reconcile lane whose window held more than its read
|
|
99
99
|
* takes (a refusal by name the leaf declares `over-cap`: the tape past the
|
|
100
100
|
* trades worker's cap), whose window stays owed while the session is held
|
|
101
|
-
* and hands ONE full run off (`handWrunLiveOverCapBack`). A
|
|
101
|
+
* and hands ONE full run off (`handWrunLiveOverCapBack`). A history move the
|
|
102
|
+
* planner reads as a verified backward extension (`extension: 'backward'`)
|
|
103
|
+
* waits at the settle gate while the gesture is live, the view moved less
|
|
104
|
+
* than WRUN_REBUILD_SETTLE_STILL_MS ago or the main candle fetch is out, so
|
|
105
|
+
* ONE handoff after the pan settles (or at the shared ceiling), which the
|
|
106
|
+
* episode's own wake decides on the motion clock, covers every page of the
|
|
107
|
+
* gesture and carries how long it held (WRUN-PANBACK A2); every other
|
|
108
|
+
* history move hands off at once. The chart's
|
|
109
|
+
* whole pan wave for such a page, offered by the executor while the episode
|
|
110
|
+
* is open or the gesture is live, is taken into it (`absorbWrunLazyWave`):
|
|
111
|
+
* it runs nothing, the episode's handoff rebuilds the page. A pan-back page left to its wave
|
|
102
112
|
* (contract C1: a verified backward extension under an owner pending or
|
|
103
113
|
* landed over it, or on a prefix-capable session within the grace its wave
|
|
104
114
|
* has to stamp one) moves no history: the wave lands the page's rows into
|
|
@@ -174,6 +184,11 @@ import type { WrunIndicatorMetadata } from '../../interfaces/wrun-runtime.interf
|
|
|
174
184
|
import type { RuntimeDiagnostic } from '../../interfaces/kscript-diagnostics.interface.js';
|
|
175
185
|
import type { WrunRowFrame } from './wrun-row-source.js';
|
|
176
186
|
import type { WrunLegStreamLane } from './wrun-leg-stream-classes.js';
|
|
187
|
+
/** The settle gate's stillness (WRUN-PANBACK A2): a backward extension's episode hands off once the chart's view has
|
|
188
|
+
* not moved for this long on the motion clock (pan and zoom events, titan's probe), so a pointer-up pause this long
|
|
189
|
+
* rebuilds the pages so far and a shorter one stays inside the episode. The episode's own wake decides it, never the
|
|
190
|
+
* drain's cadence. */
|
|
191
|
+
export declare const WRUN_REBUILD_SETTLE_STILL_MS = 1000;
|
|
177
192
|
/** The reconcile window reaches this many bars behind the session watermark
|
|
178
193
|
* (the kScript poll's 8-bar tail, V2_TECHNICAL_SOURCE_REFRESH_TAIL_BARS),
|
|
179
194
|
* and a late point older than this many bars reseeds on its own gap. */
|
|
@@ -259,9 +274,12 @@ export declare function wrunLiveLanesOf(metadata: WrunIndicatorMetadata): WrunLi
|
|
|
259
274
|
/** Every lane a session's reconcile re-asks: the row builder's own lanes
|
|
260
275
|
* the sheet declares, then the trades leg lanes the full run asked (kit 0.77.0:
|
|
261
276
|
* the ones the session holds a buffer for, `context.tradeLegRows`; a leg never
|
|
262
|
-
* asked is never re-asked), then the
|
|
263
|
-
*
|
|
264
|
-
*
|
|
277
|
+
* asked is never re-asked), then the pinned lanes it asked (U9e: a book, oi,
|
|
278
|
+
* funding or liquidations input pinned to another market, by the buffers
|
|
279
|
+
* `context.pinnedLaneRows` holds; each re-asked on its own market, an oi lane's
|
|
280
|
+
* forming bucket by the same poll as the chart's own oi), then the registry
|
|
281
|
+
* poll lane instances the full run planned (`context.pollLanes`), then its row
|
|
282
|
+
* lane instances (`context.rowLanes`), in the full run's order. */
|
|
265
283
|
export declare function wrunLiveLanesOfContext(context: WrunOverlayLiveContext): WrunLiveLane[];
|
|
266
284
|
/**
|
|
267
285
|
* What the pass that installed a source-fed session hands its drain (WRUN-PARITY-PLAN C7, plan row 20): the verdict
|
|
@@ -331,7 +349,9 @@ export declare function scheduleWrunOverlayLiveTick(chartIndex: number, indicato
|
|
|
331
349
|
export declare function requestWrunOverlayLiveDrain(indicatorId: string): void;
|
|
332
350
|
/**
|
|
333
351
|
* Contract C7: re-arm the overlay's deferred drain on a prefix run's outcome
|
|
334
|
-
* (landed, rejected, or skipped after planning)
|
|
352
|
+
* (landed, rejected, or skipped after planning), and on a warm switch's
|
|
353
|
+
* adoption (wrun-overlay-run.util adoptWrunParkedLiveSession), whose
|
|
354
|
+
* `session-start` drain can meet the adoption's own run in flight. A frame that arrived while
|
|
335
355
|
* the prefix ran woke a drain the in-flight gate turned away
|
|
336
356
|
* (`runWrunOverlayLiveTick` returns before its planner while any executor run
|
|
337
357
|
* is active), and the scheduler then dropped its record with nothing pending,
|
|
@@ -345,6 +365,14 @@ export declare function requestWrunOverlayLiveDrain(indicatorId: string): void;
|
|
|
345
365
|
* (`drainWrunLiveTick`) until it gets past the gate.
|
|
346
366
|
*/
|
|
347
367
|
export declare function rearmWrunLiveTickDrain(chartIndex: number, indicatorId: string): void;
|
|
368
|
+
/**
|
|
369
|
+
* The rows a session's evaluated bars read moved from `fromTs` on, with no lane point to say so: the host's session
|
|
370
|
+
* composition changed owner (web: an order-flow hand-back, or a new seam), so the bars it evaluated from the old
|
|
371
|
+
* seam read rows that are no longer the overlay's. It is the revised closed bar's obligation (`closedBarRevisions`):
|
|
372
|
+
* the next drain reseeds over the buffers, composed as they stand then, and no fetch is made. A session with no bar
|
|
373
|
+
* evaluated at or past `fromTs` owes nothing (the tail re-sends its forming bar anyway). Answers whether it owed.
|
|
374
|
+
*/
|
|
375
|
+
export declare function reviseWrunOverlayLiveFrom(chartIndex: number, indicatorId: string, fromTs: number): boolean;
|
|
348
376
|
export declare function holdWrunLiveTicks(on: boolean): void;
|
|
349
377
|
/** The next moment any pinned leg of the context closes (the earliest over
|
|
350
378
|
* the legs), null without legs: `floor(now / L) * L + L` for a fixed span,
|
|
@@ -508,7 +536,16 @@ export type WrunLiveTickPlan =
|
|
|
508
536
|
/** rerunWrunOverlayForChartWave (fetches). */
|
|
509
537
|
| {
|
|
510
538
|
kind: 'rebuild';
|
|
511
|
-
reason: 'identity' | '
|
|
539
|
+
reason: 'identity' | 'gap-too-wide' | 'acquisition' | 'tape-price';
|
|
540
|
+
}
|
|
541
|
+
/** History moved under the session. `extension`, read on the chart's own bars (WRUN-PANBACK A2): `backward` when
|
|
542
|
+
* the chart's first bar moved earlier, the session's first chart bar is still loaded and the newest bar did not move
|
|
543
|
+
* back (a pan-back page: the settle gate hands it off once the pan settled); `other` for a dataset replacement, a
|
|
544
|
+
* rolled-off head or a newest-bar rollback (handed off at once). */
|
|
545
|
+
| {
|
|
546
|
+
kind: 'rebuild';
|
|
547
|
+
reason: 'history';
|
|
548
|
+
extension: 'backward' | 'other';
|
|
512
549
|
};
|
|
513
550
|
export interface WrunLiveTickPlanInput {
|
|
514
551
|
context: WrunOverlayLiveContext;
|
|
@@ -566,6 +603,9 @@ export interface WrunLiveRunClock {
|
|
|
566
603
|
chartFirstTs: number;
|
|
567
604
|
/** The chart's first loaded bar the session's run was built over. */
|
|
568
605
|
sessionChartFirstTs: number;
|
|
606
|
+
/** The chart's rows still hold `sessionChartFirstTs` (a page joined in front of the bars the session computed, not a
|
|
607
|
+
* replaced dataset): the history check's backward-extension test (WRUN-PANBACK A2). Absent reads false. */
|
|
608
|
+
sessionChartFirstHeld?: boolean;
|
|
569
609
|
/** The open of the run bar holding the chart's newest bar (the forming one):
|
|
570
610
|
* the reconcile window ends with it. */
|
|
571
611
|
formingTs: number;
|
|
@@ -580,7 +620,8 @@ export interface WrunLiveRunClock {
|
|
|
580
620
|
/**
|
|
581
621
|
* Decide one drain's plan from the context, the chart's main rows, the gap
|
|
582
622
|
* marks taken and what the fold reported. In order: a moved identity, a
|
|
583
|
-
* moved row-lane acquisition,
|
|
623
|
+
* moved row-lane acquisition, a coins tape whose market traded below its
|
|
624
|
+
* priced low x 0.9, or history (a clamped session: a head rolled
|
|
584
625
|
* past its first row; a pan-back page left to its wave is not one, C1), or a
|
|
585
626
|
* gap wider than 250 bars, rebuilds; any reconcile trigger
|
|
586
627
|
* (session-start, main-jump, wake, poll-due; main-jump is detected here from
|
|
@@ -631,6 +672,9 @@ export declare function wrunPinnedCloseTimerDueAt(indicatorId: string): number |
|
|
|
631
672
|
* prefix has not landed reads no identity, so no earlier run's coverage
|
|
632
673
|
* skips the wave that owes the page's rows; a run's own start (in flight)
|
|
633
674
|
* reads the chart's identity, so a prefix that lands covers the waves over
|
|
634
|
-
* the same rows after it
|
|
675
|
+
* the same rows after it, and is noted (`wrunRunStarts`). A coverage check
|
|
676
|
+
* for an overlay whose live session carries the chart's tail reads the key
|
|
677
|
+
* its latest run started on while the history it computed stands
|
|
678
|
+
* (`wrunLiveCarriedCoverage`). Exported for the specs. */
|
|
635
679
|
export declare function wrunChartRowsIdentity(chartIndex: number, indicatorId?: string): string | undefined;
|
|
636
680
|
export {};
|