@orangecharts/wrun-chart-host 0.7.1 → 0.9.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 +27 -4
- package/dist/constants/feature-flags.constants.d.ts +5 -0
- package/dist/constants/feature-flags.constants.js +32 -0
- package/dist/constants/marketCapabilities.constants.d.ts +14 -9
- package/dist/constants/marketCapabilities.constants.js +36 -13
- package/dist/constants/opra-compliance.constants.d.ts +14 -0
- package/dist/constants/opra-compliance.constants.js +14 -0
- package/dist/constants/option-venues.constants.d.ts +29 -6
- package/dist/constants/option-venues.constants.js +19 -2
- package/dist/constants/venue-presets.constants.d.ts +17 -3
- package/dist/constants/venue-presets.constants.js +17 -3
- package/dist/host-env.d.ts +34 -4
- package/dist/host-env.js +21 -0
- package/dist/host-ports.types.d.ts +51 -3
- package/dist/index.d.ts +17 -0
- package/dist/index.js +17 -0
- package/dist/indicators/controls/tpo-session.util.d.ts +40 -11
- package/dist/indicators/controls/tpo-session.util.js +138 -14
- package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
- package/dist/interfaces/opra-realtime.interface.js +10 -10
- package/dist/interfaces/option-instrument.interface.d.ts +6 -0
- package/dist/interfaces/wrun-runtime.interface.d.ts +34 -13
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +57 -10
- package/dist/kscript-data/controls/live-trades-merge.util.js +85 -16
- package/dist/market-data/billing.interface.d.ts +138 -17
- package/dist/market-data/billing.interface.js +25 -8
- package/dist/market-data/venues/index.d.ts +3 -3
- package/dist/market-data/venues/opra.contract.copy.json +5 -3
- package/dist/market-data/venues/opra.d.ts +3 -3
- package/dist/market-data/venues/opra.js +5 -4
- package/dist/replay/replayLadder.js +3 -1
- package/dist/settings-templates/footprint-rows.d.ts +25 -0
- package/dist/settings-templates/footprint-rows.js +127 -0
- package/dist/settings-templates/form-rows.d.ts +56 -0
- package/dist/settings-templates/form-rows.js +19 -0
- package/dist/settings-templates/frvp-fields.js +14 -0
- package/dist/settings-templates/index.d.ts +10 -1
- package/dist/settings-templates/index.js +11 -2
- package/dist/settings-templates/indicator-fields.js +78 -0
- package/dist/settings-templates/tool-rules.d.ts +35 -9
- package/dist/settings-templates/tool-rules.js +42 -8
- package/dist/settings-templates/tool-tables.generated.js +13 -2
- package/dist/utility/chart/candle-volume-unit.leaf.d.ts +16 -0
- package/dist/utility/chart/candle-volume-unit.leaf.js +61 -0
- package/dist/utility/chart/crypto-index.leaf.d.ts +2 -2
- package/dist/utility/chart/crypto-index.leaf.js +2 -2
- package/dist/utility/chart/footprint-columns.util.d.ts +74 -0
- package/dist/utility/chart/footprint-columns.util.js +106 -0
- package/dist/utility/chart/footprint-display-mode.util.d.ts +40 -0
- package/dist/utility/chart/footprint-display-mode.util.js +62 -0
- package/dist/utility/chart/footprint-sierra-look.util.d.ts +2 -0
- package/dist/utility/chart/footprint-sierra-look.util.js +37 -0
- package/dist/utility/chart/index-mode-admission.util.js +9 -1
- package/dist/utility/chart/index-mode.util.d.ts +5 -2
- package/dist/utility/chart/index-mode.util.js +23 -13
- package/dist/utility/chart/kscript-venue-policy.util.d.ts +28 -21
- package/dist/utility/chart/kscript-venue-policy.util.js +34 -26
- package/dist/utility/chart/marketKind.util.d.ts +12 -10
- package/dist/utility/chart/marketKind.util.js +17 -7
- package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
- package/dist/utility/chart/om-panel-push-style.util.js +17 -15
- package/dist/utility/chart/om-panel.util.d.ts +11 -0
- package/dist/utility/chart/om-panel.util.js +65 -6
- package/dist/utility/chart/profile-block-size.util.d.ts +16 -0
- package/dist/utility/chart/profile-block-size.util.js +7 -0
- package/dist/utility/chart/quote-perp.leaf.d.ts +17 -0
- package/dist/utility/chart/quote-perp.leaf.js +20 -0
- package/dist/utility/chart/window-geometry.leaf.d.ts +23 -1
- package/dist/utility/chart/window-geometry.leaf.js +78 -6
- package/dist/utility/chart/window-owner.leaf.d.ts +13 -0
- package/dist/utility/chart/window-owner.leaf.js +5 -0
- package/dist/utility/chart/wrun-run-result.util.d.ts +5 -0
- package/dist/utility/chart/wrun-run-result.util.js +4 -1
- package/dist/utility/common/transformations.util.d.ts +7 -0
- package/dist/utility/common/transformations.util.js +11 -0
- package/dist/utility/options/cme-options-root.util.d.ts +25 -0
- package/dist/utility/options/cme-options-root.util.js +40 -0
- package/dist/utility/options/option-book.util.d.ts +27 -0
- package/dist/utility/options/option-book.util.js +76 -0
- package/dist/utility/options/option-trade-date.util.d.ts +50 -0
- package/dist/utility/options/option-trade-date.util.js +120 -0
- package/dist/utility/options/option-venue.util.d.ts +3 -3
- package/dist/utility/options/option-venue.util.js +3 -3
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.d.ts +1 -1
- package/dist/utility/wrun/run-schedule/wrun-late-reads.util.js +2 -2
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.d.ts +2 -2
- package/dist/utility/wrun/run-schedule/wrun-prefix-feeds.util.js +5 -1
- package/dist/utility/wrun/sources/host-grid-landing.d.ts +4 -2
- package/dist/utility/wrun/sources/host-grid-landing.js +8 -0
- package/dist/utility/wrun/sources/lanes/options_flow.d.ts +40 -4
- package/dist/utility/wrun/sources/lanes/options_flow.js +115 -18
- package/dist/utility/wrun/sources/opra-option-lanes.util.d.ts +12 -9
- package/dist/utility/wrun/sources/opra-option-lanes.util.js +10 -7
- package/dist/utility/wrun/sources/row-lane-registry.js +10 -5
- package/dist/utility/wrun/sources/row-lanes/index.js +2 -0
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.d.ts +3 -2
- package/dist/utility/wrun/sources/row-lanes/option_contract_flow.js +30 -5
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.d.ts +9 -3
- package/dist/utility/wrun/sources/row-lanes/option_contract_state.js +13 -5
- package/dist/utility/wrun/sources/row-lanes/option_prints.d.ts +25 -1
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +161 -30
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.d.ts +4 -0
- package/dist/utility/wrun/sources/row-lanes/option_strike_flow.js +65 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +55 -1
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +83 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +17 -1
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +33 -2
- package/dist/utility/wrun/sources/wrun-poll-lane.types.d.ts +7 -1
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +51 -5
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +136 -3
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +42 -0
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +146 -0
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +25 -5
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +111 -20
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +291 -48
- package/dist/utility/wrun/wrun-batched-marks.util.d.ts +16 -3
- package/dist/utility/wrun/wrun-batched-marks.util.js +30 -19
- package/dist/utility/wrun/wrun-batched-readout.util.d.ts +37 -9
- package/dist/utility/wrun/wrun-batched-readout.util.js +61 -15
- package/dist/utility/wrun/wrun-canvas-readout.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.d.ts +66 -0
- package/dist/utility/wrun/wrun-cell-capacity.leaf.js +86 -0
- package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +147 -9
- package/dist/utility/wrun/wrun-chart-market-facts.util.js +345 -11
- package/dist/utility/wrun/wrun-cloud-record.leaf.d.ts +27 -0
- package/dist/utility/wrun/wrun-cloud-record.leaf.js +71 -0
- package/dist/utility/wrun/wrun-cloud-record.util.d.ts +4 -21
- package/dist/utility/wrun/wrun-cloud-record.util.js +5 -65
- package/dist/utility/wrun/wrun-color-facts.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +22 -9
- package/dist/utility/wrun/wrun-color-settings.util.js +57 -23
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +92 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +122 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +10 -3
- package/dist/utility/wrun/wrun-draft-overlay.util.js +63 -6
- package/dist/utility/wrun/wrun-frames.js +5 -5
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +11 -0
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +33 -17
- package/dist/utility/wrun/wrun-hud-looks.util.js +30 -16
- package/dist/utility/wrun/wrun-lane-refusal.leaf.d.ts +29 -3
- package/dist/utility/wrun/wrun-lane-refusal.leaf.js +33 -3
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.d.ts +8 -6
- package/dist/utility/wrun/wrun-lifecycle-runtime.util.js +8 -6
- package/dist/utility/wrun/wrun-lifecycle.contract.d.ts +4 -2
- package/dist/utility/wrun/wrun-live-intake.util.d.ts +6 -2
- package/dist/utility/wrun/wrun-live-intake.util.js +136 -21
- package/dist/utility/wrun/wrun-live-tick.util.d.ts +4 -1
- package/dist/utility/wrun/wrun-live-tick.util.js +130 -44
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.d.ts +53 -0
- package/dist/utility/wrun/wrun-market-size-contract-carry.leaf.js +162 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.d.ts +224 -0
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +342 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +88 -0
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +471 -0
- package/dist/utility/wrun/wrun-opra-flow.leaf.d.ts +43 -8
- package/dist/utility/wrun/wrun-opra-flow.leaf.js +37 -6
- package/dist/utility/wrun/wrun-option-contract-flow.util.d.ts +51 -10
- package/dist/utility/wrun/wrun-option-contract-flow.util.js +85 -33
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +172 -3
- package/dist/utility/wrun/wrun-option-prints.util.js +394 -17
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +99 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +218 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +365 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +797 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +231 -7
- package/dist/utility/wrun/wrun-option-views.util.js +643 -23
- package/dist/utility/wrun/wrun-options-chain.util.d.ts +6 -4
- package/dist/utility/wrun/wrun-options-chain.util.js +8 -5
- package/dist/utility/wrun/wrun-options-stop.util.d.ts +2 -1
- package/dist/utility/wrun/wrun-options-stop.util.js +3 -2
- package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +3 -0
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.d.ts +31 -14
- package/dist/utility/wrun/wrun-overlay-lifecycle.lazy.js +22 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.d.ts +9 -1
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +32 -3
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +34 -6
- package/dist/utility/wrun/wrun-overlay-run.util.js +527 -180
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +15 -0
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +22 -0
- package/dist/utility/wrun/wrun-pack.util.d.ts +13 -8
- package/dist/utility/wrun/wrun-pack.util.js +38 -21
- package/dist/utility/wrun/wrun-panel-mount.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-panel-mount.util.js +62 -22
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +41 -14
- package/dist/utility/wrun/wrun-panel-style.util.js +86 -26
- package/dist/utility/wrun/wrun-param-map.util.d.ts +7 -6
- package/dist/utility/wrun/wrun-param-map.util.js +8 -5
- package/dist/utility/wrun/wrun-param-values.util.d.ts +10 -2
- package/dist/utility/wrun/wrun-param-values.util.js +2 -0
- package/dist/utility/wrun/wrun-pin-spelling.util.js +19 -10
- package/dist/utility/wrun/wrun-prefix-lanes.util.js +2 -2
- package/dist/utility/wrun/wrun-refusal.util.js +17 -2
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +20 -0
- package/dist/utility/wrun/wrun-script-inputs.util.js +43 -0
- package/dist/utility/wrun/wrun-source-rows.util.d.ts +4 -0
- package/dist/utility/wrun/wrun-source-rows.util.js +92 -40
- package/dist/utility/wrun/wrun-tape-source.util.d.ts +133 -48
- package/dist/utility/wrun/wrun-tape-source.util.js +205 -62
- package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
- package/dist/workers/utils/volume-profile.worker.util.d.ts +4 -1
- package/dist/workers/utils/volume-profile.worker.util.js +5 -2
- package/dist/workers/wrun/wrun-abi-host.js +3 -2
- package/package.json +11 -11
|
@@ -80,14 +80,14 @@ export type AcceptOpraDataTermsDto = AcceptMarketDataDataTermsDto;
|
|
|
80
80
|
/** POST /opra/subscription/cancel and DELETE /opra/subscription/cancel -> 200 body. */
|
|
81
81
|
export type OpraCancelResponseDto = MarketDataCancelResponseDto;
|
|
82
82
|
/**
|
|
83
|
-
* The
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
83
|
+
* The agreement version orange's contract export names (the card's pin, checked by the contract parity spec). It is
|
|
84
|
+
* NOT the current version: the server serves the current agreement text, its version and its hash
|
|
85
|
+
* (`GET /opra/agreement`, contract K1), the agreement step renders and posts exactly that, and the store reads an
|
|
86
|
+
* acceptance as current only against it (`isMarketDataAgreementCurrent`).
|
|
87
87
|
*/
|
|
88
|
-
export declare const OPRA_SUBSCRIBER_AGREEMENT_VERSION: "opra-
|
|
89
|
-
/**
|
|
90
|
-
export declare const OPRA_SUBSCRIBER_AGREEMENT_URL: "
|
|
88
|
+
export declare const OPRA_SUBSCRIBER_AGREEMENT_VERSION: "opra-b1-2026-10-22";
|
|
89
|
+
/** The agreement link orange's contract export names (the card's pin). No surface links it: the text is served. */
|
|
90
|
+
export declare const OPRA_SUBSCRIBER_AGREEMENT_URL: "/api/v1/opra/agreement";
|
|
91
91
|
/**
|
|
92
92
|
* OPRA's non-professional qualification, one stable machine id per question: these ids key the
|
|
93
93
|
* submitted `answers` record and are never swapped for translated question text. `qualifying` is the
|
|
@@ -126,8 +126,8 @@ export declare const OPRA_ATTESTATION_RENEW_WINDOW_DAYS: 30;
|
|
|
126
126
|
/**
|
|
127
127
|
* A declaration on the current form (a new question set means a new declaration) whose validity has not
|
|
128
128
|
* ended at `now`, either classification. The client owns expiry: `now` is the caller's clock (the store's
|
|
129
|
-
* last evaluation), never an implied Date.now(). A record without `expiresAt
|
|
130
|
-
*
|
|
129
|
+
* last evaluation), never an implied Date.now(). A record without `expiresAt`, or one whose `expiresAt`
|
|
130
|
+
* does not parse, reads lapsed (ask again rather than trust it).
|
|
131
131
|
*/
|
|
132
132
|
export declare function isOpraAttestationLive(attestation: OpraAttestation | null | undefined, now: number): boolean;
|
|
133
133
|
/** A non-professional declaration on the current form, still valid at `now`: the account may buy real-time. */
|
|
@@ -139,8 +139,10 @@ export declare function isOpraProfessionalDeclaration(attestation: OpraAttestati
|
|
|
139
139
|
* inside the renewal window before it; null otherwise (no expiry named, further off, or already lapsed).
|
|
140
140
|
*/
|
|
141
141
|
export declare function opraAttestationRenewBy(attestation: OpraAttestation | null | undefined, now: number): string | null;
|
|
142
|
-
/** An acceptance counts only for the version
|
|
143
|
-
export declare function isOpraAgreementCurrent(
|
|
142
|
+
/** An acceptance counts only for the version the server presents now (`current`, its K1 answer). */
|
|
143
|
+
export declare function isOpraAgreementCurrent(current: {
|
|
144
|
+
version: string;
|
|
145
|
+
} | null | undefined, agreement: OpraAgreement | null | undefined): boolean;
|
|
144
146
|
/**
|
|
145
147
|
* Normalized checkout outcome. 'redirect' = leave for Stripe. 'refused' = the server declined (or the
|
|
146
148
|
* store answered a professional account itself); 'professional_unavailable' is terminal, never a re-price.
|
|
@@ -24,13 +24,13 @@ export const OPRA_IDENTITY_FIELD_MAX_LENGTH = OPRA_VENUE.questionnaire.identityL
|
|
|
24
24
|
/** The server's bound on the one-line `address`, trimmed. */
|
|
25
25
|
export const OPRA_ADDRESS_FIELD_MAX_LENGTH = OPRA_VENUE.questionnaire.identityLimits.address;
|
|
26
26
|
/**
|
|
27
|
-
* The
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* The agreement version orange's contract export names (the card's pin, checked by the contract parity spec). It is
|
|
28
|
+
* NOT the current version: the server serves the current agreement text, its version and its hash
|
|
29
|
+
* (`GET /opra/agreement`, contract K1), the agreement step renders and posts exactly that, and the store reads an
|
|
30
|
+
* acceptance as current only against it (`isMarketDataAgreementCurrent`).
|
|
31
31
|
*/
|
|
32
32
|
export const OPRA_SUBSCRIBER_AGREEMENT_VERSION = OPRA_VENUE.agreement.version;
|
|
33
|
-
/**
|
|
33
|
+
/** The agreement link orange's contract export names (the card's pin). No surface links it: the text is served. */
|
|
34
34
|
export const OPRA_SUBSCRIBER_AGREEMENT_URL = OPRA_VENUE.agreement.url;
|
|
35
35
|
/**
|
|
36
36
|
* OPRA's non-professional qualification, one stable machine id per question: these ids key the
|
|
@@ -51,8 +51,8 @@ export const OPRA_ATTESTATION_RENEW_WINDOW_DAYS = OPRA_VENUE.questionnaire.renew
|
|
|
51
51
|
/**
|
|
52
52
|
* A declaration on the current form (a new question set means a new declaration) whose validity has not
|
|
53
53
|
* ended at `now`, either classification. The client owns expiry: `now` is the caller's clock (the store's
|
|
54
|
-
* last evaluation), never an implied Date.now(). A record without `expiresAt
|
|
55
|
-
*
|
|
54
|
+
* last evaluation), never an implied Date.now(). A record without `expiresAt`, or one whose `expiresAt`
|
|
55
|
+
* does not parse, reads lapsed (ask again rather than trust it).
|
|
56
56
|
*/
|
|
57
57
|
export function isOpraAttestationLive(attestation, now) {
|
|
58
58
|
return isMarketDataAttestationLive(OPRA_VENUE, attestation, now);
|
|
@@ -72,9 +72,9 @@ export function isOpraProfessionalDeclaration(attestation, now) {
|
|
|
72
72
|
export function opraAttestationRenewBy(attestation, now) {
|
|
73
73
|
return marketDataAttestationRenewBy(OPRA_VENUE, attestation, now);
|
|
74
74
|
}
|
|
75
|
-
/** An acceptance counts only for the version
|
|
76
|
-
export function isOpraAgreementCurrent(agreement) {
|
|
77
|
-
return isMarketDataAgreementCurrent(
|
|
75
|
+
/** An acceptance counts only for the version the server presents now (`current`, its K1 answer). */
|
|
76
|
+
export function isOpraAgreementCurrent(current, agreement) {
|
|
77
|
+
return isMarketDataAgreementCurrent(current, agreement);
|
|
78
78
|
}
|
|
79
79
|
/** The venue-generic billing error (market-data/billing.interface.ts): one class for every venue's calls. */
|
|
80
80
|
export const OpraBillingError = MarketDataBillingError;
|
|
@@ -29,4 +29,10 @@ export interface OptionInstrumentSnapshot {
|
|
|
29
29
|
updatedAtMs: number;
|
|
30
30
|
/** Venue vega (price change per 1 IV point). Optional: older fixtures omit it. */
|
|
31
31
|
vega?: number;
|
|
32
|
+
/**
|
|
33
|
+
* The options venue the row was read from (an `OptionVenue` id: `deribit`, `okx-options`, ...), stamped by the
|
|
34
|
+
* crypto chain refresh, so the book rule (utility/options/option-book.util.ts, C0) parses the symbol at its venue
|
|
35
|
+
* and keeps each venue of a merged board apart. Absent on governed chains (one book per product) and fixtures.
|
|
36
|
+
*/
|
|
37
|
+
venue?: string;
|
|
32
38
|
}
|
|
@@ -31,6 +31,7 @@ import type { WrunParamHostFill, WrunWarmupWindow } from '@orangecharts/indicato
|
|
|
31
31
|
import type { CardAnchor } from '../utility/chart/om-widget.util.js';
|
|
32
32
|
import type { ParsedPanel } from '../utility/chart/om-panel.util.js';
|
|
33
33
|
import type { WrunMiniChartsDrawing } from '@orangecharts/indicator-kit/host';
|
|
34
|
+
import type { WrunBatchedNumberFormat } from '../utility/wrun/wrun-batched-readout.util.js';
|
|
34
35
|
/** ABI capabilities accumulate: wrun-2 adds strings and cells, wrun-3
|
|
35
36
|
* adds drawings and strategy, wrun-4 adds run-level frame snapshots,
|
|
36
37
|
* wrun-5 adds the text channel (a typed text setting's UTF-8 bytes, read
|
|
@@ -286,7 +287,10 @@ export type WrunParamHost = 'source' | 'interval' | 'symbol';
|
|
|
286
287
|
* `down_color` / `grid_color` (WRUN-STYLE TH-candle-colors) the chart's
|
|
287
288
|
* bullish, bearish and grid colours packed the same way. The market facts
|
|
288
289
|
* (`kind`, `point_value`, `zone`, `quote_is_usd`, WRUN-GAPS-1005) are codes
|
|
289
|
-
* of the chart's own market (wrun-chart-market-facts.util)
|
|
290
|
+
* of the chart's own market (wrun-chart-market-facts.util), and
|
|
291
|
+
* `dollar_multiplier` (kit 0.95.0, `market.dollar_multiplier()`) the US
|
|
292
|
+
* dollars one size unit of the market's trades at one price unit is worth
|
|
293
|
+
* (wrunMarketDollarUnit; 0 where no unit is proven). */
|
|
290
294
|
export type { WrunParamHostFill };
|
|
291
295
|
/** An om style binding (the om param schema's `style`): the param is a
|
|
292
296
|
* style-only knob that never reaches init() (its slot holds a 0
|
|
@@ -680,11 +684,18 @@ export interface WrunInputSource {
|
|
|
680
684
|
block_size?: number;
|
|
681
685
|
max_depth?: number;
|
|
682
686
|
/** `tape` only (the C1 facets, `wrun-tape-source.util.ts`): the smallest
|
|
683
|
-
* print size served
|
|
684
|
-
* param (resolved from the run's current
|
|
685
|
-
* from TRADE_LARGE ("0" = the live edge
|
|
686
|
-
* most 30 days).
|
|
687
|
+
* print size served in the venue's raw stored unit, a number literal or
|
|
688
|
+
* the name of a declared numeric param (resolved from the run's current
|
|
689
|
+
* values), and the history seeded from TRADE_LARGE ("0" = the live edge
|
|
690
|
+
* only, else `^\d+(s|m|h|d)$` at most 30 days). A tape declares exactly
|
|
691
|
+
* one floor: `min_size` or `min_value`. */
|
|
687
692
|
min_size?: number | string;
|
|
693
|
+
/** `tape` only (contract C-DOLLAR): the smallest print served by its value
|
|
694
|
+
* in US dollars, spelled like `min_size` (a number literal or the name of
|
|
695
|
+
* a declared numeric param). It rides the wire as the gateway's
|
|
696
|
+
* `minQuoteAmount`, and every cell's `size` is then the print's dollar
|
|
697
|
+
* value. */
|
|
698
|
+
min_value?: number | string;
|
|
688
699
|
history?: string;
|
|
689
700
|
/** `volume_profile` only: the lane the input reads, the kScript
|
|
690
701
|
* volume_profile source's `ticksPerBar` (price ticks per bucket, an
|
|
@@ -847,8 +858,9 @@ export interface WrunInputSource {
|
|
|
847
858
|
* `needed_by` leaves out the market's size unit (wrunSheetWithLaneDemand), or a `candles` lane its
|
|
848
859
|
* `chart_interval_below` gates off on the chart's interval (wrunSheetWithLaneGate). Its lane is not
|
|
849
860
|
* demanded: no fetch, no live channel, no fold, no reconcile (wrunSourceLane answers none for it),
|
|
850
|
-
* and the row builder reads its fill on every bar without ever holding the run; a
|
|
851
|
-
*
|
|
861
|
+
* and the row builder reads its fill on every bar without ever holding the run; a celled input (a
|
|
862
|
+
* gated `candles` lane, a tape the market does not ask, kit 0.95.0) plans no leg and no cells and reads a
|
|
863
|
+
* present EMPTY block on every row, and no tape acquisition counts it (isWrunAskedTapeSource). */
|
|
852
864
|
undemanded?: true;
|
|
853
865
|
}
|
|
854
866
|
/** The four views of a pinned coarser input (`WrunInputSource.view`), and `forming_open`, a
|
|
@@ -871,6 +883,10 @@ interface WrunMetadataInput {
|
|
|
871
883
|
description?: string;
|
|
872
884
|
cellType?: 'array';
|
|
873
885
|
max_cells?: number;
|
|
886
|
+
/** A celled input's: the tuples its module's build sized the input's buffer and `in_<name>_capacity` by (kit
|
|
887
|
+
* scaffold 97 writes it beside `max_cells`; absent on every older sheet). Every block is sized by
|
|
888
|
+
* `capacity ?? max_cells` (wrun-cell-capacity.leaf `wrunSheetCellBlockTuples`). */
|
|
889
|
+
capacity?: number;
|
|
874
890
|
}
|
|
875
891
|
export interface WrunMetadataOutput {
|
|
876
892
|
index: number;
|
|
@@ -1263,8 +1279,10 @@ export interface WrunPanelStyle {
|
|
|
1263
1279
|
font_family?: WrunFontFamily;
|
|
1264
1280
|
/** SC07: hover readouts (default true). */
|
|
1265
1281
|
hover_card?: boolean;
|
|
1266
|
-
/** SC23 SC02 SC37: the pane frame (pie: box or none).
|
|
1267
|
-
|
|
1282
|
+
/** SC23 SC02 SC37: the pane frame (pie: box or none). `hairlines`, the
|
|
1283
|
+
* default on line, bars, histogram and scatter: horizontal value hairlines
|
|
1284
|
+
* only, no frame and no vertical grid. */
|
|
1285
|
+
chrome?: 'box' | 'grid' | 'none' | 'hairlines';
|
|
1268
1286
|
format?: WrunValueFormat;
|
|
1269
1287
|
decimals?: number;
|
|
1270
1288
|
signed?: boolean;
|
|
@@ -2456,8 +2474,9 @@ interface WrunBatchedSectionCommon {
|
|
|
2456
2474
|
* {{price}} {{fills}}` on marks, `{{top}} {{bottom}} {{length}} {{word}}` on spans, `{{y1}}
|
|
2457
2475
|
* {{y2}} {{length}} {{word}}` on rays (the kit's WRUN_BATCHED_TOOLTIP_TOKENS), `{{start}}` and
|
|
2458
2476
|
* `{{end}}` in place of `{{length}}` on a timed (stride-5) section (the kit's
|
|
2459
|
-
* WRUN_BATCHED_TIMED_TOOLTIP_TOKENS, printed as chart times); `{{<field
|
|
2460
|
-
*
|
|
2477
|
+
* WRUN_BATCHED_TIMED_TOOLTIP_TOKENS, printed as chart times); `{{<field>:<format>}}` picks a
|
|
2478
|
+
* number format, a word of WRUN_BATCHED_NUMBER_FORMATS (wrun-batched-readout.util:
|
|
2479
|
+
* `{{qty:units}}` prints a mark's quantity in the market's own unit, `{{qty:usd}}` in dollars). */
|
|
2461
2480
|
tooltip?: string | null;
|
|
2462
2481
|
/** The readout title, 1..40 chars (absent = the name read as words). */
|
|
2463
2482
|
label?: string;
|
|
@@ -2485,11 +2504,13 @@ export interface WrunMarksSection extends WrunBatchedSectionCommon {
|
|
|
2485
2504
|
colors?: WrunBatchedColor[];
|
|
2486
2505
|
/** The fill opacity in percent, 10..80 (default 30). */
|
|
2487
2506
|
opacity_pct?: number;
|
|
2488
|
-
/** The caption: mode 0 Off, 1 Big bubbles (the largest a bar), 2 All (default 1, `compact`, 22 px)
|
|
2507
|
+
/** The caption: mode 0 Off, 1 Big bubbles (the largest a bar), 2 All (default 1, `compact`, 22 px); its
|
|
2508
|
+
* format a word of WRUN_BATCHED_NUMBER_FORMATS (`usd` dollars, `units` the market's own unit: Big Trades
|
|
2509
|
+
* 0.7.0's Size shown as paints one of the two). */
|
|
2489
2510
|
text?: {
|
|
2490
2511
|
mode?: number;
|
|
2491
2512
|
field?: 'qty';
|
|
2492
|
-
format?:
|
|
2513
|
+
format?: WrunBatchedNumberFormat;
|
|
2493
2514
|
min_px?: number;
|
|
2494
2515
|
};
|
|
2495
2516
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type OptionTradeUnits } from '../../utility/options/option-trade-units.util.js';
|
|
2
2
|
export declare const LIVE_MAX_CELLS_PER_BAR = 20000;
|
|
3
|
+
/** The most prints one history ask reads (the history worker's cap, mirroring the historical service's
|
|
4
|
+
* HIST_TRADES_MAX_CELLS): past it the ask fails loudly instead of truncating the tape, and the wrun tape's refusal
|
|
5
|
+
* names the same number. */
|
|
6
|
+
export declare const TRADES_HISTORY_MAX_CELLS = 300000;
|
|
3
7
|
/** The raw TRADE table's retention (about two days): a seeded history ask never reaches behind
|
|
4
8
|
* it (older windows answer nothing and cost the gateway a scan over cold chunks). */
|
|
5
9
|
export declare const TRADES_RETENTION_SEC: number;
|
|
@@ -50,7 +54,9 @@ export type TradesLargeFloor = {
|
|
|
50
54
|
export interface TradesLaneLimits {
|
|
51
55
|
/** The history reads the TRADE_LARGE table: a `large` acquisition on a market the table holds. */
|
|
52
56
|
readsLargeTable: boolean;
|
|
53
|
-
/** The seed cap: the table's retention on the large lane, two hours on the raw tape
|
|
57
|
+
/** The seed cap: the table's retention on the large lane, two hours on the raw tape, and 0 (the live edge only)
|
|
58
|
+
* for a dollar floor on the raw tape, whose rows no writer priced in dollars. Every reader of the tape's served
|
|
59
|
+
* history reads this cap: the request builder, the reconcile's served start and the queue loss's repair. */
|
|
54
60
|
historyCapSec: number;
|
|
55
61
|
retentionSec: number;
|
|
56
62
|
/** The gateway's bar limit on the large lane (`tradesBarLimitStartMs`); none on the raw tape. */
|
|
@@ -58,10 +64,24 @@ export interface TradesLaneLimits {
|
|
|
58
64
|
}
|
|
59
65
|
export type LiveTradeCell = [number, number, number, number];
|
|
60
66
|
export type LiveTradesRow = [number, ...LiveTradeCell[]];
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
67
|
+
/** A tape acquisition's floor as the live rules read it (the K_TRADES payload's own fields): `minSize`
|
|
68
|
+
* in the raw unit a live print arrives in, or `minValue` in US dollars (C-DOLLAR) with the market's
|
|
69
|
+
* `valuePerUnit` (the US dollars one price unit times one size unit is worth there, the run head's
|
|
70
|
+
* `wrunMarketDollarUnit`); an option book's registry units price a dollar floor instead. */
|
|
71
|
+
export interface TradesTapeFloor {
|
|
72
|
+
/** The size floor: a print below it never folds; absent, non-finite or non-positive = no floor. */
|
|
64
73
|
minSize?: unknown;
|
|
74
|
+
/** The dollar floor: when finite and above zero it replaces `minSize`, a print folds only when its
|
|
75
|
+
* dollar value reaches it, and the cell's size is that value. */
|
|
76
|
+
minValue?: unknown;
|
|
77
|
+
/** The US dollars one price unit times one size unit of a live print is worth on the acquisition's
|
|
78
|
+
* market; absent, non-finite or non-positive, no print can be valued and none folds under a dollar
|
|
79
|
+
* floor (never a guessed multiplier). */
|
|
80
|
+
valuePerUnit?: unknown;
|
|
81
|
+
/** An option book's registry trade units: its prints are valued by their USD premium. */
|
|
82
|
+
optionUnits?: OptionTradeUnits | null;
|
|
83
|
+
}
|
|
84
|
+
export interface LiveTradesMergeOptions extends TradesTapeFloor {
|
|
65
85
|
/** The large lane's table floor (the `large` acquisition): a print the large-print table never
|
|
66
86
|
* holds (`tradesBelowLargeFloor`; the print's envelope names the market, else this one) never
|
|
67
87
|
* folds, so no live print appears that the next reconcile cannot answer. */
|
|
@@ -141,6 +161,26 @@ export declare function readLiveTradePrint(newPoint: unknown): LiveTradePrint |
|
|
|
141
161
|
* dollar stablecoin. Any other quote (KRW, a coin) is never copied: the table holds none of its
|
|
142
162
|
* prints at all. */
|
|
143
163
|
export declare function tradesLargeQuotedInDollars(normalizedSymbol: unknown): boolean;
|
|
164
|
+
/** Whether a quote asset's amounts are US dollars: USD or a dollar stablecoin (the gateway writer's
|
|
165
|
+
* `peggedUSDQuotes`, the list the large-print table copies by). */
|
|
166
|
+
export declare function isTradesDollarQuoteAsset(asset: unknown): boolean;
|
|
167
|
+
/**
|
|
168
|
+
* The size a live print's cell carries on a tape, or null when the print does not reach the tape's floor: the ONE
|
|
169
|
+
* floor rule the wrun intake's enqueue, its fold and the K_TRADES control's fold share.
|
|
170
|
+
*
|
|
171
|
+
* - A dollar floor (`minValue` finite and above zero, C-DOLLAR): the print's dollar value, and the print folds only
|
|
172
|
+
* when it reaches the floor. On an option book (`optionUnits`) its USD premium by the registry units
|
|
173
|
+
* (`liveOptionPrintUsdPremium`: a coin-premium book has none); on every other market price x size x `valuePerUnit`.
|
|
174
|
+
* The size is the live-feed COIN arm's: live-feed already applied each instrument's contract multiplier and its
|
|
175
|
+
* inverse flag (coins on a crypto contract or inverse venue), and a CME Group contract stays one contract, whose
|
|
176
|
+
* point value `valuePerUnit` carries. A print that cannot be valued (no `valuePerUnit`, units that cannot say) is
|
|
177
|
+
* null: it never folds, whatever its size.
|
|
178
|
+
* - Otherwise the raw size, below a finite positive `minSize` null.
|
|
179
|
+
*/
|
|
180
|
+
export declare function tradesTapeCellSize(print: Pick<LiveTradePrint, 'price' | 'size'>, floor: TradesTapeFloor): number | null;
|
|
181
|
+
/** Whether a tape floor can value a live print at all: a raw floor always can; a dollar floor needs the market's
|
|
182
|
+
* `valuePerUnit` or an option book's units. The live intake records a dollar tape that cannot, by name. */
|
|
183
|
+
export declare function tradesTapeFloorValuesPrints(floor: TradesTapeFloor): boolean;
|
|
144
184
|
/** A live print's notional: its quote amount when the frame carries one, else price x size. On an option
|
|
145
185
|
* book (`optionUnits`) the premium in the book's own currency by the resolver's live-print rule
|
|
146
186
|
* (option-trade-units.util `liveOptionPrintPremium`): a live print's size arrives in coin, live-feed having
|
|
@@ -160,19 +200,26 @@ export declare function tradesCmeProductRoot(market: TradesLargeMarket): string
|
|
|
160
200
|
* skips it); elsewhere the notional floor on a market quoted in dollars, null on any other quote
|
|
161
201
|
* (KRW, a coin): the table holds none of its prints. */
|
|
162
202
|
export declare function tradesLargeFloorOfMarket(market: TradesLargeMarket): TradesLargeFloor | null;
|
|
203
|
+
/** Whether a tape floor is a dollar floor (C-DOLLAR's `minValue`, finite and above zero). */
|
|
204
|
+
export declare function tradesTapeFloorIsDollars(floor: Pick<TradesTapeFloor, 'minValue'>): boolean;
|
|
163
205
|
/** The tape lane an acquisition rides on a market: the large lane (the table's retention, the
|
|
164
206
|
* gateway's bar limit, the declared history) when it asks `large` and the large-print table holds
|
|
165
207
|
* the market, else the raw tape (a two-hour seed inside the raw table's retention). On a CME Group
|
|
166
208
|
* venue a product root the writer lists no floor for is never copied, so a large acquisition on it
|
|
167
209
|
* reads the raw tape in place of an empty table and its live prints fold unfloored, the same rows
|
|
168
|
-
* either way, until the server lists the root. A
|
|
169
|
-
*
|
|
170
|
-
|
|
210
|
+
* either way, until the server lists the root. A dollar floor (`floor.minValue`) on that raw tape
|
|
211
|
+
* reads no history at all (`historyCapSec` 0, the live edge): the raw tape's quote amounts are priced
|
|
212
|
+
* by no writer rule (a backfill gap is NULL), so its rows are no proven dollars. A market quoted
|
|
213
|
+
* outside dollars keeps the table (the control cannot tell its quote: the table answers it empty, by
|
|
214
|
+
* its own rule). The ONE rule of a tape's served history: the request builder, the reconcile's served
|
|
215
|
+
* start and the queue loss's repair all read it with the acquisition's floor. */
|
|
216
|
+
export declare function tradesLaneLimits(large: boolean, market?: TradesLargeMarket, floor?: Pick<TradesTapeFloor, 'minValue'>): TradesLaneLimits;
|
|
171
217
|
/** Whether a history re-ask on a large acquisition answers a market's prints (the tape reconcile
|
|
172
218
|
* restoring what the queue cap dropped): the table on a market it holds, the raw tape on a CME
|
|
173
|
-
* Group root it skips
|
|
174
|
-
*
|
|
175
|
-
|
|
219
|
+
* Group root it skips under a size floor; never a lane that serves no history under the floor
|
|
220
|
+
* (`tradesLaneLimits`: a dollar floor on the raw tape), never a market quoted outside dollars. A
|
|
221
|
+
* market naming no normalized symbol is assumed held. */
|
|
222
|
+
export declare function tradesLargeHistoryAnswers(market: TradesLargeMarket, floor?: Pick<TradesTapeFloor, 'minValue'>): boolean;
|
|
176
223
|
/** True for a live print the large-print table never holds on a market it floors: a dollar-quoted
|
|
177
224
|
* print whose notional is under TRADES_LARGE_MIN_QUOTE_AMOUNT (the gateway copies a print whose
|
|
178
225
|
* quote amount reaches the floor), a CME Group print of fewer contracts than its root's floor (the
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
//
|
|
8
8
|
// The fold's rules, in order: a print needs a BUY or SELL series side, a
|
|
9
9
|
// finite positive amount, a finite price and a wire timestamp; a print below
|
|
10
|
-
// the acquisition's
|
|
10
|
+
// the acquisition's floor is rejected (`tradesTapeCellSize`: its `minSize` in
|
|
11
|
+
// raw units, or its `minValue` in dollars, C-DOLLAR, where the cell's size is
|
|
12
|
+
// then the print's dollar value), and on the large lane a print the
|
|
11
13
|
// large-print table never holds (`tradesBelowLargeFloor`: a dollar-quoted
|
|
12
14
|
// market's print under the notional floor, a CME Group print under its
|
|
13
15
|
// product root's contracts floor); the print lands in the chart bar
|
|
@@ -20,8 +22,12 @@ import { Intervals } from '../../constants/interval.constants.js';
|
|
|
20
22
|
import { barEndMs, barStartMs } from '../../utility/chart/calendar-interval.util.js';
|
|
21
23
|
import { cmeSessionBarEndMs, cmeSessionBarOpenMs, cmeSessionBucketMs, isCmeSessionLatticeExchange, isCmeSessionLatticeIntervalMs, } from '../../utility/chart/cme-session-bucket.util.js';
|
|
22
24
|
import { findMonday } from '../../workers/utils/time.worker.util.js';
|
|
23
|
-
import { liveOptionPrintPremium } from '../../utility/options/option-trade-units.util.js';
|
|
25
|
+
import { liveOptionPrintPremium, liveOptionPrintUsdPremium, } from '../../utility/options/option-trade-units.util.js';
|
|
24
26
|
export const LIVE_MAX_CELLS_PER_BAR = 20_000;
|
|
27
|
+
/** The most prints one history ask reads (the history worker's cap, mirroring the historical service's
|
|
28
|
+
* HIST_TRADES_MAX_CELLS): past it the ask fails loudly instead of truncating the tape, and the wrun tape's refusal
|
|
29
|
+
* names the same number. */
|
|
30
|
+
export const TRADES_HISTORY_MAX_CELLS = 300_000;
|
|
25
31
|
/** The raw TRADE table's retention (about two days): a seeded history ask never reaches behind
|
|
26
32
|
* it (older windows answer nothing and cost the gateway a scan over cold chunks). */
|
|
27
33
|
export const TRADES_RETENTION_SEC = 2 * 24 * 3600;
|
|
@@ -41,7 +47,9 @@ const TRADES_LARGE_BAR_LIMIT_MARGIN_SEC = 600;
|
|
|
41
47
|
* is copied into the table when its quote amount reaches it. */
|
|
42
48
|
export const TRADES_LARGE_MIN_QUOTE_AMOUNT = 10_000;
|
|
43
49
|
/** The quote assets whose quote amount is dollars (the gateway writer's `peggedUSDQuotes`): only the
|
|
44
|
-
* prints of a market quoted in one of these are copied into trade_large, every other quote never.
|
|
50
|
+
* prints of a market quoted in one of these are copied into trade_large, every other quote never. The
|
|
51
|
+
* dollar rule of a market's value (wrun-chart-market-facts.util `wrunMarketDollarUnit`) reads the same
|
|
52
|
+
* list (`isTradesDollarQuoteAsset`). */
|
|
45
53
|
const TRADES_LARGE_USD_QUOTES = new Set([
|
|
46
54
|
'USD',
|
|
47
55
|
'USDT',
|
|
@@ -231,6 +239,50 @@ export function tradesLargeQuotedInDollars(normalizedSymbol) {
|
|
|
231
239
|
const quote = normalizedSymbol.split('-')[1];
|
|
232
240
|
return quote !== undefined && TRADES_LARGE_USD_QUOTES.has(quote);
|
|
233
241
|
}
|
|
242
|
+
/** Whether a quote asset's amounts are US dollars: USD or a dollar stablecoin (the gateway writer's
|
|
243
|
+
* `peggedUSDQuotes`, the list the large-print table copies by). */
|
|
244
|
+
export function isTradesDollarQuoteAsset(asset) {
|
|
245
|
+
return typeof asset === 'string' && TRADES_LARGE_USD_QUOTES.has(asset.trim().toUpperCase());
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* The size a live print's cell carries on a tape, or null when the print does not reach the tape's floor: the ONE
|
|
249
|
+
* floor rule the wrun intake's enqueue, its fold and the K_TRADES control's fold share.
|
|
250
|
+
*
|
|
251
|
+
* - A dollar floor (`minValue` finite and above zero, C-DOLLAR): the print's dollar value, and the print folds only
|
|
252
|
+
* when it reaches the floor. On an option book (`optionUnits`) its USD premium by the registry units
|
|
253
|
+
* (`liveOptionPrintUsdPremium`: a coin-premium book has none); on every other market price x size x `valuePerUnit`.
|
|
254
|
+
* The size is the live-feed COIN arm's: live-feed already applied each instrument's contract multiplier and its
|
|
255
|
+
* inverse flag (coins on a crypto contract or inverse venue), and a CME Group contract stays one contract, whose
|
|
256
|
+
* point value `valuePerUnit` carries. A print that cannot be valued (no `valuePerUnit`, units that cannot say) is
|
|
257
|
+
* null: it never folds, whatever its size.
|
|
258
|
+
* - Otherwise the raw size, below a finite positive `minSize` null.
|
|
259
|
+
*/
|
|
260
|
+
export function tradesTapeCellSize(print, floor) {
|
|
261
|
+
if (tradesTapeFloorIsDollars(floor)) {
|
|
262
|
+
const minValue = Number(floor.minValue);
|
|
263
|
+
let value;
|
|
264
|
+
if (floor.optionUnits) {
|
|
265
|
+
value = liveOptionPrintUsdPremium(print.price, print.size, floor.optionUnits);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
const unit = Number(floor.valuePerUnit);
|
|
269
|
+
value = Number.isFinite(unit) && unit > 0 ? print.price * print.size * unit : null;
|
|
270
|
+
}
|
|
271
|
+
return value !== null && Number.isFinite(value) && value >= minValue ? value : null;
|
|
272
|
+
}
|
|
273
|
+
const minSize = Number(floor.minSize);
|
|
274
|
+
return Number.isFinite(minSize) && minSize > 0 && print.size < minSize ? null : print.size;
|
|
275
|
+
}
|
|
276
|
+
/** Whether a tape floor can value a live print at all: a raw floor always can; a dollar floor needs the market's
|
|
277
|
+
* `valuePerUnit` or an option book's units. The live intake records a dollar tape that cannot, by name. */
|
|
278
|
+
export function tradesTapeFloorValuesPrints(floor) {
|
|
279
|
+
if (!tradesTapeFloorIsDollars(floor))
|
|
280
|
+
return true;
|
|
281
|
+
if (floor.optionUnits)
|
|
282
|
+
return true;
|
|
283
|
+
const unit = Number(floor.valuePerUnit);
|
|
284
|
+
return Number.isFinite(unit) && unit > 0;
|
|
285
|
+
}
|
|
234
286
|
/** A live print's notional: its quote amount when the frame carries one, else price x size. On an option
|
|
235
287
|
* book (`optionUnits`) the premium in the book's own currency by the resolver's live-print rule
|
|
236
288
|
* (option-trade-units.util `liveOptionPrintPremium`): a live print's size arrives in coin, live-feed having
|
|
@@ -275,29 +327,46 @@ export function tradesLargeFloorOfMarket(market) {
|
|
|
275
327
|
? { kind: 'notional', min: TRADES_LARGE_MIN_QUOTE_AMOUNT }
|
|
276
328
|
: null;
|
|
277
329
|
}
|
|
330
|
+
/** Whether a tape floor is a dollar floor (C-DOLLAR's `minValue`, finite and above zero). */
|
|
331
|
+
export function tradesTapeFloorIsDollars(floor) {
|
|
332
|
+
const minValue = Number(floor.minValue);
|
|
333
|
+
return Number.isFinite(minValue) && minValue > 0;
|
|
334
|
+
}
|
|
278
335
|
/** The tape lane an acquisition rides on a market: the large lane (the table's retention, the
|
|
279
336
|
* gateway's bar limit, the declared history) when it asks `large` and the large-print table holds
|
|
280
337
|
* the market, else the raw tape (a two-hour seed inside the raw table's retention). On a CME Group
|
|
281
338
|
* venue a product root the writer lists no floor for is never copied, so a large acquisition on it
|
|
282
339
|
* reads the raw tape in place of an empty table and its live prints fold unfloored, the same rows
|
|
283
|
-
* either way, until the server lists the root. A
|
|
284
|
-
*
|
|
285
|
-
|
|
340
|
+
* either way, until the server lists the root. A dollar floor (`floor.minValue`) on that raw tape
|
|
341
|
+
* reads no history at all (`historyCapSec` 0, the live edge): the raw tape's quote amounts are priced
|
|
342
|
+
* by no writer rule (a backfill gap is NULL), so its rows are no proven dollars. A market quoted
|
|
343
|
+
* outside dollars keeps the table (the control cannot tell its quote: the table answers it empty, by
|
|
344
|
+
* its own rule). The ONE rule of a tape's served history: the request builder, the reconcile's served
|
|
345
|
+
* start and the queue loss's repair all read it with the acquisition's floor. */
|
|
346
|
+
export function tradesLaneLimits(large, market = {}, floor = {}) {
|
|
286
347
|
const readsLargeTable = large && (!isCmeSessionLatticeExchange(market.exchange) || tradesLargeFloorOfMarket(market) !== null);
|
|
287
|
-
|
|
288
|
-
|
|
348
|
+
if (readsLargeTable) {
|
|
349
|
+
return {
|
|
289
350
|
readsLargeTable,
|
|
290
351
|
historyCapSec: TRADES_LARGE_RETENTION_SEC,
|
|
291
352
|
retentionSec: TRADES_LARGE_RETENTION_SEC,
|
|
292
353
|
barLimitSec: TRADES_LARGE_BAR_LIMIT_SEC,
|
|
293
|
-
}
|
|
294
|
-
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
readsLargeTable,
|
|
358
|
+
historyCapSec: tradesTapeFloorIsDollars(floor) ? 0 : TRADES_MAX_HISTORY_SEC,
|
|
359
|
+
retentionSec: TRADES_RETENTION_SEC,
|
|
360
|
+
};
|
|
295
361
|
}
|
|
296
362
|
/** Whether a history re-ask on a large acquisition answers a market's prints (the tape reconcile
|
|
297
363
|
* restoring what the queue cap dropped): the table on a market it holds, the raw tape on a CME
|
|
298
|
-
* Group root it skips
|
|
299
|
-
*
|
|
300
|
-
|
|
364
|
+
* Group root it skips under a size floor; never a lane that serves no history under the floor
|
|
365
|
+
* (`tradesLaneLimits`: a dollar floor on the raw tape), never a market quoted outside dollars. A
|
|
366
|
+
* market naming no normalized symbol is assumed held. */
|
|
367
|
+
export function tradesLargeHistoryAnswers(market, floor = {}) {
|
|
368
|
+
if (!(tradesLaneLimits(true, market, floor).historyCapSec > 0))
|
|
369
|
+
return false;
|
|
301
370
|
if (isCmeSessionLatticeExchange(market.exchange))
|
|
302
371
|
return true;
|
|
303
372
|
return market.normalizedSymbol === undefined || tradesLargeQuotedInDollars(market.normalizedSymbol);
|
|
@@ -332,8 +401,8 @@ export function mergeLiveTradesDataPoint(lastDataPoint, newPoint, intervalMs, op
|
|
|
332
401
|
const print = readLiveTradePrint(newPoint);
|
|
333
402
|
if (print === null)
|
|
334
403
|
return null;
|
|
335
|
-
const
|
|
336
|
-
if (
|
|
404
|
+
const size = tradesTapeCellSize(print, options);
|
|
405
|
+
if (size === null)
|
|
337
406
|
return null;
|
|
338
407
|
if (options.largeFloor !== undefined && tradesBelowLargeFloor(print, options.largeFloor))
|
|
339
408
|
return null;
|
|
@@ -343,7 +412,7 @@ export function mergeLiveTradesDataPoint(lastDataPoint, newPoint, intervalMs, op
|
|
|
343
412
|
// A delayed closed-bar print must not append an out-of-order row.
|
|
344
413
|
if (last && last[0] > barTs)
|
|
345
414
|
return null;
|
|
346
|
-
const cell = [print.tsMs - barTs, print.price,
|
|
415
|
+
const cell = [print.tsMs - barTs, print.price, size, print.side];
|
|
347
416
|
if (!last || last[0] !== barTs)
|
|
348
417
|
return [...rows, [barTs, cell]];
|
|
349
418
|
// Live folds receive a shallow snapshot copy: never mutate its shared row
|