gloomberb 0.20.6 → 0.20.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +74 -0
- package/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/package.json +6 -1
- package/src/account/auth-model.ts +22 -0
- package/src/api-client/auth.ts +7 -2
- package/src/api-client/awards.ts +5 -0
- package/src/api-client/bond-trades.ts +22 -0
- package/src/api-client/catalysts.ts +11 -1
- package/src/api-client/data.ts +30 -6
- package/src/api-client/debt-maturities.ts +7 -0
- package/src/api-client/equity-screener.ts +17 -0
- package/src/api-client/errors.ts +2 -0
- package/src/api-client/exchange-announcements.ts +14 -7
- package/src/api-client/fund-facts.ts +41 -7
- package/src/api-client/futures-curve.ts +14 -1
- package/src/api-client/geo.ts +10 -0
- package/src/api-client/hiring.ts +2 -0
- package/src/api-client/index.ts +3 -0
- package/src/api-client/insider-signals.ts +14 -0
- package/src/api-client/members.ts +30 -2
- package/src/api-client/money-markets.ts +11 -1
- package/src/api-client/paths.ts +6 -1
- package/src/api-client/perps.ts +2 -0
- package/src/api-client/request.ts +2 -1
- package/src/api-client/socket.ts +11 -4
- package/src/api-client/types/econ.ts +2 -1
- package/src/api-client/types/filings-and-calls.ts +6 -0
- package/src/api-client/types/market.ts +4 -0
- package/src/api-client/web-experiments.ts +5 -6
- package/src/app/runtime/update.ts +2 -1
- package/src/architecture/floating-promise-allowlist.json +33 -106
- package/src/architecture/shortcut-labels-allowlist.json +1 -0
- package/src/capabilities/asset-data-inputs.ts +183 -0
- package/src/capabilities/factories.ts +8 -2
- package/src/cli/base-converter.ts +36 -2
- package/src/cli/commands/api.ts +2 -2
- package/src/cli/commands/command-utils.ts +18 -0
- package/src/cli/commands/hong-kong-movers.ts +50 -0
- package/src/cli/commands/market.ts +568 -143
- package/src/cli/commands/options-chain.ts +7 -1
- package/src/cli/commands/overview.ts +74 -14
- package/src/cli/commands/plugins.ts +7 -6
- package/src/cli/commands/search.ts +71 -12
- package/src/cli/commands/system.ts +15 -10
- package/src/cli/commands/ticker.ts +97 -44
- package/src/cli/content-figures.ts +45 -0
- package/src/cli/context.ts +5 -0
- package/src/cli/desktop-pane-shot-routes.ts +13 -4
- package/src/cli/desktop-pane-shot.ts +147 -12
- package/src/cli/earnings-calendar.ts +36 -5
- package/src/cli/export-source.ts +17 -3
- package/src/cli/fx-pair.ts +111 -11
- package/src/cli/glossary.ts +36 -2
- package/src/cli/help.ts +1 -1
- package/src/cli/history-export.ts +29 -11
- package/src/cli/history-rows.ts +130 -21
- package/src/cli/index.ts +8 -5
- package/src/cli/known-gaps.ts +45 -1
- package/src/cli/listing-arg.ts +366 -19
- package/src/cli/pane-functions/capabilities.ts +2 -2
- package/src/cli/pane-functions/catalog.ts +105 -9
- package/src/cli/pane-functions/discovery.ts +2 -0
- package/src/cli/pane-functions/dom.ts +50 -13
- package/src/cli/pane-functions/freshness.ts +45 -8
- package/src/cli/pane-functions/function-help.ts +9 -6
- package/src/cli/pane-functions/headless.ts +77 -6
- package/src/cli/pane-functions/index.ts +141 -23
- package/src/cli/pane-functions/options.ts +1 -3
- package/src/cli/pane-functions/plugin-code.ts +169 -0
- package/src/cli/pane-functions/report.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +69 -21
- package/src/cli/pane-functions/screenshot-assessment.ts +98 -7
- package/src/cli/pane-functions/screenshot-data-evidence.ts +3 -1
- package/src/cli/pane-functions/screenshot-types.ts +6 -0
- package/src/cli/quote-answer.ts +106 -3
- package/src/cli/registry.ts +42 -4
- package/src/cli/report-tables.ts +26 -6
- package/src/cli/result.ts +30 -2
- package/src/cli/series-search.ts +17 -7
- package/src/cli/statement-filings.ts +22 -8
- package/src/cli/symbol-args.ts +9 -0
- package/src/cli/ticker-resolution.ts +3 -2
- package/src/cli/unknown-command.ts +111 -14
- package/src/components/chart/composite/format.ts +15 -1
- package/src/components/chart/composite/legend.tsx +101 -47
- package/src/components/chart/composite/panel-labels.ts +4 -4
- package/src/components/chart/composite/panel-surface.tsx +4 -6
- package/src/components/chart/composite/scene/build.ts +180 -0
- package/src/components/chart/composite/scene/cursor.ts +226 -0
- package/src/components/chart/composite/scene/domain.ts +170 -0
- package/src/components/chart/composite/scene/markers.ts +115 -0
- package/src/components/chart/composite/scene/panels.ts +85 -0
- package/src/components/chart/composite/scene/points.ts +169 -0
- package/src/components/chart/composite/scene/projection.ts +105 -0
- package/src/components/chart/composite/scene/timeline.ts +71 -0
- package/src/components/chart/composite/scene.ts +12 -1066
- package/src/components/chart/composite/types.ts +4 -2
- package/src/components/chart/curve/model.ts +2 -2
- package/src/components/chart-table/axis.ts +18 -6
- package/src/components/command-bar/layout-items/focused-pane.ts +3 -0
- package/src/components/command-bar/list/model.ts +9 -0
- package/src/components/command-bar/pane-templates/items.ts +61 -15
- package/src/components/command-bar/pane-templates/workflow.ts +16 -5
- package/src/components/command-bar/routes/root/plugin-install.ts +7 -46
- package/src/components/command-bar/routes/root/provider-search.ts +8 -5
- package/src/components/command-bar/routes/root/results.ts +6 -1
- package/src/components/command-bar/routes/root/runtime.ts +1 -0
- package/src/components/command-bar/routes/root/shortcut-feedback.ts +4 -1
- package/src/components/command-bar/routes/ticker-search/actions.ts +7 -5
- package/src/components/command-bar/routes/ticker-search/results.ts +51 -3
- package/src/components/command-bar/view-model.ts +12 -0
- package/src/components/command-bar/workflow/ops.ts +21 -4
- package/src/components/command-bar/workflow/ticker-listing-picker.ts +3 -1
- package/src/components/command-bar/workflow/tickers.ts +6 -2
- package/src/components/data-table/view.tsx +46 -1
- package/src/components/form-modal/confirm.tsx +3 -2
- package/src/components/form-modal/content.tsx +3 -2
- package/src/components/form-modal/field-row.tsx +2 -0
- package/src/components/form-modal/host.tsx +18 -3
- package/src/components/form-modal/remote-reads.test-helpers.ts +34 -0
- package/src/components/index.ts +1 -1
- package/src/components/layout/pane/title.ts +21 -5
- package/src/components/layout/shell/pane/layers.tsx +20 -14
- package/src/components/layout/shell/pane-occlusion.ts +21 -0
- package/src/components/onboarding/desks-step.tsx +7 -1
- package/src/components/onboarding/onboarding-keyboard.ts +48 -6
- package/src/components/onboarding/onboarding-wizard.tsx +47 -8
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +17 -3
- package/src/components/onboarding/use-onboarding-progress.ts +57 -14
- package/src/components/onboarding/wizard-positions.ts +2 -0
- package/src/components/paged-rows.ts +11 -5
- package/src/components/ticker/list-table-view.tsx +24 -5
- package/src/components/toggle-list.tsx +44 -1
- package/src/components/ui/data-table/opentui/index.tsx +7 -6
- package/src/components/ui/data-table/opentui/model.ts +7 -3
- package/src/components/ui/data-table/types.ts +13 -2
- package/src/components/ui/fields.tsx +16 -4
- package/src/components/ui/query-bar.tsx +43 -9
- package/src/components/ui/table-layout.ts +56 -2
- package/src/core/app-services.ts +7 -2
- package/src/core/connection-health.ts +26 -0
- package/src/core/state/app/layout.ts +12 -4
- package/src/data/config/layout.ts +3 -1
- package/src/data/config/store/node.ts +4 -2
- package/src/docs/snapshot.json +794 -215
- package/src/i18n/es.ts +6 -1
- package/src/i18n/ja.ts +6 -1
- package/src/i18n/ko.ts +6 -1
- package/src/i18n/zh-cn.ts +6 -1
- package/src/i18n/zh-tw.ts +6 -1
- package/src/layout/pane-follow.ts +1 -1
- package/src/layout/pane-manager/gridlock.ts +18 -5
- package/src/layout/pane-manager/index.ts +1 -0
- package/src/layout/pane-manager/transient.ts +56 -0
- package/src/layout-marketplace/gallery.tsx +2 -1
- package/src/layout-marketplace/model.ts +4 -10
- package/src/market-data/commodity-names.ts +24 -0
- package/src/market-data/connection-follow.ts +9 -7
- package/src/market-data/coordinator/auxiliary.ts +4 -3
- package/src/market-data/coordinator/entries.ts +22 -1
- package/src/market-data/coordinator/financials.ts +2 -3
- package/src/market-data/coordinator/index.ts +67 -12
- package/src/market-data/coordinator/quotes.ts +2 -3
- package/src/market-data/fund-facts.ts +7 -1
- package/src/market-data/futures-board.ts +38 -4
- package/src/market-data/futures-contract.ts +5 -2
- package/src/market-data/fx-closes.ts +4 -1
- package/src/market-data/market/bar-period.ts +15 -0
- package/src/market-data/market/change-basis.ts +49 -8
- package/src/market-data/market/dated-previous-close.ts +133 -10
- package/src/market-data/market/format.ts +4 -2
- package/src/market-data/market/freshness.ts +22 -6
- package/src/market-data/market/status.ts +32 -4
- package/src/market-data/options-alternatives.ts +21 -9
- package/src/market-data/published-futures-sessions.ts +9 -0
- package/src/market-data/published-nse-sessions.ts +16 -1
- package/src/market-data/quotes/balance-sheet-rate.ts +34 -0
- package/src/market-data/quotes/delisting.ts +26 -2
- package/src/market-data/quotes/freshness.ts +77 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +250 -19
- package/src/market-data/quotes/regular-session-valuation.ts +8 -0
- package/src/market-data/realized-volatility.ts +3 -1
- package/src/market-data/request-types.ts +2 -0
- package/src/market-data/selectors.ts +1 -0
- package/src/news/aggregator.ts +3 -3
- package/src/plugins/builtin/account-management/delete-account.ts +78 -0
- package/src/plugins/builtin/account-management/pane.tsx +22 -19
- package/src/plugins/builtin/account-management/password-dialog.tsx +75 -0
- package/src/plugins/builtin/alerts/alert-engine.ts +15 -0
- package/src/plugins/builtin/alerts/alert-log.ts +3 -2
- package/src/plugins/builtin/alerts/cli-forms.ts +1 -1
- package/src/plugins/builtin/alerts/cli.ts +94 -13
- package/src/plugins/builtin/alerts/format.ts +8 -2
- package/src/plugins/builtin/alerts/headless.ts +1 -1
- package/src/plugins/builtin/alerts/index.tsx +13 -6
- package/src/plugins/builtin/alerts/metric-command.ts +1 -1
- package/src/plugins/builtin/alerts/pane.tsx +5 -3
- package/src/plugins/builtin/alerts/research-builder.ts +12 -0
- package/src/plugins/builtin/analytics/index.tsx +3 -3
- package/src/plugins/builtin/analytics/risk-client.ts +14 -3
- package/src/plugins/builtin/analytics/risk-pane.tsx +3 -3
- package/src/plugins/builtin/attention/pane.tsx +1 -1
- package/src/plugins/builtin/attention/trending.tsx +1 -1
- package/src/plugins/builtin/awards/detail.tsx +4 -1
- package/src/plugins/builtin/awards/headless.ts +7 -3
- package/src/plugins/builtin/awards/model.ts +11 -0
- package/src/plugins/builtin/awards/pane.tsx +12 -5
- package/src/plugins/builtin/backtest/client.ts +7 -2
- package/src/plugins/builtin/backtest/headless.ts +2 -1
- package/src/plugins/builtin/backtest/pane.tsx +4 -2
- package/src/plugins/builtin/bond-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/broker-manager/sign-in-end.ts +1 -1
- package/src/plugins/builtin/broker-trading/orders.tsx +2 -2
- package/src/plugins/builtin/buildout/company/pane.tsx +1 -1
- package/src/plugins/builtin/buildout/model/index.ts +2 -2
- package/src/plugins/builtin/catalysts/headless.ts +9 -6
- package/src/plugins/builtin/catalysts/model.ts +72 -10
- package/src/plugins/builtin/catalysts/pane.tsx +10 -7
- package/src/plugins/builtin/cds/pane.tsx +5 -3
- package/src/plugins/builtin/central-bank-rates/pane.tsx +3 -2
- package/src/plugins/builtin/chart-composer/catalog-series.ts +59 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -1
- package/src/plugins/builtin/chart-composer/headless.ts +104 -23
- package/src/plugins/builtin/chart-composer/index.tsx +6 -3
- package/src/plugins/builtin/chart-composer/legend-names.ts +19 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +37 -10
- package/src/plugins/builtin/chart-composer/presets.ts +63 -6
- package/src/plugins/builtin/chart-composer/roll-events.ts +38 -0
- package/src/plugins/builtin/chart-composer/series-catalog.ts +12 -5
- package/src/plugins/builtin/chart-composer/series-expression.ts +8 -4
- package/src/plugins/builtin/chart-composer/series-listings.ts +33 -9
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +2 -2
- package/src/plugins/builtin/clinical-trials/client.ts +13 -0
- package/src/plugins/builtin/clinical-trials/index.tsx +1 -1
- package/src/plugins/builtin/clinical-trials/pane.tsx +77 -27
- package/src/plugins/builtin/clinical-trials/search.ts +117 -0
- package/src/plugins/builtin/cloud/askg/conversation-store.ts +17 -6
- package/src/plugins/builtin/cloud/askg/lock-note.ts +4 -2
- package/src/plugins/builtin/cloud/askg/manifest.ts +3 -2
- package/src/plugins/builtin/cloud/askg/pane.tsx +2 -2
- package/src/plugins/builtin/cloud/askg/sources.ts +3 -3
- package/src/plugins/builtin/cloud/one-tap/one-tap-prompt.tsx +7 -3
- package/src/plugins/builtin/cloud/team/acm-tab.tsx +1 -1
- package/src/plugins/builtin/cloud/team/pane.tsx +17 -10
- package/src/plugins/builtin/cloud/team/views.ts +15 -3
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +105 -16
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +17 -2
- package/src/plugins/builtin/cloud/thesis/module.tsx +3 -2
- package/src/plugins/builtin/cloud/thesis/store.ts +17 -3
- package/src/plugins/builtin/commodities-energy/index.tsx +35 -3
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -1
- package/src/plugins/builtin/company-attention/app-rank.tsx +1 -1
- package/src/plugins/builtin/company-attention/building.tsx +1 -1
- package/src/plugins/builtin/company-attention/model.ts +2 -1
- package/src/plugins/builtin/company-attention/moves.tsx +1 -1
- package/src/plugins/builtin/company-attention/pane.tsx +1 -1
- package/src/plugins/builtin/company-attention/signals.tsx +1 -1
- package/src/plugins/builtin/company-kpis/pane.tsx +1 -1
- package/src/plugins/builtin/correlation/headless.ts +7 -5
- package/src/plugins/builtin/correlation/history.ts +17 -6
- package/src/plugins/builtin/correlation/index.tsx +1 -1
- package/src/plugins/builtin/correlation/relationship/history.ts +1 -1
- package/src/plugins/builtin/correlation/relationship/pane.tsx +1 -1
- package/src/plugins/builtin/cot/headless.ts +10 -3
- package/src/plugins/builtin/cot/pane.tsx +2 -2
- package/src/plugins/builtin/cpi/pane.tsx +1 -1
- package/src/plugins/builtin/credit-boards/model.ts +1 -1
- package/src/plugins/builtin/credit-documents/pane.tsx +1 -1
- package/src/plugins/builtin/crypto-board/defi-view.tsx +2 -2
- package/src/plugins/builtin/crypto-board/defi.ts +9 -3
- package/src/plugins/builtin/crypto-board/headless.ts +19 -10
- package/src/plugins/builtin/crypto-board/model.ts +8 -0
- package/src/plugins/builtin/crypto-board/pane.tsx +11 -5
- package/src/plugins/builtin/crypto-board/series.ts +17 -3
- package/src/plugins/builtin/crypto-board/supply.ts +26 -3
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +3 -2
- package/src/plugins/builtin/crypto-etf-flows/model.ts +13 -3
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +6 -3
- package/src/plugins/builtin/custom-view/pane.tsx +5 -5
- package/src/plugins/builtin/debt-maturities/client.ts +5 -0
- package/src/plugins/builtin/debt-maturities/headless.ts +3 -1
- package/src/plugins/builtin/debt-maturities/model.ts +1 -0
- package/src/plugins/builtin/debt-maturities/pane.tsx +1 -1
- package/src/plugins/builtin/dividend-yield/pane.tsx +1 -1
- package/src/plugins/builtin/doe/model.ts +1 -1
- package/src/plugins/builtin/doe/pane.tsx +1 -1
- package/src/plugins/builtin/earnings/board.tsx +2 -2
- package/src/plugins/builtin/earnings/history.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/calendar.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/data.ts +2 -1
- package/src/plugins/builtin/earnings-calls/headless.ts +15 -0
- package/src/plugins/builtin/earnings-calls/model.ts +68 -8
- package/src/plugins/builtin/earnings-calls/pane.tsx +29 -8
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +32 -2
- package/src/plugins/builtin/earnings-ripple/pane.tsx +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +94 -2
- package/src/plugins/builtin/econ/detail-view.tsx +15 -11
- package/src/plugins/builtin/econ/index.tsx +25 -9
- package/src/plugins/builtin/econ/types.ts +4 -1
- package/src/plugins/builtin/equity-screener/headless.ts +23 -7
- package/src/plugins/builtin/equity-screener/index.tsx +3 -0
- package/src/plugins/builtin/equity-screener/live.ts +39 -12
- package/src/plugins/builtin/equity-screener/model.ts +86 -5
- package/src/plugins/builtin/equity-screener/pane.tsx +20 -21
- package/src/plugins/builtin/equity-screener/results.ts +12 -3
- package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -2
- package/src/plugins/builtin/estimate-revisions/pane.tsx +2 -2
- package/src/plugins/builtin/executives/pane.tsx +2 -2
- package/src/plugins/builtin/exposure/pane.tsx +1 -1
- package/src/plugins/builtin/fear-greed/data.ts +3 -1
- package/src/plugins/builtin/fear-greed/headless.ts +8 -2
- package/src/plugins/builtin/fear-greed/pane.tsx +8 -4
- package/src/plugins/builtin/filing-events/pane.tsx +1 -1
- package/src/plugins/builtin/futures/index.tsx +5 -4
- package/src/plugins/builtin/futures/model.ts +17 -9
- package/src/plugins/builtin/futures/returns.ts +2 -0
- package/src/plugins/builtin/futures/series.ts +44 -8
- package/src/plugins/builtin/futures/table.tsx +3 -3
- package/src/plugins/builtin/futures-curve/client.ts +1 -0
- package/src/plugins/builtin/futures-curve/headless.ts +14 -12
- package/src/plugins/builtin/futures-curve/index.tsx +7 -4
- package/src/plugins/builtin/futures-curve/model.ts +93 -7
- package/src/plugins/builtin/futures-curve/pane.tsx +18 -7
- package/src/plugins/builtin/fx-matrix/amount.ts +2 -1
- package/src/plugins/builtin/fx-matrix/index.tsx +9 -0
- package/src/plugins/builtin/gpu/changes.tsx +1 -1
- package/src/plugins/builtin/gpu/equities.tsx +1 -1
- package/src/plugins/builtin/gpu/pane.tsx +2 -2
- package/src/plugins/builtin/help/function-card.tsx +4 -2
- package/src/plugins/builtin/help/function-index.ts +12 -6
- package/src/plugins/builtin/help/index.tsx +1 -1
- package/src/plugins/builtin/holders/beneficial-view.tsx +1 -1
- package/src/plugins/builtin/holders/fund-holders.ts +22 -1
- package/src/plugins/builtin/holders/headless.ts +5 -4
- package/src/plugins/builtin/holders/pane.tsx +8 -4
- package/src/plugins/builtin/holders/report-header.ts +23 -0
- package/src/plugins/builtin/insider/base-values.ts +55 -0
- package/src/plugins/builtin/insider/headless.ts +307 -83
- package/src/plugins/builtin/insider/index.tsx +65 -23
- package/src/plugins/builtin/insider/insiders.tsx +26 -16
- package/src/plugins/builtin/insider/model.ts +2 -2
- package/src/plugins/builtin/insider/signals-cells.tsx +4 -1
- package/src/plugins/builtin/insider/signals-model.ts +13 -5
- package/src/plugins/builtin/insider/signals.tsx +5 -3
- package/src/plugins/builtin/insider/tickers.tsx +466 -0
- package/src/plugins/builtin/ipo-calendar/pane.tsx +1 -1
- package/src/plugins/builtin/iv-history/client.ts +35 -4
- package/src/plugins/builtin/iv-history/headless.ts +10 -4
- package/src/plugins/builtin/iv-history/model.ts +85 -16
- package/src/plugins/builtin/iv-history/pane.tsx +2 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +6 -3
- package/src/plugins/builtin/jobs/pane.tsx +5 -5
- package/src/plugins/builtin/macro-day/pane.tsx +1 -1
- package/src/plugins/builtin/macro-day/release-table.ts +5 -5
- package/src/plugins/builtin/macro-day/releases.ts +11 -9
- package/src/plugins/builtin/market-movers/headless.ts +6 -2
- package/src/plugins/builtin/market-movers/screener.ts +18 -4
- package/src/plugins/builtin/members/breadth-pane.tsx +3 -3
- package/src/plugins/builtin/members/client.ts +24 -2
- package/src/plugins/builtin/members/headless.ts +68 -9
- package/src/plugins/builtin/members/index.tsx +7 -6
- package/src/plugins/builtin/members/model.ts +99 -13
- package/src/plugins/builtin/members/pane.tsx +72 -20
- package/src/plugins/builtin/mna/distress/pane.tsx +2 -1
- package/src/plugins/builtin/mna/pane.tsx +1 -1
- package/src/plugins/builtin/money-markets/client.ts +43 -15
- package/src/plugins/builtin/money-markets/headless.ts +18 -11
- package/src/plugins/builtin/money-markets/index.tsx +7 -6
- package/src/plugins/builtin/money-markets/model.ts +20 -5
- package/src/plugins/builtin/money-markets/pane.tsx +28 -17
- package/src/plugins/builtin/news/wire/news/footer.ts +11 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +15 -5
- package/src/plugins/builtin/notes/headless.ts +94 -0
- package/src/plugins/builtin/notes/index.tsx +3 -1
- package/src/plugins/builtin/notes/store.ts +10 -3
- package/src/plugins/builtin/options/footer.ts +8 -2
- package/src/plugins/builtin/options/open-interest-as-of.ts +12 -3
- package/src/plugins/builtin/options/view.tsx +10 -1
- package/src/plugins/builtin/options-calculator/pane.tsx +1 -1
- package/src/plugins/builtin/options-positioning/client.ts +35 -8
- package/src/plugins/builtin/options-positioning/headless.ts +17 -7
- package/src/plugins/builtin/options-positioning/index.tsx +10 -0
- package/src/plugins/builtin/options-positioning/pane.tsx +16 -7
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +1 -1
- package/src/plugins/builtin/options-scenario/pane.tsx +1 -1
- package/src/plugins/builtin/pe-band/pane.tsx +2 -2
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -2
- package/src/plugins/builtin/perps/client.ts +54 -15
- package/src/plugins/builtin/perps/headless.ts +39 -13
- package/src/plugins/builtin/perps/index.tsx +2 -1
- package/src/plugins/builtin/perps/model.ts +43 -1
- package/src/plugins/builtin/perps/pane.tsx +35 -18
- package/src/plugins/builtin/portfolio-list/allocation-rows.ts +74 -0
- package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -0
- package/src/plugins/builtin/portfolio-list/cli/period-report.ts +7 -3
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +37 -4
- package/src/plugins/builtin/portfolio-list/cli/render.ts +214 -46
- package/src/plugins/builtin/portfolio-list/headless.ts +32 -10
- package/src/plugins/builtin/portfolio-list/income.ts +63 -30
- package/src/plugins/builtin/portfolio-list/index.tsx +4 -4
- package/src/plugins/builtin/portfolio-list/pane/data.ts +16 -6
- package/src/plugins/builtin/portfolio-list/pane/fx-day-moves.ts +52 -0
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +81 -13
- package/src/plugins/builtin/portfolio-list/pane/target-weights.tsx +178 -0
- package/src/plugins/builtin/portfolio-list/period-pnl.ts +44 -5
- package/src/plugins/builtin/portfolio-list/settings.ts +12 -6
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +9 -4
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +21 -2
- package/src/plugins/builtin/portfolio-list/table.tsx +33 -25
- package/src/plugins/builtin/portfolio-list/use-throttled-ticker-order.ts +40 -3
- package/src/plugins/builtin/power/gas.tsx +2 -2
- package/src/plugins/builtin/power/prices.tsx +2 -2
- package/src/plugins/builtin/primary-dealers/pane.tsx +10 -11
- package/src/plugins/builtin/rate-path/model.ts +9 -0
- package/src/plugins/builtin/rate-path/pane.tsx +6 -5
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +27 -0
- package/src/plugins/builtin/realized-vol/headless.ts +8 -6
- package/src/plugins/builtin/realized-vol/pane.tsx +13 -7
- package/src/plugins/builtin/relative-rotation/pane.tsx +1 -1
- package/src/plugins/builtin/research/analyst-headless.ts +5 -1
- package/src/plugins/builtin/research/analyst-model.ts +7 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +1 -1
- package/src/plugins/builtin/research/relative-valuation-basis.ts +44 -4
- package/src/plugins/builtin/research/relative-valuation-headless.ts +59 -14
- package/src/plugins/builtin/research/relative-valuation-model.ts +65 -26
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +42 -17
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +1 -1
- package/src/plugins/builtin/reverse-dcf/client.ts +34 -4
- package/src/plugins/builtin/reverse-dcf/headless.ts +30 -15
- package/src/plugins/builtin/reverse-dcf/model.ts +190 -29
- package/src/plugins/builtin/reverse-dcf/pane.tsx +35 -13
- package/src/plugins/builtin/risk-factors/pane.tsx +2 -2
- package/src/plugins/builtin/roadmap/pane.tsx +2 -2
- package/src/plugins/builtin/scanner/flow-pane.tsx +4 -4
- package/src/plugins/builtin/scanner/headless.ts +15 -1
- package/src/plugins/builtin/seasonality/pane.tsx +1 -1
- package/src/plugins/builtin/sec/fund-facts-view.tsx +5 -2
- package/src/plugins/builtin/sec/fund-facts.ts +66 -6
- package/src/plugins/builtin/sec/headless.ts +8 -4
- package/src/plugins/builtin/sec/index.tsx +41 -13
- package/src/plugins/builtin/shared/report-freshness.ts +15 -6
- package/src/plugins/builtin/shared/ticker-company.ts +111 -0
- package/src/plugins/builtin/shared/use-quote-board.ts +37 -2
- package/src/plugins/builtin/shared/volatility/live-session.ts +23 -0
- package/src/plugins/builtin/shared/volatility-indices.ts +2 -0
- package/src/plugins/builtin/short-interest/publications-pane.tsx +1 -1
- package/src/plugins/builtin/short-volume/pane.tsx +1 -1
- package/src/plugins/builtin/social-mentions/outliers.tsx +3 -3
- package/src/plugins/builtin/social-mentions/pane.tsx +2 -2
- package/src/plugins/builtin/supply-chain/graph-pane.tsx +1 -1
- package/src/plugins/builtin/supply-chain/model.ts +18 -6
- package/src/plugins/builtin/supply-chain/pane.tsx +1 -1
- package/src/plugins/builtin/themes/pane.tsx +4 -4
- package/src/plugins/builtin/thirteenf/api.ts +1 -0
- package/src/plugins/builtin/thirteenf/format.ts +5 -0
- package/src/plugins/builtin/thirteenf/headless.ts +2 -2
- package/src/plugins/builtin/thirteenf/model.ts +128 -5
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +1 -1
- package/src/plugins/builtin/thirteenf/report-notes.ts +10 -3
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +1 -1
- package/src/plugins/builtin/thirteenf/table.ts +2 -2
- package/src/plugins/builtin/thirteenf/types.ts +12 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +27 -14
- package/src/plugins/builtin/ticker-detail/data-panes/returns-history.ts +6 -3
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +14 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +4 -1
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +87 -19
- package/src/plugins/builtin/ticker-detail/financials/exchange-results.ts +54 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +114 -9
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +37 -20
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +42 -19
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +3 -2
- package/src/plugins/builtin/ticker-detail/headless.ts +90 -31
- package/src/plugins/builtin/ticker-detail/overview/model.ts +22 -15
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +5 -2
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +12 -7
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +21 -0
- package/src/plugins/builtin/trace-bonds/client.ts +107 -10
- package/src/plugins/builtin/trace-bonds/detail.tsx +1 -1
- package/src/plugins/builtin/trace-bonds/headless.ts +20 -5
- package/src/plugins/builtin/trace-bonds/pane.tsx +15 -4
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/pane.tsx +1 -1
- package/src/plugins/builtin/treasury-daily/pane.tsx +2 -2
- package/src/plugins/builtin/vol-surface/charts.tsx +30 -5
- package/src/plugins/builtin/vol-surface/client.ts +40 -12
- package/src/plugins/builtin/vol-surface/events.ts +213 -0
- package/src/plugins/builtin/vol-surface/headless.ts +82 -13
- package/src/plugins/builtin/vol-surface/index.tsx +5 -1
- package/src/plugins/builtin/vol-surface/model.ts +42 -6
- package/src/plugins/builtin/vol-surface/pane.tsx +95 -23
- package/src/plugins/builtin/volatility/dvol.ts +14 -2
- package/src/plugins/builtin/volatility/headless.ts +3 -2
- package/src/plugins/builtin/volatility/index.tsx +1 -1
- package/src/plugins/builtin/volatility/pane.tsx +1 -1
- package/src/plugins/builtin/volatility/series.ts +7 -3
- package/src/plugins/builtin/world-venue-map/activity-series.ts +89 -0
- package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +123 -0
- package/src/plugins/builtin/world-venue-map/evidence.ts +2 -0
- package/src/plugins/builtin/world-venue-map/geo-series.ts +35 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +58 -9
- package/src/plugins/builtin/world-venue-map/index.ts +6 -3
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +6 -1
- package/src/plugins/builtin/world-venue-map/pane.tsx +4 -3
- package/src/plugins/builtin/yield-curve/index.tsx +12 -10
- package/src/plugins/builtin/yield-curve/swaps.tsx +1 -1
- package/src/plugins/extracted-plugins.ts +14 -10
- package/src/plugins/installer.ts +17 -1
- package/src/plugins/marketplace/feed.ts +14 -0
- package/src/plugins/marketplace/install-offer.ts +64 -0
- package/src/plugins/registry/contributions.ts +46 -8
- package/src/plugins/registry/index.ts +5 -0
- package/src/portfolio/collection-name.ts +38 -4
- package/src/portfolio/column-values.ts +35 -4
- package/src/portfolio/period-pnl.ts +4 -2
- package/src/portfolio/valuation-basis.ts +23 -1
- package/src/react/async-resource.ts +24 -8
- package/src/remote/endpoint.ts +38 -12
- package/src/remote/secrets.ts +22 -6
- package/src/remote/server.ts +20 -4
- package/src/renderers/dom/data-table/index.tsx +2 -1
- package/src/renderers/dom/data-table/row.tsx +49 -7
- package/src/renderers/dom/desktop/controls.tsx +2 -0
- package/src/renderers/dom/desktop/query-bar.tsx +57 -7
- package/src/renderers/dom/host/surface-3d.tsx +46 -5
- package/src/renderers/dom/styles.css +17 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +15 -21
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +16 -61
- package/src/renderers/electrobun/view/cli-pane-shot-socket.ts +134 -0
- package/src/renderers/electrobun/view/host-route.ts +119 -0
- package/src/renderers/electrobun/view/rpc-timeout.ts +6 -5
- package/src/renderers/opentui/toast-host.tsx +6 -3
- package/src/renderers/opentui/ui-host.tsx +29 -5
- package/src/series/registry.ts +1 -0
- package/src/series/standalone-catalog.ts +40 -0
- package/src/series/types.ts +10 -0
- package/src/series/validate.ts +5 -0
- package/src/shares/portable-layout.ts +2 -7
- package/src/sources/gloomberb-cloud/dated-chunks.ts +133 -0
- package/src/sources/gloomberb-cloud/index.ts +46 -5
- package/src/sources/gloomberb-cloud/news.ts +15 -9
- package/src/sources/gloomberb-cloud/normalizers.ts +17 -0
- package/src/sources/history-coverage.ts +13 -0
- package/src/sources/history-result.ts +1 -0
- package/src/sources/provider-errors.ts +9 -0
- package/src/sources/provider-router/batches.ts +7 -3
- package/src/sources/provider-router/financial-routes.ts +3 -1
- package/src/sources/provider-router/history.ts +6 -4
- package/src/sources/provider-router/index.ts +5 -1
- package/src/sources/provider-router/primary.ts +4 -3
- package/src/sources/provider-router/retrieved-at.ts +12 -0
- package/src/state/hooks/quote-streaming.ts +14 -6
- package/src/team/store.ts +17 -4
- package/src/telemetry/crash-reports.ts +3 -1
- package/src/test-support/cli-context.ts +3 -2
- package/src/test-support/test-env.ts +7 -0
- package/src/theme/themes.ts +16 -9
- package/src/theme/tone-contrast.ts +29 -5
- package/src/tickers/company-name-listing.ts +31 -3
- package/src/tickers/company-name.ts +9 -0
- package/src/tickers/index-roots.ts +56 -4
- package/src/tickers/instrument-kind.ts +22 -1
- package/src/tickers/listing-name.ts +7 -2
- package/src/tickers/listing-venues.ts +17 -2
- package/src/tickers/search/home-listing.ts +2 -0
- package/src/tickers/search/index.ts +69 -11
- package/src/tickers/search/major-listings.json +595 -592
- package/src/tickers/search/ranking.ts +19 -1
- package/src/tickers/terminal-codes.ts +20 -6
- package/src/time-series/bar-aggregation.ts +3 -2
- package/src/time-series/base-series.ts +18 -1
- package/src/time-series/chart-data.ts +9 -6
- package/src/time-series/chart-seed.ts +11 -3
- package/src/time-series/currency-conversion.ts +1 -0
- package/src/time-series/date-window.ts +8 -0
- package/src/time-series/formula-months.ts +57 -0
- package/src/time-series/fundamentals/current-valuation.ts +244 -0
- package/src/time-series/fundamentals/historical-valuation.ts +99 -0
- package/src/time-series/fundamentals/metric-ids.ts +61 -0
- package/src/time-series/fundamentals/period-points.ts +104 -0
- package/src/time-series/fundamentals/quarterly-ttm.ts +220 -0
- package/src/time-series/fundamentals/series.ts +164 -0
- package/src/time-series/fundamentals/source-statements.ts +178 -0
- package/src/time-series/fundamentals/statement-fields.ts +154 -0
- package/src/time-series/fundamentals/statement-merge.ts +124 -0
- package/src/time-series/fundamentals/statement.ts +114 -0
- package/src/time-series/fundamentals/valuation-multiples.ts +50 -0
- package/src/time-series/fundamentals.ts +18 -1407
- package/src/time-series/leverage.ts +12 -4
- package/src/time-series/live-bars.ts +12 -7
- package/src/time-series/live-quotes.ts +6 -2
- package/src/time-series/market.ts +10 -3
- package/src/time-series/price-comparison.ts +106 -0
- package/src/time-series/range.ts +10 -0
- package/src/time-series/resolve-context.ts +7 -2
- package/src/time-series/resolve.ts +61 -5
- package/src/time-series/series-name.ts +2 -2
- package/src/time-series/series-presentation.ts +91 -2
- package/src/time-series/session-bar.ts +13 -7
- package/src/time-series/spec.ts +21 -2
- package/src/time-series/studies/formula.ts +262 -36
- package/src/time-series/studies/leverage.ts +9 -3
- package/src/time-series/studies/resolve.ts +7 -2
- package/src/time-series/types.ts +34 -0
- package/src/time-series/use-chart-resolution.ts +18 -1
- package/src/types/data-provider.ts +7 -0
- package/src/types/financials.ts +112 -1
- package/src/types/headless.ts +64 -3
- package/src/types/instrument.ts +6 -0
- package/src/types/plugin-context.ts +9 -0
- package/src/types/plugin-pane-templates.ts +6 -0
- package/src/types/plugin-panes.ts +7 -0
- package/src/types/price-history.ts +6 -0
- package/src/ui/host.tsx +3 -1
- package/src/ui/index.tsx +7 -2
- package/src/utils/cli-output.ts +21 -1
- package/src/utils/currency-units.ts +14 -0
- package/src/utils/datetime-format.ts +11 -0
- package/src/utils/debug-log.ts +29 -0
- package/src/utils/exchange-announcements.ts +26 -3
- package/src/utils/exchange-notation.generated.ts +3 -4
- package/src/utils/exchange-results.ts +144 -0
- package/src/utils/exchanges.ts +10 -0
- package/src/utils/financial-statements.ts +212 -22
- package/src/utils/fire-and-forget.ts +1 -1
- package/src/utils/fiscal-period.ts +41 -3
- package/src/utils/format.ts +10 -6
- package/src/utils/fundamentals.ts +179 -12
- package/src/utils/futures-generic.ts +26 -0
- package/src/utils/lease-liabilities.ts +15 -5
- package/src/utils/lookup-token.ts +22 -0
- package/src/utils/max-drawdown.ts +25 -4
- package/src/utils/price-history-integrity.ts +56 -8
- package/src/utils/price-history.ts +6 -2
- package/src/utils/price-window.ts +38 -2
- package/src/utils/replace-file.ts +47 -0
- package/src/utils/rpc-timeout-error.ts +16 -2
- package/src/utils/untrusted-text.ts +14 -0
|
@@ -35,6 +35,14 @@ export interface CompanyNameListing {
|
|
|
35
35
|
* change in one line, "GETY became GETYQ on 2026-10-22".
|
|
36
36
|
*/
|
|
37
37
|
moved?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The company's own lines on other venues, where it is listed more than
|
|
40
|
+
* once under one symbol and name (ESLT:TASE beside ESLT:NASDAQ), as
|
|
41
|
+
* `SYM:EXCH`: never a line quoting
|
|
42
|
+
* shares listed elsewhere (a regional German venue, OTC), a receipt, or a US
|
|
43
|
+
* line's other US venues, which quote the same shares.
|
|
44
|
+
*/
|
|
45
|
+
otherLines?: string[];
|
|
38
46
|
}
|
|
39
47
|
|
|
40
48
|
/**
|
|
@@ -188,6 +196,9 @@ function rankCompanyLines(name: string, results: readonly InstrumentSearchResult
|
|
|
188
196
|
|
|
189
197
|
type RankedCompanyLine = ReturnType<typeof rankCompanyLines>[number];
|
|
190
198
|
|
|
199
|
+
/** At most this many of a company's other lines are named (`CompanyNameListing.otherLines`). */
|
|
200
|
+
const MAX_OTHER_LINES = 2;
|
|
201
|
+
|
|
191
202
|
/**
|
|
192
203
|
* The listing `findListingOfCompanyName` settles on from its first pick: the
|
|
193
204
|
* company's primary line, a quoted one, or the line it moved to.
|
|
@@ -236,13 +247,30 @@ async function settleCompanyListing(
|
|
|
236
247
|
// The line it moved to is a US symbol, read bare as `quote` reads one (GETYQ, which trades over the counter).
|
|
237
248
|
? { symbol: quoted.moved.symbol, exchange: "", name: best.result.name, moved: quoted.moved.note }
|
|
238
249
|
: {
|
|
239
|
-
// A vendor's venue suffix on the venue it names is the listing's own code: GARAN.IS on BIST is GARAN there.
|
|
240
|
-
symbol
|
|
250
|
+
// A vendor's venue suffix on the venue it names is the listing's own code: GARAN.IS on BIST is GARAN there. An
|
|
251
|
+
// index keeps the symbol its sources quote it by (XU100.IS, as ^GSPC): there is no share code to read it as.
|
|
252
|
+
symbol: /^index$/i.test(listedType(best.result).trim()) ? best.result.symbol.toUpperCase()
|
|
253
|
+
: suffixFree(best.result.symbol.toUpperCase(), best.exchange),
|
|
254
|
+
exchange: best.exchange, name: best.result.name,
|
|
241
255
|
...namedByService(name, best.result) ? { named: true as const } : {},
|
|
242
256
|
...best.home ? { home: true as const } : {},
|
|
243
257
|
};
|
|
258
|
+
// The same symbol under the same name: a line under another symbol or name can be another company's (AEON on AMEX
|
|
259
|
+
// beside Aeon Co.'s 8267 on JPX), however alike the names.
|
|
260
|
+
const bestSymbol = suffixFree(best.result.symbol.toUpperCase(), best.exchange);
|
|
261
|
+
const otherLines = quoted.moved || best.stock ? [] : [...new Set(companyLines(best, listed, lineFacts).flatMap((listing) => {
|
|
262
|
+
if (listing === best || listing.stock || listing.exchange === best.exchange || otherHomes.has(plainName(listing.result.name))) return [];
|
|
263
|
+
if (plainName(listing.result.name) !== plainName(best.result.name)) return [];
|
|
264
|
+
if (suffixFree(listing.result.symbol.toUpperCase(), listing.exchange) !== bestSymbol) return [];
|
|
265
|
+
if (lineDistance(listedType(listing.result), listing.exchange, listing.result.symbol) !== 0) return [];
|
|
266
|
+
// Over the counter, a line quotes shares listed elsewhere; so does another US venue of a US line (IEX).
|
|
267
|
+
if (listing.exchange.startsWith("OTC") || listing.exchange === "PNK" || listing.exchange === "PINK") return [];
|
|
268
|
+
if (isUsVenue(best.exchange) && (isUsVenue(listing.exchange) || isUsEquityExchange(listing.exchange))) return [];
|
|
269
|
+
return [`${suffixFree(listing.result.symbol.toUpperCase(), listing.exchange)}:${listing.exchange}`];
|
|
270
|
+
}))].slice(0, MAX_OTHER_LINES);
|
|
271
|
+
const listing = otherLines.length ? { ...found, otherLines } : found;
|
|
244
272
|
const meant = best.stock && options.meant ? await stockNamedRunTogether(dataProvider, name, results) : null;
|
|
245
|
-
return meant ? { ...
|
|
273
|
+
return meant ? { ...listing, meant } : listing;
|
|
246
274
|
}
|
|
247
275
|
|
|
248
276
|
/**
|
|
@@ -50,6 +50,15 @@ function companyKey(name: string): string {
|
|
|
50
50
|
return words.join(" ");
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* The words `name` adds to `base`, in order, as `companyLines` compares them:
|
|
55
|
+
* ["heavy", "ind"] for "MITSUBISHI HEAVY IND. LTD." on "Mitsubishi Corporation".
|
|
56
|
+
*/
|
|
57
|
+
export function addedCompanyWords(name: string | null | undefined, base: string | null | undefined): string[] {
|
|
58
|
+
const own = companyWords(base);
|
|
59
|
+
return companyKey(name ?? "").split(" ").filter((word) => word && !SHARE_NOISE.has(word) && !own.has(word));
|
|
60
|
+
}
|
|
61
|
+
|
|
53
62
|
function companyWords(name: string | null | undefined): Set<string> {
|
|
54
63
|
return new Set(companyKey(name ?? "").split(" ").filter((word) => word && !SHARE_NOISE.has(word)));
|
|
55
64
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Well-known index roots that people type bare. As a bare symbol each one is
|
|
3
3
|
* another instrument (MOVE is Corvex, MID a fund) or nothing at all (VIX); the
|
|
4
|
-
* index itself is quoted as ^ROOT
|
|
5
|
-
*
|
|
4
|
+
* index itself is quoted as ^ROOT, or as the symbol the sources list it
|
|
5
|
+
* under where that differs (VHSI is ^HSIL). Every entry is offered as a
|
|
6
|
+
* command to run, so only roots whose symbol returns a quote belong here.
|
|
6
7
|
*/
|
|
8
|
+
const INDEX_SYMBOLS = new Map([["VHSI", "^HSIL"]]);
|
|
7
9
|
const INDEX_ROOTS = new Map([
|
|
8
10
|
["VIX", "Cboe Volatility Index"],
|
|
9
11
|
["VVIX", "Cboe VIX of VIX Index"],
|
|
@@ -25,6 +27,7 @@ const INDEX_ROOTS = new Map([
|
|
|
25
27
|
["RUA", "Russell 3000 Index"],
|
|
26
28
|
["MOVE", "ICE BofA MOVE Index"],
|
|
27
29
|
["NYA", "NYSE Composite Index"],
|
|
30
|
+
["VHSI", "HSI Volatility Index"],
|
|
28
31
|
]);
|
|
29
32
|
|
|
30
33
|
export interface IndexRoot {
|
|
@@ -33,11 +36,11 @@ export interface IndexRoot {
|
|
|
33
36
|
name: string;
|
|
34
37
|
}
|
|
35
38
|
|
|
36
|
-
/** The index a bare root names (VIX is ^VIX); null for any other symbol, ^VIX included. */
|
|
39
|
+
/** The index a bare root names (VIX is ^VIX, VHSI ^HSIL); null for any other symbol, ^VIX included. */
|
|
37
40
|
export function indexRootFor(symbol: string): IndexRoot | null {
|
|
38
41
|
const root = symbol.trim().toUpperCase();
|
|
39
42
|
const name = INDEX_ROOTS.get(root);
|
|
40
|
-
return name ? { symbol: `^${root}`, name } : null;
|
|
43
|
+
return name ? { symbol: INDEX_SYMBOLS.get(root) ?? `^${root}`, name } : null;
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
/** "Did you mean ^VIX (Cboe Volatility Index)?" after a bare root that is not a ticker; null for any other symbol. */
|
|
@@ -46,6 +49,55 @@ export function indexRootSuggestion(symbol: string): string | null {
|
|
|
46
49
|
return root ? `Did you mean ${root.symbol} (${root.name})?` : null;
|
|
47
50
|
}
|
|
48
51
|
|
|
52
|
+
/** An index no source here carries, and the funds that track it. */
|
|
53
|
+
export interface UncarriedIndex {
|
|
54
|
+
name: string;
|
|
55
|
+
/** Who licenses the index, which is why it is not here. */
|
|
56
|
+
licensor: string;
|
|
57
|
+
/** Funds that track it, as `quote` answers them, with their names. */
|
|
58
|
+
funds: ReadonlyArray<readonly [listing: string, name: string]>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Indices whose publishers license them, so no source here quotes them, with
|
|
63
|
+
* the funds that track them (each quoted on 2026-11-09). `codes` are the
|
|
64
|
+
* spellings people type: the name, the publisher's code, Bloomberg's, a
|
|
65
|
+
* quote site's. A code with a caret is matched with it, since a bare TPX is a
|
|
66
|
+
* US ticker; the others by their letters and digits alone.
|
|
67
|
+
*/
|
|
68
|
+
const UNCARRIED_INDICES: ReadonlyArray<UncarriedIndex & { codes: readonly string[] }> = [
|
|
69
|
+
{
|
|
70
|
+
name: "TOPIX",
|
|
71
|
+
licensor: "JPX",
|
|
72
|
+
codes: ["TOPIX", "TOPIX Index", "Tokyo Stock Price Index", "TPX Index", "^TPX", "^TOPX", "TOPX", "998405", "998405:JPX", "998405.T"],
|
|
73
|
+
funds: [["1306:JPX", "NEXT FUNDS TOPIX ETF"], ["1475:JPX", "iShares Core TOPIX ETF"]],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "JPX-Nikkei Index 400",
|
|
77
|
+
licensor: "JPX and Nikkei",
|
|
78
|
+
codes: ["JPX-Nikkei 400", "JPX-Nikkei Index 400", "JPX Nikkei 400", "JPNK400", "JPNK400 Index", "^JPN400"],
|
|
79
|
+
funds: [["1591:JPX", "NEXT FUNDS JPX-Nikkei 400 ETF"], ["1592:JPX", "Listed Index Fund JPX-Nikkei 400"]],
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
const indexCodeKey = (text: string) => text.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
84
|
+
|
|
85
|
+
/** The index no source carries that `typed` names (TOPIX, ^TPX, 998405:JPX), else null. */
|
|
86
|
+
export function uncarriedIndexFor(typed: string): UncarriedIndex | null {
|
|
87
|
+
const asTyped = typed.trim().toUpperCase();
|
|
88
|
+
const key = indexCodeKey(typed);
|
|
89
|
+
if (!key) return null;
|
|
90
|
+
const found = UNCARRIED_INDICES.find((index) => index.codes.some((code) =>
|
|
91
|
+
code.startsWith("^") ? code.toUpperCase() === asTyped : indexCodeKey(code) === key));
|
|
92
|
+
return found ? { name: found.name, licensor: found.licensor, funds: found.funds } : null;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** "TOPIX is not carried: JPX licenses it. Funds that track it: 1306:JPX (NEXT FUNDS TOPIX ETF), 1475:JPX (…)." */
|
|
96
|
+
export function uncarriedIndexLine(index: UncarriedIndex): string {
|
|
97
|
+
return `${index.name} is not carried: ${index.licensor} ${index.licensor.includes(" and ") ? "license" : "licenses"} it. `
|
|
98
|
+
+ `Funds that track it: ${index.funds.map(([listing, name]) => `${listing} (${name})`).join(", ")}.`;
|
|
99
|
+
}
|
|
100
|
+
|
|
49
101
|
/** Cboe's Treasury yield indices: 13-week bill, 5-, 10- and 30-year notes. Each level is a yield in percent. */
|
|
50
102
|
const YIELD_INDEX_SYMBOLS: ReadonlySet<string> = new Set(["^IRX", "^FVX", "^TNX", "^TYX"]);
|
|
51
103
|
|
|
@@ -148,6 +148,23 @@ export function isCryptoVenuePerpetual(type: string | null | undefined, name: st
|
|
|
148
148
|
return classifyInstrumentType(type) === "crypto" && /\(derivatives\)/i.test(name ?? "");
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
/** An exchange-traded fund's intraday indicative value as an index feed lists it, under the fund's own name: ^ARKK-IV. */
|
|
152
|
+
export function isIndicativeValueListing(symbol: string | null | undefined, type?: string | null): boolean {
|
|
153
|
+
return /^\^[A-Z0-9.]{1,10}-IV$/i.test(parsePublicTickerKey(symbol ?? "").symbol) || normalizeInstrumentType(type) === "INDICATIVEVALUE";
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* A crypto venue's copy of a fund's or a company's price: a token on its
|
|
158
|
+
* shares ("... Tokenized ETF (Ondo)", typed as a coin) or a perpetual on it
|
|
159
|
+
* ("... ETF (Derivatives)"). Neither is a listing of the fund or the company.
|
|
160
|
+
* A fund or share whose own name says tokenized is a listing.
|
|
161
|
+
*/
|
|
162
|
+
export function isCryptoVenueCopy(type: string | null | undefined, name: string | null | undefined): boolean {
|
|
163
|
+
return normalizeInstrumentType(type) === "TOKENIZEDPRODUCT"
|
|
164
|
+
|| (classifyInstrumentType(type) === "crypto" && /\btokeni[sz]ed\b/i.test(name ?? ""))
|
|
165
|
+
|| (isCryptoVenuePerpetual(type, name) && /\b(?:ETFS?|ETNS?|FUNDS?|TRUST|SHARES?|STOCK)\b/i.test(name ?? ""));
|
|
166
|
+
}
|
|
167
|
+
|
|
151
168
|
/**
|
|
152
169
|
* A quote type's code in the words the other types are written in ("Common
|
|
153
170
|
* Stock", "Depositary Receipt"), so one search lists one vocabulary. A generic
|
|
@@ -173,8 +190,12 @@ const TYPE_CODE_WORDS: Record<string, string> = {
|
|
|
173
190
|
export function instrumentTypeLabel(
|
|
174
191
|
type: string | null | undefined,
|
|
175
192
|
name: string | null | undefined,
|
|
176
|
-
options: { detail?: boolean } = {},
|
|
193
|
+
options: { detail?: boolean; symbol?: string } = {},
|
|
177
194
|
): string | undefined {
|
|
195
|
+
if (isIndicativeValueListing(options.symbol, type)) return options.detail ? "Indicative value (the fund's intraday estimate, not a listing)" : "Indicative value";
|
|
196
|
+
if (normalizeInstrumentType(type) !== "TOKENIZEDPRODUCT" && /\btokeni[sz]ed\b/i.test(name ?? "") && classifyInstrumentType(type) === "crypto") {
|
|
197
|
+
return options.detail ? "Tokenized product (a crypto token, not the listing)" : "Tokenized product";
|
|
198
|
+
}
|
|
178
199
|
if (isCryptoVenuePerpetual(type, name)) {
|
|
179
200
|
return options.detail ? "Perpetual futures price (24/7 on crypto venues; not the listed future, not spot)" : "Perpetual futures price";
|
|
180
201
|
}
|
|
@@ -3,7 +3,7 @@ import type { TickerRecord } from "../types/ticker";
|
|
|
3
3
|
import { canonicalExchange, parsePublicTickerKey } from "../utils/exchanges";
|
|
4
4
|
import { optionContractName } from "../utils/options";
|
|
5
5
|
|
|
6
|
-
type NamingQuote = Pick<Quote, "name" | "listingExchangeName" | "exchangeName"
|
|
6
|
+
type NamingQuote = Pick<Quote, "name" | "listingExchangeName" | "exchangeName"> & Partial<Pick<Quote, "symbol" | "instrumentType">>;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The company a listing's own quote names: the one name `quote`, `history`,
|
|
@@ -14,7 +14,12 @@ type NamingQuote = Pick<Quote, "name" | "listingExchangeName" | "exchangeName">;
|
|
|
14
14
|
*/
|
|
15
15
|
export function quotedListingName(exchange: string, quote: NamingQuote | null | undefined): string | null {
|
|
16
16
|
const quoteExchange = canonicalExchange(quote?.listingExchangeName || quote?.exchangeName);
|
|
17
|
-
|
|
17
|
+
// ^NDX:NIM's quote names its venue by its publisher (NASDAQ GIDS) and its key by the service's code: it is still that listing's.
|
|
18
|
+
// Only an index's: a security's quote that names another venue is another listing's, whatever its key.
|
|
19
|
+
const index = quote?.instrumentType?.trim().toUpperCase() === "INDEX";
|
|
20
|
+
const ownKey = index && !!quote?.symbol && !!exchange
|
|
21
|
+
&& canonicalExchange(parsePublicTickerKey(quote.symbol).exchange) === canonicalExchange(exchange);
|
|
22
|
+
if (quoteExchange && exchange && !ownKey && quoteExchange !== canonicalExchange(exchange)) return null;
|
|
18
23
|
return quote?.name?.trim() || null;
|
|
19
24
|
}
|
|
20
25
|
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
} from "../utils/exchanges";
|
|
14
14
|
import { currencyPairSpelling } from "../utils/currency-pair";
|
|
15
15
|
import { savedAbroadForBareSymbol } from "./search/bare-symbol";
|
|
16
|
+
import { parseListingWithdrawal, withdrawalLabel } from "../market-data/quotes/delisting";
|
|
17
|
+
import type { ListingWithdrawal } from "../types/financials";
|
|
16
18
|
|
|
17
19
|
export interface ListingStore {
|
|
18
20
|
loadTicker(symbol: string): Promise<TickerRecord | null>;
|
|
@@ -33,6 +35,16 @@ export interface ListingVenue {
|
|
|
33
35
|
* spelling than the one asked for: BP for `BP.` (London's code for it).
|
|
34
36
|
*/
|
|
35
37
|
symbol?: string;
|
|
38
|
+
/** The exchange withdrew the listing (Hang Seng Bank's 0011 on HKEX): it is on record, and nothing trades there. */
|
|
39
|
+
withdrawal?: ListingWithdrawal;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** A search row's name, and its withdrawal with the day it went beside the name, as a choice between listings names it. */
|
|
43
|
+
function withdrawnOf(name: string, value: unknown): Pick<ListingVenue, "name" | "withdrawal"> {
|
|
44
|
+
const withdrawal = parseListingWithdrawal(value);
|
|
45
|
+
return withdrawal
|
|
46
|
+
? { name: [name, withdrawalLabel({ ...withdrawal, reason: null })].filter(Boolean).join(" · "), withdrawal }
|
|
47
|
+
: { name };
|
|
36
48
|
}
|
|
37
49
|
|
|
38
50
|
/** The venue's own symbol, when it is not `asked` (ignoring case). */
|
|
@@ -60,7 +72,7 @@ export async function listingVenues(symbol: string, { store, dataProvider }: Lis
|
|
|
60
72
|
: resolved.kind === "local" ? { exchange: resolved.ticker.metadata.exchange, name: resolved.ticker.metadata.name }
|
|
61
73
|
: {
|
|
62
74
|
exchange: resolved.result.exchange === "SMART" ? resolved.result.primaryExchange ?? "" : resolved.result.exchange || resolved.result.primaryExchange || "",
|
|
63
|
-
name
|
|
75
|
+
...withdrawnOf(resolved.result.name, resolved.result.withdrawal),
|
|
64
76
|
...ownSymbol(parsePublicTickerKey(resolved.result.symbol).symbol, symbol),
|
|
65
77
|
};
|
|
66
78
|
venues = only?.exchange ? [{ ...only, exchange: canonicalExchange(only.exchange) }] : [];
|
|
@@ -69,7 +81,10 @@ export async function listingVenues(symbol: string, { store, dataProvider }: Lis
|
|
|
69
81
|
if (!(error instanceof AmbiguousTickerError) || error instanceof AmbiguousContractError) return [];
|
|
70
82
|
venues = error.listings.flatMap((listing) => {
|
|
71
83
|
const key = parsePublicTickerKey(listing);
|
|
72
|
-
return key.exchange ? [{
|
|
84
|
+
return key.exchange ? [{
|
|
85
|
+
exchange: key.exchange, name: error.listingNames[listing] ?? "", ...ownSymbol(key.symbol, symbol),
|
|
86
|
+
...(error.listingWithdrawals[listing] ? { withdrawal: error.listingWithdrawals[listing] } : {}),
|
|
87
|
+
}] : [];
|
|
73
88
|
});
|
|
74
89
|
}
|
|
75
90
|
return venues.filter((venue, index) => venues.findIndex((other) => other.exchange === venue.exchange) === index);
|
|
@@ -26,6 +26,8 @@ export function listingDistance(candidate: TickerSearchCandidate): 0 | 1 | 2 {
|
|
|
26
26
|
/** `listingDistance` of a line by its type, its canonical venue and its symbol. */
|
|
27
27
|
export function lineDistance(type: string, exchange: string, symbol: string): 0 | 1 | 2 {
|
|
28
28
|
if (RECEIPT_TYPE.test(type)) return 2;
|
|
29
|
+
// An index's code is its own (XU100 for the BIST 100), never a secondary line of shares.
|
|
30
|
+
if (/^\s*index\s*$/i.test(type)) return 0;
|
|
29
31
|
// A code mixing digits and letters is a secondary line (Milan's 4MSFT, London's 0R1I), except on SGX, whose
|
|
30
32
|
// own codes mix them (D05, 5E2).
|
|
31
33
|
return SECONDARY_VENUES.has(exchange) || exchange !== "SGX" && /\d/.test(symbol) && /[A-Za-z]/.test(symbol) ? 1 : 0;
|
|
@@ -3,7 +3,7 @@ import type { SearchRequestContext, DataProvider } from "../../types/data-provid
|
|
|
3
3
|
import type { InstrumentSearchResult } from "../../types/instrument";
|
|
4
4
|
import type { TickerRecord } from "../../types/ticker";
|
|
5
5
|
import { canonicalExchange, isSharedExchangeCode, isUsListingExchange, parsePublicTickerKey, publicTickerKey, typedExchangeCode } from "../../utils/exchanges";
|
|
6
|
-
import { getListingSymbol, listingSuffixConflictsWithExchange, tickerHasListingSuffix } from "../../sources/listing-symbols";
|
|
6
|
+
import { getListingSymbol, listingSuffixConflictsWithExchange, listingSuffixVenue, tickerHasListingSuffix } from "../../sources/listing-symbols";
|
|
7
7
|
import { parseOptionSymbol } from "../../utils/options";
|
|
8
8
|
import { resolveCurrencyUnit } from "../../utils/currency-units";
|
|
9
9
|
import { currencyPairSpelling } from "../../utils/currency-pair";
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
} from "./result";
|
|
36
36
|
|
|
37
37
|
import { typedPerpetualListing } from "../perpetual-listing";
|
|
38
|
+
import { isCryptoVenueCopy, isIndicativeValueListing } from "../instrument-kind";
|
|
38
39
|
import { renamedListingFor, renamedListingFormerLine, type RenamedListing } from "../renamed-listings";
|
|
39
40
|
import { endsInLegalForm, readNearMissListing, readVenueFirstListing, readTerminalListingCode } from "../terminal-codes";
|
|
40
41
|
import { isProviderBusy, ProviderBusyError, SEARCH_BUSY_MESSAGE } from "../../sources/provider-errors";
|
|
@@ -43,7 +44,8 @@ import { companyNameExtraWords } from "../company-name";
|
|
|
43
44
|
import { withHomeListingLead } from "./home-listing";
|
|
44
45
|
import { answeredInFull, rememberSearchAnswer, withKnownListings } from "./listing-index";
|
|
45
46
|
import { savedAbroadForBareSymbol, savedUsListingOf } from "./bare-symbol";
|
|
46
|
-
import { delistingLabel } from "../../market-data/quotes/delisting";
|
|
47
|
+
import { delistingLabel, parseListingWithdrawal, withdrawalLabel } from "../../market-data/quotes/delisting";
|
|
48
|
+
import type { ListingWithdrawal } from "../../types/financials";
|
|
47
49
|
import { hasNonLatinLetters } from "../../utils/typed-text";
|
|
48
50
|
import { isNetworkFailure } from "../../utils/network-failure";
|
|
49
51
|
export type {
|
|
@@ -73,13 +75,22 @@ export const LISTING_SEARCH_LIMIT = 30;
|
|
|
73
75
|
* 2023"), and drops a name that only repeats its symbol.
|
|
74
76
|
*/
|
|
75
77
|
function listingChoiceName(result: InstrumentSearchResult): string {
|
|
76
|
-
|
|
78
|
+
const withdrawal = parseListingWithdrawal(result.withdrawal);
|
|
79
|
+
if (!result.delisting && !withdrawal) return result.name;
|
|
77
80
|
const name = result.name && normalizeTickerSymbol(result.name) !== normalizeTickerSymbol(result.symbol) ? result.name : "";
|
|
78
|
-
|
|
81
|
+
// A line its exchange withdrew says when it went (Hang Seng Bank · Delisted Jan 27, 2026), not why: the reason is its own message.
|
|
82
|
+
const ended = result.delisting ? delistingLabel(result.delisting) : withdrawalLabel({ ...withdrawal!, reason: null });
|
|
83
|
+
return [name, ended].filter(Boolean).join(" · ");
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
export class AmbiguousTickerError extends Error {
|
|
82
|
-
constructor(
|
|
87
|
+
constructor(
|
|
88
|
+
readonly query: string,
|
|
89
|
+
readonly listings: readonly string[],
|
|
90
|
+
readonly listingNames: Readonly<Record<string, string>> = {},
|
|
91
|
+
/** The listings among them their exchange withdrew, by key (`0011:HKEX`). */
|
|
92
|
+
readonly listingWithdrawals: Readonly<Record<string, ListingWithdrawal>> = {},
|
|
93
|
+
) {
|
|
83
94
|
// Every listing is a choice: a list cut short could leave out the one meant.
|
|
84
95
|
const more = listings.length - MAX_NAMED_LISTINGS;
|
|
85
96
|
const named = `${listings.slice(0, MAX_NAMED_LISTINGS).join(", ")}${more > 0 ? ` or one of ${more} more in search` : ""}`;
|
|
@@ -124,6 +135,8 @@ interface TickerSearchCandidateOptions {
|
|
|
124
135
|
includeOptionContracts?: boolean;
|
|
125
136
|
providerRanks?: ReadonlyMap<string, number>;
|
|
126
137
|
providerPopularity?: ReadonlyMap<string, number>;
|
|
138
|
+
/** Search's own row of each listing, by its key (9992:XHKG), the first it sent. */
|
|
139
|
+
providerListings?: ReadonlyMap<string, InstrumentSearchResult>;
|
|
127
140
|
}
|
|
128
141
|
|
|
129
142
|
/**
|
|
@@ -150,9 +163,12 @@ export function createLocalTickerSearchCandidates(
|
|
|
150
163
|
return Array.from(tickers).flatMap((ticker) => {
|
|
151
164
|
const symbol = normalizeTickerSymbol(ticker.metadata.ticker);
|
|
152
165
|
const savedExchange = canonicalExchange(ticker.metadata.exchange);
|
|
166
|
+
// Search's row of the saved listing itself, under any key it was saved by (9992, 9992:XHKG).
|
|
167
|
+
const savedListing = savedExchange || parsePublicTickerKey(symbol).exchange ? publicTickerKey(symbol, ticker.metadata.exchange) : null;
|
|
168
|
+
const ownRow = savedListing ? options.providerListings?.get(savedListing) : undefined;
|
|
153
169
|
// The same symbol on another venue can be another security (MSFT's BYMA
|
|
154
170
|
// receipt, NVO on Warsaw); it must not type or route the saved listing.
|
|
155
|
-
const venueHint = providerHints.get(symbol);
|
|
171
|
+
const venueHint = ownRow ?? providerHints.get(symbol);
|
|
156
172
|
const hint = venueHint && savedExchange && isOtherVenue(venueHint, savedExchange) ? undefined : venueHint;
|
|
157
173
|
const exchangeLabel = ticker.metadata.exchange || hint?.exchange || hint?.primaryExchange;
|
|
158
174
|
const hintPrimaryExchange = canonicalExchange(hint?.primaryExchange);
|
|
@@ -190,7 +206,9 @@ export function createLocalTickerSearchCandidates(
|
|
|
190
206
|
saved: true,
|
|
191
207
|
instrumentClass: classifyInstrumentKind(instrumentType),
|
|
192
208
|
instrumentType,
|
|
193
|
-
|
|
209
|
+
// A saved listing ranks as search's own row of it would: the names it answers to and its mark as its
|
|
210
|
+
// company's home, so saving the primary listing never moves it down ("popmart" is 9992 on HKEX).
|
|
211
|
+
...!contractKey && ownRow ? listingRankSignals(symbol, ownRow) : { searchAliases: buildSymbolAliases(symbol) },
|
|
194
212
|
ticker,
|
|
195
213
|
result,
|
|
196
214
|
...(contractKey ? { contractKey, id: `goto:${ticker.metadata.ticker}:${contractKey}` } : {}),
|
|
@@ -199,6 +217,18 @@ export function createLocalTickerSearchCandidates(
|
|
|
199
217
|
});
|
|
200
218
|
}
|
|
201
219
|
|
|
220
|
+
/** What ranks search's row of a listing (its aliases, the names it was found by, its home mark), for the saved row of it. */
|
|
221
|
+
function listingRankSignals(symbol: string, row: InstrumentSearchResult): Pick<TickerSearchCandidate, "searchAliases" | "nameAliases" | "searchKeywords" | "homeListing"> {
|
|
222
|
+
const names = searchResultNames(row);
|
|
223
|
+
const keywords = searchResultKeywords(row);
|
|
224
|
+
return {
|
|
225
|
+
searchAliases: [...new Set([...buildSymbolAliases(symbol), ...buildSearchResultAliases(row)])],
|
|
226
|
+
...names ? { nameAliases: names } : {},
|
|
227
|
+
...keywords ? { searchKeywords: keywords } : {},
|
|
228
|
+
...row.homeListing === true ? { homeListing: true } : {},
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
202
232
|
function createProviderTickerSearchCandidates(
|
|
203
233
|
searchResults: InstrumentSearchResult[],
|
|
204
234
|
localTickers: ReadonlyMap<string, TickerRecord>,
|
|
@@ -319,6 +349,7 @@ export function buildTickerSearchCandidates({
|
|
|
319
349
|
includeOptionContracts,
|
|
320
350
|
providerRanks: providerHints.ranks,
|
|
321
351
|
providerPopularity: providerHints.popularity,
|
|
352
|
+
providerListings: providerHints.listings,
|
|
322
353
|
};
|
|
323
354
|
const localItems = rankTickerSearchItems(
|
|
324
355
|
createLocalTickerSearchCandidates(tickers.values(), providerHints.results, candidateOptions),
|
|
@@ -528,6 +559,9 @@ async function quotedSuffixListing(
|
|
|
528
559
|
};
|
|
529
560
|
}
|
|
530
561
|
|
|
562
|
+
/** A search row for an index, as the service types one. */
|
|
563
|
+
const isIndexRow = (result: InstrumentSearchResult | undefined) => /^\s*index\s*$/i.test(result?.type ?? "");
|
|
564
|
+
|
|
531
565
|
async function resolveTickerSymbol(
|
|
532
566
|
symbol: string,
|
|
533
567
|
{ tickers, dataProvider, searchContext }: ResolveTickerSearchOptions,
|
|
@@ -557,6 +591,19 @@ async function resolveTickerSymbol(
|
|
|
557
591
|
const literalMatches = providerItems.filter((item) => normalizeTickerSymbol(item.symbol) === symbol);
|
|
558
592
|
let matches = literalMatches.length ? literalMatches
|
|
559
593
|
: providerItems.filter((item) => findExactTickerSearchMatch([item], symbol));
|
|
594
|
+
// A code search lists only with its venue's suffix is that listing when it is an index (XU100 is the BIST 100,
|
|
595
|
+
// listed as XU100.IS) or the only line: BMW, listed as BMW.DE and BMW.F, stays a code no listing is written as.
|
|
596
|
+
if (!matches.length && !parsePublicTickerKey(symbol).exchange && !tickerHasListingSuffix(symbol)) {
|
|
597
|
+
const suffixed = providerItems.filter((item) => item.result
|
|
598
|
+
&& listingSuffixVenue(item.symbol, listingExchange(item.result))?.symbol === symbol);
|
|
599
|
+
const indices = suffixed.filter((item) => isIndexRow(item.result));
|
|
600
|
+
matches = indices.length ? indices : suffixed.length === 1 ? suffixed : [];
|
|
601
|
+
}
|
|
602
|
+
// An index's name typed as one word is that index: BIST100 is the BIST 100 (XU100.IS).
|
|
603
|
+
if (!matches.length && !parsePublicTickerKey(symbol).exchange && /\d/.test(symbol)) {
|
|
604
|
+
matches = providerItems.filter((item) => isIndexRow(item.result)
|
|
605
|
+
&& (item.result?.name ?? "").replace(/\s+/g, "").toUpperCase() === symbol);
|
|
606
|
+
}
|
|
560
607
|
if (abroad) {
|
|
561
608
|
const us = matches.filter((item) => isUsListingExchange(listingExchange(item.result!)));
|
|
562
609
|
// No US listing: the row abroad is the symbol's.
|
|
@@ -581,7 +628,10 @@ async function resolveTickerSymbol(
|
|
|
581
628
|
const choices = new Set(homeFirst.map((item) => publicTickerKey(item.symbol, listingExchange(item.result!))));
|
|
582
629
|
const ambiguity = (query: string) => new AmbiguousTickerError(query, [...choices], Object.fromEntries(matches.map((item) => [
|
|
583
630
|
publicTickerKey(item.symbol, listingExchange(item.result!)), listingChoiceName(item.result!),
|
|
584
|
-
])))
|
|
631
|
+
])), Object.fromEntries(matches.flatMap((item) => {
|
|
632
|
+
const withdrawal = parseListingWithdrawal(item.result!.withdrawal);
|
|
633
|
+
return withdrawal ? [[publicTickerKey(item.symbol, listingExchange(item.result!)), withdrawal]] : [];
|
|
634
|
+
})));
|
|
585
635
|
if (pickerQuery && listings.size > 1) throw ambiguity(pickerQuery);
|
|
586
636
|
// A code that names several venues (TSE) the symbol trades on more than one of is a choice.
|
|
587
637
|
if (!saved && isSharedExchangeCode(typedExchangeCode(symbol))
|
|
@@ -658,10 +708,12 @@ function buildProviderHints(
|
|
|
658
708
|
results: Map<string, InstrumentSearchResult>;
|
|
659
709
|
ranks: Map<string, number>;
|
|
660
710
|
popularity: Map<string, number>;
|
|
711
|
+
listings: Map<string, InstrumentSearchResult>;
|
|
661
712
|
} {
|
|
662
713
|
const results = new Map<string, InstrumentSearchResult>();
|
|
663
714
|
const ranks = new Map<string, number>();
|
|
664
715
|
const popularity = new Map<string, number>();
|
|
716
|
+
const listings = new Map<string, InstrumentSearchResult>();
|
|
665
717
|
for (const [rank, result] of searchResults.entries()) {
|
|
666
718
|
const symbol = getSearchResultSymbol(result);
|
|
667
719
|
if (!ranks.has(symbol)) ranks.set(symbol, rank);
|
|
@@ -669,6 +721,7 @@ function buildProviderHints(
|
|
|
669
721
|
// that venue's place instead of the end of the issuer's listings.
|
|
670
722
|
const listingKey = publicTickerKey(symbol, listingExchange(result));
|
|
671
723
|
if (listingKey !== symbol && !ranks.has(listingKey)) ranks.set(listingKey, rank);
|
|
724
|
+
if (listingKey !== symbol && !listings.has(listingKey) && !searchContractKey(result)) listings.set(listingKey, result);
|
|
672
725
|
const score = searchResultPopularity(result);
|
|
673
726
|
if (score != null) popularity.set(symbol, Math.max(score, popularity.get(symbol) ?? score));
|
|
674
727
|
const existing = results.get(symbol);
|
|
@@ -680,7 +733,7 @@ function buildProviderHints(
|
|
|
680
733
|
results.set(symbol, result);
|
|
681
734
|
}
|
|
682
735
|
}
|
|
683
|
-
return { results, ranks, popularity };
|
|
736
|
+
return { results, ranks, popularity, listings };
|
|
684
737
|
}
|
|
685
738
|
|
|
686
739
|
/** Older servers and other providers send no popularity; ignore anything else malformed. */
|
|
@@ -963,8 +1016,9 @@ function assignTickerSearchCategories<T extends TickerSearchCandidate>(items: T[
|
|
|
963
1016
|
let assignedPrimaryListing = false;
|
|
964
1017
|
|
|
965
1018
|
return items.map((item) => {
|
|
966
|
-
// A company the theme's funds hold is not another listing of the one searched for
|
|
967
|
-
|
|
1019
|
+
// A company the theme's funds hold is not another listing of the one searched for, nor a saved row the query
|
|
1020
|
+
// names: it is related, whether its listing is saved or not.
|
|
1021
|
+
if (item.instrumentClass === "equity" && answersOnlyByKeyword(item, query)) {
|
|
968
1022
|
return { ...item, category: "Related" };
|
|
969
1023
|
}
|
|
970
1024
|
if (item.saved || item.kind === "ticker") {
|
|
@@ -976,6 +1030,10 @@ function assignTickerSearchCategories<T extends TickerSearchCandidate>(items: T[
|
|
|
976
1030
|
if (item.instrumentClass === "fund" || item.instrumentClass === "derivative") {
|
|
977
1031
|
return { ...item, category: "Funds & Derivatives" };
|
|
978
1032
|
}
|
|
1033
|
+
// A fund's indicative value (^ARKK-IV) or a crypto venue's token or perpetual on a fund names no listing of its own.
|
|
1034
|
+
if (item.kind === "search" && (isIndicativeValueListing(item.symbol, item.result?.type) || isCryptoVenueCopy(item.result?.type, item.result?.name))) {
|
|
1035
|
+
return { ...item, category: "Other Matches" };
|
|
1036
|
+
}
|
|
979
1037
|
if (!assignedPrimaryListing) {
|
|
980
1038
|
assignedPrimaryListing = true;
|
|
981
1039
|
return { ...item, category: "Primary Listing" };
|