gloomberb 0.19.4 → 0.19.6
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/package.json +3 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +86 -25
- package/src/api-client/equity-screener.ts +23 -0
- package/src/app/pane-runtime/index.tsx +2 -0
- package/src/app/pane-runtime/plugin-bindings.ts +10 -1
- package/src/app.tsx +63 -16
- package/src/cli/commands/command-utils.ts +4 -0
- package/src/cli/commands/market.ts +264 -33
- package/src/cli/commands/search.ts +22 -4
- package/src/cli/commands/ticker.ts +84 -39
- package/src/cli/currency-name-hint.ts +60 -0
- package/src/cli/glossary.ts +3 -3
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +25 -2
- package/src/cli/listing-arg.ts +12 -0
- package/src/cli/not-a-ticker.ts +5 -3
- package/src/cli/pane-functions/capabilities.ts +2 -0
- package/src/cli/pane-functions/catalog.ts +31 -5
- package/src/cli/pane-functions/function-help.ts +8 -5
- package/src/cli/pane-functions/headless.ts +11 -6
- package/src/cli/pane-functions/market-session.ts +6 -7
- package/src/cli/pane-functions/resolver.ts +75 -2
- package/src/cli/quote-answer.ts +9 -0
- package/src/cli/series-search.ts +4 -5
- package/src/cli/symbol-list.ts +54 -2
- package/src/cli/symbol-rows.ts +14 -2
- package/src/cli/ticker-resolution.ts +89 -20
- package/src/components/chart/composite/axis-overlays.tsx +60 -27
- package/src/components/chart/composite/composite-chart.tsx +118 -63
- package/src/components/chart/composite/cursor-source.ts +111 -0
- package/src/components/chart/composite/format.ts +168 -6
- package/src/components/chart/composite/legend.tsx +8 -4
- package/src/components/chart/composite/panel-bitmap.ts +28 -2
- package/src/components/chart/composite/panel-labels.ts +20 -1
- package/src/components/chart/composite/panel-surface.tsx +201 -92
- package/src/components/chart/composite/price-axis-labels.tsx +92 -46
- package/src/components/chart/composite/price-series.ts +31 -8
- package/src/components/chart/composite/scene.ts +154 -59
- package/src/components/chart/composite/series-axis-tags.tsx +4 -2
- package/src/components/chart/composite/time-axis.ts +30 -7
- package/src/components/chart/composite/time-scale.ts +211 -56
- package/src/components/chart/composite/types.ts +11 -1
- package/src/components/chart/composite/use-composite-chart-keyboard.ts +32 -12
- package/src/components/chart/curve/curve-surface.tsx +5 -2
- package/src/components/chart/curve/model.ts +4 -1
- package/src/components/chart/native/use-bitmap-metrics.ts +81 -0
- package/src/components/chart/static/series.ts +3 -0
- package/src/components/command-bar/commands/collection-list.ts +81 -0
- package/src/components/command-bar/commands/direct/index.ts +6 -0
- package/src/components/command-bar/commands/registry.ts +8 -0
- package/src/components/command-bar/layout-items/current-layout.ts +22 -1
- package/src/components/command-bar/layout-items/focused-pane.ts +22 -1
- package/src/components/command-bar/pane-templates/items.ts +19 -3
- package/src/components/command-bar/pane-templates/workflow.ts +5 -0
- package/src/components/command-bar/routes/root/results.ts +23 -3
- package/src/components/command-bar/routes/root/selection.ts +4 -2
- package/src/components/command-bar/routes/root/shortcut-feedback.ts +1 -1
- package/src/components/command-bar/routes/root/shortcut-items.ts +3 -4
- package/src/components/command-bar/routes/root/shortcuts.ts +58 -14
- package/src/components/command-bar/routes/root/ticker-first.ts +32 -0
- package/src/components/command-bar/surface/environment.ts +2 -0
- package/src/components/command-bar/view-model.ts +7 -0
- package/src/components/command-bar/workflow/ops.ts +2 -1
- package/src/components/command-bar/workflow/tickers.ts +20 -0
- package/src/components/layout/shell/active-drag.ts +38 -7
- package/src/components/layout/shell/drag/magnets.ts +106 -0
- package/src/components/layout/shell/menu.ts +15 -1
- package/src/components/layout/shell/pane/actions.ts +4 -0
- package/src/components/layout/shell/ticker-link-menu.ts +12 -3
- package/src/components/layout/status-bar.tsx +20 -0
- package/src/components/layout/window-controls.tsx +96 -35
- package/src/components/layout/window-fullscreen.ts +20 -0
- package/src/components/onboarding/onboarding-keyboard.ts +5 -1
- package/src/components/onboarding/onboarding-wizard.tsx +15 -4
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +8 -5
- package/src/components/onboarding/use-onboarding-progress.ts +20 -1
- package/src/components/price-sparkline/view.tsx +14 -6
- package/src/components/quote-flash.ts +36 -32
- package/src/components/ticker/badge/index.tsx +8 -4
- package/src/components/ticker/badge/list.tsx +23 -7
- package/src/components/ui/column-grid.tsx +8 -2
- package/src/components/ui/data-table/opentui/model.ts +4 -1
- package/src/components/ui/tabs.tsx +5 -2
- package/src/core/state/app/layout.ts +18 -3
- package/src/core/state/app/state.ts +2 -0
- package/src/core/state/app/types.ts +5 -0
- package/src/data/config/layout.ts +3 -0
- package/src/data/config/store/normalize.ts +39 -4
- package/src/i18n/es.ts +10 -0
- package/src/i18n/ja.ts +10 -0
- package/src/i18n/ko.ts +10 -0
- package/src/i18n/zh-cn.ts +10 -0
- package/src/i18n/zh-tw.ts +10 -0
- package/src/layout/pane-manager/floating-placement.ts +7 -4
- package/src/layout/pane-manager/floating.ts +5 -2
- package/src/market-data/bond-funds.ts +19 -0
- package/src/market-data/coordinator/events.ts +17 -1
- package/src/market-data/frame-scheduler.ts +47 -10
- package/src/market-data/frame-wake.ts +74 -0
- package/src/market-data/futures-board.ts +7 -6
- package/src/market-data/futures-contract.ts +14 -3
- package/src/market-data/hooks.tsx +12 -3
- package/src/market-data/market/freshness.ts +18 -0
- package/src/market-data/market/status.ts +15 -2
- package/src/market-data/performance.ts +78 -9
- package/src/market-data/request-types.ts +6 -3
- package/src/plugins/builtin/alerts/cli.ts +2 -1
- package/src/plugins/builtin/analytics/risk-evidence.ts +1 -0
- package/src/plugins/builtin/attention/evidence.ts +1 -1
- package/src/plugins/builtin/awards/client.ts +1 -1
- package/src/plugins/builtin/awards/evidence.ts +1 -1
- package/src/plugins/builtin/awards/pane.tsx +2 -1
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/index.tsx +1 -1
- package/src/plugins/builtin/bond-calculator/math.ts +1 -1
- package/src/plugins/builtin/bond-calculator/model.ts +14 -5
- package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/broker-manager/footer.ts +3 -2
- package/src/plugins/builtin/broker-manager/index.tsx +2 -1
- package/src/plugins/builtin/broker-manager/keyboard.ts +2 -1
- package/src/plugins/builtin/buildout/cells.tsx +25 -45
- package/src/plugins/builtin/buildout/detail/company.tsx +3 -3
- package/src/plugins/builtin/buildout/detail/index.tsx +1 -1
- package/src/plugins/builtin/buildout/detail/intel.tsx +4 -7
- package/src/plugins/builtin/buildout/detail/site.tsx +4 -4
- package/src/plugins/builtin/buildout/detail/ui.tsx +39 -38
- package/src/plugins/builtin/buildout/format.ts +23 -1
- package/src/plugins/builtin/buildout/model/types.ts +1 -0
- package/src/plugins/builtin/buildout/pane/index.tsx +2 -8
- package/src/plugins/builtin/buildout/table-model.ts +12 -4
- package/src/plugins/builtin/catalysts/evidence.ts +1 -1
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +1 -0
- package/src/plugins/builtin/cds/index.tsx +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +40 -1
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +28 -3
- package/src/plugins/builtin/cloud-tweets/table.tsx +3 -2
- package/src/plugins/builtin/comment-letters/client.ts +2 -1
- package/src/plugins/builtin/company-kpis/client.ts +1 -1
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -1
- package/src/plugins/builtin/company-kpis/screenshot-evidence.ts +3 -2
- package/src/plugins/builtin/correlation/headless.ts +3 -2
- package/src/plugins/builtin/cot/headless.ts +9 -3
- package/src/plugins/builtin/cot/model.ts +44 -3
- package/src/plugins/builtin/credit-documents/client.ts +1 -1
- package/src/plugins/builtin/credit-documents/evidence.ts +1 -1
- package/src/plugins/builtin/credit-documents/pane.tsx +2 -1
- package/src/plugins/builtin/crypto-board/pane.tsx +5 -4
- package/src/plugins/builtin/debt-maturities/headless.ts +11 -2
- package/src/plugins/builtin/debt-maturities/model.ts +66 -0
- package/src/plugins/builtin/debt-maturities/pane.tsx +23 -4
- package/src/plugins/builtin/earnings-calls/pane.tsx +1 -1
- package/src/plugins/builtin/earnings-ripple/index.tsx +6 -1
- package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +30 -6
- package/src/plugins/builtin/econ/fred-catalog.ts +5 -5
- package/src/plugins/builtin/econ/print-watch.ts +3 -1
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/criterion-editor.tsx +4 -16
- package/src/plugins/builtin/equity-screener/headless.ts +4 -2
- package/src/plugins/builtin/equity-screener/ideas.ts +67 -3
- package/src/plugins/builtin/equity-screener/model.ts +180 -12
- package/src/plugins/builtin/equity-screener/pane.tsx +52 -12
- package/src/plugins/builtin/equity-screener/screen-check.ts +7 -4
- package/src/plugins/builtin/equity-screener/watchlist.ts +33 -0
- package/src/plugins/builtin/futures/series.ts +16 -1
- package/src/plugins/builtin/futures-curve/client.ts +19 -0
- package/src/plugins/builtin/futures-curve/headless.ts +52 -13
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +77 -6
- package/src/plugins/builtin/futures-curve/pane.tsx +19 -3
- package/src/plugins/builtin/fx-matrix/headless.ts +4 -2
- package/src/plugins/builtin/fx-matrix/index.tsx +37 -3
- package/src/plugins/builtin/fx-matrix/pairs.ts +15 -0
- package/src/plugins/builtin/gpu/headless.ts +2 -1
- package/src/plugins/builtin/help/function-card.tsx +2 -1
- package/src/plugins/builtin/help/index.tsx +2 -1
- package/src/plugins/builtin/insider/display.ts +45 -6
- package/src/plugins/builtin/ipo-calendar/model.ts +2 -0
- package/src/plugins/builtin/iv-history/client.ts +2 -1
- package/src/plugins/builtin/iv-history/headless.ts +2 -1
- package/src/plugins/builtin/jobs/pages.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/headless.ts +2 -1
- package/src/plugins/builtin/macro-day/client.ts +41 -0
- package/src/plugins/builtin/macro-day/headless.ts +19 -9
- package/src/plugins/builtin/macro-day/model.ts +3 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +2 -1
- package/src/plugins/builtin/market-movers/index.tsx +4 -3
- package/src/plugins/builtin/members/client.ts +1 -1
- package/src/plugins/builtin/mna/distress/client.ts +1 -0
- package/src/plugins/builtin/mna/distress/headless.ts +1 -0
- package/src/plugins/builtin/mna/pane.tsx +4 -1
- package/src/plugins/builtin/options/market-reference.ts +1 -1
- package/src/plugins/builtin/options/open-interest-as-of.ts +3 -1
- package/src/plugins/builtin/options/view.tsx +2 -1
- package/src/plugins/builtin/options-calculator/evidence.ts +1 -1
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/csp-screen.ts +8 -4
- package/src/plugins/builtin/options-scenario/csp.ts +28 -9
- package/src/plugins/builtin/options-scenario/evidence.ts +5 -4
- package/src/plugins/builtin/options-scenario/pane.tsx +2 -1
- package/src/plugins/builtin/perps/client.ts +1 -1
- package/src/plugins/builtin/perps/pane.tsx +3 -1
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +17 -0
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +2 -1
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +7 -3
- package/src/plugins/builtin/portfolio-list/use-throttled-memo.ts +10 -19
- package/src/plugins/builtin/rate-path/headless.ts +24 -10
- package/src/plugins/builtin/research/analyst-model.ts +1 -0
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +2 -1
- package/src/plugins/builtin/research/event-model.ts +10 -3
- package/src/plugins/builtin/research/events-headless.ts +20 -2
- package/src/plugins/builtin/research/index.tsx +1 -0
- package/src/plugins/builtin/research/relative-valuation-currency.ts +1 -1
- package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -1
- package/src/plugins/builtin/research-search/command-bar-search.ts +3 -1
- package/src/plugins/builtin/research-search/snippet.ts +1 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +3 -2
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/sec/command-bar-search.ts +3 -2
- package/src/plugins/builtin/sec/fund-facts.ts +17 -1
- package/src/plugins/builtin/sec/index.tsx +8 -5
- package/src/plugins/builtin/sec/row-summaries.ts +28 -12
- package/src/plugins/builtin/shared/members-menu.tsx +103 -38
- package/src/plugins/builtin/short-interest/publications-model.ts +22 -1
- package/src/plugins/builtin/short-interest/publications-pane.tsx +13 -4
- package/src/plugins/builtin/short-interest/watch-client.ts +2 -1
- package/src/plugins/builtin/short-interest/watch-model.ts +1 -1
- package/src/plugins/builtin/social-mentions/client.ts +2 -1
- package/src/plugins/builtin/supply-chain/client.ts +1 -1
- package/src/plugins/builtin/supply-chain/evidence.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -1
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +1 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +24 -4
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +1 -1
- package/src/plugins/builtin/time-sales/client.ts +1 -0
- package/src/plugins/builtin/time-sales/pane.tsx +3 -2
- package/src/plugins/builtin/trace-bonds/client.ts +7 -4
- package/src/plugins/builtin/trace-bonds/index.tsx +1 -1
- package/src/plugins/builtin/vol-surface/client.ts +2 -1
- package/src/plugins/builtin/volatility/client.ts +6 -1
- package/src/plugins/builtin/volatility/headless.ts +0 -1
- package/src/plugins/builtin/yield-curve/curves.ts +15 -0
- package/src/plugins/builtin/yield-curve/headless.ts +9 -2
- package/src/plugins/builtin/yield-curve/index.tsx +5 -8
- package/src/plugins/host-modules.ts +22 -3
- package/src/plugins/host-smoke.ts +6 -3
- package/src/portfolio/collection-name.ts +19 -0
- package/src/portfolio/column-values.ts +76 -10
- package/src/renderers/browser/http-proxy-transport.ts +78 -8
- package/src/renderers/cloudflare/http-proxy.ts +13 -2
- package/src/renderers/cloudflare/proxy-session.ts +47 -24
- package/src/renderers/cloudflare/worker.ts +15 -2
- package/src/renderers/desktop/geometry.ts +279 -0
- package/src/renderers/desktop/screen-setup.ts +246 -0
- package/src/renderers/desktop/sequential-window-host.ts +179 -0
- package/src/renderers/desktop/test-utils.ts +71 -0
- package/src/renderers/desktop/window-controller.ts +433 -0
- package/src/renderers/desktop/window-host.ts +70 -0
- package/src/renderers/desktop/window-layouts.ts +630 -0
- package/src/renderers/dom/data-frames.ts +15 -4
- package/src/renderers/dom/host/box.tsx +204 -176
- package/src/renderers/dom/host/style.ts +49 -20
- package/src/renderers/dom/host/text.tsx +3 -2
- package/src/renderers/electrobun/bun/application-menu/click.ts +1 -0
- package/src/renderers/electrobun/bun/application-menu/index.ts +4 -1
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +19 -8
- package/src/renderers/electrobun/bun/desktop/backend.ts +322 -19
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +83 -61
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +29 -15
- package/src/renderers/electrobun/bun/desktop/initialization.ts +30 -11
- package/src/renderers/electrobun/bun/desktop/relaunch.ts +9 -1
- package/src/renderers/electrobun/bun/desktop/screen-setup-file.ts +55 -0
- package/src/renderers/electrobun/bun/desktop/state-broadcaster.ts +44 -8
- package/src/renderers/electrobun/bun/desktop/windows-script.ts +9 -6
- package/src/renderers/electrobun/bun/desktop/workspace/index.ts +298 -97
- package/src/renderers/electrobun/bun/desktop/workspace/requests.ts +44 -6
- package/src/renderers/electrobun/bun/index.ts +4 -97
- package/src/renderers/electrobun/bun/window/electrobun-window-host.ts +306 -0
- package/src/renderers/electrobun/bun/window/focus.ts +0 -25
- package/src/renderers/electrobun/bun/window/remembered-frame.ts +4 -82
- package/src/renderers/electrobun/bun/window/windows-native.ts +26 -1
- package/src/renderers/electrobun/shared/protocol.ts +50 -2
- package/src/renderers/electrobun/view/backend-rpc.ts +15 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +63 -3
- package/src/renderers/electrobun/view/main.tsx +13 -7
- package/src/renderers/electrobun/view/ui-host.tsx +7 -0
- package/src/renderers/electrobun/view/window-fullscreen.ts +10 -3
- package/src/series/fred-argument.ts +17 -0
- package/src/sources/provider-router/financial-routes.ts +7 -1
- package/src/sources/provider-router/index.ts +7 -1
- package/src/state/app/context/index.tsx +16 -2
- package/src/state/desktop-windows.ts +63 -0
- package/src/sync/other-window-tabs.ts +62 -0
- package/src/tickers/company-name-listing.ts +23 -3
- package/src/tickers/listing-fate.ts +147 -1
- package/src/tickers/terminal-codes.ts +5 -0
- package/src/time-series/price-units.ts +11 -0
- package/src/time-series/types.ts +6 -0
- package/src/types/config.ts +10 -1
- package/src/types/desktop-window.ts +71 -2
- package/src/types/financials.ts +4 -0
- package/src/types/headless.ts +19 -0
- package/src/types/plugin.ts +6 -0
- package/src/ui/host.tsx +2 -0
- package/src/ui/index.tsx +14 -13
- package/src/ui/same-props.ts +58 -0
- package/src/utils/cli-output.ts +33 -4
- package/src/utils/currency-names.ts +20 -0
- package/src/utils/currency-pair.ts +6 -0
- package/src/utils/exchange-rate-snapshot.ts +20 -2
- package/src/utils/format.ts +7 -2
- package/src/utils/futures-generic.ts +12 -0
- package/src/utils/fx-market-hours.ts +43 -0
- package/src/utils/http-proxy-upstream.ts +6 -2
- package/src/utils/plugin-proxy-hosts.json +0 -4
- package/src/utils/plugin-proxy-hosts.ts +22 -0
- package/src/utils/sec-filings.ts +7 -1
|
@@ -4,8 +4,8 @@ import type { HeadlessPaneColumn, HeadlessPaneDefinition, HeadlessPaneEntry, Hea
|
|
|
4
4
|
import { formatPercentRaw } from "../../../utils/format";
|
|
5
5
|
import { DATE_OPTION_EXAMPLES } from "../../../utils/calendar-date";
|
|
6
6
|
import { newestReportTime, oldestReportTime } from "../../../utils/utc-time";
|
|
7
|
-
import { fetchFuturesCurve, loadCurveSpot, loadCurveSpotBars, loadFuturesCurveAsOf } from "./client";
|
|
8
|
-
import { basisSpotSymbol, BASIS_CONVENTION, blankBasisNote, catalogueCurveUnit, curveAsOfDate, curveBasisPercent, curveBasisRows, curveChangeText, curveContractCode, curvePrice, curveRoundedPrice, curveSpotSource, curveSpreadLabel, curveTimestamp, curveNoTradeSince, curveUnitLabel, noTradeChangeNote, normalizeCurveRoot, shortDatedBasisNote, thinSpreadNotice, unpairedContractCount, unsupportedCurveRootMessage, type ContractBasis } from "./model";
|
|
7
|
+
import { fetchFuturesCurve, loadCurveSpot, loadCurveSpotBars, loadCurveSpotCloses, loadFuturesCurveAsOf } from "./client";
|
|
8
|
+
import { basisSpotSymbol, BASIS_CONVENTION, blankBasisNote, catalogueCurveUnit, curveAsOfDate, curveBasisPercent, curveBasisRows, curveChangeText, curveContractCode, curvePrice, curveReadsThirtySeconds, curveRoundedPrice, curveSpotSource, curveSpotPremium, curveSpreadLabel, curveTimestamp, curveNoTradeSince, curveUnitLabel, noTradeChangeNote, normalizeCurveRoot, shortDatedBasisNote, spotIndexSymbol, thinSpreadNotice, unpairedContractCount, unsupportedCurveRootMessage, type ContractBasis, type CurveSpotPremium } from "./model";
|
|
9
9
|
import { COMMODITIES_VIEW_STATE } from "../commodities-energy/view-state";
|
|
10
10
|
import { knownGapMessage } from "../../../cli/known-gaps";
|
|
11
11
|
|
|
@@ -91,6 +91,23 @@ const FRONT_SPREAD_FIELDS = ["label", "frontSymbol", "nextSymbol", "value", "ann
|
|
|
91
91
|
const GHOST_FIELDS = ["symbol", "expiration", "price", "asOf"];
|
|
92
92
|
/** The annualized roll yield reads as the percent it is (+32.36%); an export keeps the number. */
|
|
93
93
|
const ROLL_YIELD_FORMAT = { annualizedRollYield: (value: unknown) => typeof value === "number" ? formatPercentRaw(value) : "--" };
|
|
94
|
+
/** A Treasury root's prices read in 32nds in every section, as its contracts do; an export keeps the number. */
|
|
95
|
+
const thirtySecondsFormat = (root: string, key: string): Record<string, HeadlessPaneColumn["textFormat"]> => curveReadsThirtySeconds(root)
|
|
96
|
+
? { [key]: (value: unknown) => typeof value === "number" ? curvePrice(value, root) : "--" } : {};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Spot against the front contract, both marks of the curve's settlement
|
|
100
|
+
* session: the index close and the front settlement's premium to it.
|
|
101
|
+
*/
|
|
102
|
+
function spotPremiumEntries(premium: CurveSpotPremium, root: string): HeadlessPaneEntry[] {
|
|
103
|
+
return [
|
|
104
|
+
{ key: "spot", label: premium.label, value: premium.close,
|
|
105
|
+
formatted: premium.close == null ? "--" : `${premium.close.toFixed(2)}${premium.date ? `, ${premium.date} close` : ""}` },
|
|
106
|
+
{ key: "frontPremium", label: "Front premium", value: premium.premium,
|
|
107
|
+
formatted: premium.premium == null ? "--"
|
|
108
|
+
: `${curveChangeText(premium.premium, root)}${premium.frontSymbol ? `, ${curveContractCode(premium.frontSymbol)} settle less spot` : ""}` },
|
|
109
|
+
];
|
|
110
|
+
}
|
|
94
111
|
|
|
95
112
|
/** What one contract is: the terms a hedge is sized on, once rather than on every row, worded as `ticker` words them. */
|
|
96
113
|
function specEntries(data: FuturesCurvePayload): HeadlessPaneEntry[] {
|
|
@@ -100,18 +117,33 @@ function specEntries(data: FuturesCurvePayload): HeadlessPaneEntry[] {
|
|
|
100
117
|
const unit = catalogueCurveUnit(data.root);
|
|
101
118
|
return unit ? [{ key: "unit", label: "Unit", value: unit }] : [];
|
|
102
119
|
}
|
|
103
|
-
return
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
120
|
+
return [
|
|
121
|
+
...futuresSpecLines(spec).map((line) => {
|
|
122
|
+
const value = spec[line.key as keyof typeof spec];
|
|
123
|
+
return { key: line.key, label: line.label, value, ...line.value === String(value) ? {} : { formatted: line.value } };
|
|
124
|
+
}),
|
|
125
|
+
...curveReadsThirtySeconds(data.root) ? [TREASURY_DV01_ENTRY] : [],
|
|
126
|
+
];
|
|
107
127
|
}
|
|
108
128
|
|
|
129
|
+
/**
|
|
130
|
+
* A Treasury contract's DV01 is its cheapest-to-deliver note's divided by
|
|
131
|
+
* that note's conversion factor. CME publishes the factors, but not where they
|
|
132
|
+
* can be read, so the terms say how to size it rather than print a figure.
|
|
133
|
+
*/
|
|
134
|
+
const TREASURY_DV01_ENTRY: HeadlessPaneEntry = {
|
|
135
|
+
key: "dv01", label: "DV01", value: null,
|
|
136
|
+
formatted: "not published here; price the cheapest-to-deliver in fn YAS and divide its DV01 by its CME conversion factor",
|
|
137
|
+
};
|
|
138
|
+
|
|
109
139
|
export const futuresCurveHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
110
140
|
discovery: { aliases: ["CTM"], dataRequirements: ["Gloom Cloud futures curve endpoint"],
|
|
111
141
|
limitations: ["Listed-contract catalogues can be incomplete.", "Ghosts and percentiles use the same listed contracts.", "Cboe VIX is daily settlement.",
|
|
112
142
|
"Ann Basis is simple actual/365, each last trade against spot in the same minute, and noisy under 7 days to expiry."],
|
|
113
|
-
intents: ["futures basis trade", "cash and carry", "basis against spot"]
|
|
114
|
-
|
|
143
|
+
intents: ["futures basis trade", "cash and carry", "basis against spot"],
|
|
144
|
+
opens: [{ words: ["VX", "vix futures", "vix futures curve"], argument: "VIX" }] },
|
|
145
|
+
shape: "bundle", argument: { kind: "free-text", optional: true, placeholder: "root", description: "FUT root such as CL, ES, ZN or VX, or a CME crypto root (BTC, ETH, SOL, XRP). Defaults to ES.",
|
|
146
|
+
examples: ["VIX", "CL", "BTC"] },
|
|
115
147
|
// Only the pane reads the tab; the report always carries both.
|
|
116
148
|
options: [{ key: "tab", description: "Curve or the full contract table.", type: "enum",
|
|
117
149
|
values: [{ value: "curve" }, { value: "contracts", aliases: ["contract", "table"] }], defaultValue: "curve",
|
|
@@ -129,13 +161,17 @@ export const futuresCurveHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
129
161
|
const date = curveAsOfDate(args.options.date, new Date(), "--date");
|
|
130
162
|
// The archive keeps no spot history, so a past curve has no basis.
|
|
131
163
|
const spotSymbol = date ? null : basisSpotSymbol(root);
|
|
164
|
+
// VX reads against spot VIX's daily closes instead.
|
|
165
|
+
const indexSymbol = date ? null : spotIndexSymbol(root);
|
|
132
166
|
const now = Date.now();
|
|
133
167
|
// The quote names the spot and its feed; the one-minute bars price each trade's own minute.
|
|
134
|
-
const [data, spot, bars] = await Promise.all([
|
|
168
|
+
const [data, spot, bars, closes] = await Promise.all([
|
|
135
169
|
date ? loadFuturesCurveAsOf(root, date, ctx.apiClient) : fetchFuturesCurve(root, ctx.apiClient),
|
|
136
170
|
spotSymbol ? loadCurveSpot(spotSymbol, ctx.marketData, now) : null,
|
|
137
171
|
spotSymbol ? loadCurveSpotBars(spotSymbol, ctx.marketData, ctx.refresh === true) : null,
|
|
172
|
+
indexSymbol ? loadCurveSpotCloses(indexSymbol, ctx.marketData, ctx.refresh === true) : null,
|
|
138
173
|
]);
|
|
174
|
+
const spotPremium = closes ? curveSpotPremium(data, closes) : null;
|
|
139
175
|
const bases = spot && bars ? curveBasisRows(data.contracts, bars) : null;
|
|
140
176
|
const unit = curveUnitLabel(data);
|
|
141
177
|
const terms = specEntries(data);
|
|
@@ -148,7 +184,8 @@ export const futuresCurveHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
148
184
|
// A blank Change says why, as a blank basis does; a past curve has no session change to blank.
|
|
149
185
|
const changeNote = date ? null : noTradeChangeNote(data.contracts, data);
|
|
150
186
|
const thinSpread = thinSpreadNotice(data);
|
|
151
|
-
const notes = [...thinSpread ? [`${thinSpread}.`] : [], ...changeNote ? [changeNote] : [], ...basisNotes
|
|
187
|
+
const notes = [...thinSpread ? [`${thinSpread}.`] : [], ...changeNote ? [changeNote] : [], ...basisNotes,
|
|
188
|
+
...spotPremium?.reason ? [`Front premium blank: ${spotPremium.reason}.`] : []];
|
|
152
189
|
const columnOptions = { basis: !!bases, last: data.source !== "cboe", notice: data.contracts.some((row) => row.firstNotice) };
|
|
153
190
|
// Dated by the contracts' own quotes; the same-contract history rows are a year of context, not observations.
|
|
154
191
|
const quoted = data.contracts.map((row) => row.asOf);
|
|
@@ -162,16 +199,18 @@ export const futuresCurveHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
162
199
|
{ title: "Contracts", columns: contractColumns(root, data.settlementDate ?? null, columnOptions),
|
|
163
200
|
...bases ? { textColumns: contractColumns(root, data.settlementDate ?? null, { ...columnOptions, text: true }) } : {},
|
|
164
201
|
rows: data.contracts.map((row) => contractRow(row, data, root, !!date, bases?.get(row.symbol))) },
|
|
165
|
-
{ title: "Front spread", columns: fieldColumns(FRONT_SPREAD_FIELDS, data.slope, ROLL_YIELD_FORMAT), rows: [{ label: curveSpreadLabel(data.slope), ...data.slope, value: curveRoundedPrice(data.slope.value, root),
|
|
202
|
+
{ title: "Front spread", columns: fieldColumns(FRONT_SPREAD_FIELDS, data.slope, { ...ROLL_YIELD_FORMAT, ...thirtySecondsFormat(root, "value") }), rows: [{ label: curveSpreadLabel(data.slope), ...data.slope, value: curveRoundedPrice(data.slope.value, root),
|
|
166
203
|
annualizedRollYield: data.slope.annualizedRollYield == null ? null : Number(data.slope.annualizedRollYield.toFixed(2)),
|
|
167
204
|
percentile: rank(data.slope.percentile), rollPercentile: rank(data.slope.rollPercentile) }] },
|
|
205
|
+
...spotPremium ? [{ title: "Front vs spot", entries: spotPremiumEntries(spotPremium, root) }] : [],
|
|
168
206
|
...terms.length ? [{ title: "Contract terms", entries: terms }] : [],
|
|
169
|
-
...data.ghosts.map((ghost) => ({ title: `${ghost.label} same-contract history`, columns: fieldColumns(GHOST_FIELDS, ghost.points[0] ?? {}),
|
|
207
|
+
...data.ghosts.map((ghost) => ({ title: `${ghost.label} same-contract history`, columns: fieldColumns(GHOST_FIELDS, ghost.points[0] ?? {}, thirtySecondsFormat(root, "price")),
|
|
170
208
|
rows: ghost.points.map((point) => ({ ...point })) })),
|
|
171
209
|
],
|
|
172
210
|
errors: data.gaps,
|
|
173
211
|
...(notes.length ? { notes } : {}),
|
|
174
|
-
metadata: { ...data, quoteUnit: unit, ...(spot && bases ? { spot, basisBlankedUnpaired: unpairedContractCount(bases.values()) } : {}),
|
|
212
|
+
metadata: { ...data, quoteUnit: unit, ...(spot && bases ? { spot, basisBlankedUnpaired: unpairedContractCount(bases.values()) } : {}),
|
|
213
|
+
...(spotPremium ? { spotPremium } : {}), ...(args.argument ? {} : { defaultArgument: DEFAULT_ROOT }),
|
|
175
214
|
...(notices.length ? { notices } : {}),
|
|
176
215
|
complete: data.status === "available", percentileBasis: "Same-contract observations within one year; actual sample start/end retained" },
|
|
177
216
|
};
|
|
@@ -17,7 +17,7 @@ export const futuresCurveModule: PluginModule = {
|
|
|
17
17
|
}],
|
|
18
18
|
paneTemplates: [{ id: "futures-curve-pane", paneId: "futures-curve", label: "Futures Curve",
|
|
19
19
|
description: `Listed futures contracts, historical curves, roll yield and open interest including VIX and CME crypto futures, which add basis against spot: Ann Basis = ${BASIS_FORMULA}, simple actual/365.`,
|
|
20
|
-
keywords: ["ctm", "futures", "curve", "term structure", "contango", "backwardation", "roll", "basis", "basis trade", "carry", "annualised basis", "vix", "crude oil", "natural gas"],
|
|
20
|
+
keywords: ["ctm", "futures", "curve", "term structure", "contango", "backwardation", "roll", "basis", "basis trade", "carry", "annualised basis", "vix", "crude oil", "natural gas", "treasury futures", "dv01", "hedge ratio", "steepener", "flattener"],
|
|
21
21
|
shortcut: { prefix: "CTM", aliases: ["CT"], argKind: "text", argPlaceholder: "root", argOptional: true,
|
|
22
22
|
argOptions: () => CURVE_ROOTS },
|
|
23
23
|
headless: futuresCurveHeadless,
|
|
@@ -4,8 +4,10 @@ import { spanDigits } from "../../../components/chart-table";
|
|
|
4
4
|
import { compositeAxisTicks } from "../../../components/chart/composite/format";
|
|
5
5
|
import type { CompositeAxisDomain } from "../../../components/chart/composite/types";
|
|
6
6
|
import { FUTURES_CONTRACTS, futuresBoardContractForTicker, futuresContractByCode, tickDecimals } from "../../../market-data/futures-board";
|
|
7
|
+
import { futuresContractCode } from "../../../market-data/futures-contract";
|
|
7
8
|
import { contractMonthLabel } from "../../../utils/contract-month";
|
|
8
9
|
import { formatPercentileRank } from "../../../utils/format";
|
|
10
|
+
import { formatThirtySeconds } from "../../../market-data/market/format";
|
|
9
11
|
import { cryptoPairCoin, isFuturesSymbol } from "../shared/crypto-pair";
|
|
10
12
|
import { parseReportTime } from "../../../utils/utc-time";
|
|
11
13
|
import { zonedWallClockToUtcMs } from "../../../utils/zoned-date-time";
|
|
@@ -88,13 +90,17 @@ export function curveRootForTicker(ticker: unknown): string | null {
|
|
|
88
90
|
|
|
89
91
|
/**
|
|
90
92
|
* Treasury futures trade in fractions of a 32nd (ZT to 1/256, ZF 1/128, ZN
|
|
91
|
-
* 1/64, ZB and UB 1/32), so the catalogue leaves their tick unset.
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* 103.51562500, never 103.50 next to 103.515625.
|
|
93
|
+
* 1/64, ZB and UB 1/32), so the catalogue leaves their tick unset. Their
|
|
94
|
+
* prices read in 32nds (106-20\u00bd); a report's numbers keep the decimals the
|
|
95
|
+
* tick needs to stay exact (ZT 8, ZN 6), never float noise.
|
|
95
96
|
*/
|
|
96
97
|
const RATE_TICKS: Readonly<Record<string, number>> = { ZT: 1 / 256, ZF: 1 / 128, ZN: 1 / 64, ZB: 1 / 32, UB: 1 / 32 };
|
|
97
98
|
|
|
99
|
+
/** Whether a root's prices read in 32nds of par (the Treasury futures), not decimals. */
|
|
100
|
+
export function curveReadsThirtySeconds(root: string): boolean {
|
|
101
|
+
return RATE_TICKS[root] != null;
|
|
102
|
+
}
|
|
103
|
+
|
|
98
104
|
function curvePriceDecimals(root: string): number {
|
|
99
105
|
const rateTick = RATE_TICKS[root];
|
|
100
106
|
if (rateTick != null) return tickDecimals(rateTick);
|
|
@@ -105,6 +111,8 @@ function curvePriceDecimals(root: string): number {
|
|
|
105
111
|
|
|
106
112
|
export function curvePrice(value: number | null, root: string): string {
|
|
107
113
|
if (value == null) return "--";
|
|
114
|
+
// A Treasury future reads in 32nds, as `quote` and FUT write it: 106-20\u00bd, never 106.640625.
|
|
115
|
+
if (RATE_TICKS[root] != null) return formatThirtySeconds(Math.abs(value) < 1e-9 ? 0 : value);
|
|
108
116
|
const text = value.toFixed(curvePriceDecimals(root));
|
|
109
117
|
// A spread that rounds to zero is unsigned: 0.00, never -0.00.
|
|
110
118
|
return /[1-9]/.test(text) ? text : text.replace("-", "");
|
|
@@ -136,7 +144,7 @@ export function curveUnitLabel(data: Pick<FuturesCurvePayload, "root" | "spec" |
|
|
|
136
144
|
|
|
137
145
|
/** A contract as traders write it: GCZ26.CMX is GCZ26; a VX symbol stays as Cboe lists it. */
|
|
138
146
|
export function curveContractCode(symbol: string): string {
|
|
139
|
-
return
|
|
147
|
+
return futuresContractCode({ contract: null, contractSymbol: symbol });
|
|
140
148
|
}
|
|
141
149
|
|
|
142
150
|
/**
|
|
@@ -184,13 +192,26 @@ export function thinSpreadNotice(data: Pick<FuturesCurvePayload, "slope" | "cont
|
|
|
184
192
|
return reason ? `${curveSpreadLabel(data.slope)} is thin (${reason}): no contango or backwardation call` : null;
|
|
185
193
|
}
|
|
186
194
|
|
|
195
|
+
/**
|
|
196
|
+
* The grid a Treasury root's chart axis ticks on, in points: its own fraction
|
|
197
|
+
* of a 32nd, no finer than a quarter (ZT and ZF quarter 32nds, ZN half, ZB and
|
|
198
|
+
* UB whole 32nds), so a tick reads 104-25½, never 104-25.60. Undefined for a
|
|
199
|
+
* root quoted in decimals, whose axis steps 1, 2, 5.
|
|
200
|
+
*/
|
|
201
|
+
export function curveAxisGrid(root: string): number | undefined {
|
|
202
|
+
const tick = RATE_TICKS[root];
|
|
203
|
+
return tick == null ? undefined : Math.max(tick, 1 / 128);
|
|
204
|
+
}
|
|
205
|
+
|
|
187
206
|
/**
|
|
188
207
|
* Axis gridlines sit on round values, so they need no tick precision: one
|
|
189
208
|
* decimal count across the gutter, as many as the plotted range asks for and
|
|
190
209
|
* enough to keep every tick within a percent of that range. A span of hundreds
|
|
191
|
-
* of index points reads 7800, a VIX strip 18.5
|
|
210
|
+
* of index points reads 7800, a VIX strip 18.5. A Treasury axis reads in 32nds,
|
|
211
|
+
* its ticks on the root's grid (`curveAxisGrid`).
|
|
192
212
|
*/
|
|
193
213
|
export function curveAxisPrice(value: number, domain: CompositeAxisDomain, root: string): string {
|
|
214
|
+
if (RATE_TICKS[root] != null) return formatThirtySeconds(value);
|
|
194
215
|
const cap = curvePriceDecimals(root);
|
|
195
216
|
const tolerance = Math.abs(domain.max - domain.min) / 100;
|
|
196
217
|
const needed = (tick: number) => {
|
|
@@ -407,6 +428,56 @@ export function spotBarsFromHistory(points: readonly { date: Date | string | num
|
|
|
407
428
|
return [...byMinute].sort((a, b) => a[0] - b[0]).map(([minute, price]) => ({ minute, price }));
|
|
408
429
|
}
|
|
409
430
|
|
|
431
|
+
/**
|
|
432
|
+
* The cash index a settlement-only root's front contract is read against: VX
|
|
433
|
+
* against spot VIX. A root missing here shows no spot.
|
|
434
|
+
*/
|
|
435
|
+
const SPOT_INDEX_SYMBOLS: ReadonlyMap<string, { symbol: string; label: string }> = new Map([
|
|
436
|
+
["VX", { symbol: "^VIX", label: "Spot VIX" }],
|
|
437
|
+
]);
|
|
438
|
+
|
|
439
|
+
export function spotIndexSymbol(root: string): string | null {
|
|
440
|
+
return SPOT_INDEX_SYMBOLS.get(root)?.symbol ?? null;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Spot against the front contract: the index's close on the curve's
|
|
445
|
+
* settlement session and the front settlement's premium to it, so both are
|
|
446
|
+
* marks of one session and a live index is never read against an older
|
|
447
|
+
* settlement. `reason` says why a figure is blank.
|
|
448
|
+
*/
|
|
449
|
+
export interface CurveSpotPremium {
|
|
450
|
+
symbol: string;
|
|
451
|
+
label: string;
|
|
452
|
+
close: number | null;
|
|
453
|
+
/** The session of `close`, the curve's settlement date. */
|
|
454
|
+
date: string | null;
|
|
455
|
+
frontSymbol: string | null;
|
|
456
|
+
/** The front settlement less `close`, at the root's precision. */
|
|
457
|
+
premium: number | null;
|
|
458
|
+
reason: string | null;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/** The front contract's settlement less the index's close on the curve's settlement session. */
|
|
462
|
+
export function curveSpotPremium(data: Pick<FuturesCurvePayload, "root" | "contracts" | "slope" | "settlementDate">,
|
|
463
|
+
closes: readonly { date: Date | string | number; close: number }[]): CurveSpotPremium | null {
|
|
464
|
+
const index = SPOT_INDEX_SYMBOLS.get(data.root);
|
|
465
|
+
if (!index) return null;
|
|
466
|
+
const front = data.contracts.find((row) => row.symbol === data.slope.frontSymbol)
|
|
467
|
+
?? [...data.contracts].filter((row) => row.settlement != null).sort((a, b) => a.expiration.localeCompare(b.expiration))[0];
|
|
468
|
+
const date = data.settlementDate ?? null;
|
|
469
|
+
const bar = date ? closes.find((point) => {
|
|
470
|
+
const time = new Date(point.date).getTime();
|
|
471
|
+
return Number.isFinite(time) && new Date(time).toISOString().slice(0, 10) === date && positive(point.close);
|
|
472
|
+
}) : undefined;
|
|
473
|
+
const close = bar ? bar.close : null;
|
|
474
|
+
const settle = front ? front.settlement ?? front.price : null;
|
|
475
|
+
const premium = close != null && positive(settle) ? curveRoundedPrice(settle - close, data.root) : null;
|
|
476
|
+
const reason = !date ? "the curve has no settlement date" : close == null ? `no ${index.symbol} close on ${date}`
|
|
477
|
+
: premium == null ? "no front settlement" : null;
|
|
478
|
+
return { symbol: index.symbol, label: index.label, close, date, frontSymbol: front?.symbol ?? null, premium, reason };
|
|
479
|
+
}
|
|
480
|
+
|
|
410
481
|
/** The bar in `minute`, else the one nearest it; null when there are none. */
|
|
411
482
|
function nearestSpotBar(bars: readonly SpotBar[], minute: number): SpotBar | null {
|
|
412
483
|
let low = 0;
|
|
@@ -16,8 +16,8 @@ import { useAutoRefresh } from "../../../react/auto-refresh";
|
|
|
16
16
|
import { futuresSessionRefreshInterval } from "../shared/futures-session";
|
|
17
17
|
import { useResearchCloudSession } from "../shared/research-cloud-session";
|
|
18
18
|
import { useQuoteBoard } from "../shared/use-quote-board";
|
|
19
|
-
import { getCachedFuturesCurve, loadCurveSpotBars, loadFuturesCurve, loadFuturesCurveAsOf } from "./client";
|
|
20
|
-
import { BASIS_CONVENTION, basisSpotSymbol, blankBasisNote, curveAsOfDate, curveAxisPrice, curveBasisPercent, curveBasisRows, curveChangeText, curveContractChanges, curveContractCode, curvePrice, curveRank, curveSpot, curveSpotLabel, curveSpotSource, curveSpreadBasis, curveSpreadLabel, curveTimestamp, curveTitle, curveUnitLabel, DEFAULT_CURVE_HORIZON, futuresCurveSeries, newestQuote, noTradeChangeNote, normalizeCurveRoot, paneCurveRoot, shortDatedBasis, shortDatedBasisNote, sortCurveContracts, thinSpreadNotice, unsupportedCurveRootMessage, type CurveContractChanges, type CurveSpot } from "./model";
|
|
19
|
+
import { getCachedFuturesCurve, loadCurveSpotBars, loadCurveSpotCloses, loadFuturesCurve, loadFuturesCurveAsOf } from "./client";
|
|
20
|
+
import { BASIS_CONVENTION, basisSpotSymbol, blankBasisNote, curveAsOfDate, curveAxisGrid, curveAxisPrice, curveBasisPercent, curveBasisRows, curveChangeText, curveContractChanges, curveContractCode, curvePrice, curveRank, curveSpot, curveSpotLabel, curveSpotPremium, curveSpotSource, curveSpreadBasis, curveSpreadLabel, curveTimestamp, curveTitle, curveUnitLabel, DEFAULT_CURVE_HORIZON, futuresCurveSeries, newestQuote, noTradeChangeNote, normalizeCurveRoot, paneCurveRoot, shortDatedBasis, shortDatedBasisNote, sortCurveContracts, spotIndexSymbol, thinSpreadNotice, unsupportedCurveRootMessage, type CurveContractChanges, type CurveSpot } from "./model";
|
|
21
21
|
|
|
22
22
|
const TABS = [{ value: "curve", label: "Curve" }, { value: "contracts", label: "Contracts" }];
|
|
23
23
|
// One column order for every root. SETTLE is the exchange settlement for the
|
|
@@ -140,6 +140,12 @@ function FuturesCurveView({ width, height, focused, root, ownsTitle }: PaneProps
|
|
|
140
140
|
? (force: boolean) => loadCurveSpotBars(spotSymbol, assetData, force) : null,
|
|
141
141
|
[assetData, basisActive, spotSymbol, resource.updatedAt]);
|
|
142
142
|
const spotBars = useAsyncResource(barsLoader, { keepPreviousData: true });
|
|
143
|
+
// VX reads its front settlement against spot VIX's close on the same session, re-read whenever the curve is.
|
|
144
|
+
const indexSymbol = requestedDate ? null : spotIndexSymbol(root);
|
|
145
|
+
const closesLoader = useMemo(() => indexSymbol && assetData
|
|
146
|
+
? (force: boolean) => loadCurveSpotCloses(indexSymbol, assetData, force) : null,
|
|
147
|
+
[assetData, indexSymbol, resource.updatedAt]);
|
|
148
|
+
const spotCloses = useAsyncResource(closesLoader, { keepPreviousData: true });
|
|
143
149
|
// Until the first answer there is nothing to say: no reason, only blank cells.
|
|
144
150
|
const spot = useMemo(() => !basisActive || !spotSymbol || !spotState || spotState.loading && !spotState.quote ? null
|
|
145
151
|
: curveSpot(spotSymbol, spotState.quote, clock), [basisActive, clock, spotState, spotSymbol]);
|
|
@@ -171,6 +177,9 @@ function FuturesCurveView({ width, height, focused, root, ownsTitle }: PaneProps
|
|
|
171
177
|
const thin = data?.slope.state === "thin";
|
|
172
178
|
const spreadRank = data && !thin ? curveRank(data.slope.percentile, data.slope.samples) : null;
|
|
173
179
|
const thinSpread = data ? thinSpreadNotice(data) : null;
|
|
180
|
+
// Until the closes first answer there is nothing to say.
|
|
181
|
+
const spotPremium = useMemo(() => data && indexSymbol && spotCloses.data ? curveSpotPremium(data, spotCloses.data) : null,
|
|
182
|
+
[data, indexSymbol, spotCloses.data]);
|
|
174
183
|
const statItems: StatItem[] = data ? [
|
|
175
184
|
{ id: "roll", label: "Ann. roll yield", value: signedPercent(data.slope.annualizedRollYield),
|
|
176
185
|
...thin ? { tone: "warning" as const } : { detail: curveRank(data.slope.rollPercentile, data.slope.samples) } },
|
|
@@ -178,6 +187,13 @@ function FuturesCurveView({ width, height, focused, root, ownsTitle }: PaneProps
|
|
|
178
187
|
{ id: "spread", label: curveSpreadLabel(data.slope), value: data.slope.value == null ? "--" : curvePrice(data.slope.value, root),
|
|
179
188
|
...thin ? { tone: "warning" as const } : {},
|
|
180
189
|
detail: [data.slope.state, spreadBasis, spreadRank, slopeDate].filter(Boolean).join(" · ") },
|
|
190
|
+
...spotPremium ? [
|
|
191
|
+
{ id: "spot", label: spotPremium.label, value: spotPremium.close == null ? "--" : spotPremium.close.toFixed(2),
|
|
192
|
+
detail: spotPremium.date ? `${spotPremium.date.slice(5)} close` : undefined },
|
|
193
|
+
{ id: "premium", label: "Front premium", value: curveChangeText(spotPremium.premium, root),
|
|
194
|
+
...spotPremium.premium == null ? { tone: "warning" as const, detail: spotPremium.reason ?? undefined }
|
|
195
|
+
: { detail: spotPremium.frontSymbol ? `${curveContractCode(spotPremium.frontSymbol)} settle` : undefined } },
|
|
196
|
+
] : [],
|
|
181
197
|
...data.spec ? [{ id: "contract", label: "Contract", value: data.spec.size, detail: `tick ${futuresTickText(data.spec)}` }] : [],
|
|
182
198
|
] : [];
|
|
183
199
|
const { strip: tabStrip, rows: tabRows } = usePaneTabs({ tabs: TABS, activeValue: tab, onSelect: setTab, focused, dense: true, queryBarWidth: width });
|
|
@@ -260,7 +276,7 @@ function FuturesCurveView({ width, height, focused, root, ownsTitle }: PaneProps
|
|
|
260
276
|
const chart = strip ? {
|
|
261
277
|
render: (size: { width: number; height: number }) => <CurveSurface series={curves} width={size.width} height={size.height} display="chart"
|
|
262
278
|
caption={caption} xScale="linear" formatValue={formatValue} formatChange={formatChange}
|
|
263
|
-
formatAxisValue={(value, domain) => curveAxisPrice(value, domain, root)}
|
|
279
|
+
formatAxisValue={(value, domain) => curveAxisPrice(value, domain, root)} valueGrid={curveAxisGrid(root)}
|
|
264
280
|
selectedPointId={selectedId} onSelectedPointChange={setSelected} />,
|
|
265
281
|
minRows: curveSurfaceMinRows({ series: curves, width, caption }),
|
|
266
282
|
strip,
|
|
@@ -7,7 +7,7 @@ import { servedFromSavedCopy } from "../../../data/saved-copies";
|
|
|
7
7
|
import { fxPairObservation, fxRateObservations } from "../shared/fx-rate-freshness";
|
|
8
8
|
import { loadFxBoard, type FxLegReading } from "./client";
|
|
9
9
|
import { crossMovePercent } from "./direction";
|
|
10
|
-
import { formatRate, resolveCurrencies, type FxCurrency } from "./pairs";
|
|
10
|
+
import { FX_CURRENCY_KEYWORDS, formatRate, resolveCurrencies, type FxCurrency } from "./pairs";
|
|
11
11
|
import { FX_MATRIX_REPORT_OPTIONS, fxMatrixReportNotices } from "./settings";
|
|
12
12
|
|
|
13
13
|
const iso = (time: number | null | undefined) => time != null && Number.isFinite(time) ? new Date(time).toISOString() : null;
|
|
@@ -143,7 +143,9 @@ export const fxMatrixHeadless: HeadlessPaneDefinition<"rows"> = {
|
|
|
143
143
|
freshness: { source: "Gloom Cloud" },
|
|
144
144
|
describe: (args) => `FX Cross Rates | ${resolveCurrencies(args.options.currencies).join(" ")}`,
|
|
145
145
|
discovery: {
|
|
146
|
-
|
|
146
|
+
// A currency's code or name finds the board (`catalog yen`, `catalog chf`), and so do the safe havens it
|
|
147
|
+
// carries, the yen and the franc. Searched, never listed: the catalog's Keywords line stays short.
|
|
148
|
+
intents: ["fx", "forex", "currency", "cross rates", "exchange rates", "safe haven", ...FX_CURRENCY_KEYWORDS],
|
|
147
149
|
limitations: ["Indicative crosses through USD legs, whose observation times can differ."],
|
|
148
150
|
screenshotReadiness: "live-dom",
|
|
149
151
|
},
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
type PaneFooterSegment,
|
|
10
10
|
} from "../../../components";
|
|
11
11
|
import { handleRefreshKey } from "../../../components/data-table/table-pane";
|
|
12
|
+
import { createDataTableCsv } from "../../../components/data-table/export";
|
|
13
|
+
import { dropColumnsToFit } from "../../../components/ui/table-layout";
|
|
12
14
|
import { ageFooterSegment, savedCopyFooterSegment } from "../../../components/layout/pane/footer";
|
|
13
15
|
import { CountryFlag } from "../../../components/ui/country-flag";
|
|
14
16
|
import { getSharedMarketDataCoordinator } from "../../../market-data/coordinator";
|
|
@@ -46,6 +48,31 @@ const RATE_COLUMN_WIDTH = 10;
|
|
|
46
48
|
/** Snapshot rates reload at this pace while the feed is not carrying every leg. */
|
|
47
49
|
const FX_FALLBACK_REFRESH_MS = 60_000;
|
|
48
50
|
|
|
51
|
+
/**
|
|
52
|
+
* The board's columns for a pane `width` cells wide: whole currency columns
|
|
53
|
+
* give way from the right until the rest fit (`dropColumnsToFit`), the first
|
|
54
|
+
* currency always kept. A board with more rows than `height` holds keeps a
|
|
55
|
+
* cell for its scrollbar.
|
|
56
|
+
*/
|
|
57
|
+
function fxMatrixColumnsToFit<C extends DataTableColumn>(
|
|
58
|
+
columns: readonly C[], currencies: readonly string[], width: number, height: number,
|
|
59
|
+
): C[] {
|
|
60
|
+
const scrollbar = currencies.length + 1 > height ? 1 : 0;
|
|
61
|
+
return dropColumnsToFit(columns, Math.floor(width) - scrollbar, currencies.slice(1).reverse());
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** "1 column hidden" in the footer, the codes in its title, for a pane too narrow for every currency. */
|
|
65
|
+
export function fxHiddenColumnsSegment(hidden: readonly string[]): PaneFooterSegment {
|
|
66
|
+
const count = hidden.length;
|
|
67
|
+
return {
|
|
68
|
+
id: "hidden-columns",
|
|
69
|
+
// A capture keeps it, as a picture cannot scroll to the columns it left out.
|
|
70
|
+
capture: true,
|
|
71
|
+
title: `${hidden.join(", ")} ${count === 1 ? "is" : "are"} not shown as ${count === 1 ? "a column" : "columns"}: widen the pane`,
|
|
72
|
+
parts: [{ text: `${count} ${count === 1 ? "column" : "columns"} hidden`, tone: "muted" }],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
49
76
|
function FxMatrixPane({ focused, width, height }: PaneProps) {
|
|
50
77
|
const dataProvider = useAssetData();
|
|
51
78
|
const flagged = useUiCapabilities().nativePaneChrome === true;
|
|
@@ -181,7 +208,7 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
181
208
|
intervalMs: allLegsLive ? null : FX_FALLBACK_REFRESH_MS,
|
|
182
209
|
});
|
|
183
210
|
|
|
184
|
-
const
|
|
211
|
+
const allColumns = useMemo<DataTableColumn[]>(() => [
|
|
185
212
|
{ id: "base", label: "", width: flagged ? FLAGGED_BASE_COLUMN_WIDTH : BASE_COLUMN_WIDTH, align: "left" },
|
|
186
213
|
...currencies.map((currency) => ({
|
|
187
214
|
id: currency,
|
|
@@ -191,6 +218,10 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
191
218
|
headerLeading: flagged ? CURRENCY_FLAGS.get(currency) : undefined,
|
|
192
219
|
})),
|
|
193
220
|
], [currencies, flagged]);
|
|
221
|
+
// A pane too narrow for every currency drops whole columns from the right, never cutting a rate at its edge, and
|
|
222
|
+
// the footer says how many (a capture keeps it): each one's rates still read along its row. The first stays.
|
|
223
|
+
const columns = useMemo(() => fxMatrixColumnsToFit(allColumns, currencies, width, height), [allColumns, currencies, height, width]);
|
|
224
|
+
const hiddenCurrencies = currencies.length - (columns.length - 1);
|
|
194
225
|
|
|
195
226
|
const renderCell = useCallback((
|
|
196
227
|
row: FxCurrency,
|
|
@@ -240,13 +271,13 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
240
271
|
const updatedAgo = useUpdatedAgo(status.latestFetchedAt || null);
|
|
241
272
|
|
|
242
273
|
usePaneFooter(FX_MATRIX_PANE_ID, () => {
|
|
243
|
-
const info: PaneFooterSegment[] = [];
|
|
274
|
+
const info: PaneFooterSegment[] = hiddenCurrencies > 0 ? [fxHiddenColumnsSegment(currencies.slice(columns.length - 1))] : [];
|
|
244
275
|
if (status.loading > 0) info.push({ id: "loading", parts: [{ text: "loading", tone: "muted" }] });
|
|
245
276
|
if (statusText) info.push({ id: "rates", parts: [{ text: statusText, tone: status.stale || status.unknownTime || status.unavailable ? "warning" : "muted" }] });
|
|
246
277
|
if (savedAt != null) info.push(savedCopyFooterSegment("updated", savedAt));
|
|
247
278
|
else if (updatedAgo) info.push(ageFooterSegment(updatedAgo, { verb: "fetched" }));
|
|
248
279
|
return { info };
|
|
249
|
-
}, [savedAt, status.loading, statusText, updatedAgo]);
|
|
280
|
+
}, [columns.length, currencies, hiddenCurrencies, savedAt, status.loading, statusText, updatedAgo]);
|
|
250
281
|
|
|
251
282
|
return (
|
|
252
283
|
<DataTableView<FxCurrency>
|
|
@@ -263,6 +294,9 @@ function FxMatrixPane({ focused, width, height }: PaneProps) {
|
|
|
263
294
|
freezeFirstColumn
|
|
264
295
|
getExportMetadata={() => createFxExportMetadata(currencies, rates,
|
|
265
296
|
(currency) => rateEntries.get(currency))}
|
|
297
|
+
// An export carries every currency, the columns a narrow pane leaves out too.
|
|
298
|
+
exportCsv={() => createDataTableCsv({ columns: allColumns, items: dataProvider ? currencies : [], renderCell,
|
|
299
|
+
getExportMetadata: () => createFxExportMetadata(currencies, rates, (currency) => rateEntries.get(currency)) })}
|
|
266
300
|
items={dataProvider ? currencies : []}
|
|
267
301
|
sortColumnId={null}
|
|
268
302
|
sortDirection="asc"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { WORD_CURRENCY_CODES } from "../../../utils/currency-names";
|
|
2
|
+
|
|
1
3
|
/** The default board, in its default order. */
|
|
2
4
|
export const MAJOR_CURRENCIES = ["USD", "EUR", "GBP", "JPY", "CHF", "CAD", "AUD", "NZD"] as const;
|
|
3
5
|
|
|
@@ -15,6 +17,19 @@ export const FX_CURRENCIES = [
|
|
|
15
17
|
] as const;
|
|
16
18
|
export type FxCurrency = typeof FX_CURRENCIES[number];
|
|
17
19
|
|
|
20
|
+
/**
|
|
21
|
+
* The words a reader looks for the board by: the codes it carries (but those
|
|
22
|
+
* that are English words) and the names of its currencies, so `catalog yen`,
|
|
23
|
+
* `catalog chf` and `catalog "swiss franc"` find it. "cad" is a word too, yet
|
|
24
|
+
* in a market catalog it is the loonie far more often than not, so it still
|
|
25
|
+
* finds the board; only the fx line waits for CAD in capitals.
|
|
26
|
+
*/
|
|
27
|
+
export const FX_CURRENCY_KEYWORDS: readonly string[] = [
|
|
28
|
+
...FX_CURRENCIES.filter((code) => code === "CAD" || !WORD_CURRENCY_CODES.has(code)).map((code) => code.toLowerCase()),
|
|
29
|
+
"dollar", "euro", "yen", "pound", "sterling", "franc", "swiss franc", "loonie", "aussie", "kiwi", "yuan", "renminbi",
|
|
30
|
+
"krona", "krone", "won", "rupee", "rupiah", "ringgit", "baht", "peso", "rand", "lira", "zloty", "forint", "koruna", "shekel",
|
|
31
|
+
];
|
|
32
|
+
|
|
18
33
|
/** The flag each currency wears on the desktop and web; the euro is the EU's, not one member's. */
|
|
19
34
|
export const CURRENCY_FLAG_REGIONS: Record<FxCurrency, string> = {
|
|
20
35
|
USD: "US", EUR: "EU", GBP: "GB", JPY: "JP", CHF: "CH", CAD: "CA", AUD: "AU", NZD: "NZ",
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { quoteFreshnessFields } from "../shared/report-freshness";
|
|
10
10
|
import { countOf, freePreviewNote } from "../shared/free-preview";
|
|
11
11
|
import { getRegularSessionDisplay } from "../../../market-data/market/status";
|
|
12
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
12
13
|
|
|
13
14
|
const observationRow = (row: GpuObservation) => ({ gpu: gpuLabel(row), source: gpuSource(row), basis: gpuBasisLabel(row.basis),
|
|
14
15
|
price: row.pricePerGpuHr, availability: row.availability, observedAt: row.observedAt, effectiveAt: row.effectiveAt, provenance: row.provenance ?? "live", provenanceLabel: gpuProvenanceLabel(row, true),
|
|
@@ -98,7 +99,7 @@ export const gpuHeadless: HeadlessPaneDefinition<"bundle"> = {
|
|
|
98
99
|
const related = gpuEquityRows(rows, selected, !!board.access?.locked);
|
|
99
100
|
const histories = await loadGpuEquityHistory(ctx.marketData);
|
|
100
101
|
const equities = await Promise.all(related.map(async (row) => {
|
|
101
|
-
const quote = await ctx.marketData.getQuote(row.symbol, row.exchange).catch((
|
|
102
|
+
const quote = await ctx.marketData.getQuote(row.symbol, row.exchange).catch(logFailure("gpu.headless", "Load GPU equity quote failed", null));
|
|
102
103
|
const history = histories.find((entry) => entry.symbol === row.symbol);
|
|
103
104
|
// The regular session's last and move, as the pane's board shows them.
|
|
104
105
|
const headline = getRegularSessionDisplay(quote);
|
|
@@ -27,6 +27,7 @@ import { Box, Text, TextAttributes, useRendererHost } from "../../../ui";
|
|
|
27
27
|
import { useDialog, useDialogKeyboard, type AlertContext } from "../../../ui/dialog";
|
|
28
28
|
import { getSharedRegistry } from "../../registry";
|
|
29
29
|
import type { HelpFunction } from "./function-index";
|
|
30
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
30
31
|
|
|
31
32
|
export type FunctionHelpRequest =
|
|
32
33
|
/** `inAppDocs: false` where DOCS cannot open (a popped-out window). */
|
|
@@ -209,7 +210,7 @@ export function useFunctionHelpHost({ closeCommandBar }: { closeCommandBar: () =
|
|
|
209
210
|
content: (context: AlertContext) => (
|
|
210
211
|
<FunctionHelpCard {...context} fn={request.fn} width={width} compact={compact} inAppDocs={request.inAppDocs !== false} />
|
|
211
212
|
),
|
|
212
|
-
}).catch((
|
|
213
|
+
}).catch(logFailure("help.function-card", "Open function help card failed")).finally(() => {
|
|
213
214
|
openRef.current = false;
|
|
214
215
|
});
|
|
215
216
|
};
|
|
@@ -19,6 +19,7 @@ import { KeybindingsEditor } from "./keybindings-editor";
|
|
|
19
19
|
import { ShortcutTable, type ShortcutTableEntry } from "./shortcut-table";
|
|
20
20
|
import { resolveCommandShortcuts, resolveWindowTemplates } from "./shortcut-model";
|
|
21
21
|
import { badgeColumnWidth } from "./table-cells";
|
|
22
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
22
23
|
|
|
23
24
|
const HELP_TABS = [
|
|
24
25
|
{ label: "Basics", value: "basics" },
|
|
@@ -93,7 +94,7 @@ function HelpPane({ focused, width, height }: PaneProps) {
|
|
|
93
94
|
.then((next) => {
|
|
94
95
|
if (live) setPricing(next);
|
|
95
96
|
})
|
|
96
|
-
.catch((
|
|
97
|
+
.catch(logFailure("help", "Load Cloud pricing for help failed"));
|
|
97
98
|
return () => {
|
|
98
99
|
live = false;
|
|
99
100
|
};
|
|
@@ -46,16 +46,23 @@ function nameWord(word: string): string {
|
|
|
46
46
|
return word.split(/([-'\u2019])/).map((part) => /^[-'\u2019]$/.test(part) ? part : capitalizeWord(part)).join("");
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
/** A person's words split from the suffixes that follow the name ("JR", "III"). */
|
|
50
|
+
function splitPersonName(name: string): { words: string[]; suffixes: string[] } {
|
|
51
|
+
const parts = name.replace(/,/g, " ").split(/\s+/).filter(Boolean);
|
|
51
52
|
const suffixes: string[] = [];
|
|
52
|
-
const
|
|
53
|
-
|
|
53
|
+
const words: string[] = [];
|
|
54
|
+
parts.forEach((word, index) => {
|
|
54
55
|
const suffix = index > 0 ? PERSON_SUFFIXES[word.replace(/\./g, "").toUpperCase()] : undefined;
|
|
55
56
|
if (suffix) suffixes.push(suffix);
|
|
56
|
-
else
|
|
57
|
+
else words.push(word);
|
|
57
58
|
});
|
|
58
|
-
|
|
59
|
+
return { words, suffixes };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** `filing` reads "LAST FIRST MIDDLE", as an SEC filing conforms an owner; `natural` is already first-name-first. */
|
|
63
|
+
function formatPersonName(name: string, order: "filing" | "natural" = "filing"): string {
|
|
64
|
+
const { words: rest, suffixes } = splitPersonName(name);
|
|
65
|
+
if (order === "natural" || rest.length < 2) return [...rest.map(nameWord), ...suffixes].join(" ");
|
|
59
66
|
// SEC filings conform the reporting owner to "LAST FIRST MIDDLE".
|
|
60
67
|
let surnameLength = 1;
|
|
61
68
|
while (surnameLength < rest.length - 1 && SURNAME_PARTICLES.has(rest[surnameLength - 1]!.toLocaleLowerCase())) surnameLength += 1;
|
|
@@ -78,6 +85,38 @@ export function formatInsiderName(name: string): string {
|
|
|
78
85
|
.join("; ");
|
|
79
86
|
}
|
|
80
87
|
|
|
88
|
+
/** A name's words without initials, suffixes or case, in a fixed order: two spellings of one person share it. */
|
|
89
|
+
function nameKey(name: string): string {
|
|
90
|
+
return splitPersonName(name).words
|
|
91
|
+
.map((word) => word.replace(/[.,]+$/, "").toLocaleLowerCase())
|
|
92
|
+
.filter((word) => word.length > 1)
|
|
93
|
+
.sort()
|
|
94
|
+
.join(" ");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* A name typed freely on a form, such as the seller on a Form 144, which is
|
|
99
|
+
* as often "KEVAN PAREKH" as it is "COOK TIMOTHY D". A person already known
|
|
100
|
+
* from an insider form (`knownNames`, as those forms file them) is written as
|
|
101
|
+
* the Insider table writes them; a comma after the first word, or a trailing
|
|
102
|
+
* initial, marks filing order; any other name is taken as first-name-first
|
|
103
|
+
* and only has its case fixed.
|
|
104
|
+
*/
|
|
105
|
+
export function formatFreeformPersonName(name: string, knownNames: readonly string[] = []): string {
|
|
106
|
+
return name.split(";").map((part) => part.trim()).filter(Boolean)
|
|
107
|
+
.map((part) => {
|
|
108
|
+
if (isEntityName(part)) return part;
|
|
109
|
+
const key = nameKey(part);
|
|
110
|
+
const known = key ? knownNames.find((candidate) => nameKey(candidate) === key) : undefined;
|
|
111
|
+
if (known) return formatInsiderName(known);
|
|
112
|
+
const { words } = splitPersonName(part);
|
|
113
|
+
// "Cook, Timothy" and "COOK TIMOTHY D" put the surname first.
|
|
114
|
+
const surnameFirst = /^[^\s,]+,/.test(part) || (words.length > 1 && isInitial(words[words.length - 1]!));
|
|
115
|
+
return formatPersonName(part, surnameFirst ? "filing" : "natural");
|
|
116
|
+
})
|
|
117
|
+
.join("; ");
|
|
118
|
+
}
|
|
119
|
+
|
|
81
120
|
interface RoleRank {
|
|
82
121
|
label: string;
|
|
83
122
|
rank: number;
|
|
@@ -55,6 +55,7 @@ function venueToday(timeZone: string, now = new Date()): string {
|
|
|
55
55
|
try {
|
|
56
56
|
format = new Intl.DateTimeFormat("en-US", { timeZone, year: "numeric", month: "2-digit", day: "2-digit" });
|
|
57
57
|
} catch {
|
|
58
|
+
// Intentional ignore: a zone this runtime does not know reads the board at the local date.
|
|
58
59
|
format = null;
|
|
59
60
|
}
|
|
60
61
|
venueDays.set(timeZone, format);
|
|
@@ -145,6 +146,7 @@ function countryName(code: string): string {
|
|
|
145
146
|
regionNames ??= new Intl.DisplayNames(["en"], { type: "region" });
|
|
146
147
|
name = regionNames.of(code) ?? "";
|
|
147
148
|
} catch {
|
|
149
|
+
// Intentional ignore: a region the runtime cannot name leaves the search without a country name.
|
|
148
150
|
name = "";
|
|
149
151
|
}
|
|
150
152
|
countryNames.set(code, name);
|
|
@@ -7,6 +7,7 @@ import type { DataProvider } from "../../../types/data-provider";
|
|
|
7
7
|
import type { PricePoint } from "../../../types/financials";
|
|
8
8
|
import { realizedVolatilityCadenceIssue, rollingRealizedVolatility } from "../shared/volatility";
|
|
9
9
|
import { NO_FATE, type ListingFate } from "../../../tickers/listing-fate";
|
|
10
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
10
11
|
|
|
11
12
|
export type IvMethod = "quote-mid" | "trade-close";
|
|
12
13
|
/**
|
|
@@ -244,7 +245,7 @@ async function loadRealizedVolatilities(
|
|
|
244
245
|
try {
|
|
245
246
|
const entry = await dependencies.loadChart({ instrument, bufferRange: "1Y", granularity: "resolution", resolution: "1d" });
|
|
246
247
|
value = screenHv(resolveEntryValue(entry) ?? [], window);
|
|
247
|
-
} catch { value = null; }
|
|
248
|
+
} catch (error) { value = logFailure("iv-history.client", "Load screen price history failed", null)(error); }
|
|
248
249
|
result.set(instrument.symbol, value);
|
|
249
250
|
options.onValue?.(instrument.symbol, value);
|
|
250
251
|
}
|