@gloom-sh/terminal 0.20.12 → 0.20.14
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 +2 -1
- package/patches/@opentui%2Fcore@0.3.2.patch +22 -4
- package/src/account/auth-dialog.tsx +22 -4
- package/src/account/auth-form.tsx +6 -1
- package/src/account/billing.ts +3 -2
- package/src/account/checkout-handoff.tsx +7 -14
- package/src/account/device-signin-dialog.tsx +35 -24
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/crypto-markets.ts +10 -0
- package/src/api-client/errors.ts +3 -1
- package/src/api-client/index.ts +10 -2
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/money-markets.ts +7 -0
- package/src/api-client/request.ts +12 -2
- package/src/api-client/telemetry.ts +47 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/types/news.ts +16 -0
- package/src/architecture/floating-promise-allowlist.json +17 -34
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/brokers/signed-in/sign-in-dialog.tsx +38 -38
- package/src/cli/commands/market.ts +146 -55
- package/src/cli/commands/overview.ts +21 -7
- package/src/cli/commands/search.ts +103 -9
- package/src/cli/commands/ticker.ts +22 -13
- package/src/cli/earnings-calendar.ts +33 -53
- package/src/cli/errors.ts +3 -1
- package/src/cli/freshness.ts +7 -2
- package/src/cli/glossary.ts +10 -5
- package/src/cli/helpers.ts +8 -16
- package/src/cli/history-export.ts +4 -0
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/known-gaps.ts +11 -2
- package/src/cli/listing-arg.ts +183 -28
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/catalog.ts +81 -12
- package/src/cli/pane-functions/dom.ts +8 -1
- package/src/cli/pane-functions/freshness.ts +2 -2
- package/src/cli/pane-functions/headless.ts +13 -10
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/options.ts +7 -0
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/pane-functions/resolver.ts +61 -15
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +6 -2
- package/src/cli/result.ts +24 -5
- package/src/cli/symbol-args.ts +5 -3
- package/src/cli/symbol-list.ts +23 -10
- package/src/cli/symbol-rows.ts +135 -3
- package/src/cli/treasury-yields.ts +15 -1
- package/src/components/chart/composite/axis-overlays.tsx +5 -2
- package/src/components/chart/composite/composite-chart.tsx +1 -0
- package/src/components/chart/composite/format.ts +103 -16
- package/src/components/chart/composite/legend.tsx +60 -25
- package/src/components/chart/composite/panel-surface/axis-markers.ts +133 -0
- package/src/components/chart/composite/panel-surface/level-labels.tsx +78 -0
- package/src/components/chart/composite/panel-surface/overlays.ts +108 -0
- package/src/components/chart/composite/panel-surface/pan-coast.ts +54 -0
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +138 -0
- package/src/components/chart/composite/panel-surface/panel-levels.ts +47 -0
- package/src/components/chart/composite/panel-surface/plot-gestures.ts +403 -0
- package/src/components/chart/composite/panel-surface/plot-pointer.ts +65 -0
- package/src/components/chart/composite/panel-surface/plot-wheel.ts +102 -0
- package/src/components/chart/composite/panel-surface/pointer.ts +12 -0
- package/src/components/chart/composite/panel-surface/props.ts +79 -0
- package/src/components/chart/composite/panel-surface/tool-readout.ts +151 -0
- package/src/components/chart/composite/panel-surface/value-axis-gestures.ts +152 -0
- package/src/components/chart/composite/panel-surface.tsx +81 -1177
- package/src/components/chart/composite/time-axis.ts +51 -29
- package/src/components/chart/composite/toolbar.tsx +42 -6
- package/src/components/chart/curve/curve-surface.tsx +5 -5
- package/src/components/command-bar/commands/collection-list.ts +1 -0
- package/src/components/command-bar/list/badge.ts +8 -5
- package/src/components/command-bar/list/model.ts +0 -5
- package/src/components/command-bar/list/view.tsx +39 -2
- package/src/components/command-bar/routes/root/plugin-install.ts +4 -2
- package/src/components/command-bar/routes/root/provider-search.ts +23 -3
- package/src/components/command-bar/routes/root/results.ts +23 -11
- package/src/components/command-bar/routes/root/runtime.ts +3 -2
- package/src/components/command-bar/routes/root/selection.ts +3 -2
- package/src/components/command-bar/routes/root/shortcuts.ts +15 -0
- package/src/components/command-bar/routes/root/start-here.ts +1 -2
- package/src/components/command-bar/routes/ticker-search/actions.ts +2 -3
- package/src/components/command-bar/routes/ticker-search/results.ts +23 -4
- package/src/components/data-table/view.tsx +29 -6
- package/src/components/form-modal/host.tsx +1 -1
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +3 -3
- package/src/components/layout/pane/error-boundary.tsx +2 -1
- package/src/components/layout/pane/title.ts +10 -4
- package/src/components/markdown-text.tsx +36 -0
- package/src/components/market-board/index.tsx +4 -3
- package/src/components/onboarding/first-run-workspace.ts +46 -11
- package/src/components/onboarding/onboarding-keyboard.ts +57 -5
- package/src/components/onboarding/onboarding-wizard.tsx +91 -24
- package/src/components/onboarding/portfolio-step/index.tsx +1 -0
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +36 -9
- package/src/components/onboarding/portfolio-step/types.ts +2 -0
- package/src/components/onboarding/tickers-step-model.ts +140 -0
- package/src/components/onboarding/tickers-step.tsx +116 -0
- package/src/components/onboarding/use-onboarding-broker-form.ts +1 -1
- package/src/components/onboarding/use-onboarding-progress.ts +100 -11
- package/src/components/onboarding/use-onboarding-upgrade.ts +3 -2
- package/src/components/onboarding/wizard-model.ts +3 -1
- package/src/components/onboarding/wizard-tickers.ts +139 -0
- package/src/components/pane-settings-dialog/tui.tsx +6 -3
- package/src/components/pane-settings-dialog.tsx +2 -1
- package/src/components/pane-template-wizard.tsx +2 -0
- package/src/components/price-performance.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +2 -1
- package/src/components/speedometer-gauge/terminal.tsx +13 -8
- package/src/components/ui/choice-dialog.tsx +102 -33
- package/src/components/ui/confirm-dialog.tsx +3 -2
- package/src/components/ui/frame.tsx +7 -3
- package/src/components/ui/icon.tsx +4 -2
- package/src/components/ui/list-view.tsx +8 -0
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/number-prompt-dialog.tsx +2 -1
- package/src/components/ui/query-bar.tsx +16 -4
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/components/use-pane-notice-footer.tsx +3 -1
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +3 -3
- package/src/i18n/es.ts +6 -2
- package/src/i18n/ja.ts +6 -2
- package/src/i18n/ko.ts +6 -2
- package/src/i18n/zh-cn.ts +6 -2
- package/src/i18n/zh-tw.ts +6 -2
- package/src/layout-marketplace/model.ts +2 -1
- package/src/market-data/futures-contract.ts +2 -1
- package/src/market-data/hooks.tsx +1 -1
- package/src/market-data/market/change-basis.ts +27 -5
- package/src/market-data/market/format.ts +48 -14
- package/src/market-data/quotes/contributions.ts +13 -0
- package/src/market-data/quotes/export-identity.ts +36 -1
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/resolution.ts +16 -0
- package/src/market-data/quotes/time.ts +17 -10
- package/src/market-data/tax-equivalent.ts +3 -2
- package/src/news/aggregator.ts +19 -8
- package/src/news/hooks.ts +1 -1
- package/src/news/news-model.ts +49 -0
- package/src/news/types.ts +9 -0
- package/src/plugins/builtin/account-management/calendar-tab.tsx +8 -3
- package/src/plugins/builtin/account-management/pane.tsx +9 -8
- package/src/plugins/builtin/account-management/password-dialog.tsx +2 -2
- package/src/plugins/builtin/alerts/calendar-events.ts +4 -5
- package/src/plugins/builtin/alerts/format.ts +6 -5
- package/src/plugins/builtin/alerts/headless.ts +3 -2
- package/src/plugins/builtin/alerts/history.ts +2 -1
- package/src/plugins/builtin/alerts/pane.tsx +2 -1
- package/src/plugins/builtin/alerts/price-text.ts +2 -1
- package/src/plugins/builtin/alerts/scheduled.ts +6 -5
- package/src/plugins/builtin/analytics/account-returns.ts +6 -7
- package/src/plugins/builtin/analytics/display.ts +2 -1
- package/src/plugins/builtin/analytics/pane-model.ts +5 -9
- package/src/plugins/builtin/analytics/risk-client.ts +12 -2
- package/src/plugins/builtin/analytics/risk-headless.ts +66 -6
- package/src/plugins/builtin/analytics/risk-math.ts +23 -6
- package/src/plugins/builtin/analytics/risk-model.ts +26 -15
- package/src/plugins/builtin/analytics/risk-pane.tsx +8 -7
- package/src/plugins/builtin/analytics/view.tsx +5 -5
- package/src/plugins/builtin/attention/model.ts +6 -5
- package/src/plugins/builtin/attention/pane.tsx +5 -4
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +8 -7
- package/src/plugins/builtin/awards/model.ts +4 -3
- package/src/plugins/builtin/awards/pane.tsx +4 -4
- package/src/plugins/builtin/backtest/format.ts +3 -2
- package/src/plugins/builtin/backtest/report.ts +3 -2
- package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/add-flow.tsx +1 -1
- package/src/plugins/builtin/broker-trading/orders-data.ts +3 -3
- package/src/plugins/builtin/broker-trading/orders.tsx +3 -2
- package/src/plugins/builtin/broker-trading/ticket.tsx +2 -2
- package/src/plugins/builtin/buildout/cells.tsx +2 -1
- package/src/plugins/builtin/buildout/company/pane.tsx +4 -3
- package/src/plugins/builtin/buildout/data-runtime.ts +21 -23
- package/src/plugins/builtin/buildout/detail/values.ts +2 -1
- package/src/plugins/builtin/buildout/format.ts +4 -3
- package/src/plugins/builtin/buildout/pane/index.tsx +3 -3
- package/src/plugins/builtin/catalysts/detail.tsx +2 -1
- package/src/plugins/builtin/catalysts/model.ts +6 -5
- package/src/plugins/builtin/catalysts/pane.tsx +2 -1
- package/src/plugins/builtin/cds/headless.ts +3 -2
- package/src/plugins/builtin/cds/model.ts +8 -8
- package/src/plugins/builtin/cds/pane.tsx +3 -2
- package/src/plugins/builtin/central-bank-rates/headless.ts +2 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +3 -2
- package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -5
- package/src/plugins/builtin/changelog/index.tsx +2 -2
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +5 -2
- package/src/plugins/builtin/chart-composer/editor.tsx +1 -0
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +8 -4
- package/src/plugins/builtin/chart-composer/quick-add.tsx +4 -1
- package/src/plugins/builtin/chart-composer/series-catalog.ts +17 -1
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +3 -1
- package/src/plugins/builtin/chart-composer/user-series.ts +3 -1
- package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
- package/src/plugins/builtin/chat/controller/utils.ts +2 -1
- package/src/plugins/builtin/clinical-trials/model.ts +4 -3
- package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +4 -2
- package/src/plugins/builtin/cloud/askg/lock-note.ts +16 -4
- package/src/plugins/builtin/cloud/askg/model.ts +2 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +35 -1
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
- package/src/plugins/builtin/cloud/plugin.tsx +2 -0
- package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
- package/src/plugins/builtin/cloud/thesis/detail.tsx +13 -8
- package/src/plugins/builtin/cloud/thesis/module.tsx +2 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +6 -2
- package/src/plugins/builtin/cloud-tweets/model.ts +2 -2
- package/src/plugins/builtin/comment-letters/pane.tsx +2 -1
- package/src/plugins/builtin/commodity-balances/headless.ts +3 -2
- package/src/plugins/builtin/company-attention/app-rank.tsx +5 -4
- package/src/plugins/builtin/company-attention/building-model.ts +7 -7
- package/src/plugins/builtin/company-attention/headless.ts +6 -5
- package/src/plugins/builtin/company-attention/model.ts +4 -4
- package/src/plugins/builtin/company-attention/moves-model.ts +9 -9
- package/src/plugins/builtin/company-attention/signals-model.ts +9 -9
- package/src/plugins/builtin/company-kpis/headless.ts +2 -1
- package/src/plugins/builtin/company-kpis/model.ts +15 -10
- package/src/plugins/builtin/company-kpis/pane.tsx +2 -2
- package/src/plugins/builtin/congress-trades/detail.tsx +6 -5
- package/src/plugins/builtin/congress-trades/headless.ts +2 -1
- package/src/plugins/builtin/congress-trades/model.ts +6 -6
- package/src/plugins/builtin/congress-trades/table.tsx +7 -6
- package/src/plugins/builtin/connections/pane.tsx +5 -5
- package/src/plugins/builtin/correlation/headless.ts +2 -2
- package/src/plugins/builtin/correlation/index.tsx +4 -1
- package/src/plugins/builtin/correlation/matrix/selection.ts +2 -1
- package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -3
- package/src/plugins/builtin/cot/headless.ts +3 -2
- package/src/plugins/builtin/cot/model.ts +2 -1
- package/src/plugins/builtin/cot/pane.tsx +4 -3
- package/src/plugins/builtin/cpi/headless.ts +10 -4
- package/src/plugins/builtin/cpi/model.ts +25 -7
- package/src/plugins/builtin/cpi/pane.tsx +3 -1
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +5 -4
- package/src/plugins/builtin/credit-boards/headless.ts +2 -1
- package/src/plugins/builtin/credit-boards/model.ts +5 -5
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/index.tsx +2 -2
- package/src/plugins/builtin/credit-documents/model.ts +2 -2
- package/src/plugins/builtin/crypto-board/client.ts +6 -1
- package/src/plugins/builtin/crypto-board/defi-view.tsx +7 -7
- package/src/plugins/builtin/crypto-board/defi.ts +2 -2
- package/src/plugins/builtin/crypto-board/headless.ts +10 -2
- package/src/plugins/builtin/crypto-board/model.ts +93 -14
- package/src/plugins/builtin/crypto-board/pane.tsx +28 -13
- package/src/plugins/builtin/crypto-board/supply.ts +2 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
- package/src/plugins/builtin/custom-view/index.tsx +3 -1
- package/src/plugins/builtin/custom-view/pane.tsx +5 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +11 -0
- package/src/plugins/builtin/debt-maturities/model.ts +3 -3
- package/src/plugins/builtin/debt-maturities/pane.tsx +2 -2
- package/src/plugins/builtin/dividend-yield/client.ts +31 -5
- package/src/plugins/builtin/dividend-yield/headless.ts +20 -13
- package/src/plugins/builtin/dividend-yield/pane.tsx +12 -10
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +4 -1
- package/src/plugins/builtin/dividend-yield/ranking.ts +21 -12
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +8 -4
- package/src/plugins/builtin/docs/use-docs.ts +4 -2
- package/src/plugins/builtin/doe/headless.ts +2 -1
- package/src/plugins/builtin/doe/model.ts +12 -11
- package/src/plugins/builtin/earnings/board-model.ts +14 -8
- package/src/plugins/builtin/earnings/board-table.ts +13 -8
- package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
- package/src/plugins/builtin/earnings/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings/format.ts +16 -14
- package/src/plugins/builtin/earnings/headless.ts +57 -19
- package/src/plugins/builtin/earnings/history-model.ts +11 -7
- package/src/plugins/builtin/earnings/history-table.ts +22 -9
- package/src/plugins/builtin/earnings/history.tsx +4 -3
- package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings-calls/format.ts +6 -5
- package/src/plugins/builtin/earnings-calls/upcoming.ts +5 -5
- package/src/plugins/builtin/earnings-ripple/headless.ts +2 -1
- package/src/plugins/builtin/earnings-ripple/index.tsx +2 -0
- package/src/plugins/builtin/earnings-ripple/model.ts +3 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
- package/src/plugins/builtin/econ/calendar-model.ts +19 -3
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/fred-catalog.ts +33 -4
- package/src/plugins/builtin/econ/index.tsx +7 -6
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +25 -4
- package/src/plugins/builtin/econ-statistics/pane.tsx +2 -2
- package/src/plugins/builtin/equity-screener/headless.ts +5 -5
- package/src/plugins/builtin/equity-screener/model.ts +6 -4
- package/src/plugins/builtin/equity-screener/pane.tsx +7 -7
- package/src/plugins/builtin/equity-screener/screen-check.ts +2 -1
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
- package/src/plugins/builtin/estimate-revisions/model.ts +3 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +8 -8
- package/src/plugins/builtin/executives/format.ts +4 -4
- package/src/plugins/builtin/exposure/headless.ts +8 -8
- package/src/plugins/builtin/exposure/model.ts +4 -3
- package/src/plugins/builtin/exposure/pane.tsx +6 -5
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/headless.ts +2 -1
- package/src/plugins/builtin/filing-events/feed.ts +2 -1
- package/src/plugins/builtin/futures/table.tsx +8 -8
- package/src/plugins/builtin/futures-curve/headless.ts +18 -18
- package/src/plugins/builtin/futures-curve/model.ts +5 -5
- package/src/plugins/builtin/futures-curve/pane.tsx +8 -8
- package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
- package/src/plugins/builtin/fx-matrix/pairs.ts +2 -1
- package/src/plugins/builtin/gpu/board.tsx +6 -5
- package/src/plugins/builtin/gpu/changes.tsx +2 -1
- package/src/plugins/builtin/gpu/equities.tsx +2 -2
- package/src/plugins/builtin/gpu/headless.ts +4 -3
- package/src/plugins/builtin/gpu/model.ts +8 -7
- package/src/plugins/builtin/help/functions-table.tsx +41 -9
- package/src/plugins/builtin/help/index.tsx +6 -3
- package/src/plugins/builtin/help/keybindings-editor.tsx +35 -7
- package/src/plugins/builtin/help/shortcut-table.tsx +19 -7
- package/src/plugins/builtin/help/table-cells.tsx +51 -0
- package/src/plugins/builtin/holders/pane.tsx +4 -1
- package/src/plugins/builtin/insider/base-values.ts +2 -2
- package/src/plugins/builtin/insider/display.ts +2 -1
- package/src/plugins/builtin/insider/headless.ts +16 -16
- package/src/plugins/builtin/insider/insider-data.ts +2 -1
- package/src/plugins/builtin/insider/signals-model.ts +3 -3
- package/src/plugins/builtin/insider/table-model.ts +27 -13
- package/src/plugins/builtin/insider/table.tsx +1 -1
- package/src/plugins/builtin/ipo-calendar/model.ts +4 -4
- package/src/plugins/builtin/iv-history/format.ts +8 -7
- package/src/plugins/builtin/iv-history/headless.ts +9 -8
- package/src/plugins/builtin/iv-history/pane.tsx +3 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +5 -4
- package/src/plugins/builtin/jobs/headless.ts +11 -11
- package/src/plugins/builtin/jobs/model.ts +2 -2
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/jodi/model.ts +2 -2
- package/src/plugins/builtin/jodi/pane.tsx +2 -1
- package/src/plugins/builtin/kelly-sizer/headless.ts +4 -4
- package/src/plugins/builtin/kelly-sizer/model.ts +2 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -2
- package/src/plugins/builtin/macro-day/headless.ts +27 -15
- package/src/plugins/builtin/macro-day/model.ts +42 -4
- package/src/plugins/builtin/macro-day/pane.tsx +30 -12
- package/src/plugins/builtin/macro-day/releases.ts +24 -1
- package/src/plugins/builtin/market-halts/model.ts +11 -10
- package/src/plugins/builtin/market-halts/pane.tsx +2 -1
- package/src/plugins/builtin/market-heatmap/index.tsx +4 -4
- package/src/plugins/builtin/market-movers/session-table.ts +3 -3
- package/src/plugins/builtin/market-movers/session.ts +2 -1
- package/src/plugins/builtin/market-movers/table.ts +5 -5
- package/src/plugins/builtin/market-valuation/detail.tsx +2 -2
- package/src/plugins/builtin/market-valuation/headless.ts +7 -7
- package/src/plugins/builtin/market-valuation/pane.tsx +7 -7
- package/src/plugins/builtin/members/breadth-pane.tsx +5 -4
- package/src/plugins/builtin/members/headless.ts +2 -1
- package/src/plugins/builtin/members/model.ts +3 -2
- package/src/plugins/builtin/members/pane.tsx +10 -9
- package/src/plugins/builtin/mna/distress/model.ts +2 -1
- package/src/plugins/builtin/mna/model.ts +5 -5
- package/src/plugins/builtin/money-markets/client.ts +4 -1
- package/src/plugins/builtin/money-markets/headless.ts +17 -5
- package/src/plugins/builtin/money-markets/index.tsx +1 -1
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +11 -5
- package/src/plugins/builtin/news/headless.ts +5 -2
- package/src/plugins/builtin/news/wire/breaking/notifications.ts +21 -19
- package/src/plugins/builtin/news/wire/news/row.ts +3 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +3 -2
- package/src/plugins/builtin/news/wire/persisted-articles.ts +28 -3
- package/src/plugins/builtin/notes/headless.ts +2 -1
- package/src/plugins/builtin/notes/model.ts +2 -1
- package/src/plugins/builtin/openfda/pane.tsx +4 -3
- package/src/plugins/builtin/options/carry.ts +3 -2
- package/src/plugins/builtin/options/market-reference.ts +2 -1
- package/src/plugins/builtin/options/table.ts +48 -9
- package/src/plugins/builtin/options/view.tsx +47 -17
- package/src/plugins/builtin/options-calculator/headless.ts +3 -2
- package/src/plugins/builtin/options-calculator/pane.tsx +7 -7
- package/src/plugins/builtin/options-positioning/headless.ts +8 -7
- package/src/plugins/builtin/options-positioning/model.ts +10 -10
- package/src/plugins/builtin/options-positioning/pane.tsx +5 -5
- package/src/plugins/builtin/options-scenario/collar.ts +5 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +11 -10
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +15 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +2 -1
- package/src/plugins/builtin/options-scenario/csp.ts +6 -5
- package/src/plugins/builtin/options-scenario/headless.ts +6 -5
- package/src/plugins/builtin/options-scenario/hedge.ts +3 -3
- package/src/plugins/builtin/options-scenario/pane.tsx +7 -6
- package/src/plugins/builtin/options-scenario/strategy-screen.ts +1 -1
- package/src/plugins/builtin/pe-band/headless.ts +9 -8
- package/src/plugins/builtin/pe-band/pane.tsx +7 -7
- package/src/plugins/builtin/perps/cascade.ts +3 -2
- package/src/plugins/builtin/perps/headless.ts +10 -9
- package/src/plugins/builtin/perps/model.ts +14 -14
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +4 -2
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +61 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +11 -3
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -0
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/headless.ts +33 -6
- package/src/plugins/builtin/portfolio-list/index.tsx +3 -2
- package/src/plugins/builtin/portfolio-list/pane/futures-terms.ts +4 -2
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +5 -3
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +26 -7
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +16 -1
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -2
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +8 -5
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +6 -4
- package/src/plugins/builtin/portfolio-list/table.tsx +25 -15
- package/src/plugins/builtin/power/detail.tsx +6 -5
- package/src/plugins/builtin/power/gas-model.ts +8 -7
- package/src/plugins/builtin/power/gas.tsx +2 -1
- package/src/plugins/builtin/power/headless.ts +7 -6
- package/src/plugins/builtin/power/model.ts +3 -2
- package/src/plugins/builtin/power/prices-headless.ts +10 -9
- package/src/plugins/builtin/power/prices-model.ts +3 -2
- package/src/plugins/builtin/power/prices.tsx +2 -1
- package/src/plugins/builtin/primary-dealers/model.ts +3 -3
- package/src/plugins/builtin/primary-dealers/pane.tsx +2 -2
- package/src/plugins/builtin/rate-path/headless.ts +8 -7
- package/src/plugins/builtin/rate-path/model.ts +6 -5
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +2 -1
- package/src/plugins/builtin/realized-vol/headless.ts +11 -10
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/relative-rotation/pane.tsx +6 -6
- package/src/plugins/builtin/research/analyst-headless.ts +5 -5
- package/src/plugins/builtin/research/analyst-model.ts +7 -7
- package/src/plugins/builtin/research/analyst-pane.tsx +7 -7
- package/src/plugins/builtin/research/client.ts +14 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +40 -30
- package/src/plugins/builtin/research/event-model.ts +55 -22
- package/src/plugins/builtin/research/event-sources.ts +26 -8
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -12
- package/src/plugins/builtin/research/relative-valuation-currency.ts +16 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +33 -21
- package/src/plugins/builtin/research/relative-valuation-model.ts +31 -17
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +29 -14
- package/src/plugins/builtin/research-search/model.ts +2 -1
- package/src/plugins/builtin/research-search/saved-view.tsx +4 -3
- package/src/plugins/builtin/revenue-breakdown/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +7 -7
- package/src/plugins/builtin/reverse-dcf/model.ts +4 -4
- package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-model.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
- package/src/plugins/builtin/scanner/headless.ts +3 -2
- package/src/plugins/builtin/scanner/hilo-model.ts +2 -1
- package/src/plugins/builtin/scanner/live-headless.ts +2 -2
- package/src/plugins/builtin/scanner/live-model.ts +3 -2
- package/src/plugins/builtin/scanner/live-pane.tsx +5 -5
- package/src/plugins/builtin/seasonality/headless.ts +2 -1
- package/src/plugins/builtin/seasonality/pane.tsx +4 -3
- package/src/plugins/builtin/sec/filing-display.tsx +12 -15
- package/src/plugins/builtin/sec/fund-facts.ts +2 -2
- package/src/plugins/builtin/sec/headless.ts +2 -1
- package/src/plugins/builtin/sec/index.tsx +6 -2
- package/src/plugins/builtin/sectors/headless.ts +4 -4
- package/src/plugins/builtin/sectors/index.tsx +7 -7
- package/src/plugins/builtin/shared/cloud-upgrade.ts +4 -2
- package/src/plugins/builtin/shared/cpi-year-gap.ts +67 -0
- package/src/plugins/builtin/shared/earnings-calendar.ts +90 -6
- package/src/plugins/builtin/shared/earnings-report.ts +13 -6
- package/src/plugins/builtin/shared/research-cells.tsx +2 -2
- package/src/plugins/builtin/shared/source-footer.ts +2 -1
- package/src/plugins/builtin/shared/trend.ts +2 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +9 -8
- package/src/plugins/builtin/short-interest/headless.ts +6 -6
- package/src/plugins/builtin/short-interest/model.ts +9 -9
- package/src/plugins/builtin/short-interest/publications-model.ts +5 -5
- package/src/plugins/builtin/short-interest/publications-pane.tsx +3 -2
- package/src/plugins/builtin/short-interest/watch-headless.ts +5 -5
- package/src/plugins/builtin/short-interest/watch-pane.tsx +6 -6
- package/src/plugins/builtin/short-volume/model.ts +5 -5
- package/src/plugins/builtin/short-volume/pane.tsx +4 -4
- package/src/plugins/builtin/social-mentions/headless.ts +2 -1
- package/src/plugins/builtin/social-mentions/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/graph-model.ts +2 -1
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/headless.ts +3 -2
- package/src/plugins/builtin/supply-chain/model.ts +4 -4
- package/src/plugins/builtin/supply-chain/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +2 -1
- package/src/plugins/builtin/themes/headless.ts +2 -1
- package/src/plugins/builtin/themes/model.ts +3 -2
- package/src/plugins/builtin/themes/pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/format.ts +9 -9
- package/src/plugins/builtin/thirteenf/headless.ts +3 -2
- package/src/plugins/builtin/thirteenf/model.ts +2 -1
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +2 -1
- package/src/plugins/builtin/thirteenf/pane.tsx +5 -4
- package/src/plugins/builtin/thirteenf/report-notes.ts +2 -1
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +3 -2
- package/src/plugins/builtin/thirteenf/table.ts +6 -5
- package/src/plugins/builtin/ticker-detail/adr-pair/headless.ts +45 -2
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -3
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +4 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/model.ts +83 -35
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +2 -2
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +14 -18
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +8 -13
- package/src/plugins/builtin/ticker-detail/headless.ts +33 -6
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +8 -9
- package/src/plugins/builtin/ticker-detail/overview/model.ts +28 -14
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +6 -0
- package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +2 -1
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +43 -9
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +7 -5
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +4 -4
- package/src/plugins/builtin/ticker-detail/settings.ts +17 -0
- package/src/plugins/builtin/time-sales/headless.ts +3 -2
- package/src/plugins/builtin/time-sales/model.ts +7 -5
- package/src/plugins/builtin/time-sales/pane.tsx +7 -6
- package/src/plugins/builtin/trace-bonds/model.ts +3 -2
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +6 -6
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +3 -2
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +10 -9
- package/src/plugins/builtin/treasury-auctions/hk.ts +5 -5
- package/src/plugins/builtin/treasury-auctions/model.ts +4 -4
- package/src/plugins/builtin/treasury-auctions/pane.tsx +18 -18
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -1
- package/src/plugins/builtin/treasury-daily/model.ts +2 -2
- package/src/plugins/builtin/vol-surface/events.ts +5 -4
- package/src/plugins/builtin/vol-surface/headless.ts +19 -18
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/pane.tsx +8 -7
- package/src/plugins/builtin/vol-surface/stored.ts +2 -1
- package/src/plugins/builtin/vol-surface/tables.ts +4 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -4
- package/src/plugins/builtin/volatility/pane.tsx +6 -6
- package/src/plugins/builtin/world-indices/headless.ts +7 -7
- package/src/plugins/builtin/world-indices/index.tsx +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +2 -1
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +2 -1
- package/src/plugins/builtin/world-venue-map/layers.ts +3 -2
- package/src/plugins/builtin/world-venue-map/use-geo.ts +4 -2
- package/src/plugins/builtin/yield-curve/curves.ts +3 -3
- package/src/plugins/builtin/yield-curve/headless.ts +7 -6
- package/src/plugins/builtin/yield-curve/index.tsx +5 -4
- package/src/plugins/builtin/yield-curve/swaps.tsx +2 -1
- package/src/portfolio/allocation.ts +5 -5
- package/src/portfolio/collection-name.ts +2 -1
- package/src/portfolio/column-values.ts +61 -45
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/portfolio/listed-symbol.ts +4 -2
- package/src/portfolio/period-pnl.ts +51 -1
- package/src/renderers/dom/dialog-host.tsx +5 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/electrobun/view/remote/capability-invoker.ts +1 -1
- package/src/renderers/opentui/dialog-host.tsx +3 -4
- package/src/renderers/opentui/ui-host.tsx +32 -2
- package/src/renderers/share/layout-view.tsx +2 -1
- package/src/sources/gloomberb-cloud/news.ts +9 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +7 -0
- package/src/sources/provider-router/history.ts +5 -2
- package/src/sources/provider-router/search.ts +15 -10
- package/src/state/hooks/inline-tickers.ts +3 -2
- package/src/state/hooks/quote-streaming.ts +9 -10
- package/src/team/collections-sync.ts +8 -3
- package/src/telemetry/usage-counts.ts +26 -0
- package/src/test-support/plugin-persistence.ts +12 -0
- package/src/tickers/company-name-listing.ts +6 -5
- package/src/tickers/company-name.ts +36 -2
- package/src/tickers/instrument-coverage.ts +27 -0
- package/src/tickers/listing-venues.ts +26 -1
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/home-listing.ts +38 -1
- package/src/tickers/search/index.ts +22 -2
- package/src/tickers/search/ranking.ts +21 -2
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/time-series/base-series.ts +4 -0
- package/src/time-series/fundamentals/statement-fields.ts +11 -14
- package/src/time-series/history-acquisition.ts +1 -1
- package/src/time-series/log-scale.ts +9 -0
- package/src/time-series/reporting.ts +3 -3
- package/src/time-series/resolve.ts +6 -4
- package/src/time-series/transforms.ts +10 -5
- package/src/time-series/types.ts +5 -2
- package/src/types/config.ts +9 -0
- package/src/types/data-provider.ts +3 -2
- package/src/types/financials.ts +28 -0
- package/src/types/headless.ts +2 -0
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-panes.ts +1 -1
- package/src/types/plugin-reports.ts +8 -0
- package/src/ui/dialog-stack.ts +17 -0
- package/src/ui/dialog.tsx +6 -2
- package/src/utils/crypto-pair.ts +9 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/exchanges.ts +13 -0
- package/src/utils/financial-statements.ts +98 -17
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/futures-generic.ts +14 -0
- package/src/utils/growth.ts +67 -0
- package/src/utils/keyboard.ts +6 -0
- package/src/utils/options.ts +1 -1
- package/src/utils/report-timing.ts +2 -2
- package/src/utils/served-rates.ts +45 -0
- package/src/utils/text-wrap.ts +84 -3
- package/src/utils/trailing-dividend.ts +13 -3
- package/src/utils/zoned-date-time.ts +47 -22
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* caps, the view a request covers, and plain-value formatting shared by the
|
|
4
4
|
* pane, the terminal map and the headless report.
|
|
5
5
|
*/
|
|
6
|
+
import { formatShortDate } from "../../../utils/datetime-format";
|
|
6
7
|
import {
|
|
7
8
|
GEO_MAX_LIVE_LAYERS,
|
|
8
9
|
type GeoBbox,
|
|
@@ -148,7 +149,7 @@ export const MAP_PRESET_OPTIONS = [
|
|
|
148
149
|
function shortDate(iso: string): string | null {
|
|
149
150
|
const time = Date.parse(iso);
|
|
150
151
|
if (!Number.isFinite(time)) return null;
|
|
151
|
-
return
|
|
152
|
+
return formatShortDate(time, { year: false, utc: true });
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
/**
|
|
@@ -177,7 +178,7 @@ export function layerCoverageNote(layer: Pick<GeoLayerInfo, "id" | "name" | "asO
|
|
|
177
178
|
function asOfDate(iso: string): string | null {
|
|
178
179
|
const time = Date.parse(iso);
|
|
179
180
|
if (!Number.isFinite(time)) return null;
|
|
180
|
-
return
|
|
181
|
+
return formatShortDate(time, { utc: true });
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
/** Status and cadence in plain words, for the layer picker. */
|
|
@@ -3,6 +3,7 @@ import { peekGeoCatalog, type GeoLayerInfo, type GeoLayersPayload, type GeoReque
|
|
|
3
3
|
import { cloudGeoRequest, loadMapCatalog } from "./client";
|
|
4
4
|
import { GeoLayerFeed, type GeoFeedOptions, type GeoLayerState } from "./feed";
|
|
5
5
|
import type { GeoView } from "./layers";
|
|
6
|
+
import { logFailure } from "../../../utils/log-failure";
|
|
6
7
|
|
|
7
8
|
export interface GeoCatalogState {
|
|
8
9
|
catalog: GeoLayersPayload | null;
|
|
@@ -22,9 +23,10 @@ export function useGeoCatalog(request: GeoRequest = cloudGeoRequest): GeoCatalog
|
|
|
22
23
|
});
|
|
23
24
|
useEffect(() => {
|
|
24
25
|
let current = true;
|
|
25
|
-
|
|
26
|
+
// A failed request answers null; anything else is logged.
|
|
27
|
+
loadMapCatalog(request).then((catalog) => {
|
|
26
28
|
if (current) setState({ catalog, settled: true });
|
|
27
|
-
});
|
|
29
|
+
}, logFailure("world-venue-map.geo", "Loading the map layer catalog failed"));
|
|
28
30
|
return () => {
|
|
29
31
|
current = false;
|
|
30
32
|
};
|
|
@@ -7,7 +7,7 @@ import { yieldSpreads, type YieldLookbackCurves } from "./chart";
|
|
|
7
7
|
import { completeYieldCurve, loadHistoricalYieldCurve, yieldCurveDate } from "./history";
|
|
8
8
|
import { DATE_OPTION_FORMATS, dateOptionHint, readCalendarDate } from "../../../utils/calendar-date";
|
|
9
9
|
import { formatBasisPoints } from "../../../utils/basis-points";
|
|
10
|
-
import { formatPercentileRank } from "../../../utils/format";
|
|
10
|
+
import { MISSING_VALUE, formatPercentileRank } from "../../../utils/format";
|
|
11
11
|
import { isYieldObservationDate, loadYieldCurve, type YieldPoint } from "./treasury-data";
|
|
12
12
|
|
|
13
13
|
export type CurveId = CloudCurveId;
|
|
@@ -181,8 +181,8 @@ export function curveSpreadFigures(data: CurveData | null, lookbacks: YieldLookb
|
|
|
181
181
|
*/
|
|
182
182
|
export function curveSpreadText(figure: CurveSpreadFigure): { value: string; detail: string } {
|
|
183
183
|
return {
|
|
184
|
-
value: figure.value == null ?
|
|
185
|
-
detail: [`${figure.change1d == null ?
|
|
184
|
+
value: figure.value == null ? MISSING_VALUE : formatBasisPoints(figure.value),
|
|
185
|
+
detail: [`${figure.change1d == null ? MISSING_VALUE : formatBasisPoints(figure.change1d)} 1D`,
|
|
186
186
|
...(figure.percentile1y == null ? [] : [formatPercentileRank(figure.percentile1y, "1Y")])].join(" · "),
|
|
187
187
|
};
|
|
188
188
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import type {
|
|
2
3
|
HeadlessPaneContext,
|
|
3
4
|
HeadlessPaneDefinition,
|
|
@@ -19,9 +20,9 @@ import { formatSwapBp, selectedSwapTenor } from "./swaps-model";
|
|
|
19
20
|
import { logFailure } from "../../../utils/log-failure";
|
|
20
21
|
import { usBondMarketClosedNote } from "../../../market-data/us-bond-market";
|
|
21
22
|
|
|
22
|
-
const percent = (value: unknown) => value == null ?
|
|
23
|
+
const percent = (value: unknown) => value == null ? MISSING_VALUE : `${Number(value).toFixed(2)}%`;
|
|
23
24
|
/** A move already in basis points: `+3bp`, `-1bp`, `0bp`. */
|
|
24
|
-
const basisPoints = (value: unknown) => value == null ?
|
|
25
|
+
const basisPoints = (value: unknown) => value == null ? MISSING_VALUE : formatBasisPoints(Number(value) / 100);
|
|
25
26
|
const MATURITY_COLUMNS = [
|
|
26
27
|
{ key: "maturity", header: "Maturity" },
|
|
27
28
|
{
|
|
@@ -39,7 +40,7 @@ const COLUMNS = [
|
|
|
39
40
|
{ key: "change1dBasisPoints", header: "1D bp", align: "right" as const, format: basisPoints },
|
|
40
41
|
AS_OF_COLUMN,
|
|
41
42
|
];
|
|
42
|
-
const percentile = (value: unknown) => value == null ?
|
|
43
|
+
const percentile = (value: unknown) => value == null ? MISSING_VALUE : Number(value).toFixed(0);
|
|
43
44
|
/**
|
|
44
45
|
* With Gloom Cloud's move ranks: each tenor's 1D and 1W move, how big it was
|
|
45
46
|
* against every move of its kind (a percentile), and the year that history
|
|
@@ -51,7 +52,7 @@ const RANKED_COLUMNS = [
|
|
|
51
52
|
{ key: "move1dPercentile", header: "1D pctl", align: "right" as const, format: percentile },
|
|
52
53
|
{ key: "change1wBasisPoints", header: "1W bp", align: "right" as const, format: basisPoints },
|
|
53
54
|
{ key: "move1wPercentile", header: "1W pctl", align: "right" as const, format: percentile },
|
|
54
|
-
{ key: "movesSince", header: "Since", format: (value: unknown) => typeof value === "string" ? value.slice(0, 4) :
|
|
55
|
+
{ key: "movesSince", header: "Since", format: (value: unknown) => typeof value === "string" ? value.slice(0, 4) : MISSING_VALUE },
|
|
55
56
|
AS_OF_COLUMN,
|
|
56
57
|
];
|
|
57
58
|
const RANK_NOTE = "pctl is the share of the tenor's 1D (or 1W) moves since the year in Since that were smaller, ties counted half.";
|
|
@@ -74,8 +75,8 @@ const WORLD_COLUMNS = [
|
|
|
74
75
|
const SWAP_COLUMNS = [
|
|
75
76
|
{ key: "tenor", header: "Tenor" },
|
|
76
77
|
{ key: "rate", header: "Rate %", align: "right" as const, format: percent },
|
|
77
|
-
{ key: "changeBp", header: "1D bp", align: "right" as const, format: (value: unknown) => value == null ?
|
|
78
|
-
{ key: "spreadBp", header: "Spread bp", align: "right" as const, format: (value: unknown) => value == null ?
|
|
78
|
+
{ key: "changeBp", header: "1D bp", align: "right" as const, format: (value: unknown) => value == null ? MISSING_VALUE : formatSwapBp(Number(value)) },
|
|
79
|
+
{ key: "spreadBp", header: "Spread bp", align: "right" as const, format: (value: unknown) => value == null ? MISSING_VALUE : formatSwapBp(Number(value)) },
|
|
79
80
|
{ key: "tradeCount", header: "Trades", align: "right" as const,
|
|
80
81
|
format: (value: unknown, row: Record<string, unknown>) => `${value}${row.quality === "thin" ? " Thin" : ""}` },
|
|
81
82
|
];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
2
3
|
import {
|
|
3
4
|
ChartTableHeader, CurveSurface, curveGhostColors, DataTableView, formatPercentAxis, Notice, PaneFooterScope,
|
|
@@ -338,9 +339,9 @@ function CurveTab({ curve, onCurveChange, focused, width, height }: {
|
|
|
338
339
|
const strip = curveStrip(series, formatValue, { caption: differenceView ? "Change" : level ? `${level} %` : "Yield %", selectedPointId: selectedId });
|
|
339
340
|
const renderCell = useCallback((row: YieldTenorRow, column: DataTableColumn) => {
|
|
340
341
|
if (column.id === "tenor") return { text: row.id };
|
|
341
|
-
if (column.id === "asOf") return { text: row.asOf ??
|
|
342
|
+
if (column.id === "asOf") return { text: row.asOf ?? MISSING_VALUE, color: colors.textMuted };
|
|
342
343
|
const value = row[column.id as "yield" | "compare" | "forward" | "change1d" | "change1w" | "change1m" | "changeCompare"];
|
|
343
|
-
if (value == null) return { text:
|
|
344
|
+
if (value == null) return { text: MISSING_VALUE, color: colors.textMuted };
|
|
344
345
|
if (column.id === "yield" || column.id === "compare" || column.id === "forward") return { text: formatYield(value) };
|
|
345
346
|
// Colour follows the shown basis points, so a move that rounds to 0bp stays neutral.
|
|
346
347
|
return { text: formatYieldChange(value), color: priceColor(Math.round(value * 100), colors) };
|
|
@@ -459,7 +460,7 @@ function WorldTab({ onOpen, focused, width, height }: {
|
|
|
459
460
|
if (column.id === "asOf") return { text: row.asOf, color: colors.textMuted };
|
|
460
461
|
const value = row[column.id as "twoYear" | "tenYear" | "thirtyYear" | "twosTens" | "twoYearChange" | "tenYearChange"
|
|
461
462
|
| "thirtyYearChange" | "twosTensChange"];
|
|
462
|
-
if (value == null) return { text:
|
|
463
|
+
if (value == null) return { text: MISSING_VALUE, color: colors.textMuted };
|
|
463
464
|
if (column.id === "twoYear" || column.id === "tenYear" || column.id === "thirtyYear") return { text: formatYield(value) };
|
|
464
465
|
const text = formatYieldChange(value);
|
|
465
466
|
// The curve spread is a level in basis points; the day moves carry their sign's colour.
|
|
@@ -511,7 +512,7 @@ export const yieldCurveModule: PluginModule = {
|
|
|
511
512
|
paneId: "yield-curve",
|
|
512
513
|
label: "Yield Curve",
|
|
513
514
|
description: "Government bond curves, a world grid, and USD SOFR swap rates, swap spreads and tenor history.",
|
|
514
|
-
keywords: ["yield", "curve", "treasury", "bonds", "rates", "gc", "interest", "tips", "breakeven", "bund", "gilt", "jgb",
|
|
515
|
+
keywords: ["yield", "curve", "treasury", "bonds", "rates", "gc", "interest", "tips", "breakeven", "bund", "bunds", "germany", "german", "gilt", "jgb",
|
|
515
516
|
"mbono", "cetes", "prefixado", "sovereign", "world", "forward", "swaps", "sofr", "ois", "swap spread", "2s10s", "steepener", "flattener"],
|
|
516
517
|
shortcut: { prefix: "GC", argPlaceholder: "[curve] [date]", argKind: "text", argOptional: true },
|
|
517
518
|
headless: yieldCurveHeadless,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useCallback, useMemo } from "react";
|
|
2
3
|
import type { SwapPoint } from "../../../api-client/swap-curve";
|
|
3
4
|
import {
|
|
@@ -80,7 +81,7 @@ export function SwapsTab({ focused, width, height }: { focused: boolean; width:
|
|
|
80
81
|
if (column.id === "tradeCount") return { text: `${row.tradeCount}${row.quality === "thin" ? " Thin" : ""}`, value: row.tradeCount,
|
|
81
82
|
color: row.quality === "ok" ? undefined : colors.warning };
|
|
82
83
|
const value = row[column.id as "rate" | "changeBp" | "spreadBp"];
|
|
83
|
-
if (value == null) return { text:
|
|
84
|
+
if (value == null) return { text: MISSING_VALUE, color: colors.textMuted };
|
|
84
85
|
if (column.id === "rate") return { text: formatYield(value), value };
|
|
85
86
|
return { text: formatSwapBp(value), value,
|
|
86
87
|
color: column.id === "changeBp" ? priceColor(Math.round(value * 10), colors) : undefined };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Portfolio, PortfolioCash } from "../types/ticker";
|
|
2
2
|
import type { BrokerAccount } from "../types/trading";
|
|
3
3
|
import { currencyMinorDigits, getCurrencySymbol, resolveAssetDisplayKind } from "../market-data/market/format";
|
|
4
|
-
import { formatNumber } from "../utils/format";
|
|
4
|
+
import { MISSING_VALUE, formatNumber } from "../utils/format";
|
|
5
5
|
import { parseTypedNumber } from "../utils/decimal-comma";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -264,14 +264,14 @@ export function describeTargetSum(targetSum: number | null, basis: WeightBasis =
|
|
|
264
264
|
|
|
265
265
|
/** A weight to one decimal: 12.3%. */
|
|
266
266
|
export function formatAllocationWeight(value: number | null | undefined): string {
|
|
267
|
-
if (!finite(value)) return
|
|
267
|
+
if (!finite(value)) return MISSING_VALUE;
|
|
268
268
|
const fixed = value.toFixed(1);
|
|
269
269
|
return `${/[1-9]/.test(fixed) ? fixed : fixed.replace("-", "")}%`;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
/** Drift in percentage points, always signed unless it rounds to zero: +2.3pp. */
|
|
273
273
|
export function formatAllocationDrift(value: number | null | undefined): string {
|
|
274
|
-
if (!finite(value)) return
|
|
274
|
+
if (!finite(value)) return MISSING_VALUE;
|
|
275
275
|
const fixed = Math.abs(value).toFixed(1);
|
|
276
276
|
if (!/[1-9]/.test(fixed)) return `${fixed}pp`;
|
|
277
277
|
return `${value > 0 ? "+" : "-"}${fixed}pp`;
|
|
@@ -287,7 +287,7 @@ export function formatTradeUnits(
|
|
|
287
287
|
value: number | null | undefined,
|
|
288
288
|
{ units, assetCategory }: { units: number; assetCategory?: string },
|
|
289
289
|
): string {
|
|
290
|
-
if (!finite(value)) return
|
|
290
|
+
if (!finite(value)) return MISSING_VALUE;
|
|
291
291
|
const kind = resolveAssetDisplayKind({ assetCategory });
|
|
292
292
|
const whole = kind !== "crypto" && kind !== "cash" && Number.isInteger(units);
|
|
293
293
|
const decimals = whole ? 0 : kind === "crypto" ? 4 : 2;
|
|
@@ -307,7 +307,7 @@ export function formatAllocationMoney(
|
|
|
307
307
|
currency: string,
|
|
308
308
|
{ signed = false, whole = false }: { signed?: boolean; whole?: boolean } = {},
|
|
309
309
|
): string {
|
|
310
|
-
if (!finite(value)) return
|
|
310
|
+
if (!finite(value)) return MISSING_VALUE;
|
|
311
311
|
const digits = whole ? 0 : currencyMinorDigits(currency);
|
|
312
312
|
const body = formatNumber(Math.abs(value), digits);
|
|
313
313
|
const zero = !/[1-9]/.test(body);
|
|
@@ -82,8 +82,9 @@ export function readWatchlistArgument(
|
|
|
82
82
|
watchlist: { name: string },
|
|
83
83
|
members: readonly string[],
|
|
84
84
|
maximum: number | undefined,
|
|
85
|
+
kind: "watchlist" | "portfolio" = "watchlist",
|
|
85
86
|
): { symbols: string[]; note: string } {
|
|
86
|
-
const read = `Read ${typed.trim()} as
|
|
87
|
+
const read = `Read ${typed.trim()} as ${kind} ${watchlist.name} (${members.length} ${kind === "portfolio" ? "holding" : "symbol"}${members.length === 1 ? "" : "s"})`;
|
|
87
88
|
if (maximum == null || members.length <= maximum) return { symbols: [...members], note: `${read}.` };
|
|
88
89
|
return { symbols: members.slice(0, maximum), note: `${read}; the first ${maximum} are read.` };
|
|
89
90
|
}
|
|
@@ -12,7 +12,7 @@ import { colors, priceColor, shownPriceColor } from "../theme/colors";
|
|
|
12
12
|
import { formatQuoteAgeWithSource, resolveQuoteAgeTimestamp } from "../market-data/quotes/time";
|
|
13
13
|
import { delistingStateLabel } from "../market-data/quotes/delisting";
|
|
14
14
|
import { formatFeedTime, formatShortDate, parseDisplayDate, type ShortDateOptions } from "../utils/datetime-format";
|
|
15
|
-
import { convertCurrency, formatCompact, formatCompactAmount, formatNumber, formatPercentRaw } from "../utils/format";
|
|
15
|
+
import { MISSING_VALUE, convertCurrency, formatCompact, formatCompactAmount, formatNumber, formatPercentRaw } from "../utils/format";
|
|
16
16
|
import {
|
|
17
17
|
formatMarketCost,
|
|
18
18
|
quoteFormatOptions,
|
|
@@ -157,25 +157,35 @@ export interface ColumnContext {
|
|
|
157
157
|
/**
|
|
158
158
|
* P&L over a period instead of since cost (the pane's P&L From): P&L shows
|
|
159
159
|
* each row's P&L between the two closes and P&L% its contribution to the
|
|
160
|
-
* book. Rows are missing while the closes load (`pending`). `
|
|
161
|
-
*
|
|
162
|
-
*
|
|
160
|
+
* book. Rows are missing while the closes load (`pending`). `lines` are
|
|
161
|
+
* the lines under the rows: a book in more than one currency's part in each
|
|
162
|
+
* (its price P&L, its FX line, its total), so the rows and FX lines add up
|
|
163
|
+
* to the header's total.
|
|
163
164
|
*/
|
|
164
|
-
periodPnl?: { rows: ReadonlyMap<string, PeriodPnlRow>; pending: boolean;
|
|
165
|
+
periodPnl?: { rows: ReadonlyMap<string, PeriodPnlRow>; pending: boolean; lines?: readonly PeriodSummaryLine[] | null };
|
|
165
166
|
/** Moves whenever `periodPnl` does. */
|
|
166
167
|
periodPnlVersion?: number;
|
|
167
168
|
}
|
|
168
169
|
|
|
170
|
+
/** A line under a period's rows (`FX HKD`, `HKD total`): its label, P&L and contribution. */
|
|
171
|
+
export interface PeriodSummaryLine {
|
|
172
|
+
id: string;
|
|
173
|
+
label: string;
|
|
174
|
+
/** Null when every holding it covers is left out. */
|
|
175
|
+
pnl: number | null;
|
|
176
|
+
contribution: number | null;
|
|
177
|
+
}
|
|
178
|
+
|
|
169
179
|
/** A row's P&L or contribution over the pane's period: `…` while the closes load, `—` without both. */
|
|
170
180
|
function periodPnlCell(period: NonNullable<ColumnContext["periodPnl"]>, symbol: string, field: "pnl" | "contribution"): { text: string; color?: string } {
|
|
171
181
|
const row = period.rows.get(symbol);
|
|
172
|
-
if (!row) return { text: period.pending ? "…" :
|
|
182
|
+
if (!row) return { text: period.pending ? "…" : MISSING_VALUE };
|
|
173
183
|
return periodPnlFigure(row[field], field);
|
|
174
184
|
}
|
|
175
185
|
|
|
176
186
|
/** A period's P&L (`pnl`) or contribution figure as the P&L and P&L% cells show it, the FX line's included. */
|
|
177
187
|
export function periodPnlFigure(value: number | null | undefined, field: "pnl" | "contribution"): { text: string; color?: string; value?: number } {
|
|
178
|
-
if (value == null || !Number.isFinite(value)) return { text:
|
|
188
|
+
if (value == null || !Number.isFinite(value)) return { text: MISSING_VALUE };
|
|
179
189
|
return field === "pnl"
|
|
180
190
|
? { text: formatCompactAmount(value, { signed: true }), color: priceColor(value), value }
|
|
181
191
|
: { text: formatPercentRaw(value), color: shownPriceColor(value, 2), value };
|
|
@@ -208,7 +218,13 @@ function perpetualValue(columnId: keyof typeof PERPETUAL_FIELDS, symbol: string,
|
|
|
208
218
|
}
|
|
209
219
|
|
|
210
220
|
/** Position and calendar dates as "Jan 5", read in UTC. */
|
|
211
|
-
const MONTH_DAY: ShortDateOptions = { year: false, utc: true, fallback:
|
|
221
|
+
const MONTH_DAY: ShortDateOptions = { year: false, utc: true, fallback: MISSING_VALUE };
|
|
222
|
+
|
|
223
|
+
/** A day column: "5 Jan" on screen, the ISO day in an export (an empty cell without one), as AS OF exports its day. */
|
|
224
|
+
function dayCell(date: Date | null): { text: string; value: string | null } {
|
|
225
|
+
const text = formatShortDate(date, MONTH_DAY);
|
|
226
|
+
return { text, value: date && Number.isFinite(date.getTime()) ? date.toISOString().slice(0, 10) : null };
|
|
227
|
+
}
|
|
212
228
|
|
|
213
229
|
function startOfUtcDay(date: Date): number {
|
|
214
230
|
return Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
|
|
@@ -222,7 +238,7 @@ function daysSince(value: Date | string | number | null | undefined, now: number
|
|
|
222
238
|
}
|
|
223
239
|
|
|
224
240
|
function formatHeldDays(days: number | null): string {
|
|
225
|
-
if (days == null) return
|
|
241
|
+
if (days == null) return MISSING_VALUE;
|
|
226
242
|
if (days < 365) return `${days}d`;
|
|
227
243
|
return `${formatNumber(days / 365, 1)}y`;
|
|
228
244
|
}
|
|
@@ -266,7 +282,7 @@ function listedCurrency(
|
|
|
266
282
|
|
|
267
283
|
function compactText(value: string | null | undefined): string {
|
|
268
284
|
const trimmed = value?.trim();
|
|
269
|
-
return trimmed ? trimmed :
|
|
285
|
+
return trimmed ? trimmed : MISSING_VALUE;
|
|
270
286
|
}
|
|
271
287
|
|
|
272
288
|
function targetValue(data: AnalystResearchData | null | undefined): number | null {
|
|
@@ -457,7 +473,7 @@ export function resolvePortfolioPriceValue(
|
|
|
457
473
|
if (brokerMarkPrice != null) {
|
|
458
474
|
return { text: formatMarketPrice(brokerMarkPrice, { ...formatOptions, maxWidth }) };
|
|
459
475
|
}
|
|
460
|
-
return { text:
|
|
476
|
+
return { text: MISSING_VALUE };
|
|
461
477
|
}
|
|
462
478
|
|
|
463
479
|
/**
|
|
@@ -628,7 +644,7 @@ export function getColumnValue(
|
|
|
628
644
|
case "industry":
|
|
629
645
|
return { text: compactText(ticker.metadata.industry || financials?.profile?.industry) };
|
|
630
646
|
case "tags":
|
|
631
|
-
return { text: ticker.metadata.tags.length > 0 ? ticker.metadata.tags.join(",") :
|
|
647
|
+
return { text: ticker.metadata.tags.length > 0 ? ticker.metadata.tags.join(",") : MISSING_VALUE };
|
|
632
648
|
case "price": {
|
|
633
649
|
const cell = resolvePortfolioPriceValue(headlineQuote, brokerMarkPrice, headlineQuote ? currentQuoteOptions : markOptions, col.width, quote?.marketState);
|
|
634
650
|
// An extended-hours print says which session it is from, before it so the digits stay aligned: AH 158.78.
|
|
@@ -637,7 +653,7 @@ export function getColumnValue(
|
|
|
637
653
|
return session ? { ...cell, text: `${EXTENDED_SESSION_MARKS[session]} ${cell.text}`, value: headlineQuote.price } : cell;
|
|
638
654
|
}
|
|
639
655
|
case "change":
|
|
640
|
-
if (!headlineQuote) return { text:
|
|
656
|
+
if (!headlineQuote) return { text: MISSING_VALUE };
|
|
641
657
|
// A listing that no longer trades has no day's move: its last session's is years old.
|
|
642
658
|
if (quote?.delisting) return { text: delistingStateLabel(quote.delisting), color: colors.warning };
|
|
643
659
|
return {
|
|
@@ -645,23 +661,23 @@ export function getColumnValue(
|
|
|
645
661
|
color: marketChangeColor(headlineQuote.change, quote?.marketState),
|
|
646
662
|
};
|
|
647
663
|
case "bid":
|
|
648
|
-
return { text: quote?.bid != null ? formatMarketPrice(quote.bid, { ...currentQuoteOptions, maxWidth: col.width }) :
|
|
664
|
+
return { text: quote?.bid != null ? formatMarketPrice(quote.bid, { ...currentQuoteOptions, maxWidth: col.width }) : MISSING_VALUE };
|
|
649
665
|
case "ask":
|
|
650
|
-
return { text: quote?.ask != null ? formatMarketPrice(quote.ask, { ...currentQuoteOptions, maxWidth: col.width }) :
|
|
666
|
+
return { text: quote?.ask != null ? formatMarketPrice(quote.ask, { ...currentQuoteOptions, maxWidth: col.width }) : MISSING_VALUE };
|
|
651
667
|
case "spread":
|
|
652
668
|
return {
|
|
653
669
|
text: quote?.bid != null && quote?.ask != null
|
|
654
670
|
? formatMarketPrice(quote.ask - quote.bid, { ...currentQuoteOptions, maxWidth: col.width })
|
|
655
|
-
:
|
|
671
|
+
: MISSING_VALUE,
|
|
656
672
|
};
|
|
657
673
|
case "spread_pct": {
|
|
658
|
-
if (!isFiniteNumber(quote?.bid) || !isFiniteNumber(quote?.ask)) return { text:
|
|
674
|
+
if (!isFiniteNumber(quote?.bid) || !isFiniteNumber(quote?.ask)) return { text: MISSING_VALUE };
|
|
659
675
|
const midpoint = (quote.bid + quote.ask) / 2;
|
|
660
|
-
if (midpoint === 0) return { text:
|
|
676
|
+
if (midpoint === 0) return { text: MISSING_VALUE };
|
|
661
677
|
return { text: formatPercentRaw(((quote.ask - quote.bid) / Math.abs(midpoint)) * 100) };
|
|
662
678
|
}
|
|
663
679
|
case "bid_ask_size": {
|
|
664
|
-
if (!isFiniteNumber(quote?.bidSize) && !isFiniteNumber(quote?.askSize)) return { text:
|
|
680
|
+
if (!isFiniteNumber(quote?.bidSize) && !isFiniteNumber(quote?.askSize)) return { text: MISSING_VALUE };
|
|
665
681
|
return { text: `${formatCompact(quote?.bidSize)}/${formatCompact(quote?.askSize)}` };
|
|
666
682
|
}
|
|
667
683
|
case "change_pct": {
|
|
@@ -669,20 +685,20 @@ export function getColumnValue(
|
|
|
669
685
|
const changePercent = headlineChangePercent(headlineQuote, quote);
|
|
670
686
|
return quote
|
|
671
687
|
? { text: formatPercentRaw(changePercent), color: marketChangeColor(changePercent, quote.marketState) }
|
|
672
|
-
: { text:
|
|
688
|
+
: { text: MISSING_VALUE };
|
|
673
689
|
}
|
|
674
690
|
case "volume": {
|
|
675
691
|
const volume = reportedQuoteVolume(quote);
|
|
676
|
-
return { text: volume != null ? formatCompact(volume, { fixedDecimals: true }) :
|
|
692
|
+
return { text: volume != null ? formatCompact(volume, { fixedDecimals: true }) : MISSING_VALUE };
|
|
677
693
|
}
|
|
678
694
|
case "dollar_volume": {
|
|
679
695
|
const volume = reportedQuoteVolume(quote);
|
|
680
|
-
if (!displayQuote || volume == null) return { text:
|
|
696
|
+
if (!displayQuote || volume == null) return { text: MISSING_VALUE };
|
|
681
697
|
return { text: formatCompact(toBaseQuote(displayQuote.price * volume), { fixedDecimals: true }) };
|
|
682
698
|
}
|
|
683
699
|
case "range_52w": {
|
|
684
700
|
const position = fiftyTwoWeekPosition(displayQuote, quote);
|
|
685
|
-
if (position == null) return { text:
|
|
701
|
+
if (position == null) return { text: MISSING_VALUE };
|
|
686
702
|
// A range the service read from the stored daily bars, the source's being no year's, says so as the ticker pane does.
|
|
687
703
|
return { text: formatPercentRaw(Math.max(0, Math.min(100, position))),
|
|
688
704
|
...(quote?.yearRangeBasis === "daily-bars" ? { note: RANGE_FROM_BARS_NOTE } : {}) };
|
|
@@ -691,7 +707,7 @@ export function getColumnValue(
|
|
|
691
707
|
const cap = liveMarketCapitalization(quote, fundamentals);
|
|
692
708
|
const value = cap ? listedMarketCapitalization(convertMarketCapitalization(cap.value, cap.currency, ctx.baseCurrency, ctx.exchangeRates)) : null;
|
|
693
709
|
// An export writes the whole figure, not the three digits the cell shows (72.27B), in the base currency it names.
|
|
694
|
-
return { text: value == null ?
|
|
710
|
+
return { text: value == null ? MISSING_VALUE : formatCompact(value, { fixedDecimals: true }), value, valueUnit: ctx.baseCurrency };
|
|
695
711
|
}
|
|
696
712
|
case "pe":
|
|
697
713
|
return { text: formatPriceEarnings(liveTrailingPE(quote, fundamentals)) };
|
|
@@ -700,31 +716,31 @@ export function getColumnValue(
|
|
|
700
716
|
case "dividend_yield": {
|
|
701
717
|
const dividendYield = currentDividendYield(ticker.metadata.ticker, quote, fundamentals, ctx);
|
|
702
718
|
if (dividendYield.pending) return { text: "…" };
|
|
703
|
-
return { text: dividendYield.value != null ? `${(dividendYield.value * 100).toFixed(2)}%` :
|
|
719
|
+
return { text: dividendYield.value != null ? `${(dividendYield.value * 100).toFixed(2)}%` : MISSING_VALUE };
|
|
704
720
|
}
|
|
705
721
|
case "ext_hours": {
|
|
706
722
|
const changePercent = getExtendedSessionDisplay(quote)?.changePercent;
|
|
707
|
-
if (!isFiniteNumber(changePercent)) return { text:
|
|
723
|
+
if (!isFiniteNumber(changePercent)) return { text: MISSING_VALUE };
|
|
708
724
|
return { text: formatPercentRaw(changePercent), color: shownPriceColor(changePercent, 2) };
|
|
709
725
|
}
|
|
710
726
|
case "side":
|
|
711
|
-
return { text: positionSideLabel(ticker, ctx.activeTab) ??
|
|
727
|
+
return { text: positionSideLabel(ticker, ctx.activeTab) ?? MISSING_VALUE };
|
|
712
728
|
case "shares":
|
|
713
|
-
if (positionMetrics.positionCount === 0) return { text:
|
|
729
|
+
if (positionMetrics.positionCount === 0) return { text: MISSING_VALUE };
|
|
714
730
|
// A future counts contracts and says what one is: -1,000 × 100 oz. The table widens the column to fit.
|
|
715
731
|
return positionMetrics.isFuture
|
|
716
732
|
? { text: futuresQuantityText(formatMarketQuantity(totalShares, formatOptions), futuresContractSizeLabel(futures, multiplierHint, positionMetrics)) }
|
|
717
733
|
: { text: formatMarketQuantity(totalShares, { ...formatOptions, maxWidth: col.width }) };
|
|
718
734
|
case "avg_cost":
|
|
719
|
-
if (totalCostUnits === 0 || !Number.isFinite(totalCost)) return { text:
|
|
735
|
+
if (totalCostUnits === 0 || !Number.isFinite(totalCost)) return { text: MISSING_VALUE };
|
|
720
736
|
// A money cost keeps its currency's minor unit, as `portfolio show` prints it: 45.50, not 45.5.
|
|
721
737
|
return { text: formatMarketCost(totalCost / Math.abs(totalCostUnits), { ...withCurrencyMinorDigits(formatOptions, positionCurrency), maxWidth: col.width }) };
|
|
722
738
|
case "cost_basis":
|
|
723
739
|
// Signed, as the value is: a short's cost is what it was sold for, negative.
|
|
724
|
-
if (baseMetrics.positionCount === 0 || !Number.isFinite(baseMetrics.signedCost)) return { text:
|
|
740
|
+
if (baseMetrics.positionCount === 0 || !Number.isFinite(baseMetrics.signedCost)) return { text: MISSING_VALUE };
|
|
725
741
|
return { text: formatCompact(baseMetrics.signedCost) };
|
|
726
742
|
case "mkt_value": {
|
|
727
|
-
if (baseMetrics.positionCount === 0) return { text:
|
|
743
|
+
if (baseMetrics.positionCount === 0) return { text: MISSING_VALUE };
|
|
728
744
|
const marketValue = resolvePortfolioMarketValue(baseMetrics, activeQuote ? toBaseQuote(activeQuote.price) : null)?.net;
|
|
729
745
|
return { text: marketValue == null ? UNPRICED : formatCompactAmount(marketValue) };
|
|
730
746
|
}
|
|
@@ -759,26 +775,26 @@ export function getColumnValue(
|
|
|
759
775
|
const dayPnl = positionDayPnl({ units: totalPriceUnits, isFuture: positionMetrics.isFuture }, { price: activeQuote.price, change: activeQuote.change }, quoteCurrency, ctx, toBaseQuote);
|
|
760
776
|
return { text: formatCompactAmount(dayPnl, { signed: true }), color: priceColor(dayPnl) };
|
|
761
777
|
}
|
|
762
|
-
return { text:
|
|
778
|
+
return { text: MISSING_VALUE };
|
|
763
779
|
case "pnl": {
|
|
764
780
|
if (ctx.periodPnl) return periodPnlCell(ctx.periodPnl, ticker.metadata.ticker, "pnl");
|
|
765
781
|
const pnl = positionPnl.value;
|
|
766
|
-
return pnl === null ? { text:
|
|
782
|
+
return pnl === null ? { text: MISSING_VALUE, pnlBasis: positionPnl.basis }
|
|
767
783
|
: { text: formatCompactAmount(pnl, { signed: true }), color: priceColor(pnl), pnlBasis: positionPnl.basis };
|
|
768
784
|
}
|
|
769
785
|
case "pnl_pct": {
|
|
770
786
|
if (ctx.periodPnl) return periodPnlCell(ctx.periodPnl, ticker.metadata.ticker, "contribution");
|
|
771
787
|
const percent = portfolioPnlPercent(positionPnl.value, baseMetrics.totalCost);
|
|
772
|
-
return percent === null ? { text:
|
|
788
|
+
return percent === null ? { text: MISSING_VALUE } : { text: formatPercentRaw(percent), color: shownPriceColor(percent, 2) };
|
|
773
789
|
}
|
|
774
790
|
case "mark_delta":
|
|
775
|
-
if (!liveQuote || brokerMarkPrice == null || liveQuote.price === 0 || positionMetrics.priceBasis !== (quote?.priceBasis ?? "per-unit") || positionCurrency !== quoteCurrency) return { text:
|
|
791
|
+
if (!liveQuote || brokerMarkPrice == null || liveQuote.price === 0 || positionMetrics.priceBasis !== (quote?.priceBasis ?? "per-unit") || positionCurrency !== quoteCurrency) return { text: MISSING_VALUE };
|
|
776
792
|
{
|
|
777
793
|
const percent = ((brokerMarkPrice - liveQuote.price) / Math.abs(liveQuote.price)) * 100;
|
|
778
794
|
return { text: formatPercentRaw(percent), color: shownPriceColor(percent, 2) };
|
|
779
795
|
}
|
|
780
796
|
case "acq_date": {
|
|
781
|
-
return
|
|
797
|
+
return dayCell(earliestDateAcquired(ticker, ctx.activeTab));
|
|
782
798
|
}
|
|
783
799
|
case "held": {
|
|
784
800
|
return { text: formatHeldDays(daysSince(earliestDateAcquired(ticker, ctx.activeTab), ctx.now)) };
|
|
@@ -791,7 +807,7 @@ export function getColumnValue(
|
|
|
791
807
|
const currency = analystTargetDisplayCurrency(analyst.data, quoteCurrency, displayQuote?.price);
|
|
792
808
|
return {
|
|
793
809
|
text: value == null
|
|
794
|
-
?
|
|
810
|
+
? MISSING_VALUE
|
|
795
811
|
: formatMarketPriceWithCurrency(value, currency, { ...formatOptions, maxWidth: col.width }),
|
|
796
812
|
};
|
|
797
813
|
}
|
|
@@ -800,30 +816,30 @@ export function getColumnValue(
|
|
|
800
816
|
if (analyst.pending) return { text: "…" };
|
|
801
817
|
const value = targetValue(analyst.data);
|
|
802
818
|
const current = targetReferencePrice(analyst.data, quoteCurrency, displayQuote?.price);
|
|
803
|
-
if (value == null || !current) return { text:
|
|
819
|
+
if (value == null || !current) return { text: MISSING_VALUE };
|
|
804
820
|
const percent = ((value - current) / Math.abs(current)) * 100;
|
|
805
821
|
return { text: formatPercentRaw(percent), color: shownPriceColor(percent, 2) };
|
|
806
822
|
}
|
|
807
823
|
case "rating": {
|
|
808
824
|
const analyst = mapData(ctx.analystResearch, ticker.metadata.ticker);
|
|
809
825
|
if (analyst.pending) return { text: "…" };
|
|
810
|
-
return { text: analyst.data?.recommendationRating != null ? formatNumber(analyst.data.recommendationRating, 1) :
|
|
826
|
+
return { text: analyst.data?.recommendationRating != null ? formatNumber(analyst.data.recommendationRating, 1) : MISSING_VALUE };
|
|
811
827
|
}
|
|
812
828
|
case "ex_div": {
|
|
813
829
|
const result = exDividendDate(ticker.metadata.ticker, ctx);
|
|
814
830
|
if (result.pending) return { text: "…" };
|
|
815
|
-
return
|
|
831
|
+
return dayCell(result.date);
|
|
816
832
|
}
|
|
817
833
|
case "next_earn": {
|
|
818
834
|
const result = nextEarningsDate(ticker.metadata.ticker, ctx);
|
|
819
835
|
if (result.pending) return { text: "…" };
|
|
820
|
-
return
|
|
836
|
+
return dayCell(result.date);
|
|
821
837
|
}
|
|
822
838
|
case "perp_premium":
|
|
823
839
|
case "perp_funding": {
|
|
824
840
|
const perp = perpetualValue(col.id, ticker.metadata.ticker, ctx, quote);
|
|
825
841
|
if (perp.pending) return { text: "…" };
|
|
826
|
-
if (perp.value == null) return { text:
|
|
842
|
+
if (perp.value == null) return { text: MISSING_VALUE };
|
|
827
843
|
// An old venue reading keeps its figure, dimmed, as PERP shows a stale market.
|
|
828
844
|
return {
|
|
829
845
|
text: formatPerpetualRate(perp.value, col.id === "perp_funding" ? 4 : 2),
|
|
@@ -834,7 +850,7 @@ export function getColumnValue(
|
|
|
834
850
|
return { text: formatQuoteAgeWithSource(quote, ctx.now, { seconds: true }) };
|
|
835
851
|
case "as_of": {
|
|
836
852
|
const time = getPortfolioValuationTime(quote, ctx.valuationBasis, positionMetrics, futures?.settlement);
|
|
837
|
-
if (!time) return { text:
|
|
853
|
+
if (!time) return { text: MISSING_VALUE };
|
|
838
854
|
// In UTC, as the header says; a close the venue's calendar gives no hour for is dated by its day.
|
|
839
855
|
// An export writes the date with it, as ISO: 16:49 alone says nothing of which day.
|
|
840
856
|
const iso = new Date(time.time).toISOString();
|
|
@@ -842,14 +858,14 @@ export function getColumnValue(
|
|
|
842
858
|
if (valuesAtNominalPrice(quote, positionMetrics, ctx.valuationBasis)) return { text: "nominal", color: colors.warning, value: iso.slice(0, 10) };
|
|
843
859
|
return {
|
|
844
860
|
// Every row names its day: a bare 00:47 beside Fri 21:00 reads as the same evening.
|
|
845
|
-
text: time.dateOnly ? formatShortDate(time.time, MONTH_DAY) : formatFeedTime(time.time, ctx.now,
|
|
861
|
+
text: time.dateOnly ? formatShortDate(time.time, MONTH_DAY) : formatFeedTime(time.time, ctx.now, MISSING_VALUE, { utc: true, dayToday: true }),
|
|
846
862
|
value: time.dateOnly ? iso.slice(0, 10) : iso,
|
|
847
863
|
};
|
|
848
864
|
}
|
|
849
865
|
case PRICE_SPARKLINE_COLUMN_ID:
|
|
850
866
|
return { text: "" };
|
|
851
867
|
default:
|
|
852
|
-
return { text:
|
|
868
|
+
return { text: MISSING_VALUE };
|
|
853
869
|
}
|
|
854
870
|
}
|
|
855
871
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../utils/format";
|
|
1
2
|
import type { FuturesContractSpec, FuturesContractTermsPayload } from "../api-client/futures-curve";
|
|
2
3
|
import type { ActiveQuoteDisplay } from "../market-data/market/status";
|
|
3
4
|
import type { PricePoint } from "../types/financials";
|
|
@@ -74,7 +75,7 @@ export function futuresContractSize(spec: Pick<FuturesContractSpec, "unit" | "si
|
|
|
74
75
|
|
|
75
76
|
/** A count of contracts and what each one is: "1,000 × 100 oz", or the count alone when the size is unknown. */
|
|
76
77
|
export function futuresQuantityText(quantity: string, size: Pick<FuturesContractSize, "size"> | null | undefined): string {
|
|
77
|
-
return size?.size && quantity !==
|
|
78
|
+
return size?.size && quantity !== MISSING_VALUE ? `${quantity} × ${size.size}` : quantity;
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
function hasMultiplier(position: Pick<TickerPosition, "multiplier">): boolean {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TickerRecord } from "../types/ticker";
|
|
2
|
-
import { canonicalExchange, canonicalTickerKey, isUsEquityExchange, parsePublicTickerKey } from "../utils/exchanges";
|
|
2
|
+
import { canonicalExchange, canonicalTickerKey, displayTickerKey, isUsEquityExchange, parsePublicTickerKey } from "../utils/exchanges";
|
|
3
3
|
import { classifyInstrumentType, kindFromListingSyntax } from "../tickers/instrument-kind";
|
|
4
4
|
import { listingSuffixVenue } from "../sources/listing-symbols";
|
|
5
5
|
|
|
@@ -56,8 +56,10 @@ export function listHomeMarket(tickers: Iterable<TickerRecord>): string {
|
|
|
56
56
|
* reads as Boeing in a US list; else as `display` writes it.
|
|
57
57
|
*/
|
|
58
58
|
export function listedSymbol(ticker: TickerRecord, display: string, homeMarket: string | undefined): string {
|
|
59
|
+
// A key saved under its venue's code reads by the venue's name, as every other row: ES3:XSES is ES3:SGX.
|
|
60
|
+
if (display.includes(":")) return displayTickerKey(display);
|
|
59
61
|
const market = listingMarket(ticker);
|
|
60
|
-
if (!market || !homeMarket || market === homeMarket
|
|
62
|
+
if (!market || !homeMarket || market === homeMarket) return display;
|
|
61
63
|
const listing = venueListing(ticker.metadata.ticker, ticker.metadata.exchange);
|
|
62
64
|
return canonicalTickerKey(listing.symbol, listing.exchange);
|
|
63
65
|
}
|