gloomberb 0.20.11 → 0.20.13
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/src/account/billing.ts +3 -2
- package/src/account/upgrade-dialog.tsx +8 -8
- package/src/api-client/awards.ts +16 -0
- package/src/api-client/central-bank-rates.ts +5 -0
- package/src/api-client/data.ts +55 -2
- package/src/api-client/index.ts +28 -3
- package/src/api-client/install-experiments.ts +146 -0
- package/src/api-client/request.ts +86 -3
- package/src/api-client/socket-connection.ts +12 -1
- package/src/api-client/socket.ts +21 -3
- package/src/api-client/supply-chain-graph.ts +4 -2
- package/src/api-client/supply-chain.ts +8 -0
- package/src/api-client/telemetry.ts +47 -0
- package/src/api-client/types/econ.ts +10 -7
- package/src/api-client/types/filings-and-calls.ts +8 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/types/news.ts +16 -0
- package/src/app/global-shortcuts.ts +2 -1
- package/src/app/keybindings/actions.ts +19 -0
- package/src/app/pane-runtime/index.tsx +18 -3
- package/src/app/pane-runtime/layout-placement.ts +63 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +10 -2
- package/src/architecture/floating-promise-allowlist.json +17 -33
- package/src/brokers/signed-in/adapter.ts +2 -2
- package/src/brokers/signed-in/catalog.ts +13 -4
- package/src/capabilities/chart-series.ts +4 -1
- package/src/cli/board-coins.ts +10 -1
- package/src/cli/commands/crypto-hints.ts +3 -2
- package/src/cli/commands/fred-series.ts +0 -54
- package/src/cli/commands/market.ts +260 -63
- package/src/cli/commands/overview.ts +50 -17
- package/src/cli/commands/search.ts +140 -17
- package/src/cli/commands/ticker.ts +37 -17
- package/src/cli/desktop-pane-shot.ts +27 -2
- package/src/cli/earnings-calendar.ts +33 -53
- package/src/cli/fx-quote-rate.ts +1 -1
- package/src/cli/glossary.ts +14 -5
- package/src/cli/history-catalog-series.ts +85 -0
- package/src/cli/history-rows.ts +18 -1
- package/src/cli/index.ts +1 -1
- package/src/cli/known-gaps.ts +9 -0
- package/src/cli/list-progress.ts +45 -0
- package/src/cli/listing-arg.ts +176 -25
- package/src/cli/name-entries.ts +8 -4
- package/src/cli/not-a-ticker.ts +2 -2
- package/src/cli/pane-functions/catalog.ts +55 -7
- package/src/cli/pane-functions/dom.ts +8 -1
- package/src/cli/pane-functions/freshness.ts +52 -5
- package/src/cli/pane-functions/headless.ts +8 -8
- package/src/cli/pane-functions/index.ts +8 -5
- package/src/cli/pane-functions/market-session.ts +66 -14
- package/src/cli/pane-functions/options.ts +5 -0
- package/src/cli/pane-functions/report.ts +4 -1
- package/src/cli/pane-functions/resolver.ts +9 -2
- package/src/cli/pane-functions/screenshot-assessment.ts +28 -3
- package/src/cli/pane-functions/screenshot-types.ts +6 -0
- package/src/cli/perpetual-contract.ts +4 -4
- package/src/cli/quote-answer.ts +55 -12
- package/src/cli/quote-list-reads.ts +87 -0
- package/src/cli/report-tables.ts +70 -13
- package/src/cli/result.ts +26 -3
- package/src/cli/symbol-list.ts +31 -4
- package/src/cli/terminal-code-hints.ts +83 -0
- package/src/cli/ticker-resolution.ts +2 -1
- package/src/cli/treasury-yields.ts +5 -0
- 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 +101 -15
- package/src/components/chart/composite/legend.tsx +60 -25
- 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/action-runtime.ts +2 -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 +20 -9
- 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/command-bar/routing/launch-request.ts +2 -1
- package/src/components/command-bar/routing/navigation-state.ts +4 -2
- package/src/components/command-bar/workflow/types.ts +6 -0
- package/src/components/data-table/view.tsx +29 -6
- package/src/components/form-modal/host.tsx +1 -1
- package/src/components/layout/detached-pane-shell.tsx +3 -0
- package/src/components/layout/double-escape-close.ts +34 -3
- package/src/components/layout/floating-pane.tsx +10 -4
- package/src/components/layout/header.tsx +3 -2
- package/src/components/layout/market-summary.ts +3 -3
- package/src/components/layout/pane/cycle-order.ts +66 -2
- package/src/components/layout/pane/error-boundary.tsx +2 -1
- package/src/components/layout/pane/header.tsx +140 -31
- package/src/components/layout/pane/sidebar.tsx +13 -5
- package/src/components/layout/pane/status-footer.ts +3 -1
- package/src/components/layout/shell/drag/runtime.ts +5 -0
- package/src/components/layout/shell/index.tsx +25 -0
- package/src/components/layout/shell/menu.ts +9 -0
- package/src/components/layout/shell/pane/actions.ts +36 -0
- package/src/components/layout/shell/pane/management-shortcuts.ts +27 -3
- package/src/components/layout/shell/pane-occlusion.ts +40 -0
- package/src/components/layout/shell/shortcuts.ts +17 -1
- package/src/components/layout/shell/terminal-pointer-runtime.ts +39 -6
- package/src/components/layout/shell/window-mode/index.ts +5 -16
- package/src/components/layout/shell/window-mode/overlays.tsx +3 -1
- package/src/components/markdown-text.tsx +36 -0
- package/src/components/market-board/index.tsx +18 -8
- package/src/components/metric-treemap/index.tsx +3 -1
- 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/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/button.tsx +48 -4
- package/src/components/ui/choice-dialog.tsx +101 -32
- package/src/components/ui/data-table/opentui/index.tsx +24 -9
- package/src/components/ui/data-table/types.ts +7 -0
- package/src/components/ui/inline-quick-add.tsx +19 -3
- package/src/components/ui/list-view.tsx +11 -5
- package/src/components/ui/multi-select/dialog.tsx +1 -7
- package/src/components/ui/not-meaningful.ts +16 -0
- package/src/components/ui/query-bar.tsx +32 -5
- package/src/components/ui/selection-fill.ts +39 -0
- package/src/components/ui/stat-grid.tsx +27 -6
- package/src/core/state/app/layout-reducer.ts +2 -1
- package/src/core/state/app/pane-choices.ts +68 -0
- package/src/core/state/app/state.ts +14 -6
- package/src/core/state/app/types.ts +8 -0
- package/src/data/config/store/normalize.ts +2 -0
- package/src/docs/snapshot.json +1 -1
- package/src/i18n/es.ts +5 -2
- package/src/i18n/ja.ts +5 -2
- package/src/i18n/ko.ts +5 -2
- package/src/i18n/zh-cn.ts +5 -2
- package/src/i18n/zh-tw.ts +5 -2
- package/src/layout/pane-manager/dock-tree.ts +19 -0
- package/src/layout/pane-manager/index.ts +3 -0
- 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 +13 -13
- package/src/market-data/market/freshness.ts +33 -0
- package/src/market-data/market/status.ts +5 -1
- package/src/market-data/quotes/contributions.ts +10 -0
- package/src/market-data/quotes/freshness.ts +19 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
- package/src/market-data/quotes/live-valuation.ts +31 -4
- package/src/market-data/quotes/resolution.ts +4 -0
- package/src/market-data/quotes/time.ts +17 -24
- 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/index.tsx +1 -0
- package/src/plugins/builtin/account-management/pane.tsx +9 -8
- 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-model.ts +6 -6
- package/src/plugins/builtin/analytics/risk-pane.tsx +6 -5
- 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 +17 -8
- package/src/plugins/builtin/awards/headless.ts +37 -15
- package/src/plugins/builtin/awards/model.ts +40 -5
- package/src/plugins/builtin/awards/pane.tsx +11 -8
- 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-manager/index.tsx +1 -0
- package/src/plugins/builtin/broker-trading/index.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 +8 -7
- package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
- package/src/plugins/builtin/central-bank-rates/model.ts +24 -5
- package/src/plugins/builtin/central-bank-rates/pane.tsx +19 -9
- package/src/plugins/builtin/changelog/index.tsx +2 -2
- package/src/plugins/builtin/chart-composer/headless.ts +5 -1
- package/src/plugins/builtin/chart-composer/index.tsx +4 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +8 -3
- 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/content/handle-prompt.tsx +4 -0
- package/src/plugins/builtin/chat/controller/realtime.ts +17 -1
- package/src/plugins/builtin/chat/controller/utils.ts +2 -1
- package/src/plugins/builtin/chat/message/terminal.tsx +4 -1
- package/src/plugins/builtin/chat/sidebar.tsx +3 -4
- 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 +39 -1
- package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
- package/src/plugins/builtin/cloud/plugin.tsx +1 -0
- package/src/plugins/builtin/cloud/team/module.tsx +1 -0
- package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
- package/src/plugins/builtin/cloud/thesis/detail.tsx +22 -12
- 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/commodity-balances/pane.tsx +13 -5
- 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 +18 -13
- 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/index.ts +1 -0
- 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 +4 -3
- package/src/plugins/builtin/cpi/model.ts +8 -7
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +14 -9
- package/src/plugins/builtin/credit-boards/client.ts +5 -0
- package/src/plugins/builtin/credit-boards/headless.ts +3 -7
- package/src/plugins/builtin/credit-boards/model.ts +5 -11
- package/src/plugins/builtin/credit-boards/series.ts +19 -8
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +9 -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/defi-view.tsx +7 -7
- package/src/plugins/builtin/crypto-board/defi.ts +2 -2
- package/src/plugins/builtin/crypto-board/model.ts +4 -3
- package/src/plugins/builtin/crypto-board/pane.tsx +8 -8
- package/src/plugins/builtin/crypto-board/supply.ts +2 -2
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +23 -13
- package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +8 -3
- 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/headless.ts +16 -7
- package/src/plugins/builtin/debt-maturities/model.ts +12 -18
- package/src/plugins/builtin/debt-maturities/pane.tsx +11 -12
- package/src/plugins/builtin/dividend-yield/client.ts +7 -3
- package/src/plugins/builtin/dividend-yield/headless.ts +16 -11
- 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 +19 -11
- package/src/plugins/builtin/dividend-yield/types.ts +4 -0
- package/src/plugins/builtin/dividend-yield/view.ts +3 -3
- 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 +42 -7
- package/src/plugins/builtin/earnings/board-table.ts +13 -8
- package/src/plugins/builtin/earnings/board.tsx +15 -3
- package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
- package/src/plugins/builtin/earnings/calendar.tsx +11 -6
- package/src/plugins/builtin/earnings/client.ts +0 -9
- package/src/plugins/builtin/earnings/format.ts +16 -14
- package/src/plugins/builtin/earnings/headless.ts +64 -23
- package/src/plugins/builtin/earnings/history-model.ts +11 -7
- package/src/plugins/builtin/earnings/history-table.ts +14 -9
- package/src/plugins/builtin/earnings/history.tsx +22 -14
- package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
- package/src/plugins/builtin/earnings-calls/data.ts +24 -4
- package/src/plugins/builtin/earnings-calls/format.ts +29 -10
- package/src/plugins/builtin/earnings-calls/headless.ts +23 -3
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/earnings-calls/model.ts +11 -1
- package/src/plugins/builtin/earnings-calls/pane.tsx +2 -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/model.ts +3 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
- package/src/plugins/builtin/econ/calendar-model.ts +29 -2
- package/src/plugins/builtin/econ/detail-view.tsx +2 -2
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -0
- package/src/plugins/builtin/econ/index.tsx +16 -8
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +7 -5
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
- 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 +18 -14
- package/src/plugins/builtin/fear-greed/pane.tsx +12 -4
- package/src/plugins/builtin/filing-events/feed.ts +2 -1
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- 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 +32 -21
- 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 +11 -8
- package/src/plugins/builtin/insider/tickers.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 +18 -16
- 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/index.tsx +1 -0
- 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 +9 -8
- package/src/plugins/builtin/macro-day/model.ts +3 -2
- package/src/plugins/builtin/macro-day/pane.tsx +4 -4
- package/src/plugins/builtin/macro-day/releases.ts +25 -16
- 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/index.tsx +20 -8
- package/src/plugins/builtin/market-movers/model.ts +5 -0
- package/src/plugins/builtin/market-movers/session-body.tsx +2 -1
- 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/headless.ts +14 -3
- package/src/plugins/builtin/money-markets/model.ts +3 -2
- package/src/plugins/builtin/money-markets/pane.tsx +14 -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 +48 -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 +6 -6
- 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 -31
- package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
- 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 +6 -1
- package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +2 -1
- package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
- package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +24 -10
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +9 -11
- package/src/plugins/builtin/portfolio-list/table.tsx +10 -1
- 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 +37 -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/risk-factors/index.tsx +1 -0
- 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/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 +71 -0
- 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 +8 -3
- 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 +9 -5
- package/src/plugins/builtin/social-mentions/headless.ts +2 -1
- package/src/plugins/builtin/social-mentions/model.ts +4 -4
- package/src/plugins/builtin/social-mentions/outliers.tsx +10 -1
- package/src/plugins/builtin/social-mentions/pane.tsx +7 -0
- package/src/plugins/builtin/supply-chain/client.ts +3 -1
- package/src/plugins/builtin/supply-chain/flow.tsx +25 -8
- package/src/plugins/builtin/supply-chain/graph-client.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-evidence.ts +1 -1
- package/src/plugins/builtin/supply-chain/graph-model.ts +14 -2
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +11 -10
- package/src/plugins/builtin/supply-chain/graph.tsx +12 -6
- package/src/plugins/builtin/supply-chain/headless.ts +15 -8
- package/src/plugins/builtin/supply-chain/model.ts +72 -15
- package/src/plugins/builtin/supply-chain/pane.tsx +11 -8
- package/src/plugins/builtin/supply-chain/row-evidence.tsx +7 -6
- 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/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 +7 -5
- package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +18 -5
- package/src/plugins/builtin/ticker-detail/overview/model.ts +24 -13
- 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 +35 -7
- package/src/plugins/builtin/ticker-detail/pane.tsx +48 -24
- package/src/plugins/builtin/ticker-detail/quote-footer.ts +5 -0
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +13 -8
- 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/after.ts +50 -23
- package/src/plugins/builtin/treasury-auctions/cache.ts +23 -5
- package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
- package/src/plugins/builtin/treasury-auctions/headless.ts +231 -42
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +14 -7
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +37 -34
- package/src/plugins/builtin/treasury-auctions/hk.ts +65 -13
- package/src/plugins/builtin/treasury-auctions/index.tsx +3 -0
- package/src/plugins/builtin/treasury-auctions/keys.ts +27 -0
- package/src/plugins/builtin/treasury-auctions/like.ts +137 -0
- package/src/plugins/builtin/treasury-auctions/model.ts +101 -23
- package/src/plugins/builtin/treasury-auctions/pane.tsx +56 -28
- 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 +6 -3
- package/src/plugins/builtin/vol-surface/pane.tsx +13 -9
- 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/plugins/runtime/index.tsx +1 -0
- package/src/plugins/runtime/state.ts +20 -0
- package/src/portfolio/allocation.ts +5 -5
- package/src/portfolio/column-values.ts +54 -42
- package/src/portfolio/futures-positions.ts +2 -1
- package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
- package/src/public/react.ts +7 -0
- package/src/react/auto-refresh.ts +29 -0
- package/src/renderers/browser/deeplink-bridge.ts +24 -3
- package/src/renderers/dom/desktop/query-bar.tsx +229 -60
- package/src/renderers/dom/host/overflow-fade-px.ts +2 -0
- package/src/renderers/dom/host/overflow-fade.ts +1 -2
- package/src/renderers/dom/styles.css +25 -5
- package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -1
- package/src/renderers/opentui/ui-host.tsx +32 -2
- package/src/renderers/share/layout-view.tsx +2 -1
- package/src/series/types.ts +2 -0
- package/src/sources/gloomberb-cloud/fred-attribution.ts +86 -0
- package/src/sources/gloomberb-cloud/index.ts +25 -1
- package/src/sources/gloomberb-cloud/news.ts +9 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +24 -3
- package/src/sources/provider-errors.ts +64 -1
- package/src/sources/provider-router/batches.ts +19 -0
- package/src/sources/provider-router/index.ts +7 -1
- package/src/sources/provider-router/search.ts +15 -10
- package/src/state/app/context/index.tsx +24 -1
- package/src/state/hooks/inline-tickers.ts +3 -2
- package/src/state/hooks/quote-streaming.ts +9 -10
- package/src/state/pane-unsent-work.ts +47 -0
- package/src/team/collections-sync.ts +8 -3
- package/src/telemetry/usage-counts.ts +26 -0
- package/src/test-support/shell-pane-keys.tsx +5 -0
- package/src/test-support/telemetry-guard.ts +83 -0
- package/src/test-support/test-env.ts +12 -0
- package/src/theme/colors.ts +17 -1
- package/src/theme/ui-tokens.ts +50 -1
- package/src/tickers/company-name-listing.ts +2 -2
- package/src/tickers/company-name.ts +17 -1
- package/src/tickers/listing-venues.ts +37 -2
- package/src/tickers/renamed-listings.ts +2 -1
- package/src/tickers/search/index.ts +19 -0
- package/src/tickers/search/japanese-names.json +1 -0
- package/src/tickers/search/japanese-names.ts +152 -0
- package/src/tickers/starter-symbols.ts +7 -0
- package/src/tickers/terminal-codes.ts +55 -6
- package/src/time-series/base-series.ts +3 -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/types/config.ts +9 -0
- package/src/types/data-provider.ts +9 -2
- package/src/types/financials.ts +26 -0
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-contributions.ts +7 -0
- package/src/types/plugin-panes.ts +8 -1
- package/src/types/plugin-reports.ts +8 -0
- package/src/ui/host.tsx +6 -0
- package/src/utils/datetime-format.ts +74 -33
- package/src/utils/double-escape-close.ts +42 -0
- package/src/utils/financial-statements.ts +39 -15
- package/src/utils/format.ts +4 -9
- package/src/utils/fundamentals.ts +38 -16
- package/src/utils/fx-status.ts +30 -7
- package/src/utils/growth.ts +67 -0
- package/src/utils/keyboard.ts +6 -0
- package/src/utils/network-failure.ts +23 -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/zoned-date-time.ts +47 -22
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
1
2
|
import { useCallback, useEffect, useMemo } from "react";
|
|
2
3
|
import type { HkTender } from "../../../api-client/hk-tenders";
|
|
3
4
|
import {
|
|
@@ -19,7 +20,10 @@ import { loadingErrorFooterInfo, usePaneRefreshKey } from "../../../components/d
|
|
|
19
20
|
import { ageFooterSegment, savedCopyFooterInfo } from "../../../components/layout/pane/footer";
|
|
20
21
|
import { STALE_SEGMENT } from "../../../components/layout/pane/status-footer";
|
|
21
22
|
import { useAsyncResource } from "../../../react/async-resource";
|
|
22
|
-
import { useAutoRefresh } from "../../../react/auto-refresh";
|
|
23
|
+
import { useAutoRefresh, useUtcDay } from "../../../react/auto-refresh";
|
|
24
|
+
import { reportFooterSegment } from "../shared/source-footer";
|
|
25
|
+
import { treasuryAuctionsHeadless } from "./headless";
|
|
26
|
+
import { hkTendersReport } from "./hk-headless";
|
|
23
27
|
import { colors } from "../../../theme/colors";
|
|
24
28
|
import { Box, ScrollBox, Text, TextAttributes } from "../../../ui";
|
|
25
29
|
import { formatRelativeAge, formatShortDate } from "../../../utils/datetime-format";
|
|
@@ -32,6 +36,7 @@ import {
|
|
|
32
36
|
buildHkColumns,
|
|
33
37
|
DEFAULT_HK_SORT,
|
|
34
38
|
firstHkSortDirection,
|
|
39
|
+
hkTenderTerm,
|
|
35
40
|
formatHkAmount,
|
|
36
41
|
formatHkRate,
|
|
37
42
|
HK_SEARCH_FIELDS,
|
|
@@ -41,18 +46,17 @@ import {
|
|
|
41
46
|
hkRate,
|
|
42
47
|
hkSize,
|
|
43
48
|
hkSizeWorkedOut,
|
|
44
|
-
hkSortColumn,
|
|
45
49
|
hkSortName,
|
|
46
50
|
hkTenderId,
|
|
47
51
|
hkTenderName,
|
|
48
52
|
hkTenderType,
|
|
49
53
|
isSpread,
|
|
50
54
|
loadHkTenders,
|
|
55
|
+
parseHkSort,
|
|
51
56
|
visibleHkTenders,
|
|
52
57
|
hkWindowStart,
|
|
53
58
|
type HkColumn,
|
|
54
59
|
type HkSortPreference,
|
|
55
|
-
type HkTendersBoard,
|
|
56
60
|
} from "./hk";
|
|
57
61
|
import {
|
|
58
62
|
AUCTION_FILTERS,
|
|
@@ -63,15 +67,16 @@ import {
|
|
|
63
67
|
type AuctionFilter,
|
|
64
68
|
} from "./model";
|
|
65
69
|
import { TREASURY_AUCTIONS_PANE_ID } from "./types";
|
|
70
|
+
import { auctionViewHints } from "./keys";
|
|
66
71
|
|
|
67
72
|
const NO_TENDERS: HkTender[] = [];
|
|
68
73
|
|
|
69
|
-
/** A kept sort's name (`btc:asc`) as Hong Kong's columns read it; a US-only one is the default. */
|
|
74
|
+
/** A kept sort's name (`btc:asc`, `-btc`) as Hong Kong's columns read it; a US-only one is the default. */
|
|
70
75
|
function readHkSort(value: string | null): HkSortPreference {
|
|
71
76
|
const [name, direction] = (value ?? "").split(":");
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
74
|
-
return
|
|
77
|
+
const sort = name ? parseHkSort(name) : null;
|
|
78
|
+
if (!sort) return DEFAULT_HK_SORT;
|
|
79
|
+
return direction === "asc" || direction === "desc" ? { columnId: sort.columnId, direction } : sort;
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
const writeHkSort = (sort: HkSortPreference) => `${hkSortName(sort.columnId)}:${sort.direction}`;
|
|
@@ -89,27 +94,27 @@ function renderTenderCell(tender: HkTender, column: HkColumn, rowState: { select
|
|
|
89
94
|
case "type":
|
|
90
95
|
return { text: hkTenderType(tender), color: typeColor(tender, rowState.selected), attributes: TextAttributes.BOLD };
|
|
91
96
|
case "term":
|
|
92
|
-
return { text: tender
|
|
97
|
+
return { text: hkTenderTerm(tender), color: selected ?? colors.text };
|
|
93
98
|
case "rate":
|
|
94
|
-
return { text: formatHkRate(tender, hkRate(tender),
|
|
99
|
+
return { text: formatHkRate(tender, hkRate(tender), MISSING_VALUE), color: selected ?? colors.textBright };
|
|
95
100
|
case "btc":
|
|
96
101
|
return { text: tender.bidToCover.toFixed(2), color: selected ?? colors.text };
|
|
97
102
|
case "size":
|
|
98
|
-
return { text: formatHkAmount(tender, hkSize(tender),
|
|
103
|
+
return { text: formatHkAmount(tender, hkSize(tender), MISSING_VALUE, hkSizeWorkedOut(tender)), color: selected ?? colors.textDim };
|
|
99
104
|
case "cusip":
|
|
100
105
|
return { text: tender.issue ?? "", color: selected ?? colors.textDim };
|
|
101
106
|
}
|
|
102
107
|
}
|
|
103
108
|
|
|
104
|
-
/** A column of days, short ("Oct
|
|
109
|
+
/** A column of days, short ("28 Oct") or with the year ("28 Oct 2026"); a bond's issue month as "May" or "May 2026". */
|
|
105
110
|
function hkTableDate(date: string, showYear: boolean): string {
|
|
106
|
-
if (showYear) return date;
|
|
111
|
+
if (showYear) return hkDateText(date);
|
|
107
112
|
if (date.length === 7) return hkDateText(date).replace(/ \d{4}$/, "");
|
|
108
|
-
return formatShortDate(date, { year: false, utc: true, fallback:
|
|
113
|
+
return formatShortDate(date, { year: false, utc: true, fallback: MISSING_VALUE });
|
|
109
114
|
}
|
|
110
115
|
|
|
111
|
-
const percent = (value: number | null) => value == null ?
|
|
112
|
-
const times = (value: number | null) => value == null ?
|
|
116
|
+
const percent = (value: number | null) => value == null ? MISSING_VALUE : `${value.toFixed(3)}%`;
|
|
117
|
+
const times = (value: number | null) => value == null ? MISSING_VALUE : value.toFixed(2);
|
|
113
118
|
|
|
114
119
|
function HkTenderDetail({ tender, width }: { tender: HkTender; width: number }) {
|
|
115
120
|
const row = (label: string, value: string) => (
|
|
@@ -121,11 +126,11 @@ function HkTenderDetail({ tender, width }: { tender: HkTender; width: number })
|
|
|
121
126
|
<Box flexDirection="row" height={1} gap={2}>
|
|
122
127
|
<Text fg={colors.textDim}>{`issued ${hkDateText(tender.date)}`}</Text>
|
|
123
128
|
{tender.issue && <Text fg={colors.textDim}>{tender.issue}</Text>}
|
|
124
|
-
{tender.reopening && <Text fg={colors.textDim}>re-opening</Text>}
|
|
129
|
+
{tender.reopening && <Text fg={colors.textDim}>{`re-opening of a ${tender.term} issue`}</Text>}
|
|
125
130
|
</Box>
|
|
126
131
|
<Box height={1} />
|
|
127
132
|
{isSpread(tender)
|
|
128
|
-
? row("Spread over HONIA", formatHkRate(tender, hkRate(tender),
|
|
133
|
+
? row("Spread over HONIA", formatHkRate(tender, hkRate(tender), MISSING_VALUE))
|
|
129
134
|
: row("Average yield", percent(tender.averageYield))}
|
|
130
135
|
{/* An RMB bond's average yield is annualised; HKMA gives it semi-annualised too. */}
|
|
131
136
|
{tender.averageYieldSemiAnnual != null && row("Semi-annual basis", percent(tender.averageYieldSemiAnnual))}
|
|
@@ -134,7 +139,7 @@ function HkTenderDetail({ tender, width }: { tender: HkTender; width: number })
|
|
|
134
139
|
<Box height={1} />
|
|
135
140
|
{row("Applied", formatHkAmount(tender, tender.applied))}
|
|
136
141
|
{tender.allotted != null && row("Allotted", formatHkAmount(tender, tender.allotted))}
|
|
137
|
-
{tender.offered != null && row("Offered (worked out)", formatHkAmount(tender, tender.offered,
|
|
142
|
+
{tender.offered != null && row("Offered (worked out)", formatHkAmount(tender, tender.offered, MISSING_VALUE, true))}
|
|
138
143
|
{tender.coupon != null && row("Coupon", percent(tender.coupon))}
|
|
139
144
|
{tender.maturity && row("Maturity", hkDateText(tender.maturity))}
|
|
140
145
|
<Box height={1} />
|
|
@@ -145,13 +150,6 @@ function HkTenderDetail({ tender, width }: { tender: HkTender; width: number })
|
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
/** How far HKMA's figures run for the paper a group lists: they come a month at a time, after the tenders. */
|
|
148
|
-
function runsToFor(runsTo: HkTendersBoard["runsTo"] | undefined, filter: AuctionFilter): string | null {
|
|
149
|
-
if (!runsTo) return null;
|
|
150
|
-
const date = filter === "bill" ? runsTo.efb : filter === "note" ? runsTo.efn : filter === "bond" ? runsTo.hkgb
|
|
151
|
-
: [runsTo.efb, runsTo.efn].filter((value): value is string => !!value).sort().at(-1) ?? runsTo.hkgb;
|
|
152
|
-
return date ? hkDateText(date) : null;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
153
|
interface HkTendersViewProps {
|
|
156
154
|
focused: boolean;
|
|
157
155
|
width: number;
|
|
@@ -233,34 +231,39 @@ export function HkTendersView({
|
|
|
233
231
|
return handlePaneKey(event);
|
|
234
232
|
}, [focusSearch, handlePaneKey]);
|
|
235
233
|
|
|
236
|
-
const showYear = auctionDatesShowYear(
|
|
234
|
+
const showYear = useMemo(() => auctionDatesShowYear(rows.map((tender) => tender.date)), [rows]);
|
|
237
235
|
const columns = useMemo(() => buildHkColumns({ showYear, rows, width: width - 1 }), [rows, showYear, width]);
|
|
238
236
|
const renderRow = useCallback((tender: HkTender, column: HkColumn, _index: number, rowState: { selected: boolean }) => (
|
|
239
237
|
renderTenderCell(tender, column, rowState, showYear)
|
|
240
238
|
), [showYear]);
|
|
241
239
|
|
|
242
|
-
const
|
|
240
|
+
const utcDay = useUtcDay();
|
|
241
|
+
const board = resource.data;
|
|
243
242
|
const info = useMemo(() => {
|
|
244
243
|
const segments = loadingErrorFooterInfo(loading, error);
|
|
245
|
-
// HKMA's terms ask for the credit; its figures lag the tenders, so the footer
|
|
246
|
-
|
|
247
|
-
if (
|
|
244
|
+
// HKMA's terms ask for the credit; its figures lag the tenders, so the footer dates the newest listed,
|
|
245
|
+
// as `fn AUCT HK` ends.
|
|
246
|
+
if (board && tenders.length) {
|
|
247
|
+
segments.push(reportFooterSegment(treasuryAuctionsHeadless,
|
|
248
|
+
hkTendersReport(board, { search: searchQuery, filter, window: historyDays, view: "results", sort: null })));
|
|
249
|
+
}
|
|
248
250
|
if (savedAt != null) segments.push(...savedCopyFooterInfo([savedAt]));
|
|
249
251
|
else if (stale) segments.push(STALE_SEGMENT);
|
|
250
252
|
if (fetchedAt && savedAt == null) segments.push(ageFooterSegment(formatRelativeAge(fetchedAt)));
|
|
251
253
|
return segments;
|
|
252
|
-
}, [error, fetchedAt,
|
|
254
|
+
}, [board, error, fetchedAt, filter, historyDays, loading, savedAt, searchQuery, stale, tenders.length, utcDay]);
|
|
255
|
+
const toggleMarket = useCallback(() => marketFilter.onChange("us"), [marketFilter]);
|
|
253
256
|
const hints = useMemo(() => detailOpen || tenders.length === 0 ? [] : [
|
|
254
257
|
{ id: "search", key: "/", label: "search", onPress: focusSearch },
|
|
255
258
|
{ id: "filter", key: "f", label: "ilter", onPress: cycleFilter },
|
|
256
|
-
|
|
259
|
+
...auctionViewHints({ market: "hk", toggleMarket, cycleSort }),
|
|
260
|
+
], [cycleFilter, cycleSort, detailOpen, focusSearch, tenders.length, toggleMarket]);
|
|
257
261
|
// `o` opens HKMA's page for the dataset the selected tender came from.
|
|
258
262
|
useExternalLinkFooter({
|
|
259
263
|
registrationId: TREASURY_AUCTIONS_PANE_ID, focused: focused && !searchFocused, url: selected ? hkDatasetPage(selected) : undefined, info, hints,
|
|
260
264
|
});
|
|
261
265
|
|
|
262
266
|
usePaneMenuItems("treasury-auctions:sort-keys", () => detailOpen || tenders.length === 0 ? null : [
|
|
263
|
-
{ id: "sort-next", label: "Next Sort Column", accelerator: "]", onSelect: () => cycleSort(1) },
|
|
264
267
|
{ id: "sort-previous", label: "Previous Sort Column", accelerator: "[", onSelect: () => cycleSort(-1) },
|
|
265
268
|
], [tenders.length, cycleSort, detailOpen]);
|
|
266
269
|
|
|
@@ -320,7 +323,7 @@ export function HkTendersView({
|
|
|
320
323
|
detailOpen={detailOpen && !!selected}
|
|
321
324
|
onBack={() => setDetailOpen(false)}
|
|
322
325
|
detailContent={selected ? <HkTenderDetail tender={selected} width={width} /> : null}
|
|
323
|
-
detailTitle={selected ? `${hkTenderName(selected)} ${selected
|
|
326
|
+
detailTitle={selected ? `${hkTenderName(selected)} ${hkTenderTerm(selected)}` : undefined}
|
|
324
327
|
rootBefore={queryBar}
|
|
325
328
|
onRootKeyDown={handleRootKeyDown}
|
|
326
329
|
onDetailKeyDown={handlePaneKey}
|
|
@@ -7,7 +7,7 @@ import { createPluginCache, savedCopyForTransientFailure } from "../../../data/p
|
|
|
7
7
|
import { servedFromSavedCopy } from "../../../data/saved-copies";
|
|
8
8
|
import type { PluginPersistence } from "../../../types/plugin";
|
|
9
9
|
import { formatShortDate } from "../../../utils/datetime-format";
|
|
10
|
-
import { displayWidth, formatCompact } from "../../../utils/format";
|
|
10
|
+
import { MISSING_VALUE, displayWidth, formatCompact } from "../../../utils/format";
|
|
11
11
|
import { compareSortValues, type SortDirection } from "../../../utils/sort-values";
|
|
12
12
|
import { AUCTION_HISTORY_ALL, type AuctionHistoryWindow } from "./client";
|
|
13
13
|
import type { AuctionFilter } from "./model";
|
|
@@ -97,12 +97,54 @@ const termMonths = (term: string) => {
|
|
|
97
97
|
return own ? Number(own[1]) * (own[2] === "Year" ? 12 : 1) : null;
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
/**
|
|
100
|
+
/** A day as HKMA gives it, a bond's issue or maturity month (YYYY-MM) read as its middle. */
|
|
101
|
+
const dayOf = (date: string) => Date.parse(`${date.length === 7 ? `${date}-15` : date}T00:00:00Z`);
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The months a re-opened Government Bond had left when it was tendered, to the
|
|
105
|
+
* nearest month: HKMA names a re-opening by its issue's tenor (10GB2601 is a
|
|
106
|
+
* 10-year bond), and the 2023-10-26 tender of it sold paper with about 2.2
|
|
107
|
+
* years left. Null for a new issue, EF paper, or a bond without its maturity.
|
|
108
|
+
*/
|
|
109
|
+
function remainingMonths(tender: HkTender): number | null {
|
|
110
|
+
if (!tender.reopening || !tender.maturity) return null;
|
|
111
|
+
const days = (dayOf(tender.maturity) - dayOf(tender.date)) / 86_400_000;
|
|
112
|
+
return Number.isFinite(days) && days > 0 ? Math.max(1, Math.round(days / 30.4375)) : null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Months as a US auction writes a term: 27 is 2-Year 3-Month, 24 is 2-Year, 9 is 9-Month. */
|
|
116
|
+
function monthsTerm(months: number): string {
|
|
117
|
+
const years = Math.floor(months / 12);
|
|
118
|
+
const rest = months % 12;
|
|
119
|
+
return [years ? `${years}-Year` : "", rest ? `${rest}-Month` : ""].filter(Boolean).join(" ");
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The term a tender sold: a re-opening's what its issue had left (2-Year
|
|
124
|
+
* 3-Month of a 10-year bond), as a US reopening's 9-Year 10-Month reads;
|
|
125
|
+
* otherwise the tenor HKMA gives.
|
|
126
|
+
*/
|
|
127
|
+
export function hkTenderTerm(tender: HkTender): string {
|
|
128
|
+
const left = remainingMonths(tender);
|
|
129
|
+
return left == null ? tender.term : monthsTerm(left);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** The tender's term in months, a re-opening's what it had left. */
|
|
133
|
+
const tenderMonths = (tender: HkTender) => remainingMonths(tender) ?? termMonths(tender.term);
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* "3M" is the 3-Month bill; "1Y" the 12-Month bill as well as a 1-Year note.
|
|
137
|
+
* A re-opening answers to its issue's tenor (10Y for 10GB2601) and to the
|
|
138
|
+
* whole years its term left rounds up to (3Y for 2-Year 3-Month), as a US
|
|
139
|
+
* 9-Year 10-Month answers to 10Y.
|
|
140
|
+
*/
|
|
101
141
|
function matchesTenor(tender: HkTender, word: string): boolean | null {
|
|
102
142
|
const tenor = TENOR.exec(word);
|
|
103
143
|
if (!tenor) return null;
|
|
104
144
|
const count = Number(tenor[1]);
|
|
105
|
-
|
|
145
|
+
const months = tenor[2]![0] === "y" ? count * 12 : count;
|
|
146
|
+
const left = remainingMonths(tender);
|
|
147
|
+
return termMonths(tender.term) === months || (left != null && tenor[2]![0] === "y" && Math.ceil(left / 12) === count);
|
|
106
148
|
}
|
|
107
149
|
|
|
108
150
|
function matchesWord(tender: HkTender, word: string): boolean {
|
|
@@ -113,7 +155,8 @@ function matchesWord(tender: HkTender, word: string): boolean {
|
|
|
113
155
|
if (currency) return tender.currency === currency;
|
|
114
156
|
const tenor = matchesTenor(tender, word);
|
|
115
157
|
if (tenor != null) return tenor;
|
|
116
|
-
return tender.date.startsWith(word) || !!tender.issue?.toLowerCase().includes(word) || tender.term.toLowerCase().includes(word)
|
|
158
|
+
return tender.date.startsWith(word) || !!tender.issue?.toLowerCase().includes(word) || tender.term.toLowerCase().includes(word)
|
|
159
|
+
|| hkTenderTerm(tender).toLowerCase().includes(word);
|
|
117
160
|
}
|
|
118
161
|
|
|
119
162
|
/** Every word of the search names the tender (`10Y RMB`, `EFB 2026-10`); words that only pick the market are left out. */
|
|
@@ -141,7 +184,7 @@ export const hkSize = (tender: HkTender) => tender.allotted ?? tender.offered;
|
|
|
141
184
|
export const hkSizeWorkedOut = (tender: HkTender) => tender.allotted == null && tender.offered != null;
|
|
142
185
|
|
|
143
186
|
/** The amount in its currency: HK$66.3B, RMB750M; `≈HK$65.7B` for EF paper's worked-out size. */
|
|
144
|
-
export function formatHkAmount(tender: HkTender, value: number | null, empty =
|
|
187
|
+
export function formatHkAmount(tender: HkTender, value: number | null, empty = MISSING_VALUE, about = false): string {
|
|
145
188
|
if (value == null) return empty;
|
|
146
189
|
return `${about ? "≈" : ""}${tender.currency === "CNH" ? "RMB" : "HK$"}${formatCompact(value)}`;
|
|
147
190
|
}
|
|
@@ -174,11 +217,19 @@ const HK_SORT_NAMES: ReadonlyArray<{ names: readonly string[]; column: HkColumnI
|
|
|
174
217
|
];
|
|
175
218
|
|
|
176
219
|
/** The column a sort name means for Hong Kong's tenders; null for a US-only one (`indirect`, `btc-pctl`). */
|
|
177
|
-
|
|
178
|
-
const value = name.trim().toLowerCase();
|
|
220
|
+
function hkSortColumn(name: string): HkColumnId | null {
|
|
221
|
+
const value = name.trim().toLowerCase().replace(/^-/, "");
|
|
179
222
|
return HK_SORT_NAMES.find((entry) => entry.names.includes(value))?.column ?? null;
|
|
180
223
|
}
|
|
181
224
|
|
|
225
|
+
/** A sort name as `--sort` and the pane keep it, `-` first for the other way round (`-btc`: lowest first); null for a US-only one. */
|
|
226
|
+
export function parseHkSort(name: string): HkSortPreference | null {
|
|
227
|
+
const columnId = hkSortColumn(name);
|
|
228
|
+
if (!columnId) return null;
|
|
229
|
+
const first = firstHkSortDirection(columnId);
|
|
230
|
+
return { columnId, direction: name.trim().startsWith("-") ? first === "asc" ? "desc" : "asc" : first };
|
|
231
|
+
}
|
|
232
|
+
|
|
182
233
|
export const hkSortName = (column: HkColumnId) => HK_SORT_NAMES.find((entry) => entry.column === column)!.names[0]!;
|
|
183
234
|
|
|
184
235
|
/** Text columns read best A to Z; every figure highest first. */
|
|
@@ -192,7 +243,7 @@ function hkSortValue(tender: HkTender, column: HkColumnId): number | string | nu
|
|
|
192
243
|
switch (column) {
|
|
193
244
|
case "date": return sortDay(tender.date);
|
|
194
245
|
case "type": return hkTenderType(tender);
|
|
195
|
-
case "term": return
|
|
246
|
+
case "term": return tenderMonths(tender);
|
|
196
247
|
case "rate": return hkRate(tender);
|
|
197
248
|
case "btc": return tender.bidToCover;
|
|
198
249
|
case "size": return hkSize(tender);
|
|
@@ -242,13 +293,14 @@ export function buildHkColumns(options: { showYear?: boolean; rows?: readonly Hk
|
|
|
242
293
|
const { showYear = false, rows = [], width } = options;
|
|
243
294
|
const widest = (least: number, text: (tender: HkTender) => string) => Math.max(least, ...rows.map((tender) => displayWidth(text(tender))));
|
|
244
295
|
const columns: HkColumn[] = [
|
|
245
|
-
{ id: "date", label: "DATE", width: showYear ?
|
|
296
|
+
{ id: "date", label: "DATE", width: showYear ? 11 : 6, align: "left", title: "Issue day (a Government Bond's issue month): the business day after the tender" },
|
|
246
297
|
{ id: "type", label: "TYPE", width: 6, align: "left" },
|
|
247
|
-
{ id: "term", label: "TERM", width: widest(7,
|
|
248
|
-
|
|
298
|
+
{ id: "term", label: "TERM", width: widest(7, hkTenderTerm), align: "left",
|
|
299
|
+
title: "Term sold: a re-opening's is what its issue had left" },
|
|
300
|
+
{ id: "rate", label: "RATE", width: widest(6, (tender) => formatHkRate(tender, hkRate(tender), MISSING_VALUE)), align: "right",
|
|
249
301
|
title: "Average accepted yield; a floating rate note's spread over HONIA, bp" },
|
|
250
302
|
{ id: "btc", label: "B/C", width: 5, align: "right" },
|
|
251
|
-
{ id: "size", label: "SIZE", width: widest(7, (tender) => formatHkAmount(tender, hkSize(tender),
|
|
303
|
+
{ id: "size", label: "SIZE", width: widest(7, (tender) => formatHkAmount(tender, hkSize(tender), MISSING_VALUE, hkSizeWorkedOut(tender))), align: "right",
|
|
252
304
|
title: "A bond's amount allotted; EF paper's amount offered, worked out from its applications (≈)" },
|
|
253
305
|
{ id: "cusip", label: "ISSUE", width: widest(5, (tender) => tender.issue ?? ""), align: "left", flexGrow: 1 },
|
|
254
306
|
];
|
|
@@ -270,7 +322,7 @@ function readsAsTender(tender: HkTender): boolean {
|
|
|
270
322
|
}
|
|
271
323
|
|
|
272
324
|
/** What the HK market lists, and how far HKMA's figures run. */
|
|
273
|
-
|
|
325
|
+
interface HkTendersBoard {
|
|
274
326
|
tenders: HkTender[];
|
|
275
327
|
/** The first issue Gloom Cloud's record holds: a wider window adds rows only past it. */
|
|
276
328
|
firstTender: string | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PaneHint } from "../../../components";
|
|
2
|
+
import type { AuctionView } from "./after";
|
|
3
|
+
import type { AuctionMarket } from "./hk";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The keys a market's table answers besides search and filter: `v` turns the
|
|
7
|
+
* US table between Results and After, `m` between the US and Hong Kong, and
|
|
8
|
+
* `[`/`]` step the sort column (the footer shows `[]`, the next one).
|
|
9
|
+
*/
|
|
10
|
+
export function auctionViewHints(options: {
|
|
11
|
+
view?: AuctionView;
|
|
12
|
+
toggleView?: () => void;
|
|
13
|
+
market: AuctionMarket;
|
|
14
|
+
toggleMarket: () => void;
|
|
15
|
+
cycleSort: (step: 1 | -1) => void;
|
|
16
|
+
}): PaneHint[] {
|
|
17
|
+
const { view, toggleView, market, toggleMarket, cycleSort } = options;
|
|
18
|
+
return [
|
|
19
|
+
...(view && toggleView ? [view === "after"
|
|
20
|
+
? { id: "view", key: "v", label: " results", title: "Show Results", onPress: toggleView }
|
|
21
|
+
: { id: "view", key: "v", label: " after", title: "Show After", onPress: toggleView }] : []),
|
|
22
|
+
market === "hk"
|
|
23
|
+
? { id: "market", key: "m", label: " US", title: "US Treasury Auctions", onPress: toggleMarket }
|
|
24
|
+
: { id: "market", key: "m", label: " HK", title: "Hong Kong Tenders", onPress: toggleMarket },
|
|
25
|
+
{ id: "sort", key: "[]", label: "sort", title: "Next Sort Column", onPress: () => cycleSort(1) },
|
|
26
|
+
];
|
|
27
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { auctionTenorKey, type AfterMove, type AuctionAfter, type AuctionPercentiles } from "./after";
|
|
2
|
+
import { auctionBenchmark, isPendingAuction } from "./model";
|
|
3
|
+
import type { TreasuryAuction } from "./types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `fn AUCT 3Y --like 2026-11-09`: the earlier auctions of the same tenor
|
|
7
|
+
* that ranked most like one, and what the Treasury yield did after them.
|
|
8
|
+
*
|
|
9
|
+
* Likeness is read on the percentiles the after view shows (after.ts), which
|
|
10
|
+
* already put each auction against its own tenor's recent history: a 2.46
|
|
11
|
+
* bid-to-cover reads differently in 2008 and 2026, its percentile does not.
|
|
12
|
+
* The distance is the root mean square of the gaps between the two auctions'
|
|
13
|
+
* stop-out vs median, B/C and indirect percentiles, 0 for an auction that
|
|
14
|
+
* ranked the same on all three; only the ones the auction has count, and an
|
|
15
|
+
* earlier auction is compared only when it has them all.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** How many of the closest earlier auctions `--like` lists. */
|
|
19
|
+
export const LIKE_LIMIT = 15;
|
|
20
|
+
|
|
21
|
+
type LikeDimension = "stopOutPercentile" | "btcPercentile" | "indirectPercentile";
|
|
22
|
+
const LIKE_DIMENSIONS: readonly LikeDimension[] = ["stopOutPercentile", "btcPercentile", "indirectPercentile"];
|
|
23
|
+
|
|
24
|
+
export interface AuctionAnalog {
|
|
25
|
+
auction: TreasuryAuction;
|
|
26
|
+
/** Root mean square of the percentile gaps, 0 to 100. */
|
|
27
|
+
distance: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface AuctionAnalogs {
|
|
31
|
+
/** The percentiles the distance reads: those the auction has. */
|
|
32
|
+
dimensions: LikeDimension[];
|
|
33
|
+
/** The closest first; ties keep the newest first. */
|
|
34
|
+
analogs: AuctionAnalog[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The search that names an auction's tenor (`3Y`, `13W`, `10Y TIPS`), as
|
|
39
|
+
* `fn AUCT` takes it; null for a term with no benchmark.
|
|
40
|
+
*/
|
|
41
|
+
function tenorSearch(auction: TreasuryAuction): string | null {
|
|
42
|
+
const benchmark = auctionBenchmark(auction.securityTerm);
|
|
43
|
+
if (!benchmark) return null;
|
|
44
|
+
const kind = auction.secType === "TIPS" || auction.secType === "FRN" ? ` ${auction.secType}` : "";
|
|
45
|
+
return `${benchmark.count}${benchmark.unit[0]!.toUpperCase()}${kind}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The completed auctions on `date` among `listed` (already narrowed by the
|
|
50
|
+
* search and group): one is the auction to compare with, several ask for a
|
|
51
|
+
* search that tells them apart, naming a tenor held that day (a note or bond's
|
|
52
|
+
* before a bill's), none says so.
|
|
53
|
+
*/
|
|
54
|
+
export function likeTarget(listed: readonly TreasuryAuction[], date: string): { target: TreasuryAuction } | { error: string } {
|
|
55
|
+
const held = listed.filter((auction) => auction.auctionDate === date);
|
|
56
|
+
const completed = held.filter((auction) => !isPendingAuction(auction));
|
|
57
|
+
if (completed.length === 1) return { target: completed[0]! };
|
|
58
|
+
if (completed.length > 1) {
|
|
59
|
+
const named = completed.map((auction) => `${auction.securityTerm} ${auction.secType}`).join(", ");
|
|
60
|
+
const example = [...completed.filter((auction) => auction.secType !== "Bill" && auction.secType !== "CMB"), ...completed]
|
|
61
|
+
.map(tenorSearch).find((search) => search != null);
|
|
62
|
+
return { error: `${date} held ${completed.length} auctions (${named}): search for one${example ? `, as in fn AUCT ${example} --like ${date}` : " by its term"}.` };
|
|
63
|
+
}
|
|
64
|
+
if (held.length > 0) return { error: `The ${held[0]!.securityTerm} ${held[0]!.secType.toLowerCase()} auction of ${date} has no results yet.` };
|
|
65
|
+
return { error: `No auction on ${date} matches the search: --like takes the date an auction was held, as in fn AUCT 3Y --like 2026-11-09.` };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The earlier auctions of the target's tenor in `history` closest to it on
|
|
70
|
+
* the percentiles it has, at most `limit`. No dimensions when the target has
|
|
71
|
+
* no percentile: fewer than 12 auctions of its tenor came before it.
|
|
72
|
+
*/
|
|
73
|
+
export function rankAuctionAnalogs(
|
|
74
|
+
target: TreasuryAuction,
|
|
75
|
+
history: readonly TreasuryAuction[],
|
|
76
|
+
percentiles: ReadonlyMap<string, AuctionPercentiles>,
|
|
77
|
+
limit = LIKE_LIMIT,
|
|
78
|
+
): AuctionAnalogs {
|
|
79
|
+
const own = percentiles.get(target.id);
|
|
80
|
+
const dimensions = LIKE_DIMENSIONS.filter((key) => own?.[key] != null);
|
|
81
|
+
if (!own || dimensions.length === 0) return { dimensions, analogs: [] };
|
|
82
|
+
const tenor = auctionTenorKey(target);
|
|
83
|
+
const analogs: AuctionAnalog[] = [];
|
|
84
|
+
for (const auction of history) {
|
|
85
|
+
if (auction.id === target.id || auction.auctionDate >= target.auctionDate || isPendingAuction(auction)) continue;
|
|
86
|
+
if (auctionTenorKey(auction) !== tenor) continue;
|
|
87
|
+
const theirs = percentiles.get(auction.id);
|
|
88
|
+
if (!theirs || dimensions.some((key) => theirs[key] == null)) continue;
|
|
89
|
+
const squares = dimensions.reduce((sum, key) => sum + (theirs[key]! - own[key]!) ** 2, 0);
|
|
90
|
+
analogs.push({ auction, distance: Math.round(Math.sqrt(squares / dimensions.length) * 10) / 10 });
|
|
91
|
+
}
|
|
92
|
+
analogs.sort((left, right) => left.distance - right.distance || right.auction.auctionDate.localeCompare(left.auction.auctionDate));
|
|
93
|
+
return { dimensions, analogs: analogs.slice(0, limit) };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const AFTER_MOVES: ReadonlyArray<{ key: AfterMove; label: string }> = [
|
|
97
|
+
{ key: "after1d", label: "+1d" }, { key: "after5d", label: "+5d" }, { key: "after20d", label: "+20d" },
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
export interface AnalogMoveSummary {
|
|
101
|
+
move: AfterMove;
|
|
102
|
+
/** "+1d", "+5d", "+20d". */
|
|
103
|
+
label: string;
|
|
104
|
+
/** The median move, bp; null when no analog has it yet. */
|
|
105
|
+
medianBp: number | null;
|
|
106
|
+
/** The share of them whose yield rose, 0 to 100. */
|
|
107
|
+
rosePct: number | null;
|
|
108
|
+
/** The analogs with the move: a recent one has no +20d yet. */
|
|
109
|
+
count: number;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const median = (values: readonly number[]) => {
|
|
113
|
+
const sorted = values.toSorted((left, right) => left - right);
|
|
114
|
+
const middle = sorted.length >> 1;
|
|
115
|
+
return sorted.length % 2 ? sorted[middle]! : (sorted[middle - 1]! + sorted[middle]!) / 2;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The median of each move after the analogs, and the share of them whose
|
|
120
|
+
* yield rose. A move left blank (not in yet, or after the asked date) is not
|
|
121
|
+
* counted.
|
|
122
|
+
*/
|
|
123
|
+
export function summarizeAnalogMoves(analogs: readonly AuctionAnalog[], after: ReadonlyMap<string, Pick<AuctionAfter, AfterMove>>): AnalogMoveSummary[] {
|
|
124
|
+
return AFTER_MOVES.map(({ key, label }) => {
|
|
125
|
+
const moves = analogs.flatMap(({ auction }) => {
|
|
126
|
+
const value = after.get(auction.id)?.[key];
|
|
127
|
+
return value == null ? [] : [value];
|
|
128
|
+
});
|
|
129
|
+
return {
|
|
130
|
+
move: key,
|
|
131
|
+
label,
|
|
132
|
+
medianBp: moves.length ? Math.round(median(moves) * 10) / 10 : null,
|
|
133
|
+
rosePct: moves.length ? Math.round((moves.filter((value) => value > 0).length / moves.length) * 100) : null,
|
|
134
|
+
count: moves.length,
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
}
|