gloomberb 0.20.7 → 0.20.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +74 -0
- package/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/package.json +6 -1
- package/src/account/auth-model.ts +22 -0
- package/src/api-client/auth.ts +7 -2
- package/src/api-client/awards.ts +5 -0
- package/src/api-client/bond-trades.ts +22 -0
- package/src/api-client/catalysts.ts +11 -1
- package/src/api-client/data.ts +30 -6
- package/src/api-client/debt-maturities.ts +7 -0
- package/src/api-client/equity-screener.ts +17 -0
- package/src/api-client/errors.ts +2 -0
- package/src/api-client/exchange-announcements.ts +14 -7
- package/src/api-client/fund-facts.ts +21 -3
- package/src/api-client/futures-curve.ts +19 -2
- package/src/api-client/geo.ts +10 -0
- package/src/api-client/hiring.ts +2 -0
- package/src/api-client/index.ts +3 -0
- package/src/api-client/insider-signals.ts +14 -0
- package/src/api-client/members.ts +30 -2
- package/src/api-client/money-markets.ts +11 -1
- package/src/api-client/paths.ts +6 -1
- package/src/api-client/perps.ts +2 -0
- package/src/api-client/request.ts +2 -1
- package/src/api-client/socket.ts +7 -0
- package/src/api-client/types/econ.ts +2 -1
- package/src/api-client/types/filings-and-calls.ts +6 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/web-experiments.ts +5 -6
- package/src/app/runtime/update.ts +2 -1
- package/src/architecture/floating-promise-allowlist.json +33 -106
- package/src/capabilities/asset-data-inputs.ts +183 -0
- package/src/capabilities/factories.ts +8 -2
- package/src/cli/base-converter.ts +36 -2
- package/src/cli/commands/api.ts +2 -2
- package/src/cli/commands/command-utils.ts +18 -0
- package/src/cli/commands/hong-kong-movers.ts +50 -0
- package/src/cli/commands/market.ts +539 -130
- package/src/cli/commands/options-chain.ts +7 -1
- package/src/cli/commands/overview.ts +76 -14
- package/src/cli/commands/plugins.ts +7 -6
- package/src/cli/commands/search.ts +52 -9
- package/src/cli/commands/system.ts +15 -10
- package/src/cli/commands/ticker.ts +97 -44
- package/src/cli/content-figures.ts +45 -0
- package/src/cli/context.ts +5 -0
- package/src/cli/desktop-pane-shot-routes.ts +13 -4
- package/src/cli/desktop-pane-shot.ts +86 -12
- package/src/cli/earnings-calendar.ts +36 -5
- package/src/cli/export-source.ts +17 -3
- package/src/cli/fx-pair.ts +111 -11
- package/src/cli/glossary.ts +36 -2
- package/src/cli/help.ts +1 -1
- package/src/cli/history-export.ts +29 -11
- package/src/cli/history-rows.ts +130 -21
- package/src/cli/index.ts +8 -5
- package/src/cli/known-gaps.ts +45 -1
- package/src/cli/listing-arg.ts +366 -19
- package/src/cli/pane-functions/capabilities.ts +2 -2
- package/src/cli/pane-functions/catalog.ts +105 -9
- package/src/cli/pane-functions/data.ts +3 -2
- package/src/cli/pane-functions/discovery.ts +2 -0
- package/src/cli/pane-functions/dom.ts +46 -9
- package/src/cli/pane-functions/freshness.ts +7 -3
- package/src/cli/pane-functions/function-help.ts +9 -6
- package/src/cli/pane-functions/headless.ts +78 -6
- package/src/cli/pane-functions/index.ts +141 -23
- package/src/cli/pane-functions/options.ts +1 -3
- package/src/cli/pane-functions/plugin-code.ts +169 -0
- package/src/cli/pane-functions/report.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +69 -21
- package/src/cli/pane-functions/screenshot-assessment.ts +82 -3
- package/src/cli/pane-functions/screenshot-data-evidence.ts +3 -1
- package/src/cli/pane-functions/screenshot-types.ts +6 -0
- package/src/cli/quote-answer.ts +49 -2
- package/src/cli/registry.ts +42 -4
- package/src/cli/report-tables.ts +26 -6
- package/src/cli/result.ts +13 -2
- package/src/cli/series-search.ts +17 -7
- package/src/cli/statement-filings.ts +22 -8
- package/src/cli/symbol-args.ts +9 -0
- package/src/cli/symbol-cells.ts +6 -0
- package/src/cli/symbol-list.ts +14 -6
- package/src/cli/symbol-rows.ts +12 -5
- package/src/cli/ticker-resolution.ts +3 -2
- package/src/cli/unknown-command.ts +111 -14
- package/src/components/chart/composite/format.ts +15 -1
- package/src/components/chart/composite/legend.tsx +101 -47
- package/src/components/chart/composite/panel-labels.ts +4 -4
- package/src/components/chart/composite/panel-surface.tsx +4 -6
- package/src/components/chart/composite/scene/build.ts +180 -0
- package/src/components/chart/composite/scene/cursor.ts +226 -0
- package/src/components/chart/composite/scene/domain.ts +170 -0
- package/src/components/chart/composite/scene/markers.ts +115 -0
- package/src/components/chart/composite/scene/panels.ts +85 -0
- package/src/components/chart/composite/scene/points.ts +169 -0
- package/src/components/chart/composite/scene/projection.ts +105 -0
- package/src/components/chart/composite/scene/timeline.ts +71 -0
- package/src/components/chart/composite/scene.ts +12 -1066
- package/src/components/chart/composite/types.ts +4 -2
- package/src/components/chart/curve/model.ts +2 -2
- package/src/components/chart-table/axis.ts +18 -6
- package/src/components/command-bar/layout-items/focused-pane.ts +3 -0
- package/src/components/command-bar/list/model.ts +9 -0
- package/src/components/command-bar/pane-templates/items.ts +61 -15
- package/src/components/command-bar/pane-templates/workflow.ts +16 -5
- package/src/components/command-bar/routes/root/plugin-install.ts +7 -46
- package/src/components/command-bar/routes/root/provider-search.ts +8 -5
- package/src/components/command-bar/routes/root/results.ts +6 -1
- package/src/components/command-bar/routes/root/runtime.ts +1 -0
- package/src/components/command-bar/routes/root/shortcut-feedback.ts +4 -1
- package/src/components/command-bar/routes/ticker-search/actions.ts +7 -5
- package/src/components/command-bar/routes/ticker-search/results.ts +51 -3
- package/src/components/command-bar/view-model.ts +12 -0
- package/src/components/command-bar/workflow/ops.ts +21 -4
- package/src/components/command-bar/workflow/ticker-listing-picker.ts +3 -1
- package/src/components/command-bar/workflow/tickers.ts +6 -2
- package/src/components/data-table/view.tsx +46 -1
- package/src/components/form-modal/confirm.tsx +3 -2
- package/src/components/form-modal/content.tsx +3 -2
- package/src/components/form-modal/field-row.tsx +2 -0
- package/src/components/form-modal/host.tsx +18 -3
- package/src/components/form-modal/remote-reads.test-helpers.ts +34 -0
- package/src/components/index.ts +1 -1
- package/src/components/layout/pane/title.ts +21 -5
- package/src/components/layout/shell/pane/layers.tsx +20 -14
- package/src/components/layout/shell/pane-occlusion.ts +21 -0
- package/src/components/onboarding/desks-step.tsx +7 -1
- package/src/components/onboarding/onboarding-keyboard.ts +48 -6
- package/src/components/onboarding/onboarding-wizard.tsx +47 -8
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +17 -3
- package/src/components/onboarding/use-onboarding-progress.ts +57 -14
- package/src/components/onboarding/wizard-positions.ts +2 -0
- package/src/components/paged-rows.ts +11 -5
- package/src/components/ticker/list-table-view.tsx +24 -5
- package/src/components/toggle-list.tsx +44 -1
- package/src/components/ui/data-table/opentui/index.tsx +7 -6
- package/src/components/ui/data-table/opentui/model.ts +7 -3
- package/src/components/ui/data-table/types.ts +13 -2
- package/src/components/ui/fields.tsx +16 -4
- package/src/components/ui/page-stack-view.tsx +24 -6
- package/src/components/ui/query-bar.tsx +43 -9
- package/src/components/ui/table-layout.ts +56 -2
- package/src/core/app-services.ts +7 -2
- package/src/core/connection-health.ts +26 -0
- package/src/core/state/app/layout.ts +12 -4
- package/src/data/config/layout.ts +3 -1
- package/src/data/config/store/node.ts +4 -2
- package/src/docs/snapshot.json +756 -216
- package/src/i18n/es.ts +4 -1
- package/src/i18n/ja.ts +4 -1
- package/src/i18n/ko.ts +4 -1
- package/src/i18n/zh-cn.ts +4 -1
- package/src/i18n/zh-tw.ts +4 -1
- package/src/layout/pane-follow.ts +1 -1
- package/src/layout/pane-manager/gridlock.ts +18 -5
- package/src/layout/pane-manager/index.ts +1 -0
- package/src/layout/pane-manager/transient.ts +56 -0
- package/src/layout-marketplace/gallery.tsx +2 -1
- package/src/layout-marketplace/model.ts +4 -10
- package/src/market-data/commodity-names.ts +24 -0
- package/src/market-data/connection-follow.ts +9 -7
- package/src/market-data/coordinator/auxiliary.ts +4 -3
- package/src/market-data/coordinator/entries.ts +22 -1
- package/src/market-data/coordinator/financials.ts +2 -3
- package/src/market-data/coordinator/index.ts +67 -12
- package/src/market-data/coordinator/quotes.ts +2 -3
- package/src/market-data/fund-facts.ts +7 -1
- package/src/market-data/futures-board.ts +38 -4
- package/src/market-data/futures-contract.ts +5 -2
- package/src/market-data/futures-roll-returns.ts +226 -0
- package/src/market-data/fx-closes.ts +4 -1
- package/src/market-data/market/bar-period.ts +15 -0
- package/src/market-data/market/format.ts +4 -2
- package/src/market-data/market/freshness.ts +4 -0
- package/src/market-data/market/session-close-note.ts +41 -4
- package/src/market-data/market/status.ts +23 -3
- package/src/market-data/options-alternatives.ts +21 -9
- package/src/market-data/published-futures-sessions.ts +9 -0
- package/src/market-data/quotes/balance-sheet-rate.ts +34 -0
- package/src/market-data/quotes/delisting.ts +26 -2
- package/src/market-data/quotes/freshness.ts +62 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +254 -19
- package/src/market-data/quotes/regular-session-valuation.ts +8 -0
- package/src/market-data/realized-volatility.ts +3 -1
- package/src/market-data/request-types.ts +2 -0
- package/src/market-data/selectors.ts +1 -0
- package/src/news/aggregator.ts +3 -3
- package/src/plugins/builtin/account-management/delete-account.ts +78 -0
- package/src/plugins/builtin/account-management/pane.tsx +22 -19
- package/src/plugins/builtin/account-management/password-dialog.tsx +75 -0
- package/src/plugins/builtin/alerts/alert-log.ts +3 -2
- package/src/plugins/builtin/alerts/cli-forms.ts +1 -1
- package/src/plugins/builtin/alerts/cli.ts +72 -4
- package/src/plugins/builtin/alerts/format.ts +8 -2
- package/src/plugins/builtin/alerts/index.tsx +8 -5
- package/src/plugins/builtin/alerts/pane.tsx +5 -3
- package/src/plugins/builtin/alerts/research-builder.ts +12 -0
- package/src/plugins/builtin/analytics/index.tsx +3 -3
- package/src/plugins/builtin/analytics/risk-client.ts +14 -3
- package/src/plugins/builtin/analytics/risk-pane.tsx +3 -3
- package/src/plugins/builtin/attention/pane.tsx +1 -1
- package/src/plugins/builtin/attention/trending.tsx +1 -1
- package/src/plugins/builtin/awards/detail.tsx +4 -1
- package/src/plugins/builtin/awards/headless.ts +7 -3
- package/src/plugins/builtin/awards/model.ts +11 -0
- package/src/plugins/builtin/awards/pane.tsx +12 -5
- package/src/plugins/builtin/backtest/client.ts +16 -4
- package/src/plugins/builtin/backtest/headless.ts +2 -1
- package/src/plugins/builtin/backtest/pane.tsx +5 -3
- package/src/plugins/builtin/backtest/report.ts +22 -6
- package/src/plugins/builtin/backtest/window.ts +17 -9
- package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/broker-manager/sign-in-end.ts +1 -1
- package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
- package/src/plugins/builtin/buildout/company/pane.tsx +1 -1
- package/src/plugins/builtin/buildout/model/index.ts +2 -2
- package/src/plugins/builtin/catalysts/headless.ts +9 -6
- package/src/plugins/builtin/catalysts/model.ts +72 -10
- package/src/plugins/builtin/catalysts/pane.tsx +10 -7
- package/src/plugins/builtin/cds/pane.tsx +5 -3
- package/src/plugins/builtin/central-bank-rates/pane.tsx +3 -2
- package/src/plugins/builtin/chart-composer/catalog-series.ts +59 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -1
- package/src/plugins/builtin/chart-composer/headless.ts +104 -23
- package/src/plugins/builtin/chart-composer/index.tsx +6 -3
- package/src/plugins/builtin/chart-composer/legend-names.ts +19 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +37 -10
- package/src/plugins/builtin/chart-composer/presets.ts +63 -6
- package/src/plugins/builtin/chart-composer/roll-events.ts +38 -0
- package/src/plugins/builtin/chart-composer/series-catalog.ts +12 -5
- package/src/plugins/builtin/chart-composer/series-expression.ts +8 -4
- package/src/plugins/builtin/chart-composer/series-listings.ts +33 -9
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +2 -2
- package/src/plugins/builtin/clinical-trials/client.ts +13 -0
- package/src/plugins/builtin/clinical-trials/index.tsx +1 -1
- package/src/plugins/builtin/clinical-trials/pane.tsx +77 -27
- package/src/plugins/builtin/clinical-trials/search.ts +117 -0
- package/src/plugins/builtin/cloud/askg/conversation-store.ts +17 -6
- package/src/plugins/builtin/cloud/askg/lock-note.ts +4 -2
- package/src/plugins/builtin/cloud/askg/manifest.ts +3 -2
- package/src/plugins/builtin/cloud/askg/pane.tsx +2 -2
- package/src/plugins/builtin/cloud/askg/sources.ts +3 -3
- package/src/plugins/builtin/cloud/one-tap/one-tap-prompt.tsx +7 -3
- package/src/plugins/builtin/cloud/team/acm-tab.tsx +1 -1
- package/src/plugins/builtin/cloud/team/pane.tsx +17 -10
- package/src/plugins/builtin/cloud/team/views.ts +15 -3
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +105 -16
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +17 -2
- package/src/plugins/builtin/cloud/thesis/module.tsx +3 -2
- package/src/plugins/builtin/cloud/thesis/store.ts +17 -3
- package/src/plugins/builtin/commodities-energy/index.tsx +35 -3
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -1
- package/src/plugins/builtin/company-attention/app-rank.tsx +1 -1
- package/src/plugins/builtin/company-attention/building.tsx +1 -1
- package/src/plugins/builtin/company-attention/model.ts +2 -1
- package/src/plugins/builtin/company-attention/moves.tsx +1 -1
- package/src/plugins/builtin/company-attention/pane.tsx +1 -1
- package/src/plugins/builtin/company-attention/signals.tsx +1 -1
- package/src/plugins/builtin/company-kpis/pane.tsx +1 -1
- package/src/plugins/builtin/correlation/headless.ts +13 -7
- package/src/plugins/builtin/correlation/history.ts +17 -6
- package/src/plugins/builtin/correlation/index.tsx +8 -4
- package/src/plugins/builtin/correlation/matrix/model.ts +15 -1
- package/src/plugins/builtin/correlation/relationship/history.ts +1 -1
- package/src/plugins/builtin/correlation/relationship/model.ts +15 -1
- package/src/plugins/builtin/correlation/relationship/pane.tsx +5 -3
- package/src/plugins/builtin/cot/headless.ts +10 -3
- package/src/plugins/builtin/cot/pane.tsx +2 -2
- package/src/plugins/builtin/cpi/pane.tsx +1 -1
- package/src/plugins/builtin/credit-boards/model.ts +1 -1
- package/src/plugins/builtin/credit-documents/pane.tsx +1 -1
- package/src/plugins/builtin/crypto-board/defi-view.tsx +2 -2
- package/src/plugins/builtin/crypto-board/defi.ts +9 -3
- package/src/plugins/builtin/crypto-board/headless.ts +19 -10
- package/src/plugins/builtin/crypto-board/model.ts +8 -0
- package/src/plugins/builtin/crypto-board/pane.tsx +11 -5
- package/src/plugins/builtin/crypto-board/series.ts +17 -3
- package/src/plugins/builtin/crypto-board/supply.ts +26 -3
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +3 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +13 -3
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +6 -3
- package/src/plugins/builtin/custom-view/pane.tsx +5 -5
- package/src/plugins/builtin/debt-maturities/client.ts +5 -0
- package/src/plugins/builtin/debt-maturities/headless.ts +3 -1
- package/src/plugins/builtin/debt-maturities/model.ts +1 -0
- package/src/plugins/builtin/debt-maturities/pane.tsx +1 -1
- package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
- package/src/plugins/builtin/doe/model.ts +1 -1
- package/src/plugins/builtin/doe/pane.tsx +1 -1
- package/src/plugins/builtin/earnings/board.tsx +2 -2
- package/src/plugins/builtin/earnings/history.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/calendar.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/data.ts +2 -1
- package/src/plugins/builtin/earnings-calls/headless.ts +15 -0
- package/src/plugins/builtin/earnings-calls/model.ts +68 -8
- package/src/plugins/builtin/earnings-calls/pane.tsx +29 -8
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +32 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +94 -2
- package/src/plugins/builtin/econ/detail-view.tsx +15 -11
- package/src/plugins/builtin/econ/index.tsx +25 -9
- package/src/plugins/builtin/econ/types.ts +4 -1
- package/src/plugins/builtin/equity-screener/headless.ts +23 -7
- package/src/plugins/builtin/equity-screener/index.tsx +3 -0
- package/src/plugins/builtin/equity-screener/live.ts +39 -12
- package/src/plugins/builtin/equity-screener/model.ts +86 -5
- package/src/plugins/builtin/equity-screener/pane.tsx +20 -21
- package/src/plugins/builtin/equity-screener/results.ts +12 -3
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +2 -2
- package/src/plugins/builtin/executives/pane.tsx +2 -2
- package/src/plugins/builtin/exposure/pane.tsx +1 -1
- package/src/plugins/builtin/fear-greed/data.ts +3 -1
- package/src/plugins/builtin/fear-greed/headless.ts +8 -2
- package/src/plugins/builtin/fear-greed/pane.tsx +8 -4
- package/src/plugins/builtin/filing-events/pane.tsx +1 -1
- package/src/plugins/builtin/futures/index.tsx +5 -4
- package/src/plugins/builtin/futures/model.ts +17 -9
- package/src/plugins/builtin/futures/returns.ts +2 -0
- package/src/plugins/builtin/futures/series.ts +44 -8
- package/src/plugins/builtin/futures/table.tsx +3 -3
- package/src/plugins/builtin/futures-curve/client.ts +1 -0
- package/src/plugins/builtin/futures-curve/headless.ts +17 -12
- package/src/plugins/builtin/futures-curve/index.tsx +7 -4
- package/src/plugins/builtin/futures-curve/model.ts +117 -7
- package/src/plugins/builtin/futures-curve/pane.tsx +18 -7
- package/src/plugins/builtin/fx-matrix/amount.ts +2 -1
- package/src/plugins/builtin/fx-matrix/index.tsx +9 -0
- package/src/plugins/builtin/gpu/changes.tsx +1 -1
- package/src/plugins/builtin/gpu/equities.tsx +1 -1
- package/src/plugins/builtin/gpu/pane.tsx +2 -2
- package/src/plugins/builtin/help/function-card.tsx +4 -2
- package/src/plugins/builtin/help/function-index.ts +12 -6
- package/src/plugins/builtin/help/index.tsx +1 -1
- package/src/plugins/builtin/holders/beneficial-view.tsx +1 -1
- package/src/plugins/builtin/holders/pane.tsx +1 -1
- package/src/plugins/builtin/insider/base-values.ts +55 -0
- package/src/plugins/builtin/insider/headless.ts +307 -83
- package/src/plugins/builtin/insider/index.tsx +65 -23
- package/src/plugins/builtin/insider/insiders.tsx +26 -16
- package/src/plugins/builtin/insider/model.ts +2 -2
- package/src/plugins/builtin/insider/signals-cells.tsx +4 -1
- package/src/plugins/builtin/insider/signals-model.ts +13 -5
- package/src/plugins/builtin/insider/signals.tsx +5 -3
- package/src/plugins/builtin/insider/tickers.tsx +466 -0
- package/src/plugins/builtin/ipo-calendar/pane.tsx +1 -1
- package/src/plugins/builtin/iv-history/client.ts +35 -4
- package/src/plugins/builtin/iv-history/headless.ts +10 -4
- package/src/plugins/builtin/iv-history/model.ts +85 -16
- package/src/plugins/builtin/iv-history/pane.tsx +2 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +6 -3
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/kelly-sizer/headless.ts +2 -2
- package/src/plugins/builtin/kelly-sizer/history.ts +10 -3
- package/src/plugins/builtin/kelly-sizer/pane.tsx +2 -2
- package/src/plugins/builtin/kelly-sizer/sections.tsx +1 -1
- package/src/plugins/builtin/macro-day/pane.tsx +1 -1
- package/src/plugins/builtin/macro-day/release-table.ts +5 -5
- package/src/plugins/builtin/macro-day/releases.ts +11 -9
- package/src/plugins/builtin/market-movers/headless.ts +6 -2
- package/src/plugins/builtin/market-movers/screener.ts +18 -4
- package/src/plugins/builtin/members/breadth-pane.tsx +3 -3
- package/src/plugins/builtin/members/client.ts +24 -2
- package/src/plugins/builtin/members/headless.ts +66 -9
- package/src/plugins/builtin/members/index.tsx +7 -6
- package/src/plugins/builtin/members/model.ts +89 -5
- package/src/plugins/builtin/members/pane.tsx +70 -21
- package/src/plugins/builtin/mna/distress/pane.tsx +2 -1
- package/src/plugins/builtin/mna/pane.tsx +1 -1
- package/src/plugins/builtin/money-markets/client.ts +43 -15
- package/src/plugins/builtin/money-markets/headless.ts +18 -11
- package/src/plugins/builtin/money-markets/index.tsx +7 -6
- package/src/plugins/builtin/money-markets/model.ts +20 -5
- package/src/plugins/builtin/money-markets/pane.tsx +28 -17
- package/src/plugins/builtin/news/wire/news/footer.ts +11 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +15 -5
- package/src/plugins/builtin/notes/headless.ts +94 -0
- package/src/plugins/builtin/notes/index.tsx +3 -1
- package/src/plugins/builtin/notes/store.ts +10 -3
- package/src/plugins/builtin/options/footer.ts +8 -2
- package/src/plugins/builtin/options/open-interest-as-of.ts +12 -3
- package/src/plugins/builtin/options/view.tsx +10 -1
- package/src/plugins/builtin/options-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/options-positioning/client.ts +35 -8
- package/src/plugins/builtin/options-positioning/headless.ts +17 -7
- package/src/plugins/builtin/options-positioning/index.tsx +10 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +16 -7
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/pane.tsx +1 -1
- package/src/plugins/builtin/pe-band/pane.tsx +2 -2
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -2
- package/src/plugins/builtin/perps/client.ts +54 -15
- package/src/plugins/builtin/perps/headless.ts +39 -13
- package/src/plugins/builtin/perps/index.tsx +2 -1
- package/src/plugins/builtin/perps/model.ts +43 -1
- package/src/plugins/builtin/perps/pane.tsx +35 -18
- package/src/plugins/builtin/portfolio-list/allocation-rows.ts +74 -0
- package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -0
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +7 -3
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +33 -3
- package/src/plugins/builtin/portfolio-list/cli/render.ts +149 -24
- package/src/plugins/builtin/portfolio-list/headless.ts +30 -9
- package/src/plugins/builtin/portfolio-list/income.ts +17 -8
- package/src/plugins/builtin/portfolio-list/index.tsx +4 -4
- package/src/plugins/builtin/portfolio-list/pane/fx-day-moves.ts +52 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +76 -9
- package/src/plugins/builtin/portfolio-list/pane/target-weights.tsx +178 -0
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +44 -5
- package/src/plugins/builtin/portfolio-list/settings.ts +12 -6
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +9 -4
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +21 -2
- package/src/plugins/builtin/portfolio-list/table.tsx +33 -25
- package/src/plugins/builtin/power/gas.tsx +2 -2
- package/src/plugins/builtin/power/prices.tsx +2 -2
- package/src/plugins/builtin/primary-dealers/pane.tsx +10 -11
- package/src/plugins/builtin/rate-path/model.ts +9 -0
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +27 -0
- package/src/plugins/builtin/realized-vol/headless.ts +19 -12
- package/src/plugins/builtin/realized-vol/model.ts +14 -6
- package/src/plugins/builtin/realized-vol/pane.tsx +15 -8
- package/src/plugins/builtin/realized-vol/settings.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +1 -1
- package/src/plugins/builtin/research/analyst-headless.ts +5 -1
- package/src/plugins/builtin/research/analyst-model.ts +7 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
- package/src/plugins/builtin/research/relative-valuation-basis.ts +44 -4
- package/src/plugins/builtin/research/relative-valuation-headless.ts +59 -14
- package/src/plugins/builtin/research/relative-valuation-model.ts +65 -26
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +42 -17
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
- package/src/plugins/builtin/reverse-dcf/client.ts +34 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +30 -15
- package/src/plugins/builtin/reverse-dcf/model.ts +190 -29
- package/src/plugins/builtin/reverse-dcf/pane.tsx +35 -13
- package/src/plugins/builtin/risk-factors/pane.tsx +2 -2
- package/src/plugins/builtin/roadmap/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-pane.tsx +4 -4
- package/src/plugins/builtin/scanner/headless.ts +15 -1
- package/src/plugins/builtin/seasonality/client.ts +66 -17
- package/src/plugins/builtin/seasonality/headless.ts +7 -2
- package/src/plugins/builtin/seasonality/model.ts +12 -3
- package/src/plugins/builtin/seasonality/pane.tsx +5 -3
- package/src/plugins/builtin/sec/fund-facts-view.tsx +5 -2
- package/src/plugins/builtin/sec/fund-facts.ts +41 -1
- package/src/plugins/builtin/sec/headless.ts +8 -4
- package/src/plugins/builtin/sec/index.tsx +41 -13
- package/src/plugins/builtin/shared/ticker-company.ts +111 -0
- package/src/plugins/builtin/shared/use-quote-board.ts +65 -8
- package/src/plugins/builtin/shared/volatility/live-session.ts +23 -0
- package/src/plugins/builtin/shared/volatility-indices.ts +2 -0
- package/src/plugins/builtin/short-interest/publications-pane.tsx +1 -1
- package/src/plugins/builtin/short-volume/pane.tsx +1 -1
- package/src/plugins/builtin/social-mentions/outliers.tsx +3 -3
- package/src/plugins/builtin/social-mentions/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +1 -1
- package/src/plugins/builtin/supply-chain/pane.tsx +1 -1
- package/src/plugins/builtin/themes/pane.tsx +4 -4
- package/src/plugins/builtin/thirteenf/api.ts +1 -0
- package/src/plugins/builtin/thirteenf/format.ts +5 -0
- package/src/plugins/builtin/thirteenf/headless.ts +2 -2
- package/src/plugins/builtin/thirteenf/model.ts +128 -5
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +1 -1
- package/src/plugins/builtin/thirteenf/report-notes.ts +10 -3
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +1 -1
- package/src/plugins/builtin/thirteenf/table.ts +2 -2
- package/src/plugins/builtin/thirteenf/types.ts +12 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +27 -14
- package/src/plugins/builtin/ticker-detail/data-panes/returns-history.ts +6 -3
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +14 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +4 -1
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +87 -19
- package/src/plugins/builtin/ticker-detail/financials/exchange-results.ts +54 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +114 -9
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +37 -20
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +42 -19
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +3 -2
- package/src/plugins/builtin/ticker-detail/headless.ts +90 -31
- package/src/plugins/builtin/ticker-detail/overview/model.ts +22 -15
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +5 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +12 -7
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +21 -0
- package/src/plugins/builtin/trace-bonds/client.ts +107 -10
- package/src/plugins/builtin/trace-bonds/detail.tsx +1 -1
- package/src/plugins/builtin/trace-bonds/headless.ts +20 -5
- package/src/plugins/builtin/trace-bonds/pane.tsx +15 -4
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/pane.tsx +1 -1
- package/src/plugins/builtin/treasury-daily/pane.tsx +2 -2
- package/src/plugins/builtin/vol-surface/charts.tsx +30 -5
- package/src/plugins/builtin/vol-surface/client.ts +40 -12
- package/src/plugins/builtin/vol-surface/events.ts +213 -0
- package/src/plugins/builtin/vol-surface/headless.ts +82 -13
- package/src/plugins/builtin/vol-surface/index.tsx +5 -1
- package/src/plugins/builtin/vol-surface/model.ts +42 -6
- package/src/plugins/builtin/vol-surface/pane.tsx +95 -23
- package/src/plugins/builtin/volatility/dvol.ts +14 -2
- package/src/plugins/builtin/volatility/headless.ts +3 -2
- package/src/plugins/builtin/volatility/index.tsx +1 -1
- package/src/plugins/builtin/volatility/pane.tsx +1 -1
- package/src/plugins/builtin/volatility/series.ts +7 -3
- package/src/plugins/builtin/world-venue-map/activity-series.ts +89 -0
- package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +123 -0
- package/src/plugins/builtin/world-venue-map/evidence.ts +2 -0
- package/src/plugins/builtin/world-venue-map/geo-series.ts +35 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +58 -9
- package/src/plugins/builtin/world-venue-map/index.ts +6 -3
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +6 -1
- package/src/plugins/builtin/world-venue-map/pane.tsx +4 -3
- package/src/plugins/builtin/yield-curve/index.tsx +12 -10
- package/src/plugins/builtin/yield-curve/swaps.tsx +1 -1
- package/src/plugins/extracted-plugins.ts +14 -10
- package/src/plugins/installer.ts +17 -1
- package/src/plugins/marketplace/feed.ts +14 -0
- package/src/plugins/marketplace/install-offer.ts +64 -0
- package/src/plugins/registry/contributions.ts +46 -8
- package/src/plugins/registry/index.ts +5 -0
- package/src/portfolio/collection-name.ts +38 -4
- package/src/portfolio/column-values.ts +32 -4
- package/src/portfolio/period-pnl.ts +4 -2
- package/src/react/async-resource.ts +24 -8
- package/src/remote/endpoint.ts +38 -12
- package/src/remote/secrets.ts +22 -6
- package/src/remote/server.ts +20 -4
- package/src/renderers/dom/data-table/index.tsx +2 -1
- package/src/renderers/dom/data-table/row.tsx +49 -7
- package/src/renderers/dom/desktop/controls.tsx +3 -1
- package/src/renderers/dom/desktop/query-bar.tsx +57 -7
- package/src/renderers/dom/host/surface-3d.tsx +46 -5
- package/src/renderers/dom/styles.css +24 -4
- package/src/renderers/electrobun/view/backend-rpc.ts +15 -21
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +16 -61
- package/src/renderers/electrobun/view/cli-pane-shot-socket.ts +134 -0
- package/src/renderers/electrobun/view/host-route.ts +119 -0
- package/src/renderers/electrobun/view/rpc-timeout.ts +6 -5
- package/src/renderers/opentui/box-width.ts +30 -0
- package/src/renderers/opentui/toast-host.tsx +6 -3
- package/src/renderers/opentui/ui-host.tsx +29 -5
- package/src/series/registry.ts +1 -0
- package/src/series/standalone-catalog.ts +40 -0
- package/src/series/types.ts +10 -0
- package/src/series/validate.ts +5 -0
- package/src/shares/portable-layout.ts +2 -7
- package/src/sources/gloomberb-cloud/dated-chunks.ts +133 -0
- package/src/sources/gloomberb-cloud/index.ts +46 -5
- package/src/sources/gloomberb-cloud/news.ts +15 -9
- package/src/sources/gloomberb-cloud/normalizers.ts +17 -0
- package/src/sources/history-coverage.ts +13 -0
- package/src/sources/history-result.ts +1 -0
- package/src/sources/provider-errors.ts +9 -0
- package/src/sources/provider-router/batches.ts +7 -3
- package/src/sources/provider-router/financial-routes.ts +3 -1
- package/src/sources/provider-router/history.ts +6 -4
- package/src/sources/provider-router/index.ts +5 -1
- package/src/sources/provider-router/primary.ts +4 -3
- package/src/sources/provider-router/retrieved-at.ts +12 -0
- package/src/team/store.ts +17 -4
- package/src/telemetry/crash-reports.ts +3 -1
- package/src/test-support/cli-context.ts +3 -2
- package/src/test-support/test-env.ts +7 -0
- package/src/theme/themes.ts +16 -9
- package/src/theme/tone-contrast.ts +29 -5
- package/src/tickers/company-name-listing.ts +31 -3
- package/src/tickers/company-name.ts +9 -0
- package/src/tickers/index-roots.ts +56 -4
- package/src/tickers/listing-name.ts +7 -2
- package/src/tickers/listing-venues.ts +17 -2
- package/src/tickers/search/home-listing.ts +2 -0
- package/src/tickers/search/index.ts +64 -11
- package/src/tickers/search/major-listings.json +595 -592
- package/src/tickers/search/ranking.ts +19 -1
- package/src/tickers/terminal-codes.ts +5 -3
- package/src/time-series/bar-aggregation.ts +3 -2
- package/src/time-series/base-series.ts +18 -1
- package/src/time-series/chart-data.ts +9 -6
- package/src/time-series/chart-seed.ts +11 -3
- package/src/time-series/currency-conversion.ts +1 -0
- package/src/time-series/date-window.ts +8 -0
- package/src/time-series/formula-months.ts +57 -0
- package/src/time-series/fundamentals/period-points.ts +3 -3
- package/src/time-series/fundamentals/source-statements.ts +5 -4
- package/src/time-series/leverage.ts +12 -4
- package/src/time-series/live-bars.ts +12 -7
- package/src/time-series/live-quotes.ts +6 -2
- package/src/time-series/market.ts +10 -3
- package/src/time-series/price-comparison.ts +106 -0
- package/src/time-series/range.ts +10 -0
- package/src/time-series/resolve-context.ts +7 -2
- package/src/time-series/resolve.ts +61 -5
- package/src/time-series/series-name.ts +2 -2
- package/src/time-series/series-presentation.ts +91 -2
- package/src/time-series/session-bar.ts +13 -7
- package/src/time-series/spec.ts +21 -2
- package/src/time-series/studies/formula.ts +262 -36
- package/src/time-series/studies/leverage.ts +9 -3
- package/src/time-series/studies/resolve.ts +7 -2
- package/src/time-series/types.ts +34 -0
- package/src/time-series/use-chart-resolution.ts +18 -1
- package/src/types/data-provider.ts +7 -0
- package/src/types/financials.ts +117 -2
- package/src/types/headless.ts +70 -3
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-context.ts +9 -0
- package/src/types/plugin-pane-templates.ts +6 -0
- package/src/types/plugin-panes.ts +7 -0
- package/src/types/price-history.ts +6 -0
- package/src/ui/host.tsx +3 -1
- package/src/ui/index.tsx +7 -2
- package/src/utils/cli-output.ts +21 -1
- package/src/utils/currency-units.ts +14 -0
- package/src/utils/datetime-format.ts +11 -0
- package/src/utils/exchange-announcements.ts +26 -3
- package/src/utils/exchange-notation.generated.ts +3 -4
- package/src/utils/exchange-results.ts +144 -0
- package/src/utils/exchanges.ts +10 -0
- package/src/utils/financial-statements.ts +212 -22
- package/src/utils/fire-and-forget.ts +1 -1
- package/src/utils/fiscal-period.ts +41 -3
- package/src/utils/format.ts +10 -6
- package/src/utils/fundamentals.ts +223 -15
- package/src/utils/futures-generic.ts +26 -0
- package/src/utils/lease-liabilities.ts +15 -5
- package/src/utils/lookup-token.ts +22 -0
- package/src/utils/max-drawdown.ts +25 -4
- package/src/utils/price-history-integrity.ts +56 -8
- package/src/utils/price-history.ts +6 -2
- package/src/utils/price-window.ts +38 -2
- package/src/utils/replace-file.ts +47 -0
- package/src/utils/rpc-timeout-error.ts +16 -2
- package/src/utils/untrusted-text.ts +14 -0
|
@@ -4,6 +4,7 @@ import { splitDelayedStatus, DataTableView, EmptyState, PaneStatusBody, QueryBar
|
|
|
4
4
|
import { useTableLoadMore } from "../../../components/table-view-shared";
|
|
5
5
|
import { useStaticChartBitmapSize } from "../../../components/chart/composite/bitmap";
|
|
6
6
|
import { useAsyncResource } from "../../../react/async-resource";
|
|
7
|
+
import { apiClient } from "../../../api-client";
|
|
7
8
|
import { useTickerFinancials } from "../../../market-data/hooks";
|
|
8
9
|
import { quoteSubscriptionTargetFromTicker } from "../../../market-data/request-types";
|
|
9
10
|
import { useQuoteUpdates } from "../../../state/hooks/quote-streaming";
|
|
@@ -15,6 +16,8 @@ import type { PaneProps } from "../../../types/plugin";
|
|
|
15
16
|
import { Box, useUiCapabilities, type ScrollBoxRenderable } from "../../../ui";
|
|
16
17
|
import { FILL_REST } from "../../../components/ui/fill";
|
|
17
18
|
import { chromeBarRows } from "../../../components/layout/pane/sizing";
|
|
19
|
+
import { savedCopyFooterSegment } from "../../../components/layout/pane/footer";
|
|
20
|
+
import type { CloudResource } from "../shared/cloud-resource";
|
|
18
21
|
import { formatStrikeLabel, resolveOptionsTarget } from "../../../utils/options";
|
|
19
22
|
import { nextHeaderSort, type SortDirection } from "../../../utils/sort-values";
|
|
20
23
|
import { buildOptionCalcParams, OPTIONS_CALCULATOR_TEMPLATE_ID } from "../options-calculator/model";
|
|
@@ -22,7 +25,7 @@ import { formatModelSpotPrice } from "../options/model-spot";
|
|
|
22
25
|
import { useAutoRefresh } from "../../../react/auto-refresh";
|
|
23
26
|
import { useLiveStreamingSetting } from "../../../state/hooks/live-streaming";
|
|
24
27
|
import { CLOUD_QUOTE_DELAY_MINUTES } from "../../../api-client/plan-access";
|
|
25
|
-
import { useLiveSessionRefresh } from "../shared/volatility/live-session";
|
|
28
|
+
import { optionsClosedNotice, useLiveSessionRefresh, useOptionsSessionOpen, usOptionsReopen } from "../shared/volatility/live-session";
|
|
26
29
|
import { getSharedMarketDataCoordinator } from "../../../market-data/coordinator";
|
|
27
30
|
import { hasFreshReadyEntry } from "../../../market-data/coordinator/entries";
|
|
28
31
|
import { createSurfaceDependencies, loadVolatilitySurface, withReusedYieldCurve, type SurfaceLoadRequest } from "./client";
|
|
@@ -38,6 +41,7 @@ import {
|
|
|
38
41
|
} from "../../../components/chart/surface3d/model";
|
|
39
42
|
import { VolatilitySurface } from "./surface";
|
|
40
43
|
import { SmileChart, TermChart } from "./charts";
|
|
44
|
+
import { loadSurfaceEvents, releaseSearchDay, surfaceEventReadings } from "./events";
|
|
41
45
|
import { surfaceCoordinateLabel } from "./headless";
|
|
42
46
|
import { expiryLabel, formatIv, formatPrice, formatVolPoints, HIDDEN_SLOPE_TEXT, HIDDEN_YIELD_TEXT, selectSurfaceExpiry, surfaceForwardRow,
|
|
43
47
|
surfaceSkewRow, surfaceSpotBasisLabel } from "./tables";
|
|
@@ -126,7 +130,17 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
126
130
|
spotAsOfRef.current = quote?.lastUpdated ?? null;
|
|
127
131
|
const quoteRef = useRef(quote ?? null);
|
|
128
132
|
quoteRef.current = quote ?? null;
|
|
129
|
-
|
|
133
|
+
// Once the Term tab opens, the next FOMC and CPI add the expiries either side of each to the surface.
|
|
134
|
+
const [eventsWanted, setEventsWanted] = useState(activeTab === "term");
|
|
135
|
+
useEffect(() => { if (activeTab === "term") setEventsWanted(true); }, [activeTab]);
|
|
136
|
+
const eventSymbol = target?.effectiveTicker ?? symbol ?? null;
|
|
137
|
+
const eventExchange = target?.effectiveExchange ?? "";
|
|
138
|
+
const eventsLoader = useCallback(async () => loadSurfaceEvents({ symbol: eventSymbol!, exchange: eventExchange }, { apiClient }),
|
|
139
|
+
[eventSymbol, eventExchange]);
|
|
140
|
+
const surfaceEvents = useAsyncResource(eventsWanted && eventSymbol && !dvolCurrency(eventSymbol.toUpperCase()) ? eventsLoader : null);
|
|
141
|
+
const eventDates = surfaceEvents.data?.events.map((event) => event.date) ?? [];
|
|
142
|
+
const requestKey = JSON.stringify([target?.cacheKey, symbol, axis, tenors, ivSource, priceSide, spread, age, limit, spotAvailable, requestedExpiration,
|
|
143
|
+
eventDates]);
|
|
130
144
|
// Every load reads the spot at the moment it starts; a reload in session
|
|
131
145
|
// therefore uses the current stream price, not the one from the first load.
|
|
132
146
|
// A chain from a closed session is priced at that session's close, which
|
|
@@ -137,7 +151,7 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
137
151
|
instrument: { symbol: target?.effectiveTicker ?? symbol!, exchange: target?.effectiveExchange ?? "",
|
|
138
152
|
brokerId: instrument?.brokerId, brokerInstanceId: instrument?.brokerInstanceId, instrument },
|
|
139
153
|
spot: quoteRef.current?.price ?? 0, spotAsOf: spotAsOfRef.current, quote: quoteRef.current, limit, forceRefresh: force, signal,
|
|
140
|
-
requiredExpiries: expirationRef.current == null ? [] : [expirationRef.current],
|
|
154
|
+
requiredExpiries: expirationRef.current == null ? [] : [expirationRef.current], eventDates,
|
|
141
155
|
settings: { ...DEFAULT_SURFACE_SETTINGS, ivSource, priceSide, maxRelativeSpread: Number(spread), maxStaleSessions: Number(age) },
|
|
142
156
|
};
|
|
143
157
|
// Stable quote reference prevents every streaming tick from restarting all expiry requests.
|
|
@@ -200,7 +214,7 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
200
214
|
// A coin's options (BTC-USD, ETH-USD) come with Deribit's volatility index.
|
|
201
215
|
const coin = dvolCurrency(underlying);
|
|
202
216
|
const dvolLoader = useCallback(async () => loadDvol(coin!), [coin]);
|
|
203
|
-
const dvol = useAsyncResource<DvolPayload
|
|
217
|
+
const dvol = useAsyncResource<CloudResource<DvolPayload>>(coin ? dvolLoader : null);
|
|
204
218
|
useAutoRefresh(dvol.updatedAt, dvol.load, { intervalMs: coin ? DVOL_REFRESH_MS : null });
|
|
205
219
|
useEffect(() => () => controller.current?.abort(), [request]);
|
|
206
220
|
const incremental = partial?.key === requestKey ? partial.snapshot : null;
|
|
@@ -209,8 +223,13 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
209
223
|
// Judged on the last complete load, so a refresh in progress does not flip the view.
|
|
210
224
|
const liveQuotes = liveQuoteCoverage(settledSnapshot);
|
|
211
225
|
const liveEmpty = liveQuotes.empty && liveQuoteCoverage(liveSnapshot).points === 0;
|
|
226
|
+
// Outside the US options session a chain with no expiry fitted is the hour, not the symbol (FXE before the open):
|
|
227
|
+
// it waits for the open, beside IV30 at the last close. A coin's options trade around the clock.
|
|
228
|
+
const optionsOpen = useOptionsSessionOpen(!!symbol && !historyDate && !coin);
|
|
229
|
+
const closedUnfitted = !coin && !optionsOpen && liveQuotes.settled && liveQuotes.expiries > 0 && !liveQuotes.fitted;
|
|
230
|
+
const noLiveSurface = liveEmpty || closedUnfitted;
|
|
212
231
|
// With no clean live quote, the latest stored close stands in until the chain reopens.
|
|
213
|
-
const fallbackDate = !historyDate &&
|
|
232
|
+
const fallbackDate = !historyDate && noLiveSurface ? dates.data?.[0] ?? null : null;
|
|
214
233
|
// The underlying streams even when no other pane watches it, so each
|
|
215
234
|
// reload is fitted at the current price. The spot is only sampled at each
|
|
216
235
|
// reload, so the slow off-screen cadence is enough and spares re-renders.
|
|
@@ -240,7 +259,12 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
240
259
|
{ id: "iv30", label: "IV30", value: `${(ivRank.value * 100).toFixed(1)}%`, detail: `${ivRank.date.slice(5)} close` },
|
|
241
260
|
{ id: "ivr", label: "IV rank", value: wholeNumber(ivRank.rank) },
|
|
242
261
|
{ id: "ivp", label: "IV pctl", value: wholeNumber(ivRank.percentile) },
|
|
243
|
-
] : coin && snapshot && !snapshot.stored ? dvolStats(dvol.data, surfaceThirtyDayAtm(snapshot)) : [];
|
|
262
|
+
] : coin && snapshot && !snapshot.stored ? dvolStats(dvol.data?.payload, surfaceThirtyDayAtm(snapshot)) : [];
|
|
263
|
+
// A stored close is read on its own day, not around the releases still to come.
|
|
264
|
+
// A release that has come out since the dates were read drops at the next surface it is read against.
|
|
265
|
+
const eventReadings = useMemo(() => surfaceEvents.data && snapshot && !snapshot.stored
|
|
266
|
+
? surfaceEventReadings(snapshot.expiries, snapshot.catalogue,
|
|
267
|
+
surfaceEvents.data.events.filter((event) => event.date >= releaseSearchDay(event.kind, Date.now()))) : [], [surfaceEvents.data, snapshot]);
|
|
244
268
|
const tableHeight = Math.max(3, height - chromeBarRows(nativePaneChrome) - tabRows - statGridRows(ivStats, width));
|
|
245
269
|
const bitmapAvailable = !!useStaticChartBitmapSize(width, tableHeight);
|
|
246
270
|
// A typed date (`--expiration 2027-01-15`) is that day's UTC midnight; the
|
|
@@ -359,7 +383,7 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
359
383
|
const key = event.name;
|
|
360
384
|
// History steps with < and > (footer hints); "." stays the pane menu.
|
|
361
385
|
if (surface3d && event.shift && (key === "left" || key === "right")) stepSurfacePoint(key === "left" ? -1 : 1);
|
|
362
|
-
else if (key === "r") {
|
|
386
|
+
else if (key === "r") { active.reload(); dates.reload(); }
|
|
363
387
|
else if (key === "v") cycleTab();
|
|
364
388
|
else if (key === "t") toggleHistory();
|
|
365
389
|
else if (key === "p") openPricer();
|
|
@@ -394,7 +418,10 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
394
418
|
? "All expiries" : expirations.map(expiryLabel).join(", ")}: ${warning}`),
|
|
395
419
|
...(!spotAvailable && symbol && !historyDate ? ["Underlying price unavailable or stale"] : []),
|
|
396
420
|
...(historyDate && !stored.loading && !stored.data && !stored.error ? [`No stored ${underlying} surface for ${historyDate}`] : []),
|
|
397
|
-
|
|
421
|
+
// Outside the session the stored close stands in for the hour, and the live surface fills at the open.
|
|
422
|
+
...(fallbackDate ? [closedUnfitted
|
|
423
|
+
? `${optionsClosedNotice(usOptionsReopen(Date.now()) ?? { at: null }).title} Showing the ${fallbackDate} close; the live surface fills at the open.`
|
|
424
|
+
: `Live chain has no two-sided quotes; showing the ${fallbackDate} close`] : []),
|
|
398
425
|
...(pinned != null && snapshot && !resource.loading && !snapshot.catalogue.includes(pinned)
|
|
399
426
|
&& !snapshot.failures.some((failure) => failure.expiration === pinned)
|
|
400
427
|
? [`${expiryLabel(pinned)}: ${unlistedExpiryText(pinned, snapshot.catalogue)}`] : []),
|
|
@@ -411,12 +438,17 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
411
438
|
? `${selectedRow?.label} · K ${selectedCell.strike == null ? "--" : formatStrikeLabel(selectedCell.strike)} · fitted IV ${formatIv(selectedCell.volatility)}`
|
|
412
439
|
: "no clean quote at this cell";
|
|
413
440
|
usePaneNoticeFooter({ registrationId: "ovdv-notices", notices: [...new Set(notices)], focused });
|
|
441
|
+
const savedAts = [snapshot && !snapshot.stored ? snapshot.savedAt : undefined, ivStats.length && coin ? dvol.data?.savedAt : undefined]
|
|
442
|
+
.filter((at): at is number => at != null);
|
|
443
|
+
const savedAt = savedAts.length ? Math.min(...savedAts) : null;
|
|
414
444
|
usePaneFooter("ovdv", () => ({
|
|
415
445
|
info: [
|
|
416
446
|
...(active.loading ? [{ id: "loading", parts: [{ text: snapshot && snapshot.loaded < snapshot.requested
|
|
417
447
|
? `loading ${snapshot.loaded}/${snapshot.requested} expiries` : "loading", tone: "muted" as const }] }] : []),
|
|
418
448
|
...(freshness ? splitDelayedStatus({ id: "source", parts: [{ text: freshness, tone: "muted" }] }) : []),
|
|
419
|
-
|
|
449
|
+
// Chains (and a coin's DVOL) kept from an earlier load say when they were saved; anything else old says stale.
|
|
450
|
+
...(savedAt != null ? [savedCopyFooterSegment("saved-copy", savedAt)]
|
|
451
|
+
: snapshot?.expiries.some((entry) => entry.stale) ? [{ id: "stale", parts: [{ text: "stale", tone: "warning" as const }] }] : []),
|
|
420
452
|
...(selectedExpiry?.fit && activeTab === "smile" ? [{ id: "fit", parts: [{ text: `${selectedExpiry.fit.method} · RMSE ${(selectedExpiry.fit.residual * 100).toFixed(3)} vol pts`, tone: "muted" as const }] }] : []),
|
|
421
453
|
...(selectionStatus ? [{ id: "selection", parts: [{ text: selectionStatus, tone: "muted" as const }] }] : []),
|
|
422
454
|
],
|
|
@@ -434,7 +466,7 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
434
466
|
{ id: "older", key: "<", label: "older", title: "Older Stored Date", onPress: () => stepHistory(1) },
|
|
435
467
|
{ id: "newer", key: ">", label: "newer", title: "Newer Stored Date", onPress: () => stepHistory(-1) }] : []),
|
|
436
468
|
],
|
|
437
|
-
}), [snapshot, freshness, active.loading, historyDate, storedDates, selectedExpiry, activeTab, selectedCell, canLoadMore, camera, bitmapAvailable, selectionStatus, openChain, deltaSurface]);
|
|
469
|
+
}), [snapshot, freshness, active.loading, historyDate, storedDates, selectedExpiry, activeTab, selectedCell, canLoadMore, camera, bitmapAvailable, selectionStatus, openChain, deltaSurface, savedAt]);
|
|
438
470
|
// Keys that move the selection without a footer hint of their own, listed in
|
|
439
471
|
// the pane menu with their keys.
|
|
440
472
|
const menuActions = useRef({ nextExpiry, stepSurfacePoint, zoomCamera });
|
|
@@ -456,8 +488,12 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
456
488
|
["underlying", snapshot?.symbol, snapshot?.spot], ["rate source", "Treasury", snapshot?.rateAsOf],
|
|
457
489
|
["warnings", ...notices], ...(snapshot?.expiries.map((expiry) => ["expiry", expiryLabel(expiry.expiration), expiry.asOf,
|
|
458
490
|
expiry.fit?.method, expiry.fit?.residual, expiry.rateMethod, JSON.stringify(expiry.filterCounts)]) ?? [])];
|
|
459
|
-
|
|
460
|
-
|
|
491
|
+
// Sized to the labels and IVs they hold (the table keeps each header whole), so a narrow pane shows more of the smile.
|
|
492
|
+
const tenorLabel = (row: SurfaceGridRow) => `${row.label}${row.extrapolated ? " E" : row.interpolated ? " I" : ""}`;
|
|
493
|
+
const cellWidth = Math.max(1, ...(grid?.rows ?? []).flatMap((row) => row.cells.map((cell) => formatIv(cell.volatility).length)));
|
|
494
|
+
const columns: DataTableColumn[] = [{ id: "tenor", label: "Expiry / tenor", align: "left",
|
|
495
|
+
width: Math.max(1, ...(grid?.rows ?? []).map((row) => tenorLabel(row).length)) },
|
|
496
|
+
...(grid?.rows[0]?.cells.map((cell, index) => ({ id: String(index), width: cellWidth, align: "right" as const,
|
|
461
497
|
label: surfaceCoordinateLabel(axis, cell.coordinate, index) })) ?? [])];
|
|
462
498
|
const sortedRows = [...(grid?.rows ?? [])].sort((a, b) => {
|
|
463
499
|
const delta = sort.columnId === "tenor" ? a.years - b.years : (a.cells[Number(sort.columnId)]?.volatility ?? -1) - (b.cells[Number(sort.columnId)]?.volatility ?? -1);
|
|
@@ -468,15 +504,19 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
468
504
|
sortColumnId={sort.columnId} sortDirection={sort.direction} onHeaderClick={(id) => setSort((current) => nextHeaderSort(current, id))}
|
|
469
505
|
selection={{ kind: "id", selectedId: tableSelectedRow?.label ?? null, getId: (row) => row.label, onChange: (_id, row) => onSelectRow(row) }}
|
|
470
506
|
onActivate={onSelectRow} onRootKeyDown={handleKey} getExportMetadata={exportMetadata} freezeFirstColumn
|
|
507
|
+
// The selected strike's column (ATM until one is picked) sits mid-table, where a narrow pane would otherwise show 80% to 95%.
|
|
508
|
+
revealColumnId={String(tableCellIndex)}
|
|
471
509
|
renderCell={(row, column) => {
|
|
472
|
-
if (column.id === "tenor") return { text:
|
|
510
|
+
if (column.id === "tenor") return { text: tenorLabel(row), color: colors.textDim };
|
|
473
511
|
const index = Number(column.id), cell = row.cells[index]!;
|
|
474
512
|
const chosen = row.label === tableSelectedRow?.label && index === tableCellIndex;
|
|
475
513
|
return { text: formatIv(cell.volatility), color: chosen ? colors.selectedText : colors.textBright,
|
|
476
514
|
backgroundColor: chosen ? colors.selected : cell.volatility == null ? colors.bg : blendHex(colors.bg, cell.volatility > 0.5 ? colors.warning : colors.positive, Math.min(0.48, 0.08 + cell.volatility * 0.5)),
|
|
477
515
|
onMouseDown: () => { onSelectRow(row); setCoordinate(cell.coordinate); } };
|
|
478
516
|
}} emptyStateTitle="No volatility observations." />;
|
|
479
|
-
const
|
|
517
|
+
const reopen = !shownDate && closedUnfitted ? usOptionsReopen(Date.now()) : null;
|
|
518
|
+
const content = reopen ? <EmptyState {...optionsClosedNotice(reopen)} />
|
|
519
|
+
: !shownDate && liveEmpty ? <EmptyState title="No two-sided option quotes"
|
|
480
520
|
message={liveQuotes.zeroBid === liveQuotes.contracts
|
|
481
521
|
? `All ${liveQuotes.contracts.toLocaleString()} contracts across ${liveQuotes.expiries} expiries have a zero bid. ${ZERO_BID_HOURS}`
|
|
482
522
|
: `None of the ${liveQuotes.contracts.toLocaleString()} contracts across ${liveQuotes.expiries} expiries passes the quote filters${
|
|
@@ -494,11 +534,11 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
494
534
|
setSurfaceCoordinate(denseGrid.moneyness[selection.moneynessIndex] ?? (deltaSurface ? 0 : 1));
|
|
495
535
|
}} fallback={table} loading={active.loading} meshAvailable={bitmapAvailable} /> : activeTab === "smile" && snapshot ? <SmileChart snapshot={snapshot} expiry={selectedExpiry}
|
|
496
536
|
overlay={overlaySmiles} axis={axis} width={width} height={tableHeight} focused={focused} />
|
|
497
|
-
: activeTab === "term" && snapshot ? <TermChart snapshot={snapshot} width={width} height={tableHeight} focused={focused} />
|
|
537
|
+
: activeTab === "term" && snapshot ? <TermChart snapshot={snapshot} width={width} height={tableHeight} focused={focused} events={eventReadings} />
|
|
498
538
|
: ["skew", "forwards"].includes(activeTab) && snapshot ? <ExpiryTable snapshot={snapshot} selected={selectedExpiry}
|
|
499
539
|
onSelect={(entry) => setExpiration(entry.expiration)} forwards={activeTab === "forwards"} width={width} height={tableHeight}
|
|
500
540
|
focused={focused} onKey={handleKey} metadata={exportMetadata} /> : table;
|
|
501
|
-
const tableShown = activeTab === "table" && !!symbol && !!snapshot && !(!shownDate &&
|
|
541
|
+
const tableShown = activeTab === "table" && !!symbol && !!snapshot && !(!shownDate && noLiveSurface);
|
|
502
542
|
useEffect(() => setTableOnScreen(tableShown), [tableShown]);
|
|
503
543
|
return <Box flexDirection="column" width={width} overflow="hidden" {...(nativePaneChrome ? FILL_REST : { height })}>
|
|
504
544
|
{tabStrip}
|
|
@@ -514,9 +554,13 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
514
554
|
]}
|
|
515
555
|
meta={!snapshot ? undefined : snapshot.stored
|
|
516
556
|
? `Stored close · spot ${formatModelSpotPrice(snapshot.spot)} · captured ${formatCaptureTime(snapshot.stored.capturedAt)} New York`
|
|
517
|
-
: [`Spot ${formatModelSpotPrice(snapshot.spot)}${quote?.currency ? ` ${quote.currency}` : ""}`,
|
|
557
|
+
: fitMetaParts([`Spot ${formatModelSpotPrice(snapshot.spot)}${quote?.currency ? ` ${quote.currency}` : ""}`,
|
|
518
558
|
// The close a closed session's chain is priced at dates the chain too.
|
|
519
|
-
spotBasis, snapshot.spotBasis?.basis === "close" ? null : selectedExpiry?.asOf?.slice(0, 10)]
|
|
559
|
+
spotBasis, snapshot.spotBasis?.basis === "close" ? null : selectedExpiry?.asOf?.slice(0, 10)],
|
|
560
|
+
// A narrow terminal row keeps the spot whole and leaves out what follows it; the desktop clips in CSS.
|
|
561
|
+
nativePaneChrome ? null : width - 2 - QUERY_BAR_GAP
|
|
562
|
+
- ("Expiry ".length + expiryLabel(pinned ?? barExpiry?.expiration ?? 0).length + QUERY_BAR_GAP)
|
|
563
|
+
- (storedDates.length ? "Date ".length + (shownDate ?? "Live").length + QUERY_BAR_GAP : 0))} /> : null}
|
|
520
564
|
<PaneStatusBody loading={active.loading && !snapshot && !fateNote}
|
|
521
565
|
error={!snapshot && !fateNote ? active.error : null} empty={!!fateNote || !snapshot && !active.loading}
|
|
522
566
|
emptyTitle={fateNote ?? undefined} subject="volatility surface">
|
|
@@ -529,6 +573,23 @@ export function VolSurfacePane({ focused, width, height }: PaneProps) {
|
|
|
529
573
|
|
|
530
574
|
function noRefresh(): void {}
|
|
531
575
|
|
|
576
|
+
/** The terminal query bar's gap between its controls and before its meta. */
|
|
577
|
+
const QUERY_BAR_GAP = 2;
|
|
578
|
+
/**
|
|
579
|
+
* The meta's parts, most important first, joined with " · " as far as they
|
|
580
|
+
* fit in `room` cells; the first always, whole. Without a room, all of them.
|
|
581
|
+
*/
|
|
582
|
+
function fitMetaParts(parts: ReadonlyArray<string | null | undefined>, room: number | null): string {
|
|
583
|
+
const present = parts.filter((part): part is string => !!part);
|
|
584
|
+
let text = present[0] ?? "";
|
|
585
|
+
for (const part of present.slice(1)) {
|
|
586
|
+
const next = `${text} · ${part}`;
|
|
587
|
+
if (room != null && next.length > room) break;
|
|
588
|
+
text = next;
|
|
589
|
+
}
|
|
590
|
+
return text;
|
|
591
|
+
}
|
|
592
|
+
|
|
532
593
|
const wholeNumber = (value: number | null) => value == null ? "--" : String(Math.round(value));
|
|
533
594
|
/** Whether a settled live chain produced any clean quote, with the filter counts that explain why not. */
|
|
534
595
|
function liveQuoteCoverage(snapshot: SurfaceSnapshot | null | undefined) {
|
|
@@ -539,7 +600,8 @@ function liveQuoteCoverage(snapshot: SurfaceSnapshot | null | undefined) {
|
|
|
539
600
|
const zeroBid = counts["zero-bid"];
|
|
540
601
|
const settled = !!snapshot && snapshot.loaded >= snapshot.requested;
|
|
541
602
|
return { empty: settled && expiries.length > 0 && points === 0 && contracts > 0, points, expiries: expiries.length, contracts, zeroBid,
|
|
542
|
-
removed: surfaceFilterSummary(counts), zeroBidMost: Object.values(counts).every((count) => count <= zeroBid)
|
|
603
|
+
removed: surfaceFilterSummary(counts), zeroBidMost: Object.values(counts).every((count) => count <= zeroBid),
|
|
604
|
+
settled, fitted: expiries.some((entry) => entry.fit) };
|
|
543
605
|
}
|
|
544
606
|
const ZERO_BID_HOURS = "The delayed feed publishes zero bids outside regular hours (09:30 to 16:00 New York); the surface fills in when quotes return.";
|
|
545
607
|
|
|
@@ -571,12 +633,22 @@ function ExpiryTable({ snapshot, selected, onSelect, forwards, width, height, fo
|
|
|
571
633
|
const difference = typeof x === "number" && typeof y === "number" ? x - y : String(x ?? "").localeCompare(String(y ?? ""));
|
|
572
634
|
return sort.direction === "asc" ? difference : -difference;
|
|
573
635
|
});
|
|
636
|
+
const cellText = (entry: SurfaceExpiry, id: string) => {
|
|
637
|
+
const raw = value(entry, id);
|
|
638
|
+
return id === "expiry" ? expiryLabel(entry.expiration)
|
|
639
|
+
: raw == null ? missing(entry, id) : typeof raw === "string" ? raw : id === integerColumn ? String(raw)
|
|
640
|
+
: forwards ? (id === "0" ? formatModelSpotPrice(raw) : id === "1" && raw > 0 ? `+${formatPrice(raw)}` : formatPrice(raw)) : formatVolPoints(raw);
|
|
641
|
+
};
|
|
642
|
+
// Each column as wide as its widest cell (the table keeps its header and sort arrow whole), so a narrow pane
|
|
643
|
+
// shows the 25D put and call IVs and the risk reversal beside them before it scrolls.
|
|
644
|
+
const columns = [{ id: "expiry", label: "Expiry" }, ...fields.map((label, i) => ({ id: String(i), label }))].map((column): DataTableColumn => ({
|
|
645
|
+
...column, align: column.id === "expiry" ? "left" : "right",
|
|
646
|
+
width: Math.max(1, ...rows.map((entry) => cellText(entry, column.id).length)),
|
|
647
|
+
}));
|
|
574
648
|
return <DataTableView<SurfaceExpiry> focused={focused} rootWidth={width} rootHeight={height} items={rows}
|
|
575
|
-
columns={
|
|
649
|
+
columns={columns}
|
|
576
650
|
getItemKey={(entry) => String(entry.expiration)} selection={{ kind: "id", selectedId: String(selected?.expiration), getId: (entry) => String(entry.expiration), onChange: (_id, entry) => onSelect(entry) }}
|
|
577
651
|
onActivate={onSelect} onRootKeyDown={onKey} getExportMetadata={metadata} freezeFirstColumn
|
|
578
652
|
sortColumnId={sort.columnId} sortDirection={sort.direction} onHeaderClick={(id) => setSort((current) => nextHeaderSort(current, id))}
|
|
579
|
-
renderCell={(entry, column) => {
|
|
580
|
-
: raw == null ? missing(entry, column.id) : typeof raw === "string" ? raw : column.id === integerColumn ? String(raw)
|
|
581
|
-
: forwards ? (column.id === "0" ? formatModelSpotPrice(raw) : column.id === "1" && raw > 0 ? `+${formatPrice(raw)}` : formatPrice(raw)) : formatVolPoints(raw) }; }} emptyStateTitle="No expiry observations." />;
|
|
653
|
+
renderCell={(entry, column) => ({ text: cellText(entry, column.id) })} emptyStateTitle="No expiry observations." />;
|
|
582
654
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { apiClient } from "../../../api-client";
|
|
2
|
+
import { createPluginCache } from "../../../data/plugin-cache";
|
|
2
3
|
import { parsePublicTickerKey } from "../../../utils/exchanges";
|
|
4
|
+
import { loadCloudResource, type CloudResource } from "../shared/cloud-resource";
|
|
3
5
|
|
|
4
6
|
/** The coins Deribit publishes a volatility index (DVOL) for. */
|
|
5
7
|
export type DvolCurrency = "BTC" | "ETH";
|
|
@@ -21,8 +23,18 @@ export interface DvolPayload {
|
|
|
21
23
|
|
|
22
24
|
export type DvolApi = Pick<typeof apiClient, "impliedVolatility">;
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Each coin's last DVOL, kept so OVDV still shows it, saying when it was
|
|
28
|
+
* saved, when the service cannot be reached. Every load asks the service first.
|
|
29
|
+
*/
|
|
30
|
+
export const dvolCache = createPluginCache<DvolPayload>({
|
|
31
|
+
kind: "deribit-dvol", source: "gloom-cloud", schemaVersion: 1, policy: { staleMs: 0, expireMs: 7 * 86_400_000 },
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
/** A coin's DVOL; the saved copy, with `savedAt`, when the service cannot be reached. */
|
|
35
|
+
export function loadDvol(currency: DvolCurrency, options: { signal?: AbortSignal } = {}, api: DvolApi = apiClient): Promise<CloudResource<DvolPayload>> {
|
|
36
|
+
return loadCloudResource(dvolCache, currency,
|
|
37
|
+
() => api.impliedVolatility<DvolPayload>(`dvol?currency=${currency}`, { signal: options.signal }), { signal: options.signal });
|
|
26
38
|
}
|
|
27
39
|
|
|
28
40
|
/** BTC for BTC-USD (bare or on the coin board), ETH for ETH-USD; null for anything else, the funds trading as BTC and ETH included. */
|
|
@@ -62,9 +62,10 @@ export function createVolatilityHeadless(dependencies: VolatilityHeadlessDepende
|
|
|
62
62
|
context.signal.throwIfAborted();
|
|
63
63
|
// A saved copy answering a failed refresh ends the report with when it was saved.
|
|
64
64
|
const savedCopy = <T>(value: T) => result.savedAt != null ? servedFromSavedCopy(value, result.savedAt) : value;
|
|
65
|
-
// Daily index closes, dated by the newest index on the board
|
|
65
|
+
// Daily index closes, dated by the newest index on the board (Hong Kong's closes a session ahead of New York's);
|
|
66
|
+
// a sparse index shows as the oldest. Each row carries its own date.
|
|
66
67
|
const boardDates = result.data.board.filter((row) => row.value != null).map((row) => row.date);
|
|
67
|
-
const freshness = { source: "Cboe and FRED", status: "not-a-feed" as const, basis: "daily index closes", cadence: "daily" as const,
|
|
68
|
+
const freshness = { source: "Cboe, Hang Seng Indexes and FRED", status: "not-a-feed" as const, basis: "daily index closes", cadence: "daily" as const,
|
|
68
69
|
asOf: newestReportTime([...boardDates, result.data.curve.date]), oldest: oldestReportTime(boardDates) };
|
|
69
70
|
return { ...projectVolatilityHeadless(result.data), freshness, errors: result.errors,
|
|
70
71
|
complete: result.phase === "ready" && !result.stale && result.data.warnings.length === 0,
|
|
@@ -13,7 +13,7 @@ export const volatilityModule: PluginModule = {
|
|
|
13
13
|
paneTemplates: [{
|
|
14
14
|
id: "volatility-term-structure-pane", paneId: "volatility-term-structure",
|
|
15
15
|
label: "VIX Curve", description: "Dated VIX tenor closes, the 3M/30D ratio history and the cross-asset volatility board.",
|
|
16
|
-
keywords: ["vix", "volatility", "vol", "curve", "contango", "backwardation", "vvix", "skew", "move"],
|
|
16
|
+
keywords: ["vix", "volatility", "vol", "curve", "contango", "backwardation", "vvix", "skew", "move", "variance swap", "variance"],
|
|
17
17
|
shortcut: { prefix: "VIX" }, headless: volatilityHeadless,
|
|
18
18
|
createInstance: () => ({ instanceId: "volatility:curve", title: "VIX", placement: "floating", settings: { initialTab: "curve" } }),
|
|
19
19
|
}, {
|
|
@@ -150,7 +150,7 @@ export function VolatilityPane({ focused, width, height }: PaneProps) {
|
|
|
150
150
|
// One binding for every tab and for the loading and failed bodies, where no
|
|
151
151
|
// table is mounted; the footer binds the `v` hint.
|
|
152
152
|
usePaneRefreshKey(() => {
|
|
153
|
-
if (!resource.loading)
|
|
153
|
+
if (!resource.loading) resource.reload();
|
|
154
154
|
}, { focused });
|
|
155
155
|
const asOf = tab === "history" ? data?.term.termDate : tab === "board" ? selected?.date : data?.curve.date;
|
|
156
156
|
// A day's level is its close once Cboe settles it (16:15 New York); before
|
|
@@ -16,6 +16,7 @@ const BOARD_NAMES: Readonly<Record<string, string>> = {
|
|
|
16
16
|
gvz: "Gold volatility index",
|
|
17
17
|
vxeem: "Emerging markets volatility index",
|
|
18
18
|
vxewz: "Brazil volatility index",
|
|
19
|
+
vhsi: "HSI Volatility Index (VHSI)",
|
|
19
20
|
vxapl: "Apple volatility index",
|
|
20
21
|
vxazn: "Amazon volatility index",
|
|
21
22
|
vxgog: "Alphabet volatility index",
|
|
@@ -60,12 +61,15 @@ function dvolSeries(currency: DvolCurrency): SeriesDefinition {
|
|
|
60
61
|
frequency: "daily",
|
|
61
62
|
group: "Volatility",
|
|
62
63
|
tags: ["volatility", "DVOL", "Deribit", "crypto", "implied volatility", currency, `${currency}-USD`, coin.toLowerCase()],
|
|
64
|
+
// Deribit's own names: DVOL is bitcoin's, ETHDVOL ether's. DVOL is also a US fund, which a quote answers for.
|
|
65
|
+
aliases: currency === "BTC" ? ["dvol", "btcdvol"] : ["ethdvol"],
|
|
63
66
|
description: `Deribit's DVOL for ${currency}: the 30-day implied volatility its ${currency} options price, in vol points, daily since March 2021.`,
|
|
64
67
|
url: `https://www.deribit.com/statistics/${currency}/volatility-index`,
|
|
65
68
|
refreshMs: 5 * 60_000,
|
|
66
69
|
load: async ({ signal }) => {
|
|
67
|
-
const payload = await loadDvol(currency, signal ? { signal } : {});
|
|
68
|
-
return { points: payload.observations,
|
|
70
|
+
const { payload, savedAt } = await loadDvol(currency, signal ? { signal } : {});
|
|
71
|
+
return { points: payload.observations, ...(savedAt != null ? { savedAt } : {}),
|
|
72
|
+
attribution: { source: `Deribit DVOL (${currency})`, publisher: "Deribit" } };
|
|
69
73
|
},
|
|
70
74
|
};
|
|
71
75
|
}
|
|
@@ -74,7 +78,7 @@ function dvolSeries(currency: DvolCurrency): SeriesDefinition {
|
|
|
74
78
|
export const VOLATILITY_SERIES: readonly SeriesDefinition[] = [
|
|
75
79
|
...VOLATILITY_INDICES.filter((index) => !FRED_LISTED.has(index.id)).map((index): SeriesDefinition => {
|
|
76
80
|
const name = BOARD_NAMES[index.id] ?? index.label;
|
|
77
|
-
const tags = ["volatility", index.symbol.replace("^", "")];
|
|
81
|
+
const tags = ["volatility", index.symbol.replace("^", ""), ...index.id === "vhsi" ? ["VHSI", "Hong Kong"] : []];
|
|
78
82
|
const code = CORRELATION[index.id];
|
|
79
83
|
return code
|
|
80
84
|
? {
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* US activity in the catalog, beside the chokepoint transits: travellers
|
|
3
|
+
* through TSA's airport checkpoints and electricity demand from EIA-930, each
|
|
4
|
+
* a day at a time with its 7-day average and its change on the same weekday a
|
|
5
|
+
* year earlier. Gloom Cloud reads both from their publishers and serves them
|
|
6
|
+
* through the map's series index (`GEO:TSA`, `GEO:US48.LOAD`), each with who
|
|
7
|
+
* published it and when.
|
|
8
|
+
*/
|
|
9
|
+
import type { ExpressionSeriesDefinition, SeriesDefinition } from "../../../series/types";
|
|
10
|
+
import { formatGeoSeriesExpression } from "../chart-composer/series-expression";
|
|
11
|
+
|
|
12
|
+
const TSA_PAGE = "https://www.tsa.gov/travel/passenger-volumes";
|
|
13
|
+
const EIA_GRID_MONITOR = "https://www.eia.gov/electricity/gridmonitor/";
|
|
14
|
+
|
|
15
|
+
const TSA_TAGS = ["TSA", "air travel", "footfall", "airport", "passengers", "travelers", "checkpoint", "consumer activity"];
|
|
16
|
+
const GRID_TAGS = ["power load", "electricity demand", "grid load", "load", "EIA-930", "power", "electricity"];
|
|
17
|
+
|
|
18
|
+
type Described = Pick<ExpressionSeriesDefinition, "name" | "unit" | "description" | "group" | "publisher" | "url" | "tags">;
|
|
19
|
+
|
|
20
|
+
function entry(alias: string, definition: Described): ExpressionSeriesDefinition {
|
|
21
|
+
return { id: `geo:${alias.toLowerCase()}`, frequency: "daily", ...definition, expression: formatGeoSeriesExpression(alias) };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** An observed series, its 7-day average and its change on the same weekday 52 weeks earlier. */
|
|
25
|
+
function withDerived(
|
|
26
|
+
alias: string,
|
|
27
|
+
name: string,
|
|
28
|
+
unit: string,
|
|
29
|
+
base: Pick<Described, "group" | "publisher" | "url" | "tags">,
|
|
30
|
+
description: string,
|
|
31
|
+
derived: { average: boolean },
|
|
32
|
+
): ExpressionSeriesDefinition[] {
|
|
33
|
+
return [
|
|
34
|
+
entry(alias, { ...base, name, unit, description }),
|
|
35
|
+
...(derived.average
|
|
36
|
+
? [entry(`${alias}.7D`, {
|
|
37
|
+
...base,
|
|
38
|
+
name: `${name}, 7-day average`,
|
|
39
|
+
unit,
|
|
40
|
+
description: `${description} Averaged over the seven days to each day, from at least six of them.`,
|
|
41
|
+
})]
|
|
42
|
+
: []),
|
|
43
|
+
entry(`${alias}.YOY`, {
|
|
44
|
+
...base,
|
|
45
|
+
name: `${name} vs a year ago`,
|
|
46
|
+
unit: "%",
|
|
47
|
+
description: `${description} As a change on the same weekday 52 weeks earlier.`,
|
|
48
|
+
}),
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const TSA_SERIES = withDerived(
|
|
53
|
+
"TSA",
|
|
54
|
+
"US airport checkpoint travelers",
|
|
55
|
+
"people",
|
|
56
|
+
{ group: "Alternative data", publisher: "TSA", url: TSA_PAGE, tags: TSA_TAGS },
|
|
57
|
+
"Travelers screened at TSA airport checkpoints each day, a read on US air travel and footfall.",
|
|
58
|
+
{ average: true },
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
/** The Lower 48 and the balancing authorities that run the largest US power markets, by the alias the server gives them. */
|
|
62
|
+
const GRID_AREAS: ReadonlyArray<{ alias: string; label: string; area: string }> = [
|
|
63
|
+
{ alias: "US48", label: "US Lower 48", area: "the Lower 48 states" },
|
|
64
|
+
{ alias: "ERCOT", label: "ERCOT", area: "ERCOT (most of Texas)" },
|
|
65
|
+
{ alias: "PJM", label: "PJM", area: "PJM (the Mid-Atlantic and parts of the Midwest)" },
|
|
66
|
+
{ alias: "MISO", label: "MISO", area: "MISO (the central US)" },
|
|
67
|
+
{ alias: "CAISO", label: "CAISO", area: "CAISO (most of California)" },
|
|
68
|
+
{ alias: "NYISO", label: "NYISO", area: "NYISO (New York)" },
|
|
69
|
+
{ alias: "ISONE", label: "ISO-NE", area: "ISO-NE (New England)" },
|
|
70
|
+
{ alias: "SPP", label: "SPP", area: "SPP (the central Plains)" },
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
const GRID_SERIES = GRID_AREAS.flatMap(({ alias, label, area }) => withDerived(
|
|
74
|
+
`${alias}.LOAD`,
|
|
75
|
+
`${label} electricity demand`,
|
|
76
|
+
"GWh/day",
|
|
77
|
+
{ group: "Energy", publisher: "EIA", url: EIA_GRID_MONITOR, tags: [...GRID_TAGS, label] },
|
|
78
|
+
alias === "US48"
|
|
79
|
+
? "Electricity demand in the Lower 48 states each Eastern-time day, EIA's own Lower 48 figure from EIA-930, given for the days every balancing authority reported in full, not adjusted for weather."
|
|
80
|
+
: `Electricity demand in ${area} each Eastern-time day, from EIA-930 hourly demand, not adjusted for weather.`,
|
|
81
|
+
// The Lower 48's average is the headline; a balancing authority's stays a `GEO:` expression away.
|
|
82
|
+
{ average: alias === "US48" },
|
|
83
|
+
));
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The catalog's activity series. The server's series index has the rest
|
|
87
|
+
* (`GEO:PJM.LOAD.7D`), charted the same way.
|
|
88
|
+
*/
|
|
89
|
+
export const ACTIVITY_SERIES: readonly SeriesDefinition[] = [...TSA_SERIES, ...GRID_SERIES];
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `gloom fn CHOKE`: the chart's report, each strait's latest day beside its
|
|
3
|
+
* 7- and 28-day averages and the change against the same 28 days a year
|
|
4
|
+
* before, which the chart's year of points does not reach.
|
|
5
|
+
*/
|
|
6
|
+
import type { GeoRequest } from "../../../api-client/geo";
|
|
7
|
+
import type { HeadlessPaneContext, HeadlessSeries, HeadlessSeriesResult, HeadlessSeriesTrailing } from "../../../types/headless";
|
|
8
|
+
import { GEO_SERIES_CAPABILITY_ID } from "../chart-composer/series-expression";
|
|
9
|
+
import { resolveGeoChartSeries } from "./geo-series";
|
|
10
|
+
|
|
11
|
+
const DAY_MS = 86_400_000;
|
|
12
|
+
|
|
13
|
+
interface DatedValue {
|
|
14
|
+
time: number;
|
|
15
|
+
value: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function datedValues(points: readonly { date: string | number | Date; value?: number | null }[]): DatedValue[] {
|
|
19
|
+
return points.flatMap((point) => {
|
|
20
|
+
const time = point.date instanceof Date ? point.date.getTime() : new Date(point.date).getTime();
|
|
21
|
+
return Number.isFinite(time) && typeof point.value === "number" && Number.isFinite(point.value) ? [{ time, value: point.value }] : [];
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** The day one calendar year before `time`; 29 Feb falls back to 28 Feb. */
|
|
26
|
+
function yearBefore(time: number): number {
|
|
27
|
+
const date = new Date(time);
|
|
28
|
+
const day = date.getUTCDate();
|
|
29
|
+
date.setUTCDate(1);
|
|
30
|
+
date.setUTCFullYear(date.getUTCFullYear() - 1);
|
|
31
|
+
const lastDay = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth() + 1, 0)).getUTCDate();
|
|
32
|
+
date.setUTCDate(Math.min(day, lastDay));
|
|
33
|
+
return date.getTime();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The days a window needs values on for its mean to stand for it: 6 of 7, 24
|
|
38
|
+
* of 28. A chart read over a week (`--range 1w`) printed a "28-day" average
|
|
39
|
+
* of 7 days, and a series that starts mid-window one of its few last days.
|
|
40
|
+
*/
|
|
41
|
+
const COVERED_DAYS: Readonly<Record<number, number>> = { 7: 6, 28: 24 };
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The mean of the values dated in the `days` days that end on `end`, or null
|
|
45
|
+
* when fewer of those days have one than `COVERED_DAYS` asks.
|
|
46
|
+
*/
|
|
47
|
+
function windowMean(values: readonly DatedValue[], end: number, days: number): number | null {
|
|
48
|
+
const inside = values.filter((entry) => entry.time <= end && entry.time > end - days * DAY_MS);
|
|
49
|
+
const covered = new Set(inside.map((entry) => Math.floor(entry.time / DAY_MS))).size;
|
|
50
|
+
if (!inside.length || covered < (COVERED_DAYS[days] ?? days)) return null;
|
|
51
|
+
return inside.reduce((sum, entry) => sum + entry.value, 0) / inside.length;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Whether the values reach back to the first day of the `days` days that end on `end`. */
|
|
55
|
+
function reaches(values: readonly DatedValue[], end: number, days: number): boolean {
|
|
56
|
+
return values.some((entry) => entry.time <= end - (days - 1) * DAY_MS);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A daily series' averages to its latest day. The year-ago window is read
|
|
61
|
+
* from `yearAgo` when given (points the chart's range does not reach), else
|
|
62
|
+
* from the series' own points. A window short of its days (`COVERED_DAYS`),
|
|
63
|
+
* now or a year before, is null, and so is the change it would give.
|
|
64
|
+
*/
|
|
65
|
+
export function trailingAverages(
|
|
66
|
+
points: readonly { date: string | number | Date; value?: number | null }[],
|
|
67
|
+
yearAgo?: readonly { date: string | number | Date; value?: number | null }[],
|
|
68
|
+
): HeadlessSeriesTrailing | null {
|
|
69
|
+
const values = datedValues(points);
|
|
70
|
+
const latest = values.reduce((newest, entry) => Math.max(newest, entry.time), Number.NEGATIVE_INFINITY);
|
|
71
|
+
if (!Number.isFinite(latest)) return null;
|
|
72
|
+
const avg7 = windowMean(values, latest, 7);
|
|
73
|
+
const avg28 = windowMean(values, latest, 28);
|
|
74
|
+
const yearAgoEnd = yearBefore(latest);
|
|
75
|
+
const earlier = yearAgo ? datedValues(yearAgo) : values;
|
|
76
|
+
const yearAgoAvg28 = windowMean(earlier, yearAgoEnd, 28);
|
|
77
|
+
const changeVsYearAgoPct = avg28 != null && yearAgoAvg28 != null && yearAgoAvg28 !== 0
|
|
78
|
+
? (avg28 / yearAgoAvg28 - 1) * 100
|
|
79
|
+
: null;
|
|
80
|
+
return { avg7, avg28, yearAgoAvg28, changeVsYearAgoPct };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The map series a chart series is of (`CAP:geo-series:HORMUZ` is HORMUZ), or null for any other source. */
|
|
84
|
+
function geoSeriesToken(series: Pick<HeadlessSeries, "symbol">): string | null {
|
|
85
|
+
const prefix = `CAP:${GEO_SERIES_CAPABILITY_ID}:`;
|
|
86
|
+
return series.symbol?.startsWith(prefix) ? series.symbol.slice(prefix.length) || null : null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function isoDay(time: number): string {
|
|
90
|
+
return new Date(time).toISOString().slice(0, 10);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** The 28 days a year before the series' latest day, read on their own: the chart's year starts after them. */
|
|
94
|
+
async function yearAgoPoints(request: GeoRequest, token: string, series: HeadlessSeries, signal?: AbortSignal) {
|
|
95
|
+
const values = datedValues(series.points);
|
|
96
|
+
if (!values.length) return undefined;
|
|
97
|
+
const latest = Math.max(...values.map((entry) => entry.time));
|
|
98
|
+
const end = yearBefore(latest);
|
|
99
|
+
// Already in the chart's points, or no change to make: the 28 days to the latest are short (`--range 1w`).
|
|
100
|
+
if (reaches(values, end, 28) || windowMean(values, latest, 28) == null) return undefined;
|
|
101
|
+
const window = { start: isoDay(end - 27 * DAY_MS), end: isoDay(end) };
|
|
102
|
+
const resolved = await resolveGeoChartSeries(request, token, { range: "1Y", resolution: "auto", dateWindow: window }, signal);
|
|
103
|
+
return resolved.points.map((point) => ({ date: point.date, value: point.value }));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** CHOKE's series, each with its trailing averages; a year-ago window that cannot be read leaves that change out. */
|
|
107
|
+
export async function withTransitAverages(
|
|
108
|
+
result: HeadlessSeriesResult,
|
|
109
|
+
request: GeoRequest,
|
|
110
|
+
context: Pick<HeadlessPaneContext, "signal">,
|
|
111
|
+
): Promise<HeadlessSeriesResult> {
|
|
112
|
+
const series = await Promise.all(result.series.map(async (entry) => {
|
|
113
|
+
const token = geoSeriesToken(entry);
|
|
114
|
+
if (!token || !entry.points.length) return entry;
|
|
115
|
+
const yearAgo = await yearAgoPoints(request, token, entry, context.signal).catch((error: unknown) => {
|
|
116
|
+
if (context.signal?.aborted) throw error;
|
|
117
|
+
return [];
|
|
118
|
+
});
|
|
119
|
+
const trailing = trailingAverages(entry.points, yearAgo);
|
|
120
|
+
return trailing ? { ...entry, trailing } : entry;
|
|
121
|
+
}));
|
|
122
|
+
return { ...result, series };
|
|
123
|
+
}
|
|
@@ -65,6 +65,8 @@ export const worldMapScreenshotEvidence: PaneScreenshotEvidenceHook<WorldMapEvid
|
|
|
65
65
|
},
|
|
66
66
|
mismatches(evidence, request) {
|
|
67
67
|
const asked = requestedTokens(request);
|
|
68
|
+
// A bare MAP draws the layers its settings hold, else its default (chokepoints): none were asked for to differ from.
|
|
69
|
+
if (asked.length === 0) return [];
|
|
68
70
|
return asked.join(",") === evidence.tokens.join(",") ? [] : ["Map layers differ from the request"];
|
|
69
71
|
},
|
|
70
72
|
unavailable(evidence) {
|