@orangecharts/wrun-chart-host 0.16.0 → 0.18.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.
Files changed (69) hide show
  1. package/README.md +2 -0
  2. package/dist/constants/feature-flags.constants.d.ts +2 -9
  3. package/dist/constants/feature-flags.constants.js +20 -98
  4. package/dist/constants/feature-limits.constants.d.ts +2 -2
  5. package/dist/constants/feature-limits.constants.js +8 -6
  6. package/dist/constants/marketCapabilities.constants.d.ts +9 -0
  7. package/dist/constants/marketCapabilities.constants.js +39 -11
  8. package/dist/constants/typed-indicator-source.leaf.d.ts +7 -0
  9. package/dist/constants/typed-indicator-source.leaf.js +47 -0
  10. package/dist/constants/typed-session-history-venue.leaf.d.ts +7 -0
  11. package/dist/constants/typed-session-history-venue.leaf.js +9 -0
  12. package/dist/constants/typed-width-fold.leaf.d.ts +7 -5
  13. package/dist/constants/typed-width-fold.leaf.js +7 -5
  14. package/dist/host-env.d.ts +2 -0
  15. package/dist/host-ports.types.d.ts +12 -17
  16. package/dist/index.d.ts +2 -0
  17. package/dist/index.js +2 -0
  18. package/dist/interfaces/kscript-diagnostics.interface.d.ts +7 -0
  19. package/dist/interfaces/wrun-runtime.interface.d.ts +6 -3
  20. package/dist/market-data/venues/index.d.ts +128 -143
  21. package/dist/market-data/venues/index.js +2 -2
  22. package/dist/market-data/venues/stocks.d.ts +1 -1
  23. package/dist/market-data/venues/stocks.js +2 -4
  24. package/dist/settings-templates/indicator-fields.js +5 -0
  25. package/dist/utility/chart/cme-user-scripts-gate.util.d.ts +8 -8
  26. package/dist/utility/chart/cme-user-scripts-gate.util.js +8 -8
  27. package/dist/utility/chart/governed-lanes-gate.util.d.ts +6 -6
  28. package/dist/utility/chart/governed-lanes-gate.util.js +6 -6
  29. package/dist/utility/chart/index-mode-admission.util.js +9 -1
  30. package/dist/utility/chart/index-mode.util.d.ts +2 -2
  31. package/dist/utility/chart/index-mode.util.js +12 -6
  32. package/dist/utility/chart/index-otc.leaf.d.ts +50 -0
  33. package/dist/utility/chart/index-otc.leaf.js +86 -0
  34. package/dist/utility/chart/kscript-provenance-keys.util.js +6 -0
  35. package/dist/utility/chart/market-session-schedule.util.d.ts +19 -0
  36. package/dist/utility/chart/market-session-schedule.util.js +2 -1
  37. package/dist/utility/chart/marketKind.util.d.ts +10 -5
  38. package/dist/utility/chart/marketKind.util.js +39 -5
  39. package/dist/utility/chart/mixed-mode.util.d.ts +1 -0
  40. package/dist/utility/chart/server-built-bars.util.d.ts +4 -0
  41. package/dist/utility/chart/server-built-bars.util.js +18 -0
  42. package/dist/utility/market-events/market-events.util.js +3 -0
  43. package/dist/utility/scriptEditor/wrun-runtime-diagnostics.leaf.js +2 -0
  44. package/dist/utility/v2/v2-enums.leaf.js +2 -0
  45. package/dist/utility/wrun/sources/row-lanes/dark_pool.d.ts +2 -1
  46. package/dist/utility/wrun/sources/row-lanes/dark_pool.js +4 -3
  47. package/dist/utility/wrun/wrun-batched-marks.util.d.ts +6 -2
  48. package/dist/utility/wrun/wrun-batched-marks.util.js +37 -6
  49. package/dist/utility/wrun/wrun-chart-market-facts.util.d.ts +15 -8
  50. package/dist/utility/wrun/wrun-chart-market-facts.util.js +11 -8
  51. package/dist/utility/wrun/wrun-cme-root-specs.util.d.ts +10 -6
  52. package/dist/utility/wrun/wrun-cme-root-specs.util.js +19 -13
  53. package/dist/utility/wrun/wrun-dark-pool.util.js +1 -1
  54. package/dist/utility/wrun/wrun-declared-warmup.util.d.ts +1 -1
  55. package/dist/utility/wrun/wrun-live-intake.util.d.ts +3 -0
  56. package/dist/utility/wrun/wrun-live-intake.util.js +6 -0
  57. package/dist/utility/wrun/wrun-live-tick.util.js +5 -1
  58. package/dist/utility/wrun/wrun-market-size-defaults.leaf.js +40 -6
  59. package/dist/utility/wrun/wrun-market-size-defaults.util.d.ts +2 -2
  60. package/dist/utility/wrun/wrun-market-size-defaults.util.js +10 -8
  61. package/dist/utility/wrun/wrun-overlay-drivers.util.d.ts +3 -0
  62. package/dist/utility/wrun/wrun-overlay-run.util.d.ts +2 -0
  63. package/dist/utility/wrun/wrun-overlay-run.util.js +50 -14
  64. package/dist/utility/wrun/wrun-pin-venues.util.d.ts +3 -2
  65. package/dist/utility/wrun/wrun-pin-venues.util.js +6 -3
  66. package/dist/utility/wrun/wrun-run-health.util.js +1 -1
  67. package/dist/utility/wrun/wrun-session-composition.util.d.ts +3 -2
  68. package/dist/utility/wrun/wrun-session-composition.util.js +3 -2
  69. package/package.json +5 -5
@@ -23,9 +23,10 @@
23
23
  * (CME_ROOT_SPECS), an economic venue 6. A crypto venue settles
24
24
  * no kind on its own (it lists stock, ETF and metal perpetuals
25
25
  * too), so a coin there reads 1 once the row answers, 0 before.
26
- * point_value the CME contract's point value (CME_ROOT_SPECS, in the
27
- * quote currency; 0 for a root off the table and for an
28
- * option contract); 0 on ICE and
26
+ * point_value the CME contract's point value (CME_ROOT_SPECS: US
27
+ * dollars per whole point of the quoted price on every
28
+ * root, ZC 50 for a cent of corn; 0 for a root off the
29
+ * table and for an option contract); 0 on ICE and
29
30
  * PLATTS, whose multipliers the chart does not hold; 1 on every
