@orangecharts/wrun-chart-host 0.8.0 → 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 +2 -1
- package/dist/constants/feature-flags.constants.d.ts +4 -0
- package/dist/constants/feature-flags.constants.js +27 -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 +11 -6
- package/dist/constants/option-venues.constants.js +5 -2
- package/dist/host-env.d.ts +10 -4
- package/dist/host-ports.types.d.ts +39 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/interfaces/opra-realtime.interface.d.ts +13 -11
- package/dist/interfaces/opra-realtime.interface.js +10 -10
- package/dist/interfaces/wrun-runtime.interface.d.ts +34 -13
- package/dist/kscript-data/controls/live-trades-merge.util.d.ts +53 -10
- package/dist/kscript-data/controls/live-trades-merge.util.js +81 -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/utility/chart/crypto-index.leaf.d.ts +2 -2
- package/dist/utility/chart/crypto-index.leaf.js +2 -2
- package/dist/utility/chart/index-mode-admission.util.js +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 +30 -24
- package/dist/utility/chart/marketKind.util.d.ts +12 -10
- package/dist/utility/chart/marketKind.util.js +17 -7
- package/dist/utility/chart/om-panel-push-style.util.d.ts +7 -7
- package/dist/utility/chart/om-panel-push-style.util.js +17 -15
- package/dist/utility/chart/om-panel.util.js +6 -6
- package/dist/utility/chart/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/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/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/row-lane-registry.js +3 -2
- 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 +11 -0
- package/dist/utility/wrun/sources/row-lanes/option_prints.js +63 -9
- package/dist/utility/wrun/sources/row-lanes/option_strikes.d.ts +8 -0
- package/dist/utility/wrun/sources/row-lanes/option_strikes.js +12 -0
- package/dist/utility/wrun/sources/row-lanes/option_surface.d.ts +5 -2
- package/dist/utility/wrun/sources/row-lanes/option_surface.js +5 -2
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.d.ts +11 -5
- package/dist/utility/wrun/sources/wrun-poll-lanes.util.js +31 -10
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.d.ts +33 -1
- package/dist/utility/wrun/sources/wrun-row-lane-first-paint.util.js +95 -6
- package/dist/utility/wrun/sources/wrun-row-lane.types.d.ts +25 -5
- package/dist/utility/wrun/sources/wrun-row-lanes.util.d.ts +55 -18
- package/dist/utility/wrun/sources/wrun-row-lanes.util.js +146 -40
- 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-color-facts.util.d.ts +19 -9
- package/dist/utility/wrun/wrun-color-facts.util.js +24 -14
- package/dist/utility/wrun/wrun-color-settings.util.d.ts +15 -4
- package/dist/utility/wrun/wrun-color-settings.util.js +31 -12
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.d.ts +17 -0
- package/dist/utility/wrun/wrun-dollar-unit-port.leaf.js +9 -0
- package/dist/utility/wrun/wrun-download-meter.util.d.ts +92 -0
- package/dist/utility/wrun/wrun-download-meter.util.js +122 -0
- package/dist/utility/wrun/wrun-draft-overlay.util.d.ts +6 -1
- package/dist/utility/wrun/wrun-draft-overlay.util.js +23 -3
- package/dist/utility/wrun/wrun-frames.js +5 -5
- package/dist/utility/wrun/wrun-hosted-wire-caps.d.ts +2 -2
- package/dist/utility/wrun/wrun-hosted-wire-caps.js +7 -0
- package/dist/utility/wrun/wrun-hud-looks.util.d.ts +33 -17
- package/dist/utility/wrun/wrun-hud-looks.util.js +30 -16
- 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.js +91 -38
- 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 +166 -48
- package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +216 -33
- package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +51 -7
- package/dist/utility/wrun/wrun-market-size-defaults.util.js +314 -56
- package/dist/utility/wrun/wrun-option-prints.util.d.ts +41 -2
- package/dist/utility/wrun/wrun-option-prints.util.js +80 -13
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.d.ts +3 -0
- package/dist/utility/wrun/wrun-option-strike-flow-lane.util.js +3 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.d.ts +23 -0
- package/dist/utility/wrun/wrun-option-strike-flow.util.js +55 -0
- package/dist/utility/wrun/wrun-option-views.util.d.ts +51 -7
- package/dist/utility/wrun/wrun-option-views.util.js +151 -28
- 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 +7 -0
- package/dist/utility/wrun/wrun-overlay-recovery.util.js +25 -1
- package/dist/utility/wrun/wrun-overlay-result.util.d.ts +7 -1
- package/dist/utility/wrun/wrun-overlay-result.util.js +2 -0
- package/dist/utility/wrun/wrun-overlay-run.util.d.ts +34 -6
- package/dist/utility/wrun/wrun-overlay-run.util.js +416 -171
- package/dist/utility/wrun/wrun-pack-widths.leaf.d.ts +4 -4
- package/dist/utility/wrun/wrun-pack-widths.leaf.js +4 -4
- package/dist/utility/wrun/wrun-pack.util.d.ts +7 -3
- package/dist/utility/wrun/wrun-pack.util.js +20 -9
- package/dist/utility/wrun/wrun-panel-style.util.d.ts +27 -15
- package/dist/utility/wrun/wrun-panel-style.util.js +42 -20
- 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-prefix-lanes.util.js +2 -2
- package/dist/utility/wrun/wrun-refusal.util.js +10 -1
- package/dist/utility/wrun/wrun-script-inputs.util.d.ts +7 -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 +126 -50
- package/dist/utility/wrun/wrun-tape-source.util.js +193 -68
- package/dist/utility/wrun/wrun-volume-profile-lane.util.d.ts +7 -5
- package/dist/utility/wrun/wrun-volume-profile-lane.util.js +8 -6
- package/dist/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
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** The manner of assent an acceptance records: the click on the agreement's own "I AGREE" button. */
|
|
2
|
+
export const MARKET_DATA_ASSENT_MANNER = 'click:i-agree';
|
|
1
3
|
const DAY_MS = 86_400_000;
|
|
2
4
|
/** Every question of the venue's questionnaire answered with its qualifying answer. */
|
|
3
5
|
export function isMarketDataNonProfessional(venue, answers) {
|
|
@@ -6,14 +8,15 @@ export function isMarketDataNonProfessional(venue, answers) {
|
|
|
6
8
|
/**
|
|
7
9
|
* A declaration on the venue's current form (a new question set means a new declaration) whose validity has not ended
|
|
8
10
|
* at `now`, either classification. The client owns expiry: `now` is the caller's clock (the store's last evaluation),
|
|
9
|
-
* never an implied Date.now(). A record without `expiresAt`
|
|
10
|
-
*
|
|
11
|
+
* never an implied Date.now(). A record without `expiresAt` reads lapsed, as does one whose `expiresAt` does not parse
|
|
12
|
+
* (ask again rather than trust it): status is reconfirmed every 12 months (Exhibit A Q19.3), and a record that names
|
|
13
|
+
* no end can never be shown to be inside its year.
|
|
11
14
|
*/
|
|
12
15
|
export function isMarketDataAttestationLive(venue, attestation, now) {
|
|
13
16
|
if (!attestation || attestation.formVersion !== venue.questionnaire.formVersion)
|
|
14
17
|
return false;
|
|
15
18
|
if (attestation.expiresAt === undefined)
|
|
16
|
-
return
|
|
19
|
+
return false;
|
|
17
20
|
const ends = Date.parse(attestation.expiresAt);
|
|
18
21
|
return Number.isFinite(ends) && now < ends;
|
|
19
22
|
}
|
|
@@ -21,9 +24,17 @@ export function isMarketDataAttestationLive(venue, attestation, now) {
|
|
|
21
24
|
export function isMarketDataAttestationCurrent(venue, attestation, now) {
|
|
22
25
|
return attestation?.classification === 'non_professional' && isMarketDataAttestationLive(venue, attestation, now);
|
|
23
26
|
}
|
|
24
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* A professional declaration on the current form, still valid at `now`: real-time is not sold to the account. A
|
|
29
|
+
* professional record that names no expiry still refuses: a missing field never lifts a refusal (only a new
|
|
30
|
+
* non-professional declaration the server records does).
|
|
31
|
+
*/
|
|
25
32
|
export function isMarketDataProfessionalDeclaration(venue, attestation, now) {
|
|
26
|
-
|
|
33
|
+
if (attestation?.classification !== 'professional')
|
|
34
|
+
return false;
|
|
35
|
+
if (attestation.expiresAt === undefined)
|
|
36
|
+
return attestation.formVersion === venue.questionnaire.formVersion;
|
|
37
|
+
return isMarketDataAttestationLive(venue, attestation, now);
|
|
27
38
|
}
|
|
28
39
|
/**
|
|
29
40
|
* The expiry (ISO, as served) a still-current non-professional declaration must be renewed by, once `now` is inside
|
|
@@ -36,9 +47,15 @@ export function marketDataAttestationRenewBy(venue, attestation, now) {
|
|
|
36
47
|
? attestation.expiresAt
|
|
37
48
|
: null;
|
|
38
49
|
}
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
/**
|
|
51
|
+
* An acceptance counts only for the agreement version the SERVER presents now (`current`: its K1 answer), never for an
|
|
52
|
+
* older text and never for the version a build carries (the venue card's `agreement.version` is the contract export's
|
|
53
|
+
* pin, not the current text). With no current agreement read, nothing counts.
|
|
54
|
+
*/
|
|
55
|
+
export function isMarketDataAgreementCurrent(current, agreement) {
|
|
56
|
+
if (!current?.version)
|
|
57
|
+
return false;
|
|
58
|
+
return agreement?.accepted === true && agreement.agreementVersion === current.version;
|
|
42
59
|
}
|
|
43
60
|
export class MarketDataBillingError extends Error {
|
|
44
61
|
kind;
|
|
@@ -61,8 +61,8 @@ export declare const MARKET_DATA_VENUES: readonly [{
|
|
|
61
61
|
readonly renewalWindowDays: 30;
|
|
62
62
|
};
|
|
63
63
|
readonly agreement: {
|
|
64
|
-
readonly version: "opra-
|
|
65
|
-
readonly url: "
|
|
64
|
+
readonly version: "opra-b1-2026-10-22";
|
|
65
|
+
readonly url: "/api/v1/opra/agreement";
|
|
66
66
|
readonly delayedRequiresAcceptance: false;
|
|
67
67
|
};
|
|
68
68
|
readonly delayMinutes: 15;
|
|
@@ -73,7 +73,7 @@ export declare const MARKET_DATA_VENUES: readonly [{
|
|
|
73
73
|
readonly i18nNamespace: "opraRealtimeData";
|
|
74
74
|
readonly storeId: "opraRealtime";
|
|
75
75
|
readonly surfaces: readonly ["chain-page-subtitle", "chain-price-pill", "chain-table-marker", "chain-strike-preview", "chain-index-notice", "flow-tape", "terminal-options-tab", "options-overlay-legends", "indicator-legend-notes", "contract-chart-delay-chip", "contract-chart-delay-card", "chart-source-line", "watchlist-panel", "watchlist-cell-tooltip", "board", "purchase-live-price"];
|
|
76
|
-
readonly contractRevision: "2026-10-
|
|
76
|
+
readonly contractRevision: "2026-10-22.1";
|
|
77
77
|
}];
|
|
78
78
|
/** A registered venue's key. */
|
|
79
79
|
export type MarketDataVenueKey = (typeof MARKET_DATA_VENUES)[number]['key'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"revision": "2026-10-
|
|
2
|
+
"revision": "2026-10-22.1",
|
|
3
3
|
"key": "opra",
|
|
4
4
|
"productGroups": ["OPRA"],
|
|
5
5
|
"products": [
|
|
@@ -27,8 +27,10 @@
|
|
|
27
27
|
],
|
|
28
28
|
"identityLimits": { "text": 200, "address": 300 },
|
|
29
29
|
"agreement": {
|
|
30
|
-
"version": "opra-
|
|
31
|
-
"
|
|
30
|
+
"version": "opra-b1-2026-10-22",
|
|
31
|
+
"sha256": "105d1b2d6a89cc9416f2d2ebb18e97bed7973e4d2c39353cc55315421b958814",
|
|
32
|
+
"addendumVersion": "opra-b1-addendum-2026-10-22",
|
|
33
|
+
"url": "/api/v1/opra/agreement"
|
|
32
34
|
},
|
|
33
35
|
"delaySeconds": 900,
|
|
34
36
|
"basePath": "/opra"
|
|
@@ -54,8 +54,8 @@ export declare const OPRA_VENUE: {
|
|
|
54
54
|
readonly renewalWindowDays: 30;
|
|
55
55
|
};
|
|
56
56
|
readonly agreement: {
|
|
57
|
-
readonly version: "opra-
|
|
58
|
-
readonly url: "
|
|
57
|
+
readonly version: "opra-b1-2026-10-22";
|
|
58
|
+
readonly url: "/api/v1/opra/agreement";
|
|
59
59
|
readonly delayedRequiresAcceptance: false;
|
|
60
60
|
};
|
|
61
61
|
readonly delayMinutes: 15;
|
|
@@ -66,5 +66,5 @@ export declare const OPRA_VENUE: {
|
|
|
66
66
|
readonly i18nNamespace: "opraRealtimeData";
|
|
67
67
|
readonly storeId: "opraRealtime";
|
|
68
68
|
readonly surfaces: readonly ["chain-page-subtitle", "chain-price-pill", "chain-table-marker", "chain-strike-preview", "chain-index-notice", "flow-tape", "terminal-options-tab", "options-overlay-legends", "indicator-legend-notes", "contract-chart-delay-chip", "contract-chart-delay-card", "chart-source-line", "watchlist-panel", "watchlist-cell-tooltip", "board", "purchase-live-price"];
|
|
69
|
-
readonly contractRevision: "2026-10-
|
|
69
|
+
readonly contractRevision: "2026-10-22.1";
|
|
70
70
|
};
|
|
@@ -41,9 +41,10 @@ export const OPRA_VENUE = {
|
|
|
41
41
|
validityDays: 365,
|
|
42
42
|
renewalWindowDays: 30,
|
|
43
43
|
},
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
|
|
44
|
+
// The agreement orange's export names (OPRA's B-1 and its addendum, populated): its text, hash and addendum are
|
|
45
|
+
// served by `url` (contract K1) and an assent names them (K2). The current version is always the server's answer,
|
|
46
|
+
// never this pin (isMarketDataAgreementCurrent).
|
|
47
|
+
agreement: { version: 'opra-b1-2026-10-22', url: '/api/v1/opra/agreement', delayedRequiresAcceptance: false },
|
|
47
48
|
// OPRA defines delayed data as at least 15 minutes old; the gate's delayed window matches (900 s).
|
|
48
49
|
delayMinutes: 15,
|
|
49
50
|
// The Vendor Agreement's exact phrase (Exhibit A section 14): OPRA_DELAY_NOTICE in
|
|
@@ -70,5 +71,5 @@ export const OPRA_VENUE = {
|
|
|
70
71
|
'board',
|
|
71
72
|
'purchase-live-price',
|
|
72
73
|
],
|
|
73
|
-
contractRevision: '2026-10-
|
|
74
|
+
contractRevision: '2026-10-22.1',
|
|
74
75
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Replay fidelity ladder: measured retention and request-shaping constants.
|
|
2
2
|
import { RAIL_TFS, RAIL_TF_BOOK_EDGE_SEC, RAIL_TF_BUCKET_SEC, RAIL_TF_EDGE_SEC, REPLAY_LADDER_EDGES_SEC, REPLAY_STEP_TFS, REPLAY_STEP_TF_BOOK_EDGE_SEC, REPLAY_STEP_TF_BUCKET_SEC, REPLAY_STEP_TF_EDGE_SEC, } from '../constants/replay-ladder.leaf.js';
|
|
3
3
|
import { FEATURE_LIMITS, GATEWAY_TIER_MAX_BARS } from '../constants/feature-limits.constants.js';
|
|
4
|
+
import { checkIsCryptoIndex } from '../utility/chart/crypto-index.leaf.js';
|
|
4
5
|
import { checkIsBlockedOn1s } from '../utility/chart/index-mode.util.js';
|
|
5
6
|
import { standardIntervalMsAtOrBelow } from '../utility/chart/interval-registry.util.js';
|
|
6
7
|
const orderedCoveringTfs = ['1m', '5m', '15m', '1h', '1d'];
|
|
@@ -295,7 +296,8 @@ export function clampReplayReach(requestedMs, domain, resolution, maxBars, inten
|
|
|
295
296
|
export function reconcileReplayResolution(ageSec, chartIntervalMs, exchange) {
|
|
296
297
|
const age = Math.max(0, ageSec);
|
|
297
298
|
const playbackTf = coarseRailTfForAge(age, chartIntervalMs);
|
|
298
|
-
|
|
299
|
+
// Tick replay steps through trades: a crypto index serves 1s candles but has no trades behind them.
|
|
300
|
+
const tickAvailable = age <= REPLAY_LADDER_EDGES_SEC.tick && !checkIsBlockedOn1s(exchange) && !checkIsCryptoIndex(exchange);
|
|
299
301
|
const candidates = replayResolutionFallbackCandidatesForChartInterval(chartIntervalMs);
|
|
300
302
|
const chartResolution = replayResolutionForChartInterval(chartIntervalMs);
|
|
301
303
|
const available = candidates.filter((resolution) => resolution.kind === 'tick' ? tickAvailable : REPLAY_STEP_TF_EDGE_SEC[resolution.tf] >= age);
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* docs/features/data/cryptocap-indices.md). The backend prints each series as raw CRYPTO_DOMINANCE points and serves
|
|
4
4
|
* its candles as CRYPTO_DOMINANCE_AGG on tsdb-gateway v2: value candles with no volume, trades or book behind them.
|
|
5
5
|
*
|
|
6
|
-
* A leaf on purpose, with no imports: the market-kind table (`marketKind.util`)
|
|
7
|
-
*
|
|
6
|
+
* A leaf on purpose, with no imports: the market-kind table (`marketKind.util`), the ticker hub (`index-mode.util`) and
|
|
7
|
+
* the replay ladder all read it, and none may call into the others at module load. Web code asks
|
|
8
8
|
* `checkIsCryptoIndex` here, never through `index-mode.util` or `marketKind.util`: over a hundred specs mock those two
|
|
9
9
|
* with partial factories, and a predicate read through such a mock throws.
|
|
10
10
|
*/
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* docs/features/data/cryptocap-indices.md). The backend prints each series as raw CRYPTO_DOMINANCE points and serves
|
|
4
4
|
* its candles as CRYPTO_DOMINANCE_AGG on tsdb-gateway v2: value candles with no volume, trades or book behind them.
|
|
5
5
|
*
|
|
6
|
-
* A leaf on purpose, with no imports: the market-kind table (`marketKind.util`)
|
|
7
|
-
*
|
|
6
|
+
* A leaf on purpose, with no imports: the market-kind table (`marketKind.util`), the ticker hub (`index-mode.util`) and
|
|
7
|
+
* the replay ladder all read it, and none may call into the others at module load. Web code asks
|
|
8
8
|
* `checkIsCryptoIndex` here, never through `index-mode.util` or `marketKind.util`: over a hundred specs mock those two
|
|
9
9
|
* with partial factories, and a predicate read through such a mock throws.
|
|
10
10
|
*/
|
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
* book and list no options, so they serve no volume profile, buy/sell volume, order book,
|
|
17
17
|
* implied volatility or skew, whatever the index-mode admission lets through; a crypto index
|
|
18
18
|
* (CRYPTOCAP, not index-mode: it fetches by period like crypto) serves its value candles and no
|
|
19
|
-
* other lane at all;
|
|
19
|
+
* other lane at all; a quote-priced perpetual market (Variational, also period-fetched) serves its
|
|
20
|
+
* quote candles, funding and open interest, and no trade, volume, book, profile or options lane;
|
|
20
21
|
* - the coin table: the option-summary lanes (implied volatility, skew) hold a series for the
|
|
21
22
|
* coins `WRUN_OPTION_SUMMARY_COINS` lists (BTC and ETH) and no other.
|
|
22
23
|
* The dispatcher's own admission (`isKScriptTypeServedOnIndexMode`) stays as it is.
|
|
23
24
|
*/
|
|
24
25
|
import { checkIsCryptoIndex } from './crypto-index.leaf.js';
|
|
26
|
+
import { checkIsQuotePerp } from './quote-perp.leaf.js';
|
|
25
27
|
import { checkIsIndexMode } from './index-mode.util.js';
|
|
26
28
|
import { checkIsForexOrCommodity } from './marketKind.util.js';
|
|
27
29
|
import { WRUN_OPTION_SUMMARY_COINS, WRUN_OPTION_SUMMARY_LANES } from '../wrun/wrun-option-summary-lane.util.js';
|
|
@@ -39,6 +41,9 @@ const FOREX_COMMODITY_UNSERVED_TYPES = new Set([
|
|
|
39
41
|
]);
|
|
40
42
|
/** The one lane fetch type a crypto index market serves (the market-kind table): its value candles. */
|
|
41
43
|
const CRYPTO_INDEX_SERVED_TYPES = new Set(['ohlcv']);
|
|
44
|
+
/** The lane fetch types a quote-priced perpetual market serves (the market-kind table): its quote candles and the
|
|
45
|
+
* two perpetual series the gateway serves beside them. */
|
|
46
|
+
const QUOTE_PERP_SERVED_TYPES = new Set(['ohlcv', 'funding_rate', 'open_interest']);
|
|
42
47
|
/** The lane fetch types served for some coins only, and those coins (the coin table). */
|
|
43
48
|
const COIN_SERVED_TYPES = Object.freeze({
|
|
44
49
|
[WRUN_OPTION_SUMMARY_LANES.implied_volatility.type]: WRUN_OPTION_SUMMARY_COINS,
|
|
@@ -63,6 +68,9 @@ export function wrunLaneServiceOnMarket({ type, exchange, coin, nativeRows, }) {
|
|
|
63
68
|
if (!CRYPTO_INDEX_SERVED_TYPES.has(type) && checkIsCryptoIndex(exchange)) {
|
|
64
69
|
return { served: false, reason: 'market-kind' };
|
|
65
70
|
}
|
|
71
|
+
if (!QUOTE_PERP_SERVED_TYPES.has(type) && checkIsQuotePerp(exchange)) {
|
|
72
|
+
return { served: false, reason: 'market-kind' };
|
|
73
|
+
}
|
|
66
74
|
const coins = COIN_SERVED_TYPES[type];
|
|
67
75
|
const word = typeof coin === 'string' ? coin.trim().toUpperCase() : '';
|
|
68
76
|
if (coins !== undefined && word !== '' && !coins.includes(word))
|
|
@@ -56,8 +56,11 @@ export declare function checkIsIndexMode(exchange: string | undefined): boolean;
|
|
|
56
56
|
export declare function checkIsIndexVenue(exchange: string | undefined): boolean;
|
|
57
57
|
/**
|
|
58
58
|
* Exchanges that print quotes instead of trades: value-only candles with no
|
|
59
|
-
* volume and a quote channel live (forex, commodity
|
|
60
|
-
* TICKER/TICKER_AGG, the crypto indices on
|
|
59
|
+
* volume and a quote channel live (forex, commodity, the index venues and the
|
|
60
|
+
* quote-priced perpetual venues on TICKER/TICKER_AGG, the crypto indices on
|
|
61
|
+
* CRYPTO_DOMINANCE/CRYPTO_DOMINANCE_AGG). A venue the gateway serves only as
|
|
62
|
+
* quotes must answer true here: unlisted, it reads as crypto and asks for
|
|
63
|
+
* trades it is never served (venue-price-source.ratchet.spec.ts).
|
|
61
64
|
* The hub of the quote routing: the candle parse (the ohlcv and K_OHLCV
|
|
62
65
|
* workers keep a volume-less row), the sided-candle refusal and the live
|
|
63
66
|
* channel (`liveQuoteType`, live-feed-channel-factory.util) all read it; the
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { formatDisplayToExchange } from '../exchange-normalization.util.js';
|
|
2
|
-
import {
|
|
2
|
+
import { checkIsCryptoIndex } from './crypto-index.leaf.js';
|
|
3
|
+
import { checkIsQuotePerp } from './quote-perp.leaf.js';
|
|
3
4
|
import { PREDICTION_MARKET_EXCHANGE_NAMES } from './prediction-identity.util.js';
|
|
4
5
|
// ============================================================================
|
|
5
6
|
// EXCHANGE CONSTANTS
|
|
@@ -49,15 +50,12 @@ const INDEX_MODE_EXCHANGES = [
|
|
|
49
50
|
...COMMODITY_EXCHANGES,
|
|
50
51
|
...INDEX_VENUE_EXCHANGES,
|
|
51
52
|
];
|
|
52
|
-
// Exchanges that don't support 1s interval (index mode + prediction + forex + commodity
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
...PREDICTION_MARKET_EXCHANGE_NAMES,
|
|
59
|
-
...CRYPTO_INDEX_EXCHANGES,
|
|
60
|
-
];
|
|
53
|
+
// Exchanges that don't support 1s interval (index mode + prediction + forex + commodity). Prediction
|
|
54
|
+
// venues poll a price rather than printing trades, so none of them can host a 1s bar: the list tracks
|
|
55
|
+
// the venue SET, not Polymarket alone. The crypto indices (CRYPTOCAP) are not here: their 1s candles
|
|
56
|
+
// read the raw prints (tsdb-gateway's crypto_dominance_agg_1s tier), like a crypto pair's trades. The
|
|
57
|
+
// quote-priced perpetual venues are blocked by their own predicate (checkIsBlockedOn1s).
|
|
58
|
+
const EXCHANGES_BLOCKED_ON_1S = [...INDEX_MODE_EXCHANGES, ...PREDICTION_MARKET_EXCHANGE_NAMES];
|
|
61
59
|
const PM_SIGNAL_CRYPTO_SYMBOLS = ['BTC', 'ETH', 'SOL', 'XRP'];
|
|
62
60
|
const PM_SIGNAL_TRADFI_SYMBOLS = [
|
|
63
61
|
'TSLA',
|
|
@@ -322,8 +320,11 @@ export function checkIsIndexVenue(exchange) {
|
|
|
322
320
|
}
|
|
323
321
|
/**
|
|
324
322
|
* Exchanges that print quotes instead of trades: value-only candles with no
|
|
325
|
-
* volume and a quote channel live (forex, commodity
|
|
326
|
-
* TICKER/TICKER_AGG, the crypto indices on
|
|
323
|
+
* volume and a quote channel live (forex, commodity, the index venues and the
|
|
324
|
+
* quote-priced perpetual venues on TICKER/TICKER_AGG, the crypto indices on
|
|
325
|
+
* CRYPTO_DOMINANCE/CRYPTO_DOMINANCE_AGG). A venue the gateway serves only as
|
|
326
|
+
* quotes must answer true here: unlisted, it reads as crypto and asks for
|
|
327
|
+
* trades it is never served (venue-price-source.ratchet.spec.ts).
|
|
327
328
|
* The hub of the quote routing: the candle parse (the ohlcv and K_OHLCV
|
|
328
329
|
* workers keep a volume-less row), the sided-candle refusal and the live
|
|
329
330
|
* channel (`liveQuoteType`, live-feed-channel-factory.util) all read it; the
|
|
@@ -334,7 +335,11 @@ export function checkIsIndexVenue(exchange) {
|
|
|
334
335
|
* cme-futures-capability.spec.ts.
|
|
335
336
|
*/
|
|
336
337
|
export function checkIsTickerDataType(exchange) {
|
|
337
|
-
return (checkIsForex(exchange) ||
|
|
338
|
+
return (checkIsForex(exchange) ||
|
|
339
|
+
checkIsCommodity(exchange) ||
|
|
340
|
+
checkIsIndexVenue(exchange) ||
|
|
341
|
+
checkIsCryptoIndex(exchange) ||
|
|
342
|
+
checkIsQuotePerp(exchange));
|
|
338
343
|
}
|
|
339
344
|
export function checkIsBlockedOn1s(exchange) {
|
|
340
345
|
if (isCmeFuturesPolicyActive(exchange))
|
|
@@ -345,6 +350,11 @@ export function checkIsBlockedOn1s(exchange) {
|
|
|
345
350
|
// sub-minute rung (1s 5s 15s 30s) is ever servable on a contract.
|
|
346
351
|
if (isOpraGoverned(exchange))
|
|
347
352
|
return true;
|
|
353
|
+
// Quote-priced perpetual venues: the gateway serves TICKER_AGG from the
|
|
354
|
+
// minute up ("interval SECOND is not served for TICKER_AGG"). The leaf
|
|
355
|
+
// predicate, case-insensitive like the kind that routes their quotes.
|
|
356
|
+
if (checkIsQuotePerp(exchange))
|
|
357
|
+
return true;
|
|
348
358
|
return checkIsExchangeInSet(exchange, EXCHANGES_BLOCKED_ON_1S_SET);
|
|
349
359
|
}
|
|
350
360
|
export function getMarketType(exchange) {
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
* equity and index options, Kyle 2026-10-14) draws the same line: chart-only
|
|
7
7
|
* first-party indicators are display use, user-authored scripting waits for
|
|
8
8
|
* OPRA's confirmation. Kyle 2026-10-17 assumed that confirmation behind the
|
|
9
|
-
* `opra-user-scripts` flag
|
|
10
|
-
*
|
|
11
|
-
* the display wall, the data wall and the engine policy
|
|
12
|
-
*
|
|
9
|
+
* `opra-user-scripts` flag; since 2026-10-22 (the OPRA gate compliance round,
|
|
10
|
+
* plan row D3) the policy no longer reads it: `isOpraUserScriptRun`, ONE
|
|
11
|
+
* decision for the display wall, the data wall and the engine policy, refuses
|
|
12
|
+
* every user run, so a lit flag reads exactly like a dark one. A scope
|
|
13
|
+
* assessment with OPRA (the filing's Non-Display Declaration, Exhibit A Q8,
|
|
14
|
+
* Q12, Q13) must come before it opens again. This module is the single
|
|
15
|
+
* decider for both planes.
|
|
13
16
|
* Every run door (add, mount, protected fetch, cache paint, alerts arm,
|
|
14
17
|
* editor Run), the per-payload data guard in titan-charts dataFetch, and the
|
|
15
18
|
* engine policy descriptor consult it; nothing else may re-derive provenance
|
|
@@ -95,20 +98,25 @@ export declare function isFirstPartyKScriptRun(settings: KScriptProvenanceSettin
|
|
|
95
98
|
* server lane, which reads governed data through its own gate identity (UW-PARITY H3), so a browser flag never opens
|
|
96
99
|
* a plane to them. A Cloud run is the record on the socket row source (`wrunRowSourceKindOf`), read through the
|
|
97
100
|
* migration on read (`wrunCloudRecordOf`): the wave-3 record (`wrunRunTarget: 'cloud'`, no `wrunRef`) and a record
|
|
98
|
-
* persisted before wave 3 (`wrunRef`) alike. The runs the `opra-user-scripts` flag
|
|
99
|
-
* without the flag where a door must know a decision waits on it (the
|
|
101
|
+
* persisted before wave 3 (`wrunRef`) alike. The runs the `opra-user-scripts` flag opened the OPRA plane to while it
|
|
102
|
+
* was honoured (`isOpraUserScriptRun`); read without the flag where a door must know a decision waits on it (the
|
|
103
|
+
* flag's hydration).
|
|
100
104
|
*/
|
|
101
105
|
export declare function isOpraUserScriptCandidate(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
|
|
102
106
|
/**
|
|
103
|
-
* Whether the
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
107
|
+
* Whether the OPRA plane is open to this user run. The ONE decision every OPRA door reads, directly or through the
|
|
108
|
+
* walls below: the display wall, the data wall (the dataFetch door, the protected pre-flight, the cache paint), the
|
|
109
|
+
* engine policy, and the wrun chain decision. The CME plane never reads it.
|
|
110
|
+
*
|
|
111
|
+
* Always false (2026-10-22, the OPRA gate compliance round, plan row D3): the `opra-user-scripts` flag (Kyle
|
|
112
|
+
* 2026-10-17: the OPRA permission for user-authored scripts assumed) opened the plane to a browser user run
|
|
113
|
+
* (`isOpraUserScriptCandidate`) while lit; it is no longer honoured, and stays defined only so nothing that names it
|
|
114
|
+
* breaks. OPRA's approval covers web display only: user-authored scripting over OPRA data stays refused until a scope
|
|
115
|
+
* assessment with OPRA (the filing's Non-Display Declaration, Exhibit A Q8, Q12, Q13) allows it.
|
|
108
116
|
*/
|
|
109
|
-
export declare function isOpraUserScriptRun(
|
|
110
|
-
/** Whether a run may consume the OPRA plane's data: every first-party run, and
|
|
111
|
-
*
|
|
117
|
+
export declare function isOpraUserScriptRun(_settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
|
|
118
|
+
/** Whether a run may consume the OPRA plane's data: every first-party run, and no user run (`isOpraUserScriptRun`;
|
|
119
|
+
* `mayReadOpra`, the one decision the wrun run head and every source lane read too). */
|
|
112
120
|
export declare function isOpraReadableKScriptRun(settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
|
|
113
121
|
/** Whether a source exchange touches a CME-governed venue (the CME-only curation and copy). */
|
|
114
122
|
export declare function payloadTouchesCmeVenue(exchange: unknown): boolean;
|
|
@@ -132,8 +140,8 @@ export declare function payloadTouchesGovernedVenue(exchange: unknown): boolean;
|
|
|
132
140
|
* teardown, resubscribe, self-heal, suite/layout/copy apply) consult
|
|
133
141
|
* isKScriptDisplayBlockedOnExchange below instead, which is a strict superset
|
|
134
142
|
* of this predicate. Per plane: a CME leg blocks every user run; an OPRA leg
|
|
135
|
-
* blocks
|
|
136
|
-
*
|
|
143
|
+
* blocks every user run too (`isOpraReadableKScriptRun`: the flag that could
|
|
144
|
+
* open the plane is no longer honoured, see `isOpraUserScriptRun`).
|
|
137
145
|
*/
|
|
138
146
|
export declare function isUserKScriptBlockedOnExchange(exchange: unknown, settings: KScriptProvenanceSettingsLike | null | undefined): boolean;
|
|
139
147
|
/**
|
|
@@ -171,9 +179,8 @@ export declare function isUserKScriptBlockedOnExchange(exchange: unknown, settin
|
|
|
171
179
|
* OPRA (no CME leg): every first-party run is explicitly venue-approved, the
|
|
172
180
|
* built-ins, the converted corpus, the official docs and the official
|
|
173
181
|
* packages alike (chart-only display use under the OPRA licence), and every
|
|
174
|
-
* user run is blocked
|
|
175
|
-
*
|
|
176
|
-
* decision). The CME per-script curation is CME evidence and does not apply
|
|
182
|
+
* user run is blocked (the data wall's own per-plane verdict, so the two walls
|
|
183
|
+
* read one decision, `isOpraUserScriptRun`). The CME per-script curation is CME evidence and does not apply
|
|
177
184
|
* there; a book-reading official is refused by the options mode (OPRA has no
|
|
178
185
|
* book), not by this wall.
|
|
179
186
|
*/
|
|
@@ -199,8 +206,8 @@ export declare function shouldBlockKScriptSourcePayload(args: {
|
|
|
199
206
|
* engine: first-party runs get no engine policy at all; user runs get the
|
|
200
207
|
* governed set of every gate plane as deniedExchanges once the engine pin
|
|
201
208
|
* supports it, so a user script on a crypto chart cannot pull an explicit
|
|
202
|
-
* OPRA source either
|
|
203
|
-
*
|
|
209
|
+
* OPRA source either. A run the OPRA plane is open to (`isOpraUserScriptRun`,
|
|
210
|
+
* none since 2026-10-22) would get the CME family alone.
|
|
204
211
|
*/
|
|
205
212
|
export interface KScriptDataAccessPolicyDescriptor {
|
|
206
213
|
governedExchanges: readonly string[];
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
* equity and index options, Kyle 2026-10-14) draws the same line: chart-only
|
|
7
7
|
* first-party indicators are display use, user-authored scripting waits for
|
|
8
8
|
* OPRA's confirmation. Kyle 2026-10-17 assumed that confirmation behind the
|
|
9
|
-
* `opra-user-scripts` flag
|
|
10
|
-
*
|
|
11
|
-
* the display wall, the data wall and the engine policy
|
|
12
|
-
*
|
|
9
|
+
* `opra-user-scripts` flag; since 2026-10-22 (the OPRA gate compliance round,
|
|
10
|
+
* plan row D3) the policy no longer reads it: `isOpraUserScriptRun`, ONE
|
|
11
|
+
* decision for the display wall, the data wall and the engine policy, refuses
|
|
12
|
+
* every user run, so a lit flag reads exactly like a dark one. A scope
|
|
13
|
+
* assessment with OPRA (the filing's Non-Display Declaration, Exhibit A Q8,
|
|
14
|
+
* Q12, Q13) must come before it opens again. This module is the single
|
|
15
|
+
* decider for both planes.
|
|
13
16
|
* Every run door (add, mount, protected fetch, cache paint, alerts arm,
|
|
14
17
|
* editor Run), the per-payload data guard in titan-charts dataFetch, and the
|
|
15
18
|
* engine policy descriptor consult it; nothing else may re-derive provenance
|
|
@@ -31,8 +34,6 @@ import { isWrunDraftScriptId } from '../wrun/wrun-draft-overlay.util.js';
|
|
|
31
34
|
import { isWrunOfficialPackage } from '../wrun/wrun-official-scope.leaf.js';
|
|
32
35
|
// Worker-safe too: it reads the twin stamp, the registry ref and the built-in keys alone.
|
|
33
36
|
import { builtinIdentityOf } from './builtin-identity.util.js';
|
|
34
|
-
// Dependency-free: the flag store hands the flag's live readers to it (no store import here).
|
|
35
|
-
import { isOpraUserScriptsFlagOn } from './opra-user-scripts-gate.util.js';
|
|
36
37
|
// Leaf module (no imports): the row source a record runs on (a Cloud record rides the socket source).
|
|
37
38
|
import { wrunRowSourceKindOf } from '../wrun/wrun-overlay-identity.util.js';
|
|
38
39
|
// Near-leaf (the identity leaf only): the migration on read of a record persisted before lane parity wave 3. The
|
|
@@ -156,8 +157,9 @@ export function isFirstPartyKScriptRun(settings) {
|
|
|
156
157
|
* server lane, which reads governed data through its own gate identity (UW-PARITY H3), so a browser flag never opens
|
|
157
158
|
* a plane to them. A Cloud run is the record on the socket row source (`wrunRowSourceKindOf`), read through the
|
|
158
159
|
* migration on read (`wrunCloudRecordOf`): the wave-3 record (`wrunRunTarget: 'cloud'`, no `wrunRef`) and a record
|
|
159
|
-
* persisted before wave 3 (`wrunRef`) alike. The runs the `opra-user-scripts` flag
|
|
160
|
-
* without the flag where a door must know a decision waits on it (the
|
|
160
|
+
* persisted before wave 3 (`wrunRef`) alike. The runs the `opra-user-scripts` flag opened the OPRA plane to while it
|
|
161
|
+
* was honoured (`isOpraUserScriptRun`); read without the flag where a door must know a decision waits on it (the
|
|
162
|
+
* flag's hydration).
|
|
161
163
|
*/
|
|
162
164
|
export function isOpraUserScriptCandidate(settings) {
|
|
163
165
|
if (!settings || isFirstPartyKScriptRun(settings))
|
|
@@ -167,17 +169,21 @@ export function isOpraUserScriptCandidate(settings) {
|
|
|
167
169
|
return settings.isProtectedScript !== true;
|
|
168
170
|
}
|
|
169
171
|
/**
|
|
170
|
-
* Whether the
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
172
|
+
* Whether the OPRA plane is open to this user run. The ONE decision every OPRA door reads, directly or through the
|
|
173
|
+
* walls below: the display wall, the data wall (the dataFetch door, the protected pre-flight, the cache paint), the
|
|
174
|
+
* engine policy, and the wrun chain decision. The CME plane never reads it.
|
|
175
|
+
*
|
|
176
|
+
* Always false (2026-10-22, the OPRA gate compliance round, plan row D3): the `opra-user-scripts` flag (Kyle
|
|
177
|
+
* 2026-10-17: the OPRA permission for user-authored scripts assumed) opened the plane to a browser user run
|
|
178
|
+
* (`isOpraUserScriptCandidate`) while lit; it is no longer honoured, and stays defined only so nothing that names it
|
|
179
|
+
* breaks. OPRA's approval covers web display only: user-authored scripting over OPRA data stays refused until a scope
|
|
180
|
+
* assessment with OPRA (the filing's Non-Display Declaration, Exhibit A Q8, Q12, Q13) allows it.
|
|
175
181
|
*/
|
|
176
|
-
export function isOpraUserScriptRun(
|
|
177
|
-
return
|
|
182
|
+
export function isOpraUserScriptRun(_settings) {
|
|
183
|
+
return false;
|
|
178
184
|
}
|
|
179
|
-
/** Whether a run may consume the OPRA plane's data: every first-party run, and
|
|
180
|
-
*
|
|
185
|
+
/** Whether a run may consume the OPRA plane's data: every first-party run, and no user run (`isOpraUserScriptRun`;
|
|
186
|
+
* `mayReadOpra`, the one decision the wrun run head and every source lane read too). */
|
|
181
187
|
export function isOpraReadableKScriptRun(settings) {
|
|
182
188
|
return mayReadOpra({ official: isFirstPartyKScriptRun(settings), opraUserScripts: isOpraUserScriptRun(settings) });
|
|
183
189
|
}
|
|
@@ -215,8 +221,8 @@ export function payloadTouchesGovernedVenue(exchange) {
|
|
|
215
221
|
* teardown, resubscribe, self-heal, suite/layout/copy apply) consult
|
|
216
222
|
* isKScriptDisplayBlockedOnExchange below instead, which is a strict superset
|
|
217
223
|
* of this predicate. Per plane: a CME leg blocks every user run; an OPRA leg
|
|
218
|
-
* blocks
|
|
219
|
-
*
|
|
224
|
+
* blocks every user run too (`isOpraReadableKScriptRun`: the flag that could
|
|
225
|
+
* open the plane is no longer honoured, see `isOpraUserScriptRun`).
|
|
220
226
|
*/
|
|
221
227
|
export function isUserKScriptBlockedOnExchange(exchange, settings) {
|
|
222
228
|
if (payloadTouchesCmeVenue(exchange) && !isFirstPartyKScriptRun(settings))
|
|
@@ -258,9 +264,8 @@ export function isUserKScriptBlockedOnExchange(exchange, settings) {
|
|
|
258
264
|
* OPRA (no CME leg): every first-party run is explicitly venue-approved, the
|
|
259
265
|
* built-ins, the converted corpus, the official docs and the official
|
|
260
266
|
* packages alike (chart-only display use under the OPRA licence), and every
|
|
261
|
-
* user run is blocked
|
|
262
|
-
*
|
|
263
|
-
* decision). The CME per-script curation is CME evidence and does not apply
|
|
267
|
+
* user run is blocked (the data wall's own per-plane verdict, so the two walls
|
|
268
|
+
* read one decision, `isOpraUserScriptRun`). The CME per-script curation is CME evidence and does not apply
|
|
264
269
|
* there; a book-reading official is refused by the options mode (OPRA has no
|
|
265
270
|
* book), not by this wall.
|
|
266
271
|
*/
|
|
@@ -291,7 +296,7 @@ export function isKScriptDisplayBlockedOnExchange(exchange, settings) {
|
|
|
291
296
|
* rejections, and a policy block is a standing state, not an incident.
|
|
292
297
|
*/
|
|
293
298
|
export function shouldBlockKScriptSourcePayload(args) {
|
|
294
|
-
// The data wall's per-plane verdict: an OPRA source a
|
|
299
|
+
// The data wall's per-plane verdict: an OPRA source is served to a first-party run only (`isOpraUserScriptRun`).
|
|
295
300
|
const blocked = isUserKScriptBlockedOnExchange(args.payloadExchange, args.settings) ||
|
|
296
301
|
(payloadReadsOpraPlane(args.payload) && !isOpraReadableKScriptRun(args.settings));
|
|
297
302
|
if (!blocked)
|
|
@@ -303,7 +308,8 @@ const ENGINE_GOVERNED_EXCHANGES = Object.freeze([
|
|
|
303
308
|
...CME_GOVERNED_EXCHANGES,
|
|
304
309
|
...OPRA_GOVERNED_EXCHANGES,
|
|
305
310
|
]);
|
|
306
|
-
/** The CME family alone: the set a user run
|
|
311
|
+
/** The CME family alone: the set a user run OPRA is open to would be denied (none while `isOpraUserScriptRun` is
|
|
312
|
+
* closed). */
|
|
307
313
|
const ENGINE_CME_GOVERNED_EXCHANGES = Object.freeze([...CME_GOVERNED_EXCHANGES]);
|
|
308
314
|
export function buildKScriptDataAccessPolicy(settings) {
|
|
309
315
|
return {
|
|
@@ -5,12 +5,13 @@ import { type OmTargetMetadata } from './om-target.util.js';
|
|
|
5
5
|
* The frontend's market-kind vocabulary: TitanCharts' `MarketKind` union plus
|
|
6
6
|
* FE-owned kinds for governed CME venues (`'futures'`), HyperLiquid
|
|
7
7
|
* prediction markets (`'hip4'`), economic series (`'economic'`: FRED and
|
|
8
|
-
* the ECONOMICS catalog publishers, which the engine still knows as `'fred'`)
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* the ECONOMICS catalog publishers, which the engine still knows as `'fred'`),
|
|
9
|
+
* the crypto-wide indices (`'cryptoIndex'`: CRYPTOCAP's BTC.D, TOTAL, ...)
|
|
10
|
+
* and the perpetual venues that publish quotes, never trades (`'quotePerp'`:
|
|
11
|
+
* Variational, quote-perp.leaf). TitanCharts does not know these kinds;
|
|
12
|
+
* anything handed into the engine narrows through `toTitanMarketKind`.
|
|
12
13
|
*/
|
|
13
|
-
export type VenueMarketKind = Exclude<MarketKind, 'fred'> | 'economic' | 'futures' | 'hip4' | 'options' | 'cryptoIndex';
|
|
14
|
+
export type VenueMarketKind = Exclude<MarketKind, 'fred'> | 'economic' | 'futures' | 'hip4' | 'options' | 'cryptoIndex' | 'quotePerp';
|
|
14
15
|
/** Which wire path serves an economic series (see `economicSource`). */
|
|
15
16
|
export type EconomicSource = 'fred' | 'observation';
|
|
16
17
|
/**
|
|
@@ -127,15 +128,16 @@ export declare function checkIsForexCommodityOrFutures(exchange: string | undefi
|
|
|
127
128
|
* the engine's `'fred'` (single-value series treatment); `'cryptoIndex'`
|
|
128
129
|
* maps to `'crypto'`: the indices print 24/7 (about every 250 ms after a
|
|
129
130
|
* price move, every 5 s per coin) onto uniform bars from 1m up, the crypto
|
|
130
|
-
* treatment's own shape, gap policy included.
|
|
131
|
-
* the
|
|
131
|
+
* treatment's own shape, gap policy included. `'quotePerp'` maps to
|
|
132
|
+
* `'crypto'` too: its perpetuals quote around the clock onto uniform minute
|
|
133
|
+
* bars. FE-internal code always sees the honest venue kind.
|
|
132
134
|
*/
|
|
133
135
|
export declare function toTitanMarketKind(kind: VenueMarketKind): MarketKind;
|
|
134
136
|
/**
|
|
135
137
|
* True when TitanCharts must omit the dedicated 'volume' legend overlay:
|
|
136
|
-
* economic series, forex/commodity venues
|
|
137
|
-
* per-bar volume. Governed CME futures
|
|
138
|
-
* bars, so they keep it.
|
|
138
|
+
* economic series, forex/commodity venues, the crypto indices and the
|
|
139
|
+
* quote-priced perpetual venues ship no per-bar volume. Governed CME futures
|
|
140
|
+
* DO ship contracts volume on TRADE_AGG bars, so they keep it.
|
|
139
141
|
*/
|
|
140
142
|
export declare function venueOmitsVolumeOverlay(exchange: string | undefined | null): boolean;
|
|
141
143
|
export declare function checkIsDex(exchange: string | undefined | null): boolean;
|