@gloom-sh/terminal 0.20.20 → 0.20.22
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 +6 -3
- package/patches/electrobun-devkit@2.0.5.patch +169 -3
- package/src/api-client/buybacks.ts +108 -0
- package/src/api-client/data.ts +214 -2
- package/src/api-client/dilution.ts +183 -0
- package/src/api-client/earnings.ts +2 -2
- package/src/api-client/equity-screener.ts +24 -0
- package/src/api-client/exchange-announcements.ts +16 -5
- package/src/api-client/exchange-short-balances.ts +24 -0
- package/src/api-client/futures-curve.ts +5 -0
- package/src/api-client/hk-cbbc.ts +134 -0
- package/src/api-client/hk-ccass.ts +233 -0
- package/src/api-client/index.ts +55 -3
- package/src/api-client/jpx-short-positions.ts +24 -0
- package/src/api-client/market-discovery.ts +42 -6
- package/src/api-client/members.ts +7 -0
- package/src/api-client/ownership-disclosures.ts +35 -0
- package/src/api-client/paths.ts +5 -2
- package/src/api-client/perps.ts +20 -0
- package/src/api-client/request.ts +92 -17
- package/src/api-client/revenue-breakdown.ts +6 -2
- package/src/api-client/sfc-short-positions.ts +19 -0
- package/src/api-client/supply-chain.ts +22 -0
- package/src/api-client/taiwan-revenue.ts +134 -0
- package/src/api-client/types/filings-and-calls.ts +2 -0
- package/src/api-client/types/jobs.ts +1 -0
- package/src/api-client/types/world-venues.ts +1 -0
- package/src/app/language-observer.tsx +6 -1
- package/src/app/pane-runtime/plugin-bindings.ts +15 -8
- package/src/app/pro-welcome/model.ts +15 -11
- package/src/app/pro-welcome/row.tsx +3 -3
- package/src/app/pro-welcome/use-pro-welcome.ts +2 -2
- package/src/app/runtime/plugin-bindings.ts +20 -2
- package/src/app/runtime/startup.ts +3 -2
- package/src/app.tsx +3 -2
- package/src/architecture/core-builtin-allowlist.json +2 -2
- package/src/architecture/dom-text-cuts-allowlist.json +2 -2
- package/src/architecture/floating-promise-allowlist.json +2 -2
- package/src/architecture/pane-tabs-allowlist.json +3 -0
- package/src/brokers/account-cache.ts +2 -1
- package/src/brokers/account-choice.ts +121 -0
- package/src/brokers/broker-portfolio-sync.ts +30 -5
- package/src/brokers/profile-form.ts +3 -0
- package/src/brokers/signed-in/adapter.ts +16 -5
- package/src/brokers/sync-broker-instance.ts +27 -3
- package/src/capabilities/asset-data-inputs.ts +13 -0
- package/src/capabilities/factories.ts +12 -3
- package/src/capabilities/registry.ts +1 -0
- package/src/capabilities/types.ts +1 -0
- package/src/cli/commands/market.ts +199 -103
- package/src/cli/commands/news-search.ts +12 -0
- package/src/cli/commands/options-chain.ts +11 -5
- package/src/cli/commands/options-leaps.ts +55 -30
- package/src/cli/commands/overview.ts +24 -24
- package/src/cli/commands/search.ts +2 -1
- package/src/cli/commands/ticker.ts +30 -16
- package/src/cli/csv-export.ts +9 -5
- package/src/cli/desktop-pane-shot-browser.ts +143 -53
- package/src/cli/desktop-pane-shot.ts +61 -67
- package/src/cli/export-source.ts +40 -2
- package/src/cli/glossary.ts +3 -2
- package/src/cli/helpers.ts +2 -1
- package/src/cli/history-demergers.ts +171 -17
- package/src/cli/history-rows.ts +47 -5
- package/src/cli/known-gaps.ts +21 -7
- package/src/cli/listing-arg.ts +22 -11
- package/src/cli/pane-functions/capabilities.ts +4 -9
- package/src/cli/pane-functions/catalog-snapshot.json +48 -44
- package/src/cli/pane-functions/catalog.ts +7 -20
- package/src/cli/pane-functions/data.ts +8 -4
- package/src/cli/pane-functions/dom.ts +8 -5
- package/src/cli/pane-functions/financial-ratio-shot.ts +20 -5
- package/src/cli/pane-functions/freshness.ts +57 -12
- package/src/cli/pane-functions/function-help.ts +36 -4
- package/src/cli/pane-functions/headless.ts +85 -27
- package/src/cli/pane-functions/index.ts +13 -5
- package/src/cli/pane-functions/market-session.ts +26 -1
- package/src/cli/pane-functions/report-notices.ts +10 -0
- package/src/cli/pane-functions/resolver.ts +79 -4
- package/src/cli/pane-functions/screenshot-assessment.ts +26 -10
- package/src/cli/pane-functions/screenshot-bridge.ts +5 -1
- package/src/cli/pane-functions/screenshot-data-evidence.ts +12 -5
- package/src/cli/pane-functions/screenshot-payload.ts +55 -6
- package/src/cli/pane-functions/screenshot-render.ts +22 -7
- package/src/cli/pane-functions/ticker-question.ts +52 -47
- package/src/cli/perpetual-contract.ts +14 -1
- package/src/cli/rendered-table-rows.ts +75 -0
- package/src/cli/report-tables.ts +18 -3
- package/src/cli/result.ts +14 -2
- package/src/cli/visible-key-values.ts +3 -2
- package/src/components/chart/composite/format.ts +14 -1
- package/src/components/chart/composite/panel-surface/panel-cursor.tsx +37 -14
- package/src/components/chart/composite/panel-surface.tsx +1 -0
- package/src/components/chart/composite/text-renderer.ts +104 -44
- package/src/components/chart/curve/model.ts +4 -1
- package/src/components/chart-table/layout.ts +8 -4
- package/src/components/command-bar/list/model.ts +2 -0
- package/src/components/command-bar/pane-templates/items.ts +5 -25
- package/src/components/command-bar/panel/index.tsx +7 -4
- package/src/components/command-bar/routes/root/provider-search.ts +4 -4
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/routes/root/start-here.ts +1 -1
- package/src/components/command-bar/routes/ticker-search/results.ts +21 -1
- package/src/components/command-bar/routes/ticker-search/route.ts +3 -3
- package/src/components/command-bar/routes/ticker-search/title.ts +23 -0
- package/src/components/command-bar/routing/list-state.ts +17 -5
- package/src/components/command-bar/selection-runtime.ts +3 -2
- package/src/components/command-bar/surface/index.tsx +2 -0
- package/src/components/command-bar/workflow/alert.ts +6 -4
- package/src/components/command-bar/workflow/collection-actions.ts +2 -1
- package/src/components/data-table/export.ts +3 -1
- package/src/components/data-table/sections.ts +12 -1
- package/src/components/data-table/view.tsx +50 -8
- package/src/components/feed-data-table/stack-view.tsx +3 -0
- package/src/components/index.ts +3 -3
- package/src/components/layout/floating-pane.tsx +5 -2
- package/src/components/layout/pane/footer/index.tsx +1 -0
- package/src/components/layout/pane/footer/model.ts +20 -7
- package/src/components/layout/pane/header.tsx +21 -2
- package/src/components/layout/pane/index.tsx +6 -2
- package/src/components/layout/pane/link-note.ts +12 -0
- package/src/components/layout/pane/title.ts +12 -5
- package/src/components/market-board/index.tsx +8 -11
- package/src/components/price-selector-dialog.tsx +8 -4
- package/src/components/reader/reader-text.tsx +25 -2
- package/src/components/ticker/badge/list.tsx +4 -3
- package/src/components/ticker/list-table-view.tsx +16 -1
- package/src/components/ui/data-table/column-fit.ts +129 -0
- package/src/components/ui/data-table/display-columns.ts +28 -9
- package/src/components/ui/data-table/index.tsx +57 -15
- package/src/components/ui/data-table/opentui/index.tsx +5 -0
- package/src/components/ui/data-table/types.ts +96 -5
- package/src/components/ui/data-table/visible-range.ts +9 -1
- package/src/components/ui/day-cell.ts +30 -0
- package/src/components/ui/index.ts +3 -1
- package/src/components/ui/prose.tsx +3 -1
- package/src/components/ui/query-bar.tsx +20 -14
- package/src/components/ui/table-layout.ts +188 -6
- package/src/core/state/app/layout.ts +7 -2
- package/src/core/state/app/state.ts +6 -2
- package/src/data/cached-query.ts +20 -4
- package/src/data/config/store/legacy-tabs.ts +51 -0
- package/src/data/config/store/node.ts +2 -2
- package/src/data/config/store/normalize.ts +11 -5
- package/src/data/config/store/shared-file.ts +8 -7
- package/src/data/config/store/shared-layout.ts +146 -0
- package/src/data/news-pane-snapshots.ts +2 -1
- package/src/data/plugin-cache.ts +5 -1
- package/src/data/saved-copies.ts +68 -2
- package/src/data/sqlite/access.ts +76 -11
- package/src/data/sqlite/checkpointer.ts +73 -10
- package/src/data/sqlite/database.ts +14 -1
- package/src/data/sqlite/retry.ts +1 -1
- package/src/docs/load.ts +5 -2
- package/src/docs/snapshot.json +1665 -4362
- package/src/docs/topics.ts +11 -9
- package/src/i18n/es.ts +109 -0
- package/src/i18n/index.ts +74 -4
- package/src/i18n/ja.ts +109 -0
- package/src/i18n/ko.ts +109 -0
- package/src/i18n/react.ts +10 -2
- package/src/i18n/zh-cn.ts +109 -0
- package/src/i18n/zh-tw.ts +109 -0
- package/src/layout/pane-manager/dock-normalization.ts +61 -0
- package/src/market-data/ah-pair.ts +7 -2
- package/src/market-data/coordinator/index.ts +25 -5
- package/src/market-data/depositary-pair.ts +27 -10
- package/src/market-data/fund-actions.ts +21 -0
- package/src/market-data/futures-roll-returns.ts +54 -7
- package/src/market-data/fx-closes.ts +14 -0
- package/src/market-data/market/freshness.ts +37 -33
- package/src/market-data/market/futures-product-hours.ts +113 -0
- package/src/market-data/market/futures-week.ts +2 -0
- package/src/market-data/market/globex-day.ts +9 -2
- package/src/market-data/market/split-price-basis.ts +55 -0
- package/src/market-data/market/status.ts +30 -25
- package/src/market-data/market/venue-session.ts +18 -0
- package/src/market-data/options-alternatives.ts +49 -7
- package/src/market-data/perpetual-open-interest.ts +41 -0
- package/src/market-data/price-adjustments.ts +115 -0
- package/src/market-data/quotes/balance-sheet-rate.ts +6 -2
- package/src/market-data/quotes/contributions.ts +4 -2
- package/src/market-data/quotes/day-range.ts +24 -9
- package/src/market-data/quotes/export-identity.ts +11 -3
- package/src/market-data/quotes/freshness.ts +7 -5
- package/src/market-data/quotes/regular-session-valuation.ts +6 -0
- package/src/market-data/quotes/resolution.ts +20 -24
- package/src/market-data/quotes/tick-range.ts +22 -1
- package/src/market-data/quotes/time.ts +161 -7
- package/src/market-data/split-terms.ts +3 -2
- package/src/news/aggregator.ts +1 -0
- package/src/news/news-model.ts +12 -2
- package/src/news/query-presets.ts +6 -4
- package/src/news/types.ts +15 -0
- package/src/plugins/builtin/alerts/alert-engine.ts +2 -0
- package/src/plugins/builtin/alerts/cli-forms.ts +6 -2
- package/src/plugins/builtin/alerts/cli-move.ts +5 -2
- package/src/plugins/builtin/alerts/cli.ts +67 -30
- package/src/plugins/builtin/alerts/command.ts +51 -3
- package/src/plugins/builtin/alerts/event-rows.ts +1 -1
- package/src/plugins/builtin/alerts/events-pane.tsx +2 -1
- package/src/plugins/builtin/alerts/format.ts +87 -16
- package/src/plugins/builtin/alerts/headless.ts +29 -10
- package/src/plugins/builtin/alerts/history-pane.tsx +74 -33
- package/src/plugins/builtin/alerts/history-rows.ts +24 -1
- package/src/plugins/builtin/alerts/index.tsx +34 -35
- package/src/plugins/builtin/alerts/metric-data.ts +24 -6
- package/src/plugins/builtin/alerts/move-checks.ts +1 -0
- package/src/plugins/builtin/alerts/pane.tsx +24 -6
- package/src/plugins/builtin/alerts/pro-rules.ts +10 -4
- package/src/plugins/builtin/alerts/quotes.ts +10 -5
- package/src/plugins/builtin/alerts/research-builder.ts +6 -2
- package/src/plugins/builtin/alerts/research-rules.ts +12 -0
- package/src/plugins/builtin/alerts/session.ts +28 -0
- package/src/plugins/builtin/alerts/types.ts +2 -0
- package/src/plugins/builtin/analytics/pane-model.ts +2 -1
- package/src/plugins/builtin/analytics/risk-model.ts +2 -2
- package/src/plugins/builtin/attention/headless.ts +2 -2
- package/src/plugins/builtin/attention/model.ts +7 -2
- package/src/plugins/builtin/attention/pane.tsx +2 -1
- package/src/plugins/builtin/awards/detail.tsx +5 -4
- package/src/plugins/builtin/awards/headless.ts +14 -5
- package/src/plugins/builtin/awards/model.ts +36 -1
- package/src/plugins/builtin/awards/pane.tsx +29 -9
- package/src/plugins/builtin/backtest/pane.tsx +4 -2
- package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
- package/src/plugins/builtin/broker-manager/detail.tsx +67 -4
- package/src/plugins/builtin/broker-manager/index.tsx +35 -4
- package/src/plugins/builtin/broker-manager/keyboard.ts +10 -0
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +35 -2
- package/src/plugins/builtin/broker-trading/orders.tsx +10 -3
- package/src/plugins/builtin/broker-trading/ticket.tsx +14 -5
- package/src/plugins/builtin/buildout/detail/company.tsx +0 -1
- package/src/plugins/builtin/buildout/detail/ui.tsx +7 -5
- package/src/plugins/builtin/buildout/format.ts +3 -1
- package/src/plugins/builtin/buildout/model/normalizers.ts +0 -1
- package/src/plugins/builtin/buildout/model/types.ts +0 -1
- package/src/plugins/builtin/buildout/pane/index.tsx +9 -0
- package/src/plugins/builtin/buildout/pane/status.tsx +11 -0
- package/src/plugins/builtin/buybacks/client.ts +48 -0
- package/src/plugins/builtin/buybacks/index.tsx +22 -0
- package/src/plugins/builtin/buybacks/model.ts +151 -0
- package/src/plugins/builtin/buybacks/pane.tsx +140 -0
- package/src/plugins/builtin/buybacks/series.ts +36 -0
- package/src/plugins/builtin/catalysts/detail.tsx +14 -8
- package/src/plugins/builtin/catalysts/evidence.ts +11 -3
- package/src/plugins/builtin/catalysts/headless.ts +52 -9
- package/src/plugins/builtin/catalysts/kinds.ts +413 -0
- package/src/plugins/builtin/catalysts/model.ts +61 -18
- package/src/plugins/builtin/catalysts/pane.tsx +85 -19
- package/src/plugins/builtin/cds/client.ts +9 -2
- package/src/plugins/builtin/cds/headless.ts +25 -10
- package/src/plugins/builtin/cds/model.ts +37 -12
- package/src/plugins/builtin/cds/pane.tsx +18 -10
- package/src/plugins/builtin/chart-composer/chart-spec-edit.ts +68 -7
- package/src/plugins/builtin/chart-composer/chart-title.ts +114 -0
- package/src/plugins/builtin/chart-composer/cli-options.ts +1 -1
- package/src/plugins/builtin/chart-composer/headless.ts +27 -7
- package/src/plugins/builtin/chart-composer/index.tsx +2 -68
- package/src/plugins/builtin/chart-composer/leverage-overlay.ts +2 -4
- package/src/plugins/builtin/chart-composer/pane.tsx +13 -4
- package/src/plugins/builtin/chart-composer/presets.ts +1 -1
- package/src/plugins/builtin/chart-composer/session-history.ts +14 -2
- package/src/plugins/builtin/chat/controller/draft-sync.ts +13 -7
- package/src/plugins/builtin/chat/controller/index.ts +5 -3
- package/src/plugins/builtin/chat/controller/session-runtime.ts +18 -8
- package/src/plugins/builtin/chat/controller/state.ts +4 -0
- package/src/plugins/builtin/chat/index.tsx +1 -1
- package/src/plugins/builtin/chat/pane-requests.ts +8 -4
- package/src/plugins/builtin/clinical-trials/model.ts +2 -2
- package/src/plugins/builtin/clinical-trials/pane.tsx +3 -3
- package/src/plugins/builtin/cloud/askg/pane.tsx +60 -50
- package/src/plugins/builtin/cloud/auth-actions.tsx +6 -3
- package/src/plugins/builtin/cloud/mcp-connect/dialog.tsx +4 -1
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +2 -1
- package/src/plugins/builtin/comment-letters/pane.tsx +4 -2
- package/src/plugins/builtin/commodity-balances/headless.ts +2 -1
- package/src/plugins/builtin/company-attention/building-model.ts +3 -4
- package/src/plugins/builtin/company-attention/building.tsx +2 -0
- package/src/plugins/builtin/company-attention/headless.ts +4 -3
- package/src/plugins/builtin/company-attention/model.ts +2 -0
- package/src/plugins/builtin/company-attention/moves-model.ts +2 -1
- package/src/plugins/builtin/company-attention/moves.tsx +2 -0
- package/src/plugins/builtin/company-attention/pane.tsx +17 -3
- package/src/plugins/builtin/company-attention/signals-model.ts +3 -4
- package/src/plugins/builtin/company-attention/signals.tsx +5 -0
- package/src/plugins/builtin/company-kpis/headless.ts +27 -11
- package/src/plugins/builtin/company-kpis/model.ts +47 -7
- package/src/plugins/builtin/company-kpis/pane.tsx +36 -19
- package/src/plugins/builtin/company-kpis/taiwan-monthly-model.ts +99 -0
- package/src/plugins/builtin/company-kpis/taiwan-monthly-view.tsx +327 -0
- package/src/plugins/builtin/composite/ownership-browser.ts +28 -0
- package/src/plugins/builtin/composite/ownership.ts +5 -1
- package/src/plugins/builtin/congress-trades/detail.tsx +44 -8
- package/src/plugins/builtin/congress-trades/headless.ts +15 -11
- package/src/plugins/builtin/congress-trades/model.ts +104 -11
- package/src/plugins/builtin/congress-trades/pane.tsx +11 -6
- package/src/plugins/builtin/congress-trades/table.tsx +17 -10
- package/src/plugins/builtin/congress-trades/use-feed.ts +13 -2
- package/src/plugins/builtin/correlation/headless.ts +5 -5
- package/src/plugins/builtin/correlation/history.ts +1 -0
- package/src/plugins/builtin/correlation/index.tsx +7 -5
- package/src/plugins/builtin/correlation/matrix/selection.ts +21 -3
- package/src/plugins/builtin/correlation/relationship/model.ts +5 -0
- package/src/plugins/builtin/correlation/relationship/pane.tsx +14 -10
- package/src/plugins/builtin/correlation/relationship/view-model.ts +4 -21
- package/src/plugins/builtin/cot/headless.ts +1 -1
- package/src/plugins/builtin/cot/pane.tsx +7 -2
- package/src/plugins/builtin/cpi/headless.ts +2 -1
- package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
- package/src/plugins/builtin/credit-documents/detail.tsx +2 -1
- package/src/plugins/builtin/credit-documents/export.ts +18 -12
- package/src/plugins/builtin/credit-documents/headless.ts +1 -1
- package/src/plugins/builtin/credit-documents/model.ts +106 -25
- package/src/plugins/builtin/credit-documents/pane.tsx +9 -5
- package/src/plugins/builtin/crypto-board/defi-view.tsx +2 -1
- package/src/plugins/builtin/crypto-board/defi.ts +5 -4
- package/src/plugins/builtin/crypto-board/headless.ts +7 -2
- package/src/plugins/builtin/crypto-board/model.ts +6 -4
- package/src/plugins/builtin/crypto-board/pane.tsx +2 -1
- package/src/plugins/builtin/crypto-board/supply.ts +4 -3
- package/src/plugins/builtin/crypto-etf-flows/headless.ts +15 -8
- package/src/plugins/builtin/crypto-etf-flows/pane.tsx +6 -5
- package/src/plugins/builtin/debt-maturities/headless.ts +56 -38
- package/src/plugins/builtin/debt-maturities/model.ts +2 -1
- package/src/plugins/builtin/debt-maturities/pane.tsx +24 -22
- package/src/plugins/builtin/dilution/index.tsx +74 -0
- package/src/plugins/builtin/dilution/model.ts +159 -0
- package/src/plugins/builtin/dilution/pane.tsx +592 -0
- package/src/plugins/builtin/dividend-yield/client.ts +81 -10
- package/src/plugins/builtin/dividend-yield/headless.ts +44 -24
- package/src/plugins/builtin/dividend-yield/index.tsx +2 -1
- package/src/plugins/builtin/dividend-yield/model.ts +9 -6
- package/src/plugins/builtin/dividend-yield/pane.tsx +28 -15
- package/src/plugins/builtin/dividend-yield/ranking-view.tsx +6 -2
- package/src/plugins/builtin/dividend-yield/ranking.ts +22 -8
- package/src/plugins/builtin/dividend-yield/reference-price.ts +3 -0
- package/src/plugins/builtin/dividend-yield/types.ts +12 -0
- package/src/plugins/builtin/dividend-yield/view.ts +61 -12
- package/src/plugins/builtin/docs/index.tsx +1 -1
- package/src/plugins/builtin/docs/pane.tsx +7 -3
- package/src/plugins/builtin/docs/use-docs.ts +2 -1
- package/src/plugins/builtin/doe/headless.ts +1 -1
- package/src/plugins/builtin/doe/pane.tsx +16 -7
- package/src/plugins/builtin/earnings/board-model.ts +19 -6
- package/src/plugins/builtin/earnings/board-table.ts +64 -48
- package/src/plugins/builtin/earnings/board.tsx +93 -51
- package/src/plugins/builtin/earnings/headless.ts +71 -12
- package/src/plugins/builtin/earnings/history-model.ts +28 -15
- package/src/plugins/builtin/earnings/history.tsx +1 -1
- package/src/plugins/builtin/earnings-calls/calendar.tsx +23 -10
- package/src/plugins/builtin/earnings-calls/data.ts +8 -5
- package/src/plugins/builtin/earnings-calls/format.ts +34 -0
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -4
- package/src/plugins/builtin/earnings-calls/pane.tsx +22 -17
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +14 -12
- package/src/plugins/builtin/earnings-ripple/headless.ts +1 -1
- package/src/plugins/builtin/earnings-ripple/pane.tsx +4 -3
- package/src/plugins/builtin/econ/calendar-model.ts +73 -4
- package/src/plugins/builtin/econ/index.tsx +32 -36
- package/src/plugins/builtin/econ-statistics/detail.tsx +2 -2
- package/src/plugins/builtin/econ-statistics/headless.ts +10 -5
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -3
- package/src/plugins/builtin/econ-statistics/view.ts +15 -4
- package/src/plugins/builtin/equity-screener/client.ts +1 -1
- package/src/plugins/builtin/equity-screener/headless.ts +149 -31
- package/src/plugins/builtin/equity-screener/live.ts +23 -5
- package/src/plugins/builtin/equity-screener/model.ts +38 -14
- package/src/plugins/builtin/equity-screener/pane.tsx +5 -5
- package/src/plugins/builtin/estimate-revisions/headless.ts +23 -2
- package/src/plugins/builtin/estimate-revisions/model.ts +63 -13
- package/src/plugins/builtin/estimate-revisions/pane.tsx +228 -225
- package/src/plugins/builtin/estimate-revisions/sorting.ts +8 -16
- package/src/plugins/builtin/exposure/drivers.ts +5 -2
- package/src/plugins/builtin/exposure/headless.ts +7 -4
- package/src/plugins/builtin/exposure/holdings.ts +2 -2
- package/src/plugins/builtin/exposure/model.ts +2 -1
- package/src/plugins/builtin/exposure/pane.tsx +16 -7
- package/src/plugins/builtin/fear-greed/format.ts +7 -7
- package/src/plugins/builtin/fear-greed/pane.tsx +21 -7
- package/src/plugins/builtin/futures/index.tsx +29 -1
- package/src/plugins/builtin/futures/model.ts +93 -10
- package/src/plugins/builtin/futures/returns.ts +54 -1
- package/src/plugins/builtin/futures/table.tsx +14 -2
- package/src/plugins/builtin/futures/use-front-returns.ts +20 -3
- package/src/plugins/builtin/futures-curve/client.ts +1 -1
- package/src/plugins/builtin/futures-curve/headless.ts +21 -10
- package/src/plugins/builtin/futures-curve/model.ts +31 -9
- package/src/plugins/builtin/futures-curve/pane.tsx +26 -17
- package/src/plugins/builtin/fx-matrix/headless.ts +3 -2
- package/src/plugins/builtin/gpu/headless.ts +11 -5
- package/src/plugins/builtin/gpu/model.ts +1 -1
- package/src/plugins/builtin/help/function-index.ts +16 -8
- package/src/plugins/builtin/help/functions-table.tsx +6 -4
- package/src/plugins/builtin/help/shortcut-model.ts +7 -2
- package/src/plugins/builtin/holders/beneficial-model.ts +1 -1
- package/src/plugins/builtin/holders/beneficial-view.tsx +3 -2
- package/src/plugins/builtin/holders/ccass-market-pane.tsx +363 -0
- package/src/plugins/builtin/holders/ccass-view.tsx +323 -0
- package/src/plugins/builtin/holders/disclosures-view.tsx +63 -0
- package/src/plugins/builtin/holders/disclosures.ts +33 -0
- package/src/plugins/builtin/holders/headless.ts +25 -7
- package/src/plugins/builtin/holders/index.tsx +75 -1
- package/src/plugins/builtin/holders/pane.tsx +79 -14
- package/src/plugins/builtin/holders/report-rows.ts +2 -0
- package/src/plugins/builtin/holders/table-model.ts +14 -6
- package/src/plugins/builtin/holders/types.ts +2 -2
- package/src/plugins/builtin/insider/activity-chart.ts +141 -0
- package/src/plugins/builtin/insider/client.ts +118 -11
- package/src/plugins/builtin/insider/filing-stories.ts +36 -20
- package/src/plugins/builtin/insider/headless.ts +2 -1
- package/src/plugins/builtin/insider/index.tsx +74 -12
- package/src/plugins/builtin/insider/issuer.ts +5 -2
- package/src/plugins/builtin/insider/signals-cells.tsx +15 -8
- package/src/plugins/builtin/insider/signals.tsx +6 -5
- package/src/plugins/builtin/insider/table-model.ts +17 -17
- package/src/plugins/builtin/insider/table.tsx +18 -10
- package/src/plugins/builtin/ipo-calendar/headless.ts +55 -11
- package/src/plugins/builtin/ipo-calendar/listing-ipo.ts +31 -4
- package/src/plugins/builtin/ipo-calendar/model.ts +208 -47
- package/src/plugins/builtin/ipo-calendar/pane.tsx +87 -25
- package/src/plugins/builtin/iv-history/client.ts +17 -8
- package/src/plugins/builtin/iv-history/format.ts +23 -12
- package/src/plugins/builtin/iv-history/headless.ts +11 -5
- package/src/plugins/builtin/iv-history/model.ts +15 -13
- package/src/plugins/builtin/iv-history/pane.tsx +5 -2
- package/src/plugins/builtin/iv-history/screen-pane.tsx +46 -24
- package/src/plugins/builtin/jobs/headless.ts +4 -3
- package/src/plugins/builtin/jobs/pane.tsx +6 -5
- package/src/plugins/builtin/jodi/headless.ts +15 -2
- package/src/plugins/builtin/jodi/model.ts +46 -5
- package/src/plugins/builtin/jodi/pane.tsx +17 -13
- package/src/plugins/builtin/kelly-sizer/headless.ts +3 -1
- package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -1
- package/src/plugins/builtin/macro-day/client.ts +2 -3
- package/src/plugins/builtin/macro-day/comparison.ts +58 -0
- package/src/plugins/builtin/macro-day/headless.ts +47 -3
- package/src/plugins/builtin/macro-day/index.tsx +32 -9
- package/src/plugins/builtin/macro-day/model.ts +1 -1
- package/src/plugins/builtin/macro-day/pane.tsx +109 -15
- package/src/plugins/builtin/market-halts/model.ts +10 -8
- package/src/plugins/builtin/market-halts/pane.tsx +1 -1
- package/src/plugins/builtin/market-heatmap/data.ts +17 -2
- package/src/plugins/builtin/market-heatmap/headless.ts +56 -6
- package/src/plugins/builtin/market-heatmap/index.tsx +57 -3
- package/src/plugins/builtin/market-heatmap/model.ts +27 -1
- package/src/plugins/builtin/market-movers/footer.ts +29 -3
- package/src/plugins/builtin/market-movers/headless.ts +12 -5
- package/src/plugins/builtin/market-movers/index.tsx +3 -3
- package/src/plugins/builtin/market-movers/model.ts +7 -1
- package/src/plugins/builtin/market-movers/session-body.tsx +6 -3
- package/src/plugins/builtin/market-movers/session-table.ts +1 -0
- package/src/plugins/builtin/market-movers/session.ts +1 -1
- package/src/plugins/builtin/market-movers/table.ts +1 -1
- package/src/plugins/builtin/market-valuation/detail.tsx +3 -3
- package/src/plugins/builtin/market-valuation/headless.ts +6 -6
- package/src/plugins/builtin/market-valuation/pane.tsx +2 -3
- package/src/plugins/builtin/market-valuation/view.ts +6 -8
- package/src/plugins/builtin/members/client.ts +9 -2
- package/src/plugins/builtin/members/headless.ts +20 -14
- package/src/plugins/builtin/members/model.ts +64 -18
- package/src/plugins/builtin/members/pane.tsx +21 -15
- package/src/plugins/builtin/mna/distress/detail.tsx +7 -6
- package/src/plugins/builtin/mna/distress/model.ts +7 -7
- package/src/plugins/builtin/mna/distress/pane.tsx +8 -7
- package/src/plugins/builtin/mna/headless.ts +40 -7
- package/src/plugins/builtin/mna/model.ts +66 -6
- package/src/plugins/builtin/mna/pane.tsx +118 -60
- package/src/plugins/builtin/money-markets/headless.ts +1 -1
- package/src/plugins/builtin/news/headless.ts +4 -0
- package/src/plugins/builtin/news/index.tsx +3 -1
- package/src/plugins/builtin/news/wire/industry-pane.tsx +3 -1
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +1 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +15 -4
- package/src/plugins/builtin/news/wire/persisted-articles.ts +8 -4
- package/src/plugins/builtin/notes/headless.ts +7 -0
- package/src/plugins/builtin/notes/index.tsx +3 -2
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +18 -2
- package/src/plugins/builtin/openfda/model.ts +1 -1
- package/src/plugins/builtin/openfda/pane.tsx +37 -9
- package/src/plugins/builtin/options/analytics.ts +30 -6
- package/src/plugins/builtin/options/calc-seed.ts +38 -3
- package/src/plugins/builtin/options/footer.ts +18 -1
- package/src/plugins/builtin/options/live-quotes.ts +21 -6
- package/src/plugins/builtin/options/open-interest-as-of.ts +5 -0
- package/src/plugins/builtin/options/quote-context.tsx +21 -8
- package/src/plugins/builtin/options/table.ts +17 -2
- package/src/plugins/builtin/options/view.tsx +104 -52
- package/src/plugins/builtin/options-calculator/model.ts +65 -3
- package/src/plugins/builtin/options-calculator/pane.tsx +11 -3
- package/src/plugins/builtin/options-calculator/valuation.ts +33 -0
- package/src/plugins/builtin/options-positioning/cbbc-model.ts +160 -0
- package/src/plugins/builtin/options-positioning/cbbc-view.tsx +453 -0
- package/src/plugins/builtin/options-positioning/headless.ts +4 -4
- package/src/plugins/builtin/options-positioning/index.tsx +22 -1
- package/src/plugins/builtin/options-positioning/pane.tsx +23 -4
- package/src/plugins/builtin/options-scenario/charts.tsx +2 -1
- package/src/plugins/builtin/options-scenario/client.ts +20 -4
- package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +5 -5
- package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +11 -14
- package/src/plugins/builtin/options-scenario/csp-screen.ts +9 -1
- package/src/plugins/builtin/options-scenario/headless.ts +4 -4
- package/src/plugins/builtin/options-scenario/index.tsx +1 -1
- package/src/plugins/builtin/options-scenario/model.ts +7 -0
- package/src/plugins/builtin/options-scenario/pane.tsx +24 -14
- package/src/plugins/builtin/pe-band/client.ts +5 -9
- package/src/plugins/builtin/pe-band/headless.ts +11 -13
- package/src/plugins/builtin/pe-band/model.ts +39 -60
- package/src/plugins/builtin/pe-band/pane.tsx +16 -16
- package/src/plugins/builtin/perps/cascade-tabs.tsx +2 -1
- package/src/plugins/builtin/perps/cascade.ts +4 -3
- package/src/plugins/builtin/perps/equity-row.tsx +3 -1
- package/src/plugins/builtin/perps/freshness.ts +16 -9
- package/src/plugins/builtin/perps/headless.ts +21 -11
- package/src/plugins/builtin/perps/markets-section.tsx +16 -10
- package/src/plugins/builtin/perps/model.ts +37 -5
- package/src/plugins/builtin/perps/pane.tsx +3 -2
- package/src/plugins/builtin/perps/status-line.ts +12 -3
- package/src/plugins/builtin/perps/venue-markets.ts +38 -0
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +4 -3
- package/src/plugins/builtin/portfolio-list/cached-account.ts +3 -1
- package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -1
- package/src/plugins/builtin/portfolio-list/cli/render.ts +46 -7
- package/src/plugins/builtin/portfolio-list/headless.ts +31 -8
- package/src/plugins/builtin/portfolio-list/settings.ts +4 -0
- package/src/plugins/builtin/portfolio-list/table.tsx +26 -3
- package/src/plugins/builtin/power/client.ts +2 -2
- package/src/plugins/builtin/power/detail.tsx +11 -8
- package/src/plugins/builtin/power/gas-model.ts +2 -1
- package/src/plugins/builtin/power/gas.tsx +3 -2
- package/src/plugins/builtin/power/headless.ts +5 -2
- package/src/plugins/builtin/power/model.ts +19 -0
- package/src/plugins/builtin/power/pane.tsx +5 -4
- package/src/plugins/builtin/power/prices-headless.ts +4 -3
- package/src/plugins/builtin/power/prices.tsx +7 -6
- package/src/plugins/builtin/primary-dealers/headless.ts +1 -1
- package/src/plugins/builtin/primary-dealers/model.ts +2 -1
- package/src/plugins/builtin/rate-path/headless.ts +5 -2
- package/src/plugins/builtin/rate-path/pane.tsx +13 -10
- package/src/plugins/builtin/realized-vol/fx-proxy.ts +7 -8
- package/src/plugins/builtin/realized-vol/headless.ts +4 -5
- package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
- package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
- package/src/plugins/builtin/research/analyst-model.ts +1 -1
- package/src/plugins/builtin/research/analyst-pane.tsx +2 -1
- package/src/plugins/builtin/research/earnings-estimates-pane.tsx +262 -0
- package/src/plugins/builtin/research/event-charts.ts +322 -0
- package/src/plugins/builtin/research/event-data.ts +138 -0
- package/src/plugins/builtin/research/event-detail.tsx +442 -0
- package/src/plugins/builtin/research/event-model.ts +328 -31
- package/src/plugins/builtin/research/event-sources.ts +58 -8
- package/src/plugins/builtin/research/event-views.tsx +397 -0
- package/src/plugins/builtin/research/events-headless.ts +60 -4
- package/src/plugins/builtin/research/headless-schema.ts +2 -2
- package/src/plugins/builtin/research/headless.ts +84 -7
- package/src/plugins/builtin/research/index.tsx +19 -17
- package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -8
- package/src/plugins/builtin/research/relative-valuation-headless.ts +8 -4
- package/src/plugins/builtin/research/relative-valuation-model.ts +23 -8
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +10 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +9 -4
- package/src/plugins/builtin/revenue-breakdown/headless.ts +1 -1
- package/src/plugins/builtin/revenue-breakdown/index.tsx +2 -1
- package/src/plugins/builtin/revenue-breakdown/model.ts +2 -0
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +10 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +14 -9
- package/src/plugins/builtin/scanner/feed.ts +7 -4
- package/src/plugins/builtin/scanner/flow-pane.tsx +8 -4
- package/src/plugins/builtin/scanner/headless.ts +59 -26
- package/src/plugins/builtin/scanner/hilo-pane.tsx +6 -3
- package/src/plugins/builtin/scanner/lock-note.ts +7 -10
- package/src/plugins/builtin/scanner/us-session.ts +9 -0
- package/src/plugins/builtin/seasonality/client.ts +46 -10
- package/src/plugins/builtin/seasonality/headless.ts +29 -11
- package/src/plugins/builtin/seasonality/model.ts +101 -24
- package/src/plugins/builtin/seasonality/pane.tsx +10 -6
- package/src/plugins/builtin/sec/exchange-filings.ts +44 -0
- package/src/plugins/builtin/sec/filing-content.ts +13 -0
- package/src/plugins/builtin/sec/fund-facts.ts +10 -8
- package/src/plugins/builtin/sec/headless.ts +60 -8
- package/src/plugins/builtin/sec/index.tsx +144 -71
- package/src/plugins/builtin/sec/model.ts +10 -4
- package/src/plugins/builtin/sec/row-summaries.ts +1 -0
- package/src/plugins/builtin/sectors/client.ts +27 -5
- package/src/plugins/builtin/sectors/headless.ts +2 -1
- package/src/plugins/builtin/sectors/index.tsx +22 -10
- package/src/plugins/builtin/series-inventory.ts +4 -0
- package/src/plugins/builtin/shared/beat-miss-chart.ts +66 -0
- package/src/plugins/builtin/shared/cloud-resource.ts +3 -3
- package/src/plugins/builtin/shared/day-entries.ts +41 -0
- package/src/plugins/builtin/shared/earnings-calendar.ts +80 -53
- package/src/plugins/builtin/shared/earnings-report.ts +53 -15
- package/src/plugins/builtin/shared/extended-print.ts +38 -0
- package/src/plugins/builtin/shared/history-span.ts +2 -1
- package/src/plugins/builtin/shared/locked-rows.tsx +1 -1
- package/src/plugins/builtin/shared/pro-feature-wall.tsx +1 -1
- package/src/plugins/builtin/shared/pro-lock-note.ts +8 -12
- package/src/plugins/builtin/shared/report-freshness.ts +7 -3
- package/src/plugins/builtin/shared/scanner-capture.ts +16 -3
- package/src/plugins/builtin/shared/ticker-company.ts +17 -8
- package/src/plugins/builtin/shared/ticker-request.ts +4 -2
- package/src/plugins/builtin/shared/use-quote-board.ts +11 -4
- package/src/plugins/builtin/shared/volatility/live-session.ts +6 -7
- package/src/plugins/builtin/shared/volatility/option-snapshot.ts +30 -0
- package/src/plugins/builtin/shared/volatility/quote-session.ts +49 -0
- package/src/plugins/builtin/short-interest/exchange-balances.ts +76 -0
- package/src/plugins/builtin/short-interest/exchange-positions-pane.tsx +55 -0
- package/src/plugins/builtin/short-interest/headless.ts +15 -2
- package/src/plugins/builtin/short-interest/index.tsx +7 -3
- package/src/plugins/builtin/short-interest/jpx.ts +38 -0
- package/src/plugins/builtin/short-interest/model.ts +3 -2
- package/src/plugins/builtin/short-interest/pane.tsx +4 -3
- package/src/plugins/builtin/short-interest/publications-model.ts +73 -2
- package/src/plugins/builtin/short-interest/publications-pane.tsx +16 -4
- package/src/plugins/builtin/short-interest/sfc.ts +40 -0
- package/src/plugins/builtin/short-interest/surface.tsx +16 -2
- package/src/plugins/builtin/short-volume/headless.ts +18 -3
- package/src/plugins/builtin/short-volume/model.ts +6 -1
- package/src/plugins/builtin/short-volume/pane.tsx +8 -7
- package/src/plugins/builtin/short-volume/sgx.ts +23 -0
- package/src/plugins/builtin/social-mentions/client.ts +7 -3
- package/src/plugins/builtin/social-mentions/outliers-model.ts +2 -1
- package/src/plugins/builtin/social-mentions/outliers.tsx +9 -2
- package/src/plugins/builtin/social-mentions/pane.tsx +10 -8
- package/src/plugins/builtin/supply-chain/client.ts +10 -2
- package/src/plugins/builtin/supply-chain/directories.ts +18 -0
- package/src/plugins/builtin/supply-chain/evidence.ts +12 -4
- package/src/plugins/builtin/supply-chain/headless.ts +20 -7
- package/src/plugins/builtin/supply-chain/pane.tsx +40 -11
- package/src/plugins/builtin/thirteenf/api.ts +323 -34
- package/src/plugins/builtin/thirteenf/data.ts +147 -40
- package/src/plugins/builtin/thirteenf/format.ts +4 -6
- package/src/plugins/builtin/thirteenf/headless.ts +75 -32
- package/src/plugins/builtin/thirteenf/model.ts +24 -11
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +16 -8
- package/src/plugins/builtin/thirteenf/pane.tsx +45 -22
- package/src/plugins/builtin/thirteenf/report-notes.ts +52 -2
- package/src/plugins/builtin/thirteenf/session-scope.ts +57 -0
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +27 -7
- package/src/plugins/builtin/thirteenf/signals.ts +22 -1
- package/src/plugins/builtin/thirteenf/split-history.ts +119 -0
- package/src/plugins/builtin/thirteenf/table.ts +6 -6
- package/src/plugins/builtin/thirteenf/types.ts +17 -1
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -2
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +11 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +12 -8
- package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +5 -4
- package/src/plugins/builtin/ticker-detail/data-panes/returns-model.ts +7 -0
- package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +12 -5
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +36 -5
- package/src/plugins/builtin/ticker-detail/financials/model.ts +179 -39
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +77 -14
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +69 -14
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +81 -37
- package/src/plugins/builtin/ticker-detail/headless.ts +65 -38
- package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +80 -14
- package/src/plugins/builtin/ticker-detail/overview/model.ts +54 -25
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +28 -9
- package/src/plugins/builtin/ticker-detail/overview/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +52 -23
- package/src/plugins/builtin/ticker-detail/pane.tsx +19 -10
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +41 -23
- package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +30 -13
- package/src/plugins/builtin/ticker-detail/research-groups.ts +15 -2
- package/src/plugins/builtin/ticker-detail/research-tabs.ts +2 -1
- package/src/plugins/builtin/ticker-detail/settings.ts +9 -2
- package/src/plugins/builtin/time-sales/headless.ts +52 -16
- package/src/plugins/builtin/time-sales/model.ts +2 -2
- package/src/plugins/builtin/time-sales/window.ts +84 -10
- package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
- package/src/plugins/builtin/treasury-auctions/cache.ts +44 -19
- package/src/plugins/builtin/treasury-auctions/client.ts +9 -4
- package/src/plugins/builtin/vol-surface/charts.tsx +7 -3
- package/src/plugins/builtin/vol-surface/events.ts +20 -10
- package/src/plugins/builtin/vol-surface/evidence.ts +2 -2
- package/src/plugins/builtin/vol-surface/headless.ts +47 -29
- package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
- package/src/plugins/builtin/vol-surface/model.ts +34 -9
- package/src/plugins/builtin/vol-surface/pane.tsx +50 -74
- package/src/plugins/builtin/vol-surface/quote-coverage.ts +68 -0
- package/src/plugins/builtin/vol-surface/tables.ts +57 -6
- package/src/plugins/builtin/volatility/charts.tsx +7 -3
- package/src/plugins/builtin/volatility/headless.ts +5 -5
- package/src/plugins/builtin/volatility/pane.tsx +8 -5
- package/src/plugins/builtin/world-indices/footer.ts +1 -1
- package/src/plugins/builtin/world-indices/headless.ts +5 -3
- package/src/plugins/builtin/world-venue-map/chokepoint-report.ts +3 -1
- package/src/plugins/builtin/world-venue-map/headless.ts +42 -14
- package/src/plugins/builtin/world-venue-map/layered-pane.tsx +5 -3
- package/src/plugins/builtin/world-venue-map/pane.tsx +4 -3
- package/src/plugins/builtin/world-venue-map/venue-exceptions.ts +72 -0
- package/src/plugins/builtin/world-venue-map/venue-header.tsx +20 -11
- package/src/plugins/builtin/yield-curve/client.ts +3 -1
- package/src/plugins/builtin/yield-curve/headless.ts +4 -2
- package/src/plugins/builtin/yield-curve/index.tsx +4 -3
- package/src/plugins/catalog-browser.ts +3 -34
- package/src/plugins/duplicates.ts +60 -0
- package/src/plugins/loader.ts +12 -3
- package/src/plugins/marketplace/feed.ts +3 -2
- package/src/plugins/marketplace/model.ts +10 -1
- package/src/plugins/registry/contributions.ts +37 -10
- package/src/plugins/registry/index.ts +2 -1
- package/src/portfolio/column-values.ts +51 -5
- package/src/public/__snapshots__/public-api.test.ts.snap +5 -0
- package/src/public/i18n.ts +3 -2
- package/src/react/async-resource.ts +8 -7
- package/src/renderers/browser/bundled-plugins.ts +2 -1
- package/src/renderers/dom/build-assets.ts +20 -0
- package/src/renderers/dom/css.d.ts +1 -0
- package/src/renderers/dom/data-table/index.tsx +96 -10
- package/src/renderers/dom/data-table/row.tsx +1 -1
- package/src/renderers/dom/es2023-array-methods.ts +57 -0
- package/src/renderers/dom/host/surface-fit.ts +64 -13
- package/src/renderers/dom/styles.css +6 -1
- package/src/renderers/electrobun/bun/desktop/backend.ts +12 -1
- package/src/renderers/electrobun/bun/external-plugins.ts +16 -6
- package/src/renderers/electrobun/shared/protocol.ts +2 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +38 -8
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +15 -8
- package/src/renderers/electrobun/view/external-plugins.ts +1 -0
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +3 -0
- package/src/series/types.ts +1 -0
- package/src/sources/gloomberb-cloud/batched-lookups.ts +12 -1
- package/src/sources/gloomberb-cloud/fred-attribution.ts +6 -5
- package/src/sources/gloomberb-cloud/index.ts +78 -8
- package/src/sources/gloomberb-cloud/news.ts +15 -2
- package/src/sources/gloomberb-cloud/normalizers.ts +10 -0
- package/src/sources/history-result.ts +2 -1
- package/src/sources/history-retention.ts +14 -2
- package/src/sources/listing-symbols.ts +1 -1
- package/src/sources/provider-router/cache.ts +32 -3
- package/src/sources/provider-router/cached-routes.ts +25 -0
- package/src/sources/provider-router/connection-health.ts +1 -0
- package/src/sources/provider-router/financials.ts +4 -4
- package/src/sources/provider-router/history.ts +2 -2
- package/src/sources/provider-router/index.ts +23 -1
- package/src/sources/provider-router/sec-filings-page.ts +25 -0
- package/src/sources/sec-edgar/content.ts +67 -36
- package/src/state/app/context/index.tsx +12 -4
- package/src/sync/broker-instances.ts +63 -11
- package/src/sync/config-merge.ts +1 -1
- package/src/sync/sanitize.ts +2 -0
- package/src/test-support/cloud-api.ts +34 -0
- package/src/test-support/strict-table-capture.tsx +83 -0
- package/src/tickers/listing-fate.ts +28 -0
- package/src/tickers/search/home-listing.ts +3 -0
- package/src/tickers/search/index-root-lead.ts +40 -0
- package/src/tickers/search/index.ts +23 -7
- package/src/tickers/terminal-codes.ts +7 -4
- package/src/time-series/alignment.ts +14 -4
- package/src/time-series/base-series.ts +20 -10
- package/src/time-series/chart-data.ts +2 -0
- package/src/time-series/chart-seed.ts +3 -1
- package/src/time-series/fundamentals/current-valuation.ts +22 -5
- package/src/time-series/fundamentals/historical-valuation.ts +2 -2
- package/src/time-series/fundamentals/history-link.ts +25 -0
- package/src/time-series/fundamentals/quarterly-ttm.ts +50 -5
- package/src/time-series/fundamentals/series.ts +15 -12
- package/src/time-series/history-acquisition.ts +2 -0
- package/src/time-series/market.ts +33 -5
- package/src/time-series/price-comparison.ts +42 -61
- package/src/time-series/resolve-context.ts +8 -0
- package/src/time-series/resolve.ts +67 -20
- package/src/time-series/spec.ts +2 -1
- package/src/time-series/studies/formula.ts +4 -2
- package/src/time-series/studies/indicators.ts +2 -0
- package/src/time-series/studies/pair.ts +4 -2
- package/src/time-series/studies/shared.ts +1 -0
- package/src/time-series/types.ts +3 -1
- package/src/time-series/use-chart-resolution.ts +34 -16
- package/src/time-series/valuation-currency.ts +40 -12
- package/src/types/config.ts +13 -61
- package/src/types/data-provider.ts +38 -1
- package/src/types/financials.ts +72 -6
- package/src/types/headless.ts +53 -0
- package/src/types/instrument.ts +1 -0
- package/src/types/plugin-context.ts +8 -1
- package/src/utils/crypto-pair.ts +26 -0
- package/src/utils/day-format.ts +104 -0
- package/src/utils/exchange-announcements.ts +36 -12
- package/src/utils/exchange-notation.generated.ts +58 -1
- package/src/utils/exchanges.ts +43 -1
- package/src/utils/financial-statements.ts +40 -46
- package/src/utils/format.ts +74 -12
- package/src/utils/forward-dividend.ts +2 -1
- package/src/utils/function-search.ts +38 -0
- package/src/utils/fuzzy-search.ts +10 -6
- package/src/utils/option-choice.ts +15 -0
- package/src/utils/price-history.ts +15 -1
- package/src/utils/reason-codes.ts +6 -3
- package/src/utils/trailing-dividend.ts +288 -28
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +0 -757
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HeadlessPaneColumn, HeadlessPaneRow } from "../../../types/headless";
|
|
2
|
+
import { EXTENDED_SESSION_LABELS, type ExtendedSession } from "../../../market-data/market/status";
|
|
3
|
+
import { asOfClock } from "../../../market-data/quotes/time";
|
|
4
|
+
import { MISSING_VALUE } from "../../../utils/format";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* When a report row's pre-market, after-hours or overnight print was observed
|
|
8
|
+
* (`extendedUpdatedAt`, epoch ms), as a card dates it: `Sat 00:34 UTC`. Empty
|
|
9
|
+
* without one. The row's own as-of is its close's once the session is over.
|
|
10
|
+
*/
|
|
11
|
+
function extendedPrintTimeText(row: HeadlessPaneRow): string {
|
|
12
|
+
const time = row.extendedUpdatedAt;
|
|
13
|
+
return typeof time === "number" && Number.isFinite(time) && time > 0 ? asOfClock(Math.min(time, Date.now())) : "";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* An extended print column's text with its time after the figures
|
|
18
|
+
* (`$70.60 +1.35% Sat 00:34 UTC`), as `quote` prints it; `figures` is what the
|
|
19
|
+
* column draws for the print alone.
|
|
20
|
+
*/
|
|
21
|
+
export function withExtendedPrintTime(figures: string, row: HeadlessPaneRow): string {
|
|
22
|
+
return [figures, extendedPrintTimeText(row)].filter(Boolean).join(" ");
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* When each row's extended print was observed, as `quote --csv`'s `After Hours
|
|
27
|
+
* Updated` dates it: XYZ:NYSE's close at 21:00 UTC, its after-hours print at
|
|
28
|
+
* 00:34 UTC. Exported last, so a column read by position stays where it was;
|
|
29
|
+
* a text report says the time beside the print instead.
|
|
30
|
+
*/
|
|
31
|
+
export function extendedPrintTimeColumn(session: ExtendedSession): HeadlessPaneColumn {
|
|
32
|
+
return {
|
|
33
|
+
key: "extendedUpdatedAt", header: `${EXTENDED_SESSION_LABELS[session]} Updated`, exportLast: true,
|
|
34
|
+
format: (value, row) => row.extendedSession === session && typeof value === "number" && Number.isFinite(value) && value > 0
|
|
35
|
+
? new Date(value).toISOString()
|
|
36
|
+
: MISSING_VALUE,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { StatItem } from "../../../components/ui";
|
|
2
|
+
import { formatDay } from "../../../utils/day-format";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The dates a range of a dated history shows. A range that reaches back past
|
|
@@ -51,5 +52,5 @@ export function historyStartNotice(name: string, range: string, span: HistorySpa
|
|
|
51
52
|
|
|
52
53
|
/** The same in a pane's detail figures: the history's dates, beside the range figures they bound. */
|
|
53
54
|
export function historySpanStat(span: HistorySpan | null): StatItem | null {
|
|
54
|
-
return span?.whole ? { id: "history", label: "History", value: span.start, detail: `to ${span.end}` } : null;
|
|
55
|
+
return span?.whole ? { id: "history", label: "History", value: formatDay(span.start), detail: `to ${formatDay(span.end)}` } : null;
|
|
55
56
|
}
|
|
@@ -11,7 +11,7 @@ import { useThemeColors } from "../../../theme/theme-context";
|
|
|
11
11
|
|
|
12
12
|
export function Blurred({ children }: { children: ReactNode }) {
|
|
13
13
|
return (
|
|
14
|
-
<Box flexDirection="row" style={{ filter: "blur(5px)", userSelect: "none", WebkitUserSelect: "none" }}>
|
|
14
|
+
<Box flexDirection="row" data-gloom-report-ignore="true" aria-hidden="true" style={{ filter: "blur(5px)", userSelect: "none", WebkitUserSelect: "none" }}>
|
|
15
15
|
{children}
|
|
16
16
|
</Box>
|
|
17
17
|
);
|
|
@@ -46,7 +46,7 @@ export function useProFeatureWall(copy: ProFeatureWallCopy, size: { width: numbe
|
|
|
46
46
|
const gated = !options.preview;
|
|
47
47
|
let wall: ReactNode = null;
|
|
48
48
|
if ((gated && !access.signedIn) || refused === 401) {
|
|
49
|
-
wall = <SignInWall placement={`${copy.placement.replace(/-wall$/, "")}-signin`} {...size} symbol={symbol} exchange={exchange} action={copy.action} />;
|
|
49
|
+
wall = <SignInWall placement={`${copy.placement.replace(/-wall$/, "")}-signin`} {...size} symbol={symbol} exchange={exchange} action={copy.action} pro />;
|
|
50
50
|
} else if ((gated && !access.emailVerified) || refused === 403) {
|
|
51
51
|
wall = <SignInWall placement={`${copy.placement.replace(/-wall$/, "")}-signin`} {...size} symbol={symbol} exchange={exchange} action={copy.action} needsVerification />;
|
|
52
52
|
} else if ((gated && !access.hasProAccess) || refused === 402) {
|
|
@@ -23,7 +23,7 @@ export interface FreeRoute {
|
|
|
23
23
|
* takes. A read that fails, or is still out after a few seconds, counts as
|
|
24
24
|
* no data; pass `context.signal` on to reads that take one.
|
|
25
25
|
*/
|
|
26
|
-
answers?(symbol: string, context: HeadlessPaneContext): Promise<boolean>;
|
|
26
|
+
answers?(symbol: string, context: HeadlessPaneContext): Promise<boolean | null>;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/** A refused read asks for its note twice (the error it throws, then the report), so an answer is kept a while. */
|
|
@@ -36,7 +36,7 @@ const ANSWER_TTL_MS = 5 * 60_000;
|
|
|
36
36
|
*/
|
|
37
37
|
const ROUTE_CHECK_WAIT_MS = 3_000;
|
|
38
38
|
|
|
39
|
-
const answers = new WeakMap<FreeRoute, TtlCache<boolean>>();
|
|
39
|
+
const answers = new WeakMap<FreeRoute, TtlCache<boolean | null>>();
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Whether the route has data for the symbol, null when its check failed or was
|
|
@@ -45,7 +45,7 @@ const answers = new WeakMap<FreeRoute, TtlCache<boolean>>();
|
|
|
45
45
|
* rather than hiding the route for minutes over one slow read.
|
|
46
46
|
*/
|
|
47
47
|
async function routeAnswers(route: FreeRoute, check: NonNullable<FreeRoute["answers"]>, symbol: string, context: HeadlessPaneContext, deadline: number): Promise<boolean | null> {
|
|
48
|
-
const bySymbol = answers.get(route) ?? createTtlCache<boolean>({ ttlMs: ANSWER_TTL_MS });
|
|
48
|
+
const bySymbol = answers.get(route) ?? createTtlCache<boolean | null>({ ttlMs: ANSWER_TTL_MS });
|
|
49
49
|
answers.set(route, bySymbol);
|
|
50
50
|
const key = symbol.trim().toUpperCase();
|
|
51
51
|
const kept = bySymbol.load(key, () => {
|
|
@@ -122,11 +122,8 @@ export async function proLockNote(
|
|
|
122
122
|
* For a function that reads what its free routes read (RISK the SEC's
|
|
123
123
|
* 10-Ks and 20-Fs, FLOW the listing's options): the sentence the note
|
|
124
124
|
* says when every route answered that the symbol has none. The note then
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* A function that reads only the one ticker has nothing to unlock for it,
|
|
128
|
-
* so the note does not ask for an upgrade; a board (FLOW) still has the
|
|
129
|
-
* rest of the market.
|
|
125
|
+
* gives no unlock instructions for that request: upgrading won't add
|
|
126
|
+
* coverage for that listing.
|
|
130
127
|
*/
|
|
131
128
|
noneFor?: (ticker: string) => string;
|
|
132
129
|
},
|
|
@@ -147,13 +144,12 @@ export async function proLockNote(
|
|
|
147
144
|
const { route: free, noneHasData } = pane.free ? await answeringFreeRoute(lock, pane.free) : { route: null, noneHasData: false };
|
|
148
145
|
// Unlocking reads nothing for a symbol none of the function's own data covers: it is named only where it has some.
|
|
149
146
|
const uncovered = noneHasData && !!pane.noneFor;
|
|
150
|
-
const bare = pane.argument === "none" || (pane.argument === "optional" &&
|
|
151
|
-
const command = bare ? `gloom fn ${token}` : `gloom fn ${token} ${
|
|
152
|
-
const nothingToUnlock = uncovered && (pane.argument ?? "ticker") === "ticker";
|
|
147
|
+
const bare = pane.argument === "none" || (pane.argument === "optional" && !symbol);
|
|
148
|
+
const command = bare ? `gloom fn ${token}` : `gloom fn ${token} ${ticker}`;
|
|
153
149
|
return [
|
|
154
150
|
`${token} ${what}: ${pane.does}. ${without} it shows none of ${pane.shows}.`,
|
|
155
151
|
...free ? [`Free, with no sign-in: ${free.text(ticker, symbol ?? "the company")}`] : [],
|
|
156
152
|
...uncovered ? [pane.noneFor!(ticker)] : [],
|
|
157
|
-
...
|
|
153
|
+
...uncovered ? [] : [`${unlock}; ${command} then reads with that session.`],
|
|
158
154
|
].join("\n");
|
|
159
155
|
}
|
|
@@ -5,6 +5,7 @@ import { isQuoteBeforeLatestSession, isQuoteStaleForCurrentSession } from "../..
|
|
|
5
5
|
import { quoteFeedDelayMinutes, readIndexSession } from "../../../market-data/market/freshness";
|
|
6
6
|
import { quoteHeadlineTime } from "../../../market-data/market/status";
|
|
7
7
|
import { indexLevelMarketState } from "../../../market-data/market/index-level";
|
|
8
|
+
import { isOutsideFuturesProductHours } from "../../../market-data/market/futures-product-hours";
|
|
8
9
|
import { barSizeFromGap, medianBarGap } from "../../../time-series/bar-spacing";
|
|
9
10
|
import { apiClient } from "../../../api-client";
|
|
10
11
|
import { CLOUD_NEWS_DELAY_HOURS, hasProAccess, type PlanAccessUser } from "../../../api-client/plan-rules";
|
|
@@ -131,8 +132,10 @@ export function quoteFreshnessFields(
|
|
|
131
132
|
...(quote.nominalPrice ? { nominal: true as const } : {}),
|
|
132
133
|
...(delayMinutes != null ? { delayMinutes } : {}),
|
|
133
134
|
...(exchange && session ? { sessionExchange: exchange } : {}),
|
|
134
|
-
// An index's final close reads as a close, not after hours.
|
|
135
|
-
...(quote.marketState && session
|
|
135
|
+
// An index's final close reads as a close, not after hours; a grain or a soft outside its own hours, as closed.
|
|
136
|
+
...(quote.marketState && session
|
|
137
|
+
? { marketState: isOutsideFuturesProductHours(quote, now) ? "CLOSED" as const : indexLevelMarketState(quote) }
|
|
138
|
+
: {}),
|
|
136
139
|
...(sessionCalendar && session ? { sessionCalendar } : {}),
|
|
137
140
|
};
|
|
138
141
|
}
|
|
@@ -145,9 +148,10 @@ export function quoteFreshnessFields(
|
|
|
145
148
|
* for (`asOfDate`), not by the older last trade. A board publishes one per
|
|
146
149
|
* quote it shows, so `fn` and `shot` date it as `quote` dates the same quotes.
|
|
147
150
|
*/
|
|
148
|
-
export function quoteObservation(quote: Quote, now = Date.now()): QuoteFreshnessFields & { updatedAt: number; asOfDate?: string } {
|
|
151
|
+
export function quoteObservation(quote: Quote, now = Date.now()): QuoteFreshnessFields & { quoteSymbol: string; updatedAt: number; asOfDate?: string } {
|
|
149
152
|
return {
|
|
150
153
|
...quoteFreshnessFields(quote, now),
|
|
154
|
+
quoteSymbol: quote.symbol,
|
|
151
155
|
updatedAt: quoteHeadlineTime(quote),
|
|
152
156
|
...(quote.nominalPrice ? { asOfDate: quote.nominalPrice.session } : {}),
|
|
153
157
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
import type { apiClient, ScannerFeedEvent, ScannerKind } from "../../../api-client";
|
|
3
|
+
import { venueSessionNow } from "../../../market-data/market/venue-session";
|
|
3
4
|
|
|
4
5
|
// The panes that read a scanner feed, and the shot capture that reads it for
|
|
5
6
|
// them. Core (the CLI's `shot` and its page) imports this, not the scanner
|
|
@@ -14,6 +15,16 @@ export const LIVE_SCAN_TEMPLATE_ID = "scanner-live-pane";
|
|
|
14
15
|
export const SCANNER_PANE_KINDS: Readonly<Record<string, ScannerKind>> = { [HILO_PANE_ID]: "hilo", [FLOW_PANE_ID]: "flow" };
|
|
15
16
|
|
|
16
17
|
export type ScannerClient = Pick<typeof apiClient, "subscribeScanner">;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Whether US equities are shut at `now` by the exchange calendar: a weekend, a holiday, or the night between the
|
|
21
|
+
* 20:00 New York close of after-hours and the 04:00 pre-market. The scanners have no session to scan then, so HILO and
|
|
22
|
+
* FLOW answer as a closed session whatever a scanner still holding the last one says.
|
|
23
|
+
*/
|
|
24
|
+
export function usScannerSessionClosed(now: number): boolean {
|
|
25
|
+
const phase = venueSessionNow("NYSE", now)?.phase;
|
|
26
|
+
return phase === "closed" || phase === "holiday";
|
|
27
|
+
}
|
|
17
28
|
/** Where a scanner pane gets its feed; absent, the shared cloud socket. */
|
|
18
29
|
export const ScannerClientContext = createContext<ScannerClient | null>(null);
|
|
19
30
|
|
|
@@ -53,14 +64,16 @@ const SCANNER_LABELS: Record<ScannerKind, string> = {
|
|
|
53
64
|
* the deadline, since a scanner warming up can pass through a stale row on its
|
|
54
65
|
* way to live. With `acceptStarting`, so is a starting one, for a report that
|
|
55
66
|
* says the scanner is starting rather than failing; a screenshot keeps failing
|
|
56
|
-
* on one, as it would only picture an empty pane.
|
|
67
|
+
* on one, as it would only picture an empty pane. With `closed`, the market is
|
|
68
|
+
* known shut and nothing better is coming: the first answer is taken, whatever
|
|
69
|
+
* it is.
|
|
57
70
|
*/
|
|
58
71
|
export function captureScannerEvent(
|
|
59
72
|
client: ScannerClient,
|
|
60
73
|
scanner: ScannerKind,
|
|
61
74
|
signal: AbortSignal,
|
|
62
75
|
timeoutMs = SCANNER_SNAPSHOT_TIMEOUT_MS,
|
|
63
|
-
{ acceptStarting = false }: { acceptStarting?: boolean } = {},
|
|
76
|
+
{ acceptStarting = false, closed = false }: { acceptStarting?: boolean; closed?: boolean } = {},
|
|
64
77
|
): Promise<ScannerFeedEvent> {
|
|
65
78
|
const label = SCANNER_LABELS[scanner];
|
|
66
79
|
return new Promise((resolve, reject) => {
|
|
@@ -86,7 +99,7 @@ export function captureScannerEvent(
|
|
|
86
99
|
}), timeoutMs);
|
|
87
100
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
88
101
|
unsubscribe = client.subscribeScanner(scanner, (event: ScannerFeedEvent) => {
|
|
89
|
-
if (event.type === "denied") {
|
|
102
|
+
if (event.type === "denied" || closed) {
|
|
90
103
|
finish(() => resolve(event));
|
|
91
104
|
return;
|
|
92
105
|
}
|
|
@@ -4,15 +4,24 @@ import type { DataProvider } from "../../../types/data-provider";
|
|
|
4
4
|
import type { CompanyProfile } from "../../../types/financials";
|
|
5
5
|
import { shortCompanyName } from "../../../tickers/company-name";
|
|
6
6
|
import { classifyInstrumentKind } from "../../../tickers/search/ranking";
|
|
7
|
+
import { canonicalExchange, isKnownExchangeCode, parsePublicTickerKey } from "../../../utils/exchanges";
|
|
7
8
|
import { logFailure } from "../../../utils/log-failure";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* A search typed as a ticker (`TRIAL VKTX`, `FDA AZN`): one to five letters,
|
|
11
|
-
* with a share class
|
|
12
|
-
*
|
|
12
|
+
* with a share class, and the venue it lists on when written as the app writes
|
|
13
|
+
* a listing (`FDA AZN:LSE`, `BRK.B:NYSE`). Registries know companies by name,
|
|
14
|
+
* so a symbol no record mentions is looked up as its company.
|
|
13
15
|
*/
|
|
14
16
|
export function looksLikeTicker(term: string): boolean {
|
|
15
|
-
|
|
17
|
+
const match = /^([A-Za-z]{1,5}(?:[.-][A-Za-z])?)(?::([A-Za-z]{2,8}))?$/.exec(term.trim());
|
|
18
|
+
return !!match && (!match[2] || isKnownExchangeCode(canonicalExchange(match[2])));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The listing a ticker search names: `AZN:LSE` is AZN on LSE, `AZN` the symbol alone. */
|
|
22
|
+
function tickerListing(ticker: string): { symbol: string; exchange: string } {
|
|
23
|
+
const { symbol, exchange } = parsePublicTickerKey(ticker.trim().toUpperCase());
|
|
24
|
+
return { symbol, exchange: exchange ?? "" };
|
|
16
25
|
}
|
|
17
26
|
|
|
18
27
|
/**
|
|
@@ -23,9 +32,9 @@ export function looksLikeTicker(term: string): boolean {
|
|
|
23
32
|
* timed out) rejects: it says nothing about the company.
|
|
24
33
|
*/
|
|
25
34
|
export async function tickerCompanyName(dataProvider: Pick<DataProvider, "getQuote"> | null, ticker: string): Promise<string | null> {
|
|
26
|
-
const symbol = ticker
|
|
35
|
+
const { symbol, exchange } = tickerListing(ticker);
|
|
27
36
|
if (!dataProvider || !symbol) return null;
|
|
28
|
-
const quote = await dataProvider.getQuote(symbol).catch((error: unknown) => {
|
|
37
|
+
const quote = await (exchange ? dataProvider.getQuote(symbol, exchange) : dataProvider.getQuote(symbol)).catch((error: unknown) => {
|
|
29
38
|
if (isNoSourceAnswer(error)) return null;
|
|
30
39
|
throw error;
|
|
31
40
|
});
|
|
@@ -79,15 +88,15 @@ async function tickerListedCompany(
|
|
|
79
88
|
dataProvider: Pick<DataProvider, "getQuote" | "getTickerFinancials"> | null,
|
|
80
89
|
ticker: string,
|
|
81
90
|
): Promise<ListedCompany | null> {
|
|
82
|
-
const symbol = ticker
|
|
91
|
+
const { symbol, exchange } = tickerListing(ticker);
|
|
83
92
|
if (!dataProvider || !symbol) return null;
|
|
84
93
|
const [quote, financials] = await Promise.all([
|
|
85
|
-
dataProvider.getQuote(symbol).catch((error: unknown) => {
|
|
94
|
+
(exchange ? dataProvider.getQuote(symbol, exchange) : dataProvider.getQuote(symbol)).catch((error: unknown) => {
|
|
86
95
|
if (isNoSourceAnswer(error)) return null;
|
|
87
96
|
throw error;
|
|
88
97
|
}),
|
|
89
98
|
// What it does is a detail: a profile that could not be read leaves the name to tell.
|
|
90
|
-
Promise.resolve().then(() => dataProvider.getTickerFinancials(symbol,
|
|
99
|
+
Promise.resolve().then(() => dataProvider.getTickerFinancials(symbol, exchange)).catch(logFailure("ticker-company", `Read ${symbol}'s profile failed`, null)),
|
|
91
100
|
]);
|
|
92
101
|
const legalName = quote?.name?.trim();
|
|
93
102
|
const kind = classifyInstrumentKind(quote?.instrumentType);
|
|
@@ -71,12 +71,14 @@ export function useTickerRequest<T>(
|
|
|
71
71
|
symbol: string | null,
|
|
72
72
|
exchange: string,
|
|
73
73
|
savedAs?: readonly unknown[],
|
|
74
|
+
enabled = true,
|
|
74
75
|
) {
|
|
75
76
|
const scope = useCloudDisplayScope();
|
|
76
77
|
const request = useCallback((force: boolean) => loader(symbol!, exchange, force), [exchange, loader, symbol]);
|
|
77
|
-
const { data, loading, error, reload } = useAsyncResource(symbol ? request : null, {
|
|
78
|
+
const { data, loading, error, reload } = useAsyncResource(symbol && enabled ? request : null, {
|
|
78
79
|
clearOnError: discardDeniedResearch,
|
|
79
|
-
savedCopy: savedAs && symbol && scope ? { key: [...savedAs, scope, symbol, exchange] } : null,
|
|
80
|
+
savedCopy: enabled && savedAs && symbol && scope ? { key: [...savedAs, scope, symbol, exchange] } : null,
|
|
80
81
|
});
|
|
82
|
+
if (!enabled) return { data: null, loading: false, error: null, reload };
|
|
81
83
|
return { data, loading, error: symbol ? error : "No ticker selected", reload };
|
|
82
84
|
}
|
|
@@ -611,6 +611,7 @@ export interface QuoteBoardStatus {
|
|
|
611
611
|
loading: number;
|
|
612
612
|
/** Symbols showing their last good quote after a failed load. */
|
|
613
613
|
stale: number;
|
|
614
|
+
staleSymbol: string | null;
|
|
614
615
|
/** Symbols with no quote to show at all. */
|
|
615
616
|
unavailable: number;
|
|
616
617
|
latestTs: number;
|
|
@@ -621,15 +622,19 @@ export interface QuoteBoardStatus {
|
|
|
621
622
|
export function quoteBoardStatus(quotes: BoardQuoteMap): QuoteBoardStatus {
|
|
622
623
|
let loading = 0;
|
|
623
624
|
let stale = 0;
|
|
625
|
+
let staleSymbol: string | null = null;
|
|
624
626
|
let unavailable = 0;
|
|
625
627
|
let latestTs = 0;
|
|
626
|
-
for (const state of quotes
|
|
628
|
+
for (const [symbol, state] of quotes) {
|
|
627
629
|
if (state.loading) loading += 1;
|
|
628
|
-
if (state.stale)
|
|
630
|
+
if (state.stale) {
|
|
631
|
+
stale += 1;
|
|
632
|
+
staleSymbol = stale === 1 ? state.quote?.symbol ?? symbol : null;
|
|
633
|
+
}
|
|
629
634
|
else if (!state.quote && !state.loading) unavailable += 1;
|
|
630
635
|
latestTs = Math.max(latestTs, state.quote?.lastUpdated ?? 0);
|
|
631
636
|
}
|
|
632
|
-
return { loading, stale, unavailable, latestTs, savedAt: oldestSavedCopyAt(Array.from(quotes.values(), (state) => state.quote)) };
|
|
637
|
+
return { loading, stale, staleSymbol, unavailable, latestTs, savedAt: oldestSavedCopyAt(Array.from(quotes.values(), (state) => state.quote)) };
|
|
633
638
|
}
|
|
634
639
|
|
|
635
640
|
/** The quotes a board shows, for the footer's delayed clock (`useQuoteDelayFooter`). */
|
|
@@ -642,7 +647,7 @@ export function quoteBoardFooterInfo(status: QuoteBoardStatus): PaneFooterSegmen
|
|
|
642
647
|
const info: PaneFooterSegment[] = [];
|
|
643
648
|
if (status.loading > 0) info.push({ id: "loading", parts: [{ text: "loading", tone: "muted" }] });
|
|
644
649
|
if (status.stale > 0) {
|
|
645
|
-
info.push({ id: "stale", parts: [{ text: `${status.stale} stale`, tone: "warning" }] });
|
|
650
|
+
info.push({ id: "stale", parts: [{ text: `${status.staleSymbol ?? status.stale} stale`, tone: "warning" }] });
|
|
646
651
|
}
|
|
647
652
|
if (status.unavailable > 0) {
|
|
648
653
|
info.push({ id: "error", parts: [{ text: `${status.unavailable} unavailable`, tone: "warning" }] });
|
|
@@ -749,6 +754,7 @@ const boardHeadlines = new WeakMap<Quote, Quote>();
|
|
|
749
754
|
* price's (quoteHeadlineTime), as `quote` dates it.
|
|
750
755
|
*/
|
|
751
756
|
export function boardHeadlineQuote(quote: Quote): Quote {
|
|
757
|
+
if (quote.futuresPriceKind) return quote;
|
|
752
758
|
const cached = boardHeadlines.get(quote);
|
|
753
759
|
if (cached) return cached;
|
|
754
760
|
const display = getRegularSessionDisplay(quote);
|
|
@@ -781,6 +787,7 @@ export function renderQuoteBoardCell(
|
|
|
781
787
|
|
|
782
788
|
switch (kind) {
|
|
783
789
|
case "status": {
|
|
790
|
+
if (state?.stale && !format.sessionText) return { text: "!", value: "stale", color: colors.warning };
|
|
784
791
|
if (format.sessionText) {
|
|
785
792
|
return { text: quoteSessionLabel(quote, format.now) ?? MISSING_VALUE, color: quoteSessionColor(quote, colors, format.now) };
|
|
786
793
|
}
|
|
@@ -65,14 +65,13 @@ export function usOptionsReopen(now: number): { at: string | null; short: string
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* symbol.
|
|
68
|
+
* When a volatility view with nothing fitted outside the options session can
|
|
69
|
+
* next read new quotes: `Options closed until Mon 14:30 UTC, 09:30 ET.` It
|
|
70
|
+
* follows what the last session's quotes did (they did not pass cleaning),
|
|
71
|
+
* and promises no surface: the next session's quotes may not pass either.
|
|
73
72
|
*/
|
|
74
|
-
export function
|
|
75
|
-
return
|
|
73
|
+
export function optionsClosedText(reopen: { at: string | null }): string {
|
|
74
|
+
return `Options closed${reopen.at ? ` until ${reopen.at}` : ""}.`;
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
/**
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { latestRegularSessionOpen } from "../../../../market-data/market/freshness";
|
|
2
|
+
import type { OptionsChain } from "../../../../types/financials";
|
|
3
|
+
import { daysToExpiry, expiryIsoDate, isLiveOptionExpiry } from "../../../../utils/option-expiry";
|
|
4
|
+
import { optionQuoteSession } from "./quote-session";
|
|
5
|
+
|
|
6
|
+
export function optionExpiryFacts(expiration: number, now: number, venue?: string) {
|
|
7
|
+
return {
|
|
8
|
+
date: expiryIsoDate(expiration),
|
|
9
|
+
daysToExpiry: daysToExpiry(expiration, now),
|
|
10
|
+
expired: !isLiveOptionExpiry(expiration, now, venue),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function optionSnapshotFreshness(chain: OptionsChain, now: number, venue?: string, saved = false) {
|
|
15
|
+
const observed = chain.asOf ? Date.parse(chain.asOf) : NaN;
|
|
16
|
+
const delayMinutes = chain.delayMinutes ?? 0;
|
|
17
|
+
const feedTime = now - delayMinutes * 60_000;
|
|
18
|
+
const calendar = venue || "NYSE";
|
|
19
|
+
const open = latestRegularSessionOpen(calendar, feedTime);
|
|
20
|
+
const stale = saved || (!chain.venue && Number.isFinite(observed) && (open != null ? observed < open
|
|
21
|
+
: optionQuoteSession(chain, calendar) !== optionQuoteSession({ asOf: new Date(feedTime).toISOString() }, calendar)));
|
|
22
|
+
const asOf = Number.isFinite(observed) ? chain.asOf! : null;
|
|
23
|
+
return {
|
|
24
|
+
asOf,
|
|
25
|
+
status: stale ? "stale" as const : asOf == null ? "unreported" as const
|
|
26
|
+
: chain.dataSource ?? (delayMinutes > 0 ? "delayed" as const : undefined),
|
|
27
|
+
...(delayMinutes > 0 && !stale && asOf != null ? { delayMinutes } : {}),
|
|
28
|
+
...(asOf == null ? { note: "Option snapshot time not reported" } : {}),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getPublishedUsEquitySession } from "../../../../market-data/published-us-sessions";
|
|
2
|
+
import type { OptionsChain } from "../../../../types/financials";
|
|
3
|
+
import { zonedWallClockToUtcMs } from "../../../../utils/zoned-date-time";
|
|
4
|
+
|
|
5
|
+
const newYorkDate = new Intl.DateTimeFormat("en-CA", { timeZone: "America/New_York", year: "numeric", month: "2-digit", day: "2-digit" });
|
|
6
|
+
|
|
7
|
+
/** A day's regular open, from the published calendar, else a weekday's 09:30 New York; null on a closed day. */
|
|
8
|
+
function sessionOpen(exchange: string, date: string): number | null {
|
|
9
|
+
const session = getPublishedUsEquitySession(exchange, date);
|
|
10
|
+
if (session) return session.kind === "session" ? session.open : null;
|
|
11
|
+
const [year, month, day] = date.split("-").map(Number) as [number, number, number];
|
|
12
|
+
const weekday = new Date(Date.UTC(year, month - 1, day)).getUTCDay();
|
|
13
|
+
return weekday === 0 || weekday === 6 ? null : zonedWallClockToUtcMs("America/New_York", year, month, day, 9, 30, 0);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function previousDate(date: string): string {
|
|
17
|
+
const [year, month, day] = date.split("-").map(Number) as [number, number, number];
|
|
18
|
+
return new Date(Date.UTC(year, month - 1, day - 1)).toISOString().slice(0, 10);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The US session a listed chain's quotes and volume are from, YYYY-MM-DD: the
|
|
23
|
+
* latest one open by the time of its quotes. Read before the open (Tuesday
|
|
24
|
+
* premarket), Monday's last quotes carry Monday's volume, not a Tuesday count.
|
|
25
|
+
* A venue that trades around the clock (Deribit) has no such session: null.
|
|
26
|
+
*/
|
|
27
|
+
export function optionQuoteSession(chain: Pick<OptionsChain, "asOf" | "venue">, exchange = "NYSE"): string | null {
|
|
28
|
+
if (chain.venue) return null;
|
|
29
|
+
const time = chain.asOf ? Date.parse(chain.asOf) : Number.NaN;
|
|
30
|
+
if (!Number.isFinite(time)) return null;
|
|
31
|
+
let date = newYorkDate.format(time);
|
|
32
|
+
// A long holiday weekend is the furthest a quote sits from its session.
|
|
33
|
+
for (let step = 0; step < 7; step += 1) {
|
|
34
|
+
const open = sessionOpen(exchange, date);
|
|
35
|
+
if (open != null && open <= time) return date;
|
|
36
|
+
date = previousDate(date);
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Whether a quote time falls inside a US regular session, when the market, not the hour, set its bids. */
|
|
42
|
+
export function quotedInSession(asOf: string | null | undefined, exchange = "NYSE"): boolean {
|
|
43
|
+
const time = asOf ? Date.parse(asOf) : Number.NaN;
|
|
44
|
+
if (!Number.isFinite(time)) return false;
|
|
45
|
+
const session = getPublishedUsEquitySession(exchange, newYorkDate.format(time));
|
|
46
|
+
if (session) return session.kind === "session" && time >= session.open && time <= session.close;
|
|
47
|
+
const open = sessionOpen(exchange, newYorkDate.format(time));
|
|
48
|
+
return open != null && time >= open && time <= open + 6.5 * 3_600_000;
|
|
49
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { apiClient } from "../../../api-client";
|
|
2
|
+
import type { BalanceVenue, KoreanShortPositions, MainlandLendingBalances, TaiwanShortBalances } from "../../../api-client/exchange-short-balances";
|
|
3
|
+
import type { HeadlessPaneLoadArgs, HeadlessRowsResult } from "../../../types/headless";
|
|
4
|
+
import { canonicalExchange, parsePublicTickerKey } from "../../../utils/exchanges";
|
|
5
|
+
import { sfcValue } from "./sfc";
|
|
6
|
+
|
|
7
|
+
const suffixes: Record<string, BalanceVenue> = { TWO: "TPEX", TW: "TWSE", SS: "SSE", SZ: "SZSE", KS: "KRX", KQ: "KOSDAQ" };
|
|
8
|
+
|
|
9
|
+
export function balanceListing(key: string, exchange?: string): { symbol: string; exchange: BalanceVenue } | null {
|
|
10
|
+
const parsed = parsePublicTickerKey(key);
|
|
11
|
+
const suffix = suffixes[parsed.symbol.split(".")[1] ?? ""];
|
|
12
|
+
|
|
13
|
+
const venue = parsed.exchange || canonicalExchange(exchange) || suffix;
|
|
14
|
+
if (suffix && suffix !== venue) return null;
|
|
15
|
+
const symbol = parsed.symbol.replace(/\.(?:TW(?:O)?|SS|SZ|KS|KQ)$/, "");
|
|
16
|
+
if (venue === "KRX" || venue === "KOSDAQ") return /^[0-9][0-9A-Z]{5}$/.test(symbol) ? { symbol, exchange: venue } : null;
|
|
17
|
+
if (venue === "SSE" || venue === "SZSE") return /^\d{6}$/.test(symbol) ? { symbol, exchange: venue } : null;
|
|
18
|
+
if (venue !== "TWSE" && venue !== "TPEX") return null;
|
|
19
|
+
return /^[0-9][0-9A-Z]{3,11}$/.test(symbol) ? { symbol, exchange: venue } : null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const taiwanColumns = [
|
|
23
|
+
{ key: "day", header: "Trading date", width: 13 },
|
|
24
|
+
{ key: "marginBalance", header: "Margin short balance", width: 21, align: "right" },
|
|
25
|
+
{ key: "sblBalance", header: "SBL short balance", width: 19, align: "right" },
|
|
26
|
+
{ key: "marginSold", header: "Margin sold", width: 14, align: "right" },
|
|
27
|
+
{ key: "sblSold", header: "SBL sold", width: 14, align: "right" },
|
|
28
|
+
] as const;
|
|
29
|
+
|
|
30
|
+
const mainlandColumns = [
|
|
31
|
+
{ key: "day", header: "Trading date", width: 13 },
|
|
32
|
+
{ key: "outstanding", header: "Outstanding on loan", width: 21, align: "right" },
|
|
33
|
+
{ key: "sold", header: "Sold short", width: 16, align: "right" },
|
|
34
|
+
] as const;
|
|
35
|
+
|
|
36
|
+
const koreanColumns = [
|
|
37
|
+
{ key: "day", header: "Position date", width: 13 },
|
|
38
|
+
{ key: "netShort", header: "Net short shares", width: 18, align: "right" },
|
|
39
|
+
{ key: "percent", header: "% of listed shares", width: 19, align: "right" },
|
|
40
|
+
{ key: "valueKrw", header: "Value (KRW)", width: 20, align: "right" },
|
|
41
|
+
{ key: "listedShares", header: "Listed shares", width: 18, align: "right" },
|
|
42
|
+
] as const;
|
|
43
|
+
|
|
44
|
+
export function balanceColumns(venue: BalanceVenue) {
|
|
45
|
+
if (venue === "KRX" || venue === "KOSDAQ") return koreanColumns;
|
|
46
|
+
return venue === "SSE" || venue === "SZSE" ? mainlandColumns : taiwanColumns;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function readExchangeBalances(client: Pick<typeof apiClient, "getKoreanShortPositions" | "getMainlandLendingBalances" | "getTaiwanShortBalances">, symbol: string, venue: BalanceVenue, asOf?: string) {
|
|
50
|
+
if (venue === "KRX" || venue === "KOSDAQ") return client.getKoreanShortPositions(symbol, venue, asOf);
|
|
51
|
+
return venue === "SSE" || venue === "SZSE"
|
|
52
|
+
? client.getMainlandLendingBalances(symbol, venue, asOf)
|
|
53
|
+
: client.getTaiwanShortBalances(symbol, venue, asOf);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type Report = TaiwanShortBalances | MainlandLendingBalances | KoreanShortPositions;
|
|
57
|
+
export function balanceEmpty(data: Report, asOf?: string) {
|
|
58
|
+
if (!data.reportsReviewed) return asOf ? `No ${data.exchange} file observed by ${asOf}.` : `No ${data.exchange} reports available.`;
|
|
59
|
+
return `No balance for ${data.symbol} in the ${data.reportsReviewed} exchange reports reviewed.`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function balanceReport(data: Report, args: HeadlessPaneLoadArgs, asOf?: string): HeadlessRowsResult {
|
|
63
|
+
const points = args.options.order === "oldest" ? [...data.points].reverse() : data.points;
|
|
64
|
+
const korean = data.exchange === "KRX" || data.exchange === "KOSDAQ";
|
|
65
|
+
const source = korean ? "Korea Exchange" : data.exchange;
|
|
66
|
+
return {
|
|
67
|
+
rows: points.slice(0, Number(args.options.limit)).map(row => ({ ...row })),
|
|
68
|
+
columns: balanceColumns(data.exchange).map(column => ({ ...column, format: sfcValue })),
|
|
69
|
+
empty: balanceEmpty(data, asOf), ...(!korean ? {unit: "shares"} : {}), interval: "daily",
|
|
70
|
+
metadata: { symbol: args.symbols[0], source, reportsReviewed: data.reportsReviewed, newestReport: data.newestReport, ...(asOf ? { asOf } : {}) },
|
|
71
|
+
notes: korean ? ["KRX aggregates disclosed net short positions by security. The percentage uses listed shares. Reports become available after the position date."] : data.exchange === "SSE" || data.exchange === "SZSE"
|
|
72
|
+
? ["Outstanding on loan is the closing securities lending balance. Sold short is the trading day’s volume in shares or fund units."]
|
|
73
|
+
: ["SBL counts short sales of borrowed securities. Balances are outstanding shares at the close. Sold is the trading day's volume."],
|
|
74
|
+
freshness: { source, status: "not-a-feed", basis: "daily exchange short-sale balances", observedKey: "day", oldest: null },
|
|
75
|
+
};
|
|
76
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { sgxVolumeColumns, sgxVolumeEmpty } from "../short-volume/sgx";
|
|
2
|
+
import { jpxColumns, jpxEmpty } from "./jpx";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import { apiClient } from "../../../api-client";
|
|
5
|
+
import type { BalanceVenue } from "../../../api-client/exchange-short-balances";
|
|
6
|
+
import { DataTableView, PaneStatusBody, usePaneStatusLinkFooter } from "../../../components";
|
|
7
|
+
import { usePaneRefreshKey } from "../../../components/data-table/table-pane";
|
|
8
|
+
import { useAsyncResource } from "../../../react/async-resource";
|
|
9
|
+
import type { PaneProps } from "../../../types/plugin";
|
|
10
|
+
import { sfcColumns, sfcEmpty, sfcValue } from "./sfc";
|
|
11
|
+
import { balanceColumns, balanceEmpty, readExchangeBalances } from "./exchange-balances";
|
|
12
|
+
|
|
13
|
+
type Venue = BalanceVenue | "HKEX" | "JPX" | "SGX";
|
|
14
|
+
type ReportRow = { day: string; sourceUrl: string } & Record<string, number | string | null>;
|
|
15
|
+
const rowKey = (row: ReportRow) => row.line == null ? row.day : row.day + ":" + row.line;
|
|
16
|
+
|
|
17
|
+
async function loadReport(symbol: string, venue: Venue) {
|
|
18
|
+
if (venue === "SGX") {
|
|
19
|
+
const data = await apiClient.getSgxShortSales(symbol);
|
|
20
|
+
return { rows: data.points.map(row => ({ ...row })), empty: sgxVolumeEmpty(data), page: "https://www.sgx.com/securities/trading", source: "Singapore Exchange" };
|
|
21
|
+
}
|
|
22
|
+
if (venue === "JPX") {
|
|
23
|
+
const data = await apiClient.getJpxShortPositions(symbol);
|
|
24
|
+
return { rows: data.points.map(row => ({ ...row })), empty: jpxEmpty(data), page: data.page, source: data.source };
|
|
25
|
+
}
|
|
26
|
+
if (venue === "HKEX") {
|
|
27
|
+
const data = await apiClient.getSfcShortPositions(symbol);
|
|
28
|
+
return { rows: data.points.map(row => ({ ...row })), empty: sfcEmpty(data), page: data.page, source: data.source };
|
|
29
|
+
}
|
|
30
|
+
const data = await readExchangeBalances(apiClient, symbol, venue);
|
|
31
|
+
return { rows: data.points.map(row => ({ ...row })), empty: balanceEmpty(data), page: undefined, source: venue };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function ExchangePositionsPane({ symbol, venue, focused, width, height }: Pick<PaneProps, "focused" | "width" | "height"> & {symbol: string; venue: Venue}) {
|
|
35
|
+
const read = useCallback(() => loadReport(symbol, venue), [symbol, venue]);
|
|
36
|
+
const resource = useAsyncResource(read);
|
|
37
|
+
const [selectedId, setSelectedId] = useState<string | null>(null);
|
|
38
|
+
const data = resource.data;
|
|
39
|
+
const rows: ReportRow[] = data?.rows ?? [];
|
|
40
|
+
const current = rows.find(row => rowKey(row) === selectedId) ?? rows[0];
|
|
41
|
+
const hk = venue === "HKEX";
|
|
42
|
+
const columns = (hk ? sfcColumns : venue === "SGX" ? sgxVolumeColumns : venue === "JPX" ? jpxColumns : balanceColumns(venue)).map(column => ({
|
|
43
|
+
id: column.key, label: column.header, width: column.width, align: "align" in column ? column.align : "left" as const,
|
|
44
|
+
}));
|
|
45
|
+
usePaneRefreshKey(resource.reload, { focused });
|
|
46
|
+
usePaneStatusLinkFooter({ registrationId: "exchange-short-positions", focused, loading: resource.loading, error: resource.error,
|
|
47
|
+
label: hk ? "weekly report" : "daily report", source: data?.source, url: current?.sourceUrl ?? data?.page, showOpenHint: !!(current || data?.page) });
|
|
48
|
+
return <PaneStatusBody loading={resource.loading && !data} error={data ? null : resource.error} subject={venue === "SGX" ? "SGX executed short sales" : hk ? "SFC reportable short positions" : venue === "JPX" ? "JPX short seller disclosures" : "Short sale balances"}
|
|
49
|
+
empty={!!data && !rows.length} emptyTitle={data?.empty}>
|
|
50
|
+
<DataTableView focused={focused} rootWidth={width} rootHeight={height} freezeFirstColumn columns={columns} items={rows}
|
|
51
|
+
selection={{ kind: "id", selectedId: current ? rowKey(current) : null, getId: rowKey, onChange: setSelectedId }}
|
|
52
|
+
emptyStateTitle={data?.empty ?? "No reported positions."} sortColumnId="day" sortDirection="desc" getItemKey={rowKey}
|
|
53
|
+
renderCell={(row, column) => ({ text: sfcValue(row[column.id]), value: row[column.id] ?? null })} />
|
|
54
|
+
</PaneStatusBody>;
|
|
55
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { jpxReport, jpxSymbol } from "./jpx";
|
|
2
|
+
import { balanceListing, balanceReport, readExchangeBalances } from "./exchange-balances";
|
|
3
|
+
import { sfcSymbol, sfcReport } from "./sfc";
|
|
1
4
|
import type {
|
|
2
5
|
HeadlessPaneColumn,
|
|
3
6
|
HeadlessPaneContext,
|
|
@@ -75,7 +78,7 @@ export function createShortInterestHeadless(
|
|
|
75
78
|
argument: {
|
|
76
79
|
kind: "ticker",
|
|
77
80
|
placeholder: "ticker",
|
|
78
|
-
description: "US
|
|
81
|
+
description: "Equity ticker for the US, mainland China, Hong Kong, Japan, Korea or Taiwan.",
|
|
79
82
|
},
|
|
80
83
|
discovery: {
|
|
81
84
|
limitations: [
|
|
@@ -83,6 +86,7 @@ export function createShortInterestHeadless(
|
|
|
83
86
|
"Percent of float is each settlement's shares short over the float of its day: the 10-K or 10-Q share count known when FINRA published it, at the part of today's count that floats; the latest is over the current float. A settlement no count was known for stays blank.",
|
|
84
87
|
],
|
|
85
88
|
},
|
|
89
|
+
additionalListingVenues: ["HKEX", "JPX", "TWSE", "TPEX", "SSE", "SZSE", "KRX", "KOSDAQ"],
|
|
86
90
|
usListingsOnly: "FINRA short interest",
|
|
87
91
|
// FINRA's settlements count OTC securities' shares short too: 0700.HK is offered TCEHY.
|
|
88
92
|
usListingsOtc: true,
|
|
@@ -99,7 +103,7 @@ export function createShortInterestHeadless(
|
|
|
99
103
|
key: "asOf",
|
|
100
104
|
type: "string",
|
|
101
105
|
placeholder: "date",
|
|
102
|
-
description: `Only
|
|
106
|
+
description: `Only FINRA settlements published or exchange reports observed by this date, as ${DATE_OPTION_EXAMPLES}.`,
|
|
103
107
|
normalize: (value) => isoDateOption(value, "as-of"),
|
|
104
108
|
},
|
|
105
109
|
{
|
|
@@ -117,6 +121,15 @@ export function createShortInterestHeadless(
|
|
|
117
121
|
describe: (args) => `Short Interest | ${args.symbols[0]}`,
|
|
118
122
|
async load(args, ctx) {
|
|
119
123
|
const symbol = args.symbols[0]!;
|
|
124
|
+
const balances = balanceListing(symbol);
|
|
125
|
+
const cutoff = typeof args.options.asOf === "string" ? args.options.asOf : undefined;
|
|
126
|
+
const jp = jpxSymbol(symbol);
|
|
127
|
+
if (jp) return jpxReport(await ctx.apiClient.getJpxShortPositions(jp, cutoff), args, cutoff);
|
|
128
|
+
if (balances) return balanceReport(await readExchangeBalances(ctx.apiClient, balances.symbol, balances.exchange, cutoff), args, cutoff);
|
|
129
|
+
const hk = sfcSymbol(symbol);
|
|
130
|
+
if (hk) {
|
|
131
|
+
return sfcReport(await ctx.apiClient.getSfcShortPositions(hk, cutoff), args, cutoff);
|
|
132
|
+
}
|
|
120
133
|
const loaded = await dependencies.loadRecords(symbol, args, ctx);
|
|
121
134
|
const { records, source, cloudSessionRequired } = Array.isArray(loaded)
|
|
122
135
|
? { records: loaded, source: undefined, cloudSessionRequired: false }
|