30
31
  * other market the chart serves, all priced per unit (spot,
31
32
  * perpetuals, stocks, ETFs, forex, indices, metals, prediction
@@ -130,8 +131,10 @@ const US_LISTING_EXCHANGES = new Set([
130
131
  'CBOE.F',
131
132
  ]);
132
133
  /** om `packages/cli/src/shared/session-venues.ts` CME_FAMILY_EXCHANGES (the
133
- * chart's governed codes, isCmeGoverned, are all in it). */
134
- const CME_FAMILY_EXCHANGES = new Set([
134
+ * chart's governed codes, isCmeGoverned, are all in it). Exported read-only for
135
+ * the point value golden (src/fixtures/wrun-cme-point-values/golden.json), which
136
+ * states the venues a CME root's point value answers on. */
137
+ export const CME_FAMILY_EXCHANGES = new Set([
135
138
  'CME',
136
139
  'CME_MINI',
137
140
  'CBOT',
@@ -356,8 +359,8 @@ function cmeChainRoot(market) {
356
359
  * chart's own exchange and the venue table:
357
360
  *
358
361
  * CME a CME-governed chart reads the chain of its own root: the root's point value (CME_ROOT_SPECS, ES 50,
359
- * NQ 20) when the root is quoted in US dollars; a root off the table, or quoted in another unit (a CBOT
360
- * grain quotes US cents), is 0.
362
+ * NQ 20) when the root is priced in US dollars (wrunCmeRootDollarPointValue); a root off the table, or a
363
+ * CBOT grain (priced in US cents, kept off the dollar features), is 0.
361
364
  * OPRA a chart whose options list on OPRA (the venue table over the options seam's market, `optionsExchange`
362
365
  * else the chart's own: an OPRA contract chart, a US stock or ETF chart, a stock twin while the opra flag
363
366
  * is lit): 100.
@@ -976,7 +979,7 @@ function wrunMarketQuoteInDollars(market, venue, row, units) {
976
979
  *
977
980
  * - A CME Group contract counts contracts on the COIN arm (live-feed never multiplies a point-valued product), so its
978
981
  * unit is the instrument registry's point value, in US dollars per point (`warmWrunMarketTradeUnits`: ES 50, 6A
979
- * 100,000, a cents-quoted grain per cent, ZC 50 and ZL 600), the number the large-print writer prices the table's
982
+ * 100,000, a cents-priced grain per cent, ZC 50 and ZL 600), the number the large-print writer prices the table's
980
983
  * copies with. An option contract, or a contract the registry holds no point value for, cannot be priced.
981
984
  * - Every other market counts its base asset on the COIN arm (live-feed applied each instrument's contract multiplier
982
985
  * and its inverse flag), so its unit is the market facts' point value (1, `market.point_value()`; 0 on ICE and
@@ -11,8 +11,9 @@ import type { CmeExchangeDto } from '../../interfaces/cme-realtime.interface.js'
11
11
  export interface CmeRootSpec {
12
12
  /** What the contract trades (a futures contract reports its underlying's kind). */
13
13
  kind: WrunMarketKind;
14
+ /** US dollars per whole point of the quoted price, per contract, on every row (a cents-priced grain included). */
14
15
  pointValue: number;
15
- /** The quotation currency of the price the chart draws. */
16
+ /** The unit of the PRICE the chart draws (US cents on the CBOT grains): never a unit of `pointValue`. */
16
17
  quote: WrunMarketQuoteIsUsd;
17
18
  /** The CME Group exchange the root lists on (its contracts and its options). */
18
19
  exchange: CmeExchangeDto;
@@ -20,16 +21,19 @@ export interface CmeRootSpec {
20
21
  /** Read-only outside this module: the market facts, the paper venue and the session's dollar lane read it. */
21
22
  export declare const CME_ROOT_SPECS: Readonly<Record<string, Readonly<CmeRootSpec>>>;
22
23
  /**
23
- * The US dollars one contract of `root` is worth for one whole point of its quoted price: the root's point value
24
- * (CME_ROOT_SPECS) when the root is quoted in US dollars, so a print of `size` contracts at `price` is worth
25
- * size x price x this. Undefined for a root off the table and for one quoted in another unit (the CBOT grains quote US
26
- * cents): no dollar value is ever guessed.
24
+ * The US dollars one contract of `root` is worth for one whole point of its quoted price, for the DOLLAR FEATURES (the
25
+ * session's dollar lane, the live intake's dollar fold, the option multiplier): the root's point value
26
+ * (CME_ROOT_SPECS) when the root is priced in US dollars, so a print of `size` contracts at `price` is worth
27
+ * size x price x this. Undefined for a root off the table and for one priced in another unit (the CBOT grains, priced
28
+ * in US cents). That gate is a product decision, not a unit conversion: the point value is US dollars on every row,
29
+ * and the grains stay off these features until they are checked against real trades.
27
30
  */
28
31
  export declare function wrunCmeRootDollarPointValue(root: string | null | undefined): number | undefined;
29
32
  /**
30
33
  * The dollar point value of a market's contract (`wrunCmeRootDollarPointValue` of its root: NQ1! and NQZ6 read NQ, 20)
31
34
  * on a CME Group venue, where prints count contracts; null on a CME Group market none prices (an option contract, a
32
- * root off the table, a cents-quoted grain), so its contracts are never valued in dollars; undefined off the CME family,
35
+ * root off the table, a cents-priced grain: `wrunCmeRootDollarPointValue`), so its contracts are never valued in
36
+ * dollars there; undefined off the CME family,
33
37
  * whose prints this rule says nothing about.
34
38
  */
35
39
  export declare function wrunCmeDollarPointValue(market: {
@@ -16,6 +16,9 @@ export const CME_ROOT_SPECS = {
16
16
  '6B': { kind: 'forex', pointValue: 62_500, quote: 'usd', exchange: 'CME' }, // 62,500 pounds: fx/g10/british-pound
17
17
  '6J': { kind: 'forex', pointValue: 12_500_000, quote: 'usd', exchange: 'CME' }, // 12,500,000 yen: fx/g10/japanese-yen
18
18
  '6C': { kind: 'forex', pointValue: 100_000, quote: 'usd', exchange: 'CME' }, // 100,000 CAD: fx/g10/canadian-dollar
19
+ '6A': { kind: 'forex', pointValue: 100_000, quote: 'usd', exchange: 'CME' }, // 100,000 AUD: fx/g10/australian-dollar
20
+ '6S': { kind: 'forex', pointValue: 125_000, quote: 'usd', exchange: 'CME' }, // 125,000 CHF: fx/g10/swiss-franc
21
+ '6N': { kind: 'forex', pointValue: 100_000, quote: 'usd', exchange: 'CME' }, // 100,000 NZD: fx/g10/new-zealand-dollar
19
22
  // US Treasury futures, quoted in points of par (100): the face value / 100 per point.
20
23
  ZT: { kind: 'unknown', pointValue: 2_000, quote: 'usd', exchange: 'CBOT' }, // $200,000 face: interest-rates/us-treasury/2-year-us-treasury-note
21
24
  ZF: { kind: 'unknown', pointValue: 1_000, quote: 'usd', exchange: 'CBOT' }, // $100,000 face: interest-rates/us-treasury/5-year-us-treasury-note
@@ -37,14 +40,14 @@ export const CME_ROOT_SPECS = {
37
40
  SIL: { kind: 'metal', pointValue: 1_000, quote: 'usd', exchange: 'COMEX' }, // 1,000 troy ounces: metals/precious/1000-oz-silver
38
41
  HG: { kind: 'metal', pointValue: 25_000, quote: 'usd', exchange: 'COMEX' }, // 25,000 pounds: metals/base/copper
39
42
  MHG: { kind: 'metal', pointValue: 2_500, quote: 'usd', exchange: 'COMEX' }, // 2,500 pounds: metals/base/micro-copper
40
- // Grains (CBOT), quoted in US cents per bushel (soybean oil per pound), the unit the chart
41
- // draws (corn near 460): a whole point is one cent, worth the contract size in cents, and
42
- // the quote is US cents, not dollars (Pine reads `syminfo.currency` "USX" there).
43
- ZC: { kind: 'unknown', pointValue: 5_000, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels: agriculture/grains/corn
44
- ZW: { kind: 'unknown', pointValue: 5_000, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels: agriculture/grains/wheat
45
- KE: { kind: 'unknown', pointValue: 5_000, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels: agriculture/grains/kc-wheat
46
- ZS: { kind: 'unknown', pointValue: 5_000, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels: agriculture/oilseeds/soybean
47
- ZL: { kind: 'unknown', pointValue: 60_000, quote: 'other', exchange: 'CBOT' }, // 60,000 pounds: agriculture/oilseeds/soybean-oil
43
+ // Grains (CBOT), priced in US cents per bushel (soybean oil per pound), the unit the chart
44
+ // draws (corn near 460; Pine reads `syminfo.currency` "USX" there, so `quote` is 'other').
45
+ // A whole point is one cent: the contract size x $0.01, in US dollars like every row.
46
+ ZC: { kind: 'unknown', pointValue: 50, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels x $0.01: agriculture/grains/corn
47
+ ZW: { kind: 'unknown', pointValue: 50, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels x $0.01: agriculture/grains/wheat
48
+ KE: { kind: 'unknown', pointValue: 50, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels x $0.01: agriculture/grains/kc-wheat
49
+ ZS: { kind: 'unknown', pointValue: 50, quote: 'other', exchange: 'CBOT' }, // 5,000 bushels x $0.01: agriculture/oilseeds/soybean
50
+ ZL: { kind: 'unknown', pointValue: 600, quote: 'other', exchange: 'CBOT' }, // 60,000 pounds x $0.01: agriculture/oilseeds/soybean-oil
48
51
  // Cryptocurrency futures (CME), quoted in US dollars per coin.
49
52
  BTC: { kind: 'crypto', pointValue: 5, quote: 'usd', exchange: 'CME' }, // 5 bitcoin: cryptocurrencies/bitcoin/bitcoin
50
53
  MBT: { kind: 'crypto', pointValue: 0.1, quote: 'usd', exchange: 'CME' }, // 0.1 bitcoin: cryptocurrencies/bitcoin/micro-bitcoin
@@ -52,10 +55,12 @@ export const CME_ROOT_SPECS = {
52
55
  MET: { kind: 'crypto', pointValue: 0.1, quote: 'usd', exchange: 'CME' }, // 0.1 ether: cryptocurrencies/ether/micro-ether
53
56
  };
54
57
  /**
55
- * The US dollars one contract of `root` is worth for one whole point of its quoted price: the root's point value
56
- * (CME_ROOT_SPECS) when the root is quoted in US dollars, so a print of `size` contracts at `price` is worth
57
- * size x price x this. Undefined for a root off the table and for one quoted in another unit (the CBOT grains quote US
58
- * cents): no dollar value is ever guessed.
58
+ * The US dollars one contract of `root` is worth for one whole point of its quoted price, for the DOLLAR FEATURES (the
59
+ * session's dollar lane, the live intake's dollar fold, the option multiplier): the root's point value
60
+ * (CME_ROOT_SPECS) when the root is priced in US dollars, so a print of `size` contracts at `price` is worth
61
+ * size x price x this. Undefined for a root off the table and for one priced in another unit (the CBOT grains, priced
62
+ * in US cents). That gate is a product decision, not a unit conversion: the point value is US dollars on every row,
63
+ * and the grains stay off these features until they are checked against real trades.
59
64
  */
60
65
  export function wrunCmeRootDollarPointValue(root) {
61
66
  if (typeof root !== 'string')
@@ -69,7 +74,8 @@ export function wrunCmeRootDollarPointValue(root) {
69
74
  /**
70
75
  * The dollar point value of a market's contract (`wrunCmeRootDollarPointValue` of its root: NQ1! and NQZ6 read NQ, 20)
71
76
  * on a CME Group venue, where prints count contracts; null on a CME Group market none prices (an option contract, a
72
- * root off the table, a cents-quoted grain), so its contracts are never valued in dollars; undefined off the CME family,
77
+ * root off the table, a cents-priced grain: `wrunCmeRootDollarPointValue`), so its contracts are never valued in
78
+ * dollars there; undefined off the CME family,
73
79
  * whose prints this rule says nothing about.
74
80
  */
75
81
  export function wrunCmeDollarPointValue(market) {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The `dark_pool` row lane's identity and fetch (sources/row-lanes/dark_pool.ts loads this module inside them, so the
3
3
  * lane file on the boot path stays light). Both read the chart port (web: titan-charts):
4
- * - `wrunDarkPoolMarket(chart, { official })`: the Tape's market resolver under `us-equities-full` and the venue policy:
4
+ * - `wrunDarkPoolMarket(chart, { official })`: the Tape's market resolver under the venue policy:
5
5
  * the tape market on a US stock Trades chart, the venue policy's stop (a user run on a tape closed to scripting, on
6
6
  * either feed), the Price only stop, or null for a chart that reads no US stock tape;
7
7
  * - `wrunDarkPoolPrints(market, window, { signal })`: the window read (stock-tape-dark-pool-read.util
@@ -39,7 +39,7 @@
39
39
  * alone (the browser compile pipeline's stamp writer, which never writes a converging value), W is the same
40
40
  * arithmetic for both (`wrunHistoryWarmupBars`), and `wrunHistoryStampExactColumns` names the selector columns the
41
41
  * overlap proof compares exactly whatever the tolerance. Whether a chart honors a converging stamp is the overlay
42
- * run's question (`wrun-converging-prefix`, default off), never this reader's.
42
+ * run's question (`wrunConvergingPrefixOn`, signed-in sessions), never this reader's.
43
43
  */
44
44
  import type { WrunHistoryWarmup, WrunHistoryWarmupExact, WrunIndicatorMetadata } from '../../interfaces/wrun-runtime.interface.js';
45
45
  /**
@@ -217,6 +217,9 @@ export declare function wrunLiveOhlcvPoint(point: unknown): {
217
217
  * widen high/low, replace the close and ADD volume), bucketed by the chart
218
218
  * rule on the leg's own `market` (a WEEK bucket on its Monday, a CME Group
219
219
  * leg on the session lattice). Never mutates its inputs.
220
+ *
221
+ * Bars the server alone builds (`barsAreServerBuilt`: the index venue at one day and wider) are never folded: no live
222
+ * print may create or change one. A script on such a leg reads its newest bars again on every lane reconcile.
220
223
  */
221
224
  export declare function foldWrunLegCandleRows(base: ReadonlyArray<ArrayLike<number>>, points: readonly unknown[], intervalMs: number, market?: WrunLiveBucketMarket | null): FoldResult | null;
222
225
  /**
@@ -95,6 +95,7 @@ import { serverNowMs } from '../auth/server-clock.util.js';
95
95
  import { wrunRowLaneByKey } from './sources/row-lane-registry.js';
96
96
  import { wrunHostBarOf } from './wrun-tier-grid.util.js';
97
97
  import { barStartMs } from '../chart/calendar-interval.util.js';
98
+ import { barsAreServerBuilt } from '../chart/index-otc.leaf.js';
98
99
  import { getWrunOverlayLiveContext, onWrunOverlayLiveTeardown, } from './wrun-overlay-drivers.util.js';
99
100
  import { WRUN_TYPED_PINNED_SOURCES, wrunDeclaredSourceLanes, wrunLegRowHostBar, wrunLaneAcquisitionIntervalMs, wrunPinnedIntervalOf, } from './wrun-source-rows.util.js';
100
101
  import { getProfileBucketHeight, normalizeTicksPerBar } from '../../workers/utils/volume-profile.worker.util.js';
@@ -598,10 +599,15 @@ export function wrunLiveOhlcvPoint(point) {
598
599
  * widen high/low, replace the close and ADD volume), bucketed by the chart
599
600
  * rule on the leg's own `market` (a WEEK bucket on its Monday, a CME Group
600
601
  * leg on the session lattice). Never mutates its inputs.
602
+ *
603
+ * Bars the server alone builds (`barsAreServerBuilt`: the index venue at one day and wider) are never folded: no live
604
+ * print may create or change one. A script on such a leg reads its newest bars again on every lane reconcile.
601
605
  */
602
606
  export function foldWrunLegCandleRows(base, points, intervalMs, market) {
603
607
  if (!Number.isFinite(intervalMs) || intervalMs <= 0)
604
608
  return null;
609
+ if (barsAreServerBuilt(market?.exchange, intervalMs))
610
+ return null;
605
611
  const indexByTs = new Map();
606
612
  for (let at = 0; at < base.length; at += 1)
607
613
  indexByTs.set(Number(base[at][0]), at);
@@ -5638,7 +5638,11 @@ function publishWrunDebugTick(context, outputRows) {
5638
5638
  return;
5639
5639
  const store = wrunChartHostEnv().chart.chartStore();
5640
5640
  // The session's own console provenance (the run that installed it), never the chart's market now.
5641
- store.setIndicatorPrintOutputs(context.chartIndex, context.indicatorId, selectWrunDebugLines(context.metadata, outputRows), { opra: context.opraRead === true, ...(context.cmeRead === true ? { cme: true } : {}) });
5641
+ store.setIndicatorPrintOutputs(context.chartIndex, context.indicatorId, selectWrunDebugLines(context.metadata, outputRows), {
5642
+ opra: context.opraRead === true,
5643
+ ...(context.cmeRead === true ? { cme: true } : {}),
5644
+ ...(context.indexOtcRead === true ? { indexOtc: true } : {}),
5645
+ });
5642
5646
  }
5643
5647
  export function __resetWrunLiveTickForTests() {
5644
5648
  for (const state of tickStates.values()) {
@@ -116,12 +116,38 @@ const VOLUME_COLUMN = 5;
116
116
  const UNKNOWN_SIZE_UNIT = WRUN_MARKET_SIZE_UNITS.indexOf('unknown');
117
117
  const COINS_SIZE_UNIT = WRUN_MARKET_SIZE_UNITS.indexOf('coins');
118
118
  const CONTRACTS_SIZE_UNIT = WRUN_MARKET_SIZE_UNITS.indexOf('contracts');
119
+ /** A candle's length: the chart's interval, or where that is not known the smallest step between two of the candles
120
+ * (a step is never shorter than a candle). Infinity for rows with no step. */
121
+ function wrunCandleBarMs(rows, intervalMs) {
122
+ if (intervalMs !== undefined && Number.isFinite(intervalMs) && intervalMs > 0)
123
+ return intervalMs;
124
+ let smallest = Infinity;
125
+ for (let at = rows.length - 1; at > 0; at -= 1) {
126
+ const step = Number(rows[at][0]) - Number(rows[at - 1][0]);
127
+ if (step > 0 && step < smallest)
128
+ smallest = step;
129
+ }
130
+ return smallest;
131
+ }
132
+ /**
133
+ * What the step between two candles counts for on the market's own clock (BT-CLOSED-DAYS): the step less the whole
134
+ * days of its idle part, the time after the earlier candle closed. A market that closes for whole days (a weekend, a
135
+ * holiday) reopens that many days late: a stock's weekend counts as its weeknight, a futures weekend as its daily
136
+ * break, a day chart's Friday to Monday as one day. Idle time under a day stays whole (a quiet market's own time, a
137
+ * nightly close), and so does the day between two day candles (no idle part).
138
+ */
139
+ function wrunTradingClockStep(step, barMs) {
140
+ const idle = step - barMs;
141
+ return idle >= DAY_MS ? step - Math.floor(idle / DAY_MS) * DAY_MS : step;
142
+ }
119
143
  /**
120
144
  * A candle-volume measure per day, from the chart's own candles (ascending, the newest the forming one, which is left
121
145
  * out: its volume is partial): `barValue` of the closed candles opening in the 24 hours before the newest one's open,
122
146
  * summed and scaled to a day by the span they cover (a fine chart loads less than a day: 500 one-minute candles count
123
- * 499 minutes; a gap where nothing traded counts as covered time with no volume). One closed candle longer than a day
124
- * (1W, 1M) is prorated by its length, the gap to the next open held to `intervalMs`. Undefined when the closed candles
147
+ * 499 minutes; a gap where nothing traded counts as covered time with no volume). The 24 hours run on the market's
148
+ * own clock (`wrunTradingClockStep`): whole days it stood closed are no part of them, so the day read on a Monday
149
+ * morning is Friday afternoon and Monday morning, never Sunday. One closed candle longer than a day (1W, 1M) is
150
+ * prorated by its length, the gap to the next open held to the candle's length. Undefined when the closed candles
125
151
  * cover under an hour or hold no volume.
126
152
  */
127
153
  function wrunDailyCandleSum(rows, intervalMs, barValue) {
@@ -132,22 +158,30 @@ function wrunDailyCandleSum(rows, intervalMs, barValue) {
132
158
  const lastClosedOpen = Number(rows[last - 1][0]);
133
159
  if (!Number.isFinite(newestOpen) || !Number.isFinite(lastClosedOpen))
134
160
  return undefined;
135
- const barMs = intervalMs !== undefined && Number.isFinite(intervalMs) && intervalMs > 0 ? intervalMs : Infinity;
161
+ const barMs = wrunCandleBarMs(rows, intervalMs);
136
162
  const lastSpan = Math.min(newestOpen - lastClosedOpen, barMs);
137
163
  if (lastSpan > DAY_MS) {
138
164
  const volume = barValue(rows[last - 1]);
139
165
  return Number.isFinite(volume) && volume > 0 ? (volume * DAY_MS) / lastSpan : undefined;
140
166
  }
141
- const windowStart = newestOpen - DAY_MS;
167
+ // Walk back from the newest open, each candle placed by the clock time since it opened. The walk ends at the first
168
+ // candle that opened over a day before (the day is then whole), or at the oldest candle (the day is what they cover).
169
+ let covered = 0;
170
+ let whole = false;
142
171
  let volume = 0;
143
172
  for (let at = last - 1; at >= 0; at -= 1) {
144
- if (!(Number(rows[at][0]) >= windowStart))
173
+ const step = wrunTradingClockStep(Number(rows[at + 1][0]) - Number(rows[at][0]), barMs);
174
+ if (!(step >= 0 && covered + step <= DAY_MS)) {
175
+ whole = true;
145
176
  break;
177
+ }
178
+ covered += step;
146
179
  const bar = barValue(rows[at]);
147
180
  if (Number.isFinite(bar) && bar > 0)
148
181
  volume += bar;
149
182
  }
150
- const covered = newestOpen - Math.max(windowStart, Number(rows[0][0]));
183
+ if (whole)
184
+ covered = DAY_MS;
151
185
  if (!(covered >= HOUR_MS) || !(volume > 0))
152
186
  return undefined;
153
187
  return (volume * DAY_MS) / covered;
@@ -70,8 +70,8 @@ interface WrunMarketSizeChart {
70
70
  * now), and `isCurrent` says the run is still the overlay's own (its chart and mount stand). After each await, in the
71
71
  * task that keeps and writes, the chart still names that market (a switch during the directory's answer moves it, and
72
72
  * neither the mount nor the refusal attempt sees a switch), and the verdict that reads the candles reads them only
73
- * while they were loaded for it (`loadedMainIdentityOf`: the symbol pipeline stamps the new market's metadata before
74
- * its rows replace the old market's). A fact it cannot prove reads as a transient skip: no memo, no write.
73
+ * while they were loaded for it (the host's `mainRowsLoadedFor`: the symbol pipeline stamps the new market's metadata
74
+ * before its rows replace the old market's). A fact it cannot prove reads as a transient skip: no memo, no write.
75
75
  */
76
76
  export declare function reconcileWrunMarketSizeDefaults(args: {
77
77
  chartIndex: number;
@@ -247,8 +247,8 @@ function wrunMarketSizeUnprovenFacts(families) {
247
247
  * now), and `isCurrent` says the run is still the overlay's own (its chart and mount stand). After each await, in the
248
248
  * task that keeps and writes, the chart still names that market (a switch during the directory's answer moves it, and
249
249
  * neither the mount nor the refusal attempt sees a switch), and the verdict that reads the candles reads them only
250
- * while they were loaded for it (`loadedMainIdentityOf`: the symbol pipeline stamps the new market's metadata before
251
- * its rows replace the old market's). A fact it cannot prove reads as a transient skip: no memo, no write.
250
+ * while they were loaded for it (the host's `mainRowsLoadedFor`: the symbol pipeline stamps the new market's metadata
251
+ * before its rows replace the old market's). A fact it cannot prove reads as a transient skip: no memo, no write.
252
252
  */
253
253
  export async function reconcileWrunMarketSizeDefaults(args) {
254
254
  const { chartIndex, indicatorId, tc, meta, sheet, market, isCurrent } = args;
@@ -311,8 +311,8 @@ export async function reconcileWrunMarketSizeDefaults(args) {
311
311
  ? wrunMarketSizeFactsNow(families, {
312
312
  tc,
313
313
  chartMetadata: market.read() ?? undefined,
314
- identity: market.identity,
315
- loaded: dataFetching?.loadedMainIdentityOf(chartIndex) ?? null,
314
+ // The host's own answer, for the chart as it reads now (`keyed()`: still the keyed market).
315
+ rowsOwn: dataFetching?.mainRowsLoadedFor(chartIndex, market.read()) ?? false,
316
316
  ownCandles: formula === undefined,
317
317
  exchange,
318
318
  symbol,
@@ -477,12 +477,14 @@ function wrunChartFormulaOf(exchange, symbol, transformations) {
477
477
  * The facts of the keyed market, read in the caller's task once the chart is proven on that market: the size unit once
478
478
  * the directory placed it, the venue's candle volume unit (`ownCandles`: a formula chart's candles are no market's),
479
479
  * the market's dollar unit (the market facts, `wrunMarketDollarUnit`), and the chart's own candles while they were
480
- * loaded for the keyed market (`loaded`, the loaded-main identity, names its `identity`). Candles loaded for another
481
- * market are never read: the volume verdict that would read them reads `unproven` (the candles not yet the market's
482
- * own, never its own too few), and no carry prices with them. The option verdict reads no candles, so it stands then.
480
+ * loaded for the keyed market (`rowsOwn`: the host's answer, its data-fetching port's `mainRowsLoadedFor`; the package
481
+ * never compares the market's spelling with the loader's itself, since a US stock on Trades reads its tape's candles
482
+ * and the two never match there). Candles loaded for another market are never read: the volume verdict that would
483
+ * read them reads `unproven` (the candles not yet the market's own, never its own too few), and no carry prices with
484
+ * them. The option verdict reads no candles, so it stands then.
483
485
  */
484
486
  function wrunMarketSizeFactsNow(families, facts) {
485
- const rowsOwn = facts.loaded !== null && wrunChartMarketIdentity(facts.loaded) === facts.identity;
487
+ const { rowsOwn } = facts;
486
488
  const rows = rowsOwn && (families.volume !== undefined || families.coins !== undefined)
487
489
  ? wrunChartCandleRows(facts.tc)
488
490
  : [];
@@ -350,6 +350,9 @@ export interface WrunOverlayLiveContext {
350
350
  * chart, or one whose lanes read the CME plane): every debug line its ticks and reseeds publish states it. No
351
351
  * cloud frame raises it (the Cloud lane never reads CME). */
352
352
  cmeRead?: true;
353
+ /** The session reads the index and yield venue's data (the console provenance of the run that installed it,
354
+ * `computed.indexOtc`): every debug line its ticks and reseeds publish states it. No cloud frame raises it. */
355
+ indexOtcRead?: true;
353
356
  /** The delayed CME legs its legend names (the installing run's `computed.cmeDelayed`). */
354
357
  cmeDelayed?: ReadonlyArray<{
355
358
  symbol: string;
@@ -275,6 +275,8 @@ export declare function surfaceWrunRunFailureOnLegend(chartIndex: number, indica
275
275
  opra?: boolean;
276
276
  /** The same for the CME plane (`computed.cme`): its runtime trap row carries the CME mark. */
277
277
  cme?: boolean;
278
+ /** The same for the index and yield venue (`computed.indexOtc`): its runtime trap row carries the venue's mark. */
279
+ indexOtc?: boolean;
278
280
  /** The run's refusal context (the run pass builds it from the chart it ran on). */
279
281
  refusalContext?: WrunRefusalContext;
280
282
  /** The attempt token the run resolved before its first await; absent or null: no toast. */
@@ -201,7 +201,8 @@ import { awaitWrunChildOverlays, mountWrunChildOverlays, prepareWrunHeatmapWindo
201
201
  import { planWrunFormingPreRoll, planWrunIntrabarLegFetch, planWrunLegFetch, wrunClampedLegDiagnostics, wrunIntrabarServedNotes, wrunLegFetchReads, WRUN_COARSER_LEG_WARMUP_CANDLES, } from './wrun-leg-fetch.util.js';
202
202
  import { barEndMs, isCalendarIntervalLabel } from '../chart/calendar-interval.util.js';
203
203
  import { wrunCandlesLowAcross, wrunCoinTapeDayAsk, wrunCoinTapeWindow, wrunHeldCoinTapePriceLow, wrunPricedCoinTape, wrunTapeReadIdentity, WRUN_TAPE_COINS_DAY_INTERVAL, WRUN_TAPE_COINS_DAY_MS, } from './wrun-tape-coins.util.js';
204
- import { normalizeTransformations, selfTransformationToken } from '../common/transformations.util.js';
204
+ import { normalizeTransformations, selfTransformationToken, transformationsTouchVenue, } from '../common/transformations.util.js';
205
+ import { checkIsIndexOtc } from '../chart/index-otc.leaf.js';
205
206
  import { resolveWrunTapeAcquisition, WRUN_TAPE_COINS_UNPRICED_CODE, WRUN_TAPE_INTERVAL_UNSUPPORTED_CODE, WRUN_TAPE_TOO_MANY_TRADES_CODE, WRUN_TAPE_VALUE_UNPROVEN_CODE, wrunTapeAcquisitionFloor, wrunTapeFloorOf, wrunTapeFloorSettingWords, wrunTapeFloorSettings, wrunTapeFloorWords, wrunTapeLaneExtras, } from './wrun-tape-source.util.js';
206
207
  import { wrunChartSession, wrunLegCandleClose, wrunPrimaryRowBounds } from './wrun-leg-close.util.js';
207
208
  import { isWrunRowSourceTransientError, wrunRowBatchDeliveredSheet, wrunRowSourceSettingsLeftBy, } from './wrun-row-source.js';
@@ -526,6 +527,12 @@ export async function runWrunOverlayOnChart(target) {
526
527
  // is the output's provenance, never a permission).
527
528
  if (payloadTouchesCmeVenue(chartExchange))
528
529
  computed.cme = true;
530
+ // The same on the index and yield venue (`computed.indexOtc`): every run whose chart market, or a formula leg of
531
+ // it, is on the venue reads its candles, and the venue's licence is display only.
532
+ if (wrunTouchesIndexOtc(chartExchange) ||
533
+ transformationsTouchVenue(chartMetadata?.transformations, checkIsIndexOtc)) {
534
+ computed.indexOtc = true;
535
+ }
529
536
  // A run reading options decides its ONE options market here (derived-roots.util `decideWrunRunOptionsMarket`):
530
537
  // where the options list on OPRA (a stock, an OPRA contract, a known stock twin) or the overlay's last read was
531
538
  // OPRA's (its provenance stamp), it waits, bounded, for the `opra` flag the plane and its stop reasons are judged
@@ -843,6 +850,7 @@ export async function runWrunOverlayOnChart(target) {
843
850
  outputNames,
844
851
  opra: computed.opra === true,
845
852
  cme: computed.cme === true,
853
+ indexOtc: computed.indexOtc === true,
846
854
  refusalContext: refusal.ctx,
847
855
  token: refusalAttempt,
848
856
  isCurrent,
@@ -988,10 +996,19 @@ function assertWrunCmeStudyAuthCurrent(computed, indicatorId) {
988
996
  new WrunChartGoneError(`wrun overlay '${indicatorId}' was superseded during its run (cme-lanes)`));
989
997
  }
990
998
  }
991
- /** The console provenance a run's outputs carry (`setIndicatorPrintOutputs`): its OPRA fact always, its CME fact only
992
- * when set, so an output of a run that read no CME reads exactly as before. */
999
+ /** The console provenance a run's outputs carry (`setIndicatorPrintOutputs`): its OPRA fact always, its CME and index
1000
+ * venue facts only when set, so an output of a run that read neither reads exactly as before. */
993
1001
  function wrunRunOutputProvenance(computed) {
994
- return { opra: computed.opra === true, ...(computed.cme === true ? { cme: true } : {}) };
1002
+ return {
1003
+ opra: computed.opra === true,
1004
+ ...(computed.cme === true ? { cme: true } : {}),
1005
+ ...(computed.indexOtc === true ? { indexOtc: true } : {}),
1006
+ };
1007
+ }
1008
+ /** Whether a source exchange is on the index and yield venue (index-otc.leaf `checkIsIndexOtc`), in either form the
1009
+ * run head reads (a string, or the multi-exchange array: any leg on the venue). */
1010
+ function wrunTouchesIndexOtc(exchange) {
1011
+ return (Array.isArray(exchange) ? exchange : [exchange]).some((entry) => typeof entry === 'string' && checkIsIndexOtc(entry));
995
1012
  }
996
1013
  /** Whether a venue refusal is the display wall's (its painter stamped the one standing legend message, so the run
997
1014
  * adds no record, chip or console row of its own): every `WrunVenueBlockedError` but the strategy and the
@@ -1021,15 +1038,16 @@ export function wrunTrapRowWithReplayToken(trap, error, overlay) {
1021
1038
  details: { ...trap.details, trap: { ...record, token: parkWrunTrapSeed(seed, overlay.indicatorId) } },
1022
1039
  };
1023
1040
  }
1024
- /** A run's runtime trap row with the run's console provenance on it (`RuntimeDiagnostic.opra` and `.cme`): the row as
1025
- * it is for a run that read neither plane. */
1041
+ /** A run's runtime trap row with the run's console provenance on it (`RuntimeDiagnostic.opra`, `.cme` and
1042
+ * `.indexOtc`): the row as it is for a run that read none of them. */
1026
1043
  function wrunTrapRowWithProvenance(trap, provenance) {
1027
- if (provenance.opra !== true && provenance.cme !== true)
1044
+ if (provenance.opra !== true && provenance.cme !== true && provenance.indexOtc !== true)
1028
1045
  return trap;
1029
1046
  return {
1030
1047
  ...trap,
1031
1048
  ...(provenance.opra === true ? { opra: true } : {}),
1032
1049
  ...(provenance.cme === true ? { cme: true } : {}),
1050
+ ...(provenance.indexOtc === true ? { indexOtc: true } : {}),
1033
1051
  };
1034
1052
  }
1035
1053
  /**
@@ -1287,6 +1305,12 @@ function wrunPinReadsCme(market) {
1287
1305
  return false;
1288
1306
  return wrunPinMarketsOf(market.exchange ?? '', market.symbol ?? '').some((leg) => payloadTouchesCmeVenue(leg.exchange));
1289
1307
  }
1308
+ /** Whether a pin names a market on the index and yield venue (`wrunPinReadsOpra`'s twin, index-otc.leaf). */
1309
+ function wrunPinReadsIndexOtc(market) {
1310
+ if (market === undefined)
1311
+ return false;
1312
+ return wrunPinMarketsOf(market.exchange ?? '', market.symbol ?? '').some((leg) => checkIsIndexOtc(leg.exchange));
1313
+ }
1290
1314
  /**
1291
1315
  * Whether the sheet a run reads (its settings painted, its lane demand applied) pins a CME market: a secondary input's
1292
1316
  * pinned market (an ohlcv or leg-stream pin, a trades leg, a coin leg's venue) on the CME plane (`wrunPinReadsCme`), or
@@ -2914,7 +2938,7 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
2914
2938
  // context exists (D4): the run starts with a hidden head of W candles before its first landed row (a clamped
2915
2939
  // window's head included), the chart's own candles asked through the main candle request. Any `history_warmup`
2916
2940
  // key reaches the verdict (a torn stamp answers `warmup-invalid` there, never reads as no stamp; a converging one
2917
- // reads as no stamp there before anything else while `wrun-converging-prefix` is off, so no head is planned), and W
2941
+ // reads as no stamp there before anything else for a guest session, so no head is planned), and W
2918
2942
  // reads the settings the package computes with (`wrunWarmupSettings`: a run at another interval, and a twin whose
2919
2943
  // Timeframe is at or below the chart's, take their chart arm, as the init args below send them).
2920
2944
  const warmupVerdict = target.metadata.history_warmup === undefined
@@ -3291,7 +3315,8 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
3291
3315
  // a stock listing: wrun_pin_venue_unknown, a failed run, whether the sheet,
3292
3316
  // a default or a saved pick names it); a pin on an index venue the
3293
3317
  // gateway serves no series for to
3294
- // scripts yet (POLYGON_INDICES) is not servable, but it is no reason to
3318
+ // scripts yet (WRUN_PIN_UNSERVED_EXCHANGES: the index and yield venue)
3319
+ // is not servable, but it is no reason to
3295
3320
  // kill the run: it is SOFT-refused per input. The leg is never fetched,
3296
3321
  // never enters the live context (no reconcile asks for it), and every
3297
3322
  // input served off it reads its missing fill on every row (NaN under
@@ -3466,6 +3491,14 @@ async function prepareWrunSandboxRun(passTarget, tc, meta, refusal, computed, ow
3466
3491
  if (delayed !== undefined)
3467
3492
  computed.cmeDelayed = delayed;
3468
3493
  }
3494
+ // The same for a leg on the index and yield venue (`computed.indexOtc`): a leg the run admitted reads its data, on
3495
+ // any chart. A pin there is soft-refused today (`WRUN_PIN_UNSERVED_EXCHANGES`) and never asked; the mark stands
3496
+ // ready for the day the gateway serves it.
3497
+ if (legs.some((leg) => wrunPinReadsIndexOtc(leg.market)) ||
3498
+ tradeLegLanes.some((lane) => !softRefusedTradeLegs.has(lane) && wrunPinReadsIndexOtc(wrunTradesLegOf(lane))) ||
3499
+ pinnedLaneIds.some((lane) => !softRefusedPinnedLanes.has(lane) && wrunPinReadsIndexOtc(wrunPinnedLaneOf(lane)))) {
3500
+ computed.indexOtc = true;
3501
+ }
3469
3502
  const formingBarTs = live && replay === undefined && wrunLandsLegsOnBars(legs, tradeLegLanes)
3470
3503
  ? await wrunFormingBarTsOf(target.chartIndex, clock.intervalMs, chartMetadata)
3471
3504
  : null;
@@ -6659,6 +6692,7 @@ async function integrateWrunRunAsk(runTarget, tc, meta, refusal, computed, owner
6659
6692
  // The run's console provenance: every debug line the session's ticks and reseeds publish states it.
6660
6693
  ...(computed.opra === true ? { opraRead: true } : {}),
6661
6694
  ...(computed.cme === true ? { cmeRead: true } : {}),
6695
+ ...(computed.indexOtc === true ? { indexOtcRead: true } : {}),
6662
6696
  // The delayed CME legs its legend names: every tick and reseed names them alike.
6663
6697
  ...(computed.cmeDelayed !== undefined ? { cmeDelayed: computed.cmeDelayed } : {}),
6664
6698
  // The current paint (above): the ticks and the reseeds keep the look.
@@ -7622,6 +7656,7 @@ async function integrateWrunRowSourceBatch(asked, tc, meta, refusal, computed, o
7622
7656
  // The run's console provenance: every debug line the session's ticks publish states it.
7623
7657
  ...(computed.opra === true ? { opraRead: true } : {}),
7624
7658
  ...(computed.cme === true ? { cmeRead: true } : {}),
7659
+ ...(computed.indexOtc === true ? { indexOtcRead: true } : {}),
7625
7660
  carrySeed: emptyWrunInputCarry(),
7626
7661
  fedBuckets: {},
7627
7662
  pushEligible: false,
@@ -9324,6 +9359,7 @@ export async function reseedWrunOverlayFromBuffers(indicatorId, reason, options
9324
9359
  await publishWrunDebugOutput(context.chartIndex, indicatorId, context.metadata, outputRows, {
9325
9360
  opra: context.opraRead === true,
9326
9361
  ...(context.cmeRead === true ? { cme: true } : {}),
9362
+ ...(context.indexOtcRead === true ? { indexOtc: true } : {}),
9327
9363
  });
9328
9364
  try {
9329
9365
  // The canvas fill (G1) for the session's market; a mirror entry that aged
@@ -12082,7 +12118,7 @@ function wrunWarmupStampCorroborated(module, sheet) {
12082
12118
  * reason) and the capability line, where it used to read as no stamp at all (the roster's silent `not-audited`); it
12083
12119
  * still corroborates nothing (no W reads off it, and the per-bar stamp refuses any sheet carrying the key). A record
12084
12120
  * of another kind is a later round's stamp and reads as no stamp, as it always has (`wrunHistoryWarmupOf`), and so
12085
- * does a converging one while its flag is off: every caller asks `wrunConvergingStampDark` first (R2-13). */
12121
+ * does a converging one for a guest session: every caller asks `wrunConvergingStampDark` first (R2-13). */
12086
12122
  function wrunWarmupStampTorn(sheet) {
12087
12123
  if (sheet === null || typeof sheet !== 'object')
12088
12124
  return false;
@@ -12094,11 +12130,11 @@ function wrunWarmupStampTorn(sheet) {
12094
12130
  const kind = raw.kind;
12095
12131
  return (kind === 'exact' || kind === 'converges') && wrunWarmupStampOf(sheet) === undefined;
12096
12132
  }
12097
- /** Whether the chart honors a converging warm-up stamp (`FeatureFlag.WrunConvergingPrefix`, STAMPS round A, default
12098
- * off); a host whose flag store is not up reads off. */
12133
+ /** Whether the chart honors a converging warm-up stamp: a signed-in session; a host without `user.isSignedIn`, or whose
12134
+ * session is not up, reads off. */
12099
12135
  function wrunConvergingPrefixOn() {
12100
12136
  try {
12101
- return wrunChartHostEnv().user.isFeatureOn(FeatureFlag.WrunConvergingPrefix);
12137
+ return wrunChartHostEnv().user.isSignedIn?.() === true;
12102
12138
  }
12103
12139
  catch {
12104
12140
  return false;
@@ -12109,7 +12145,7 @@ function wrunWarmupStampConverges(sheet) {
12109
12145
  const raw = sheet !== null && typeof sheet === 'object' ? sheet.history_warmup : undefined;
12110
12146
  return (raw !== null && typeof raw === 'object' && !Array.isArray(raw) && raw.kind === 'converges');
12111
12147
  }
12112
- /** A converging stamp its flag leaves unread (STAMPS round A, R2-13): while `wrun-converging-prefix` is off, a
12148
+ /** A converging stamp a guest session leaves unread (STAMPS round A, R2-13): while `wrunConvergingPrefixOn` is off, a
12113
12149
  * `converges` record of ANY shape reads as no stamp, exactly as an unknown kind always has (never torn, never
12114
12150
  * planned, never admitted), so the run, its head, its rows and its admission are today's. Asked first by every reader
12115
12151
  * that plans or admits on a stamp, before any other reading of it (the torn check included). */
@@ -4,8 +4,9 @@ import type { WrunUnservedLeg } from './wrun-run-health.util.js';
4
4
  import type { WrunPinnedLeg, WrunPinnedWire } from './wrun-source-rows.util.js';
5
5
  /** The venues the gateway serves no series for to scripts yet: a pin on one is soft-refused per
6
6
  * input with a `WRUN_LEG_UNSERVED` row naming why (never silently NaN). Remove a venue here the
7
- * moment the gateway lists it; nothing else gates it. */
8
- export declare const WRUN_PIN_UNSERVED_EXCHANGES: readonly ["POLYGON_INDICES"];
7
+ * moment the gateway lists it; nothing else gates it. POLYGON_INDICES is retired and stays: a
8
+ * script saved with a pin on it must keep reading unserved, never unknown. */
9
+ export declare const WRUN_PIN_UNSERVED_EXCHANGES: readonly ["POLYGON_INDICES", "INDICES_OTC"];
9
10
  /** A pin on a venue word the chart's lanes cannot ask (`wrunPinVenueVerdict` 'unknown'): the sheet
10
11
  * contract's code (om's WRUN_PIN_VENUE_UNKNOWN_CODE; the shared host this chart loads does not
11
12
  * carry it yet), refused before any fetch as a failed run. */
@@ -17,7 +17,8 @@
17
17
  * on a session venue (`wrun_pin_session_interval_unserved`: a 3d candle there groups trading days
18
18
  * and would be confirmed early). An own-market leg carries no `market` and is never a pin (the
19
19
  * display wall decides the chart's own venue, `isKScriptDisplayBlockedOnExchange`).
20
- * - An index venue (`WRUN_PIN_UNSERVED_EXCHANGES`: POLYGON_INDICES) is UNSERVED until the data
20
+ * - An index venue (`WRUN_PIN_UNSERVED_EXCHANGES`: the index and yield venue, and the retired
21
+ * POLYGON_INDICES so a saved pin on it stays unserved) is UNSERVED until the data
21
22
  * service serves index series to scripts (WRUN-CAPS-BACKEND-REQUEST.md, ask 2a: the directory
22
23
  * still holds the index rows out): the leg is soft-refused per input the way the lane refusals
23
24
  * are, never fetched, never in the live context, its inputs reading their missing fill while a
@@ -54,6 +55,7 @@ import { Exchange } from '@orangecharts/orange-v2-pb-common';
54
55
  import { delimiter } from '../../constants/data-source.constants.js';
55
56
  import { Intervals } from '../../constants/interval.constants.js';
56
57
  import { checkIsIndexMode } from '../chart/index-mode.util.js';
58
+ import { INDEX_OTC_EXCHANGES } from '../chart/index-otc.leaf.js';
57
59
  import { PUBLISHER_ONLY_EXCHANGES } from '../../constants/economic.constants.js';
58
60
  import { normalizeLegacyExchange } from '../chart/legacy-exchange.leaf.js';
59
61
  import { extractTokensFromTransformations, parsedTransformations } from '../common/transformations.util.js';
@@ -61,8 +63,9 @@ import { wrunChartHostEnv } from '../../host-env.js';
61
63
  import { attachWrunRefusal, wrunAuthorRuleSeed } from './wrun-refusal.util.js';
62
64
  /** The venues the gateway serves no series for to scripts yet: a pin on one is soft-refused per
63
65
  * input with a `WRUN_LEG_UNSERVED` row naming why (never silently NaN). Remove a venue here the
64
- * moment the gateway lists it; nothing else gates it. */
65
- export const WRUN_PIN_UNSERVED_EXCHANGES = ['POLYGON_INDICES'];
66
+ * moment the gateway lists it; nothing else gates it. POLYGON_INDICES is retired and stays: a
67
+ * script saved with a pin on it must keep reading unserved, never unknown. */
68
+ export const WRUN_PIN_UNSERVED_EXCHANGES = ['POLYGON_INDICES', ...INDEX_OTC_EXCHANGES];
66
69
  /** A pin on a venue word the chart's lanes cannot ask (`wrunPinVenueVerdict` 'unknown'): the sheet
67
70
  * contract's code (om's WRUN_PIN_VENUE_UNKNOWN_CODE; the shared host this chart loads does not
68
71
  * carry it yet), refused before any fetch as a failed run. */
@@ -117,7 +117,7 @@ export function wrunFeedMissingDiagnostics(feeds, ctx) {
117
117
  /** The technical words of one input on an unserved leg: the alerts engine's for the same refusal
118
118
  * (its wrun-input-plan), so a script reads one reason on every host. */
119
119
  function unservedInputMessage(input, leg) {
120
- return (`Input '${input}' pins ${leg.symbol} on ${leg.exchange}; index series (SPX, NDX, VIX, DJI) are not served yet: ` +
120
+ return (`Input '${input}' pins ${leg.symbol} on ${leg.exchange}; index and yield series are not served yet: ` +
121
121
  `the gateway holds ${leg.exchange} out of the market directory until the backend opens it, ` +
122
122
  `so the input reads its missing fill (NaN) on every bar.`);
123
123
  }