gloomberb 0.20.3 → 0.20.5
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.md +2 -0
- package/bin/gloom +9 -0
- package/bin/without-bun.cjs +98 -0
- package/package.json +3 -1
- package/src/account/auth-dialog.tsx +17 -0
- package/src/api-client/data.ts +144 -35
- package/src/api-client/fx-interventions.ts +64 -0
- package/src/api-client/index.ts +1 -0
- package/src/api-client/release-summaries.ts +21 -0
- package/src/api-client/types/econ.ts +12 -0
- package/src/api-client/yield-curves.ts +1 -1
- package/src/app/global-shortcuts.ts +4 -1
- package/src/app/keybindings/actions.ts +8 -2
- package/src/app/keybindings/config.ts +2 -1
- package/src/app/keybindings/index.ts +1 -0
- package/src/app/keybindings/labels.ts +6 -1
- package/src/app/keybindings/resolve.ts +23 -4
- package/src/app/keybindings/terminal-keys.ts +35 -0
- package/src/app/pane-runtime/index.tsx +2 -2
- package/src/app/pane-runtime/ticker-open-runtime.ts +274 -67
- package/src/architecture/ui-literals-allowlist.json +1 -1
- package/src/capabilities/chart-series.ts +27 -1
- package/src/cli/commands/keybindings.ts +5 -5
- package/src/cli/commands/market.ts +154 -21
- package/src/cli/commands/news-search.ts +60 -10
- package/src/cli/commands/overview.ts +16 -1
- package/src/cli/commands/plugins.ts +27 -5
- package/src/cli/commands/remote.ts +16 -17
- package/src/cli/commands/system.ts +20 -4
- package/src/cli/commands/ticker.ts +60 -19
- package/src/cli/fx-forward.ts +25 -7
- package/src/cli/glossary.ts +19 -5
- package/src/cli/history-rows.ts +5 -3
- package/src/cli/index.ts +8 -8
- package/src/cli/known-gaps.ts +27 -1
- package/src/cli/listing-arg.ts +11 -1
- package/src/cli/name-entries.ts +5 -1
- package/src/cli/not-a-ticker.ts +4 -0
- package/src/cli/pane-functions/function-help.ts +5 -5
- package/src/cli/report-tables.ts +18 -6
- package/src/cli/result.ts +15 -7
- package/src/cli/types.ts +2 -0
- package/src/components/chart/composite/axis-overlays.tsx +22 -0
- package/src/components/chart/composite/composite-chart.tsx +54 -13
- package/src/components/chart/composite/event-captions.ts +109 -0
- package/src/components/chart/composite/event-guides.ts +74 -0
- package/src/components/chart/composite/rasterizer.ts +2 -0
- package/src/components/chart/composite/text-renderer.ts +2 -0
- package/src/components/chart/composite/types.ts +31 -0
- package/src/components/command-bar/layout-items/focused-pane.ts +5 -5
- package/src/components/command-bar/pane-settings.ts +2 -2
- package/src/components/command-bar/routes/root/provider-search.ts +5 -4
- package/src/components/command-bar/routes/root/results.ts +6 -2
- package/src/components/command-bar/routes/ticker-search/results.ts +51 -0
- package/src/components/command-bar/routes/ticker-search/route.ts +3 -2
- package/src/components/input-search-bar.tsx +9 -2
- package/src/components/layout/detached-pane-shell.tsx +1 -1
- package/src/components/layout/floating-pane.tsx +5 -1
- package/src/components/layout/pane/footer/index.tsx +21 -14
- package/src/components/layout/pane/footer/model.ts +6 -0
- package/src/components/layout/pane/header.tsx +2 -0
- package/src/components/layout/shell/action-menu-overlay.tsx +10 -5
- package/src/components/layout/shell/active-drag.ts +149 -105
- package/src/components/layout/shell/drag/drop-zones.ts +162 -0
- package/src/components/layout/shell/drag/index.ts +47 -218
- package/src/components/layout/shell/drag/live.ts +10 -3
- package/src/components/layout/shell/drag/overlays.tsx +182 -5
- package/src/components/layout/shell/drag/runtime.ts +29 -6
- package/src/components/layout/shell/drag/shared-edges.ts +156 -0
- package/src/components/layout/shell/index.tsx +11 -6
- package/src/components/layout/shell/menu.ts +11 -2
- package/src/components/layout/shell/native/pointer-runtime.ts +25 -0
- package/src/components/layout/shell/native/window-state.ts +2 -2
- package/src/components/layout/shell/pane/capture.ts +4 -1
- package/src/components/layout/shell/pane/layers.tsx +71 -7
- package/src/components/layout/shell/terminal-pointer-runtime.ts +18 -9
- package/src/components/layout/shell/window-mode/index.ts +8 -10
- package/src/components/layout/status-bar.tsx +6 -1
- package/src/components/layout/window-edit/mode.ts +39 -7
- package/src/components/layout/window-edit/presentation.ts +1 -1
- package/src/components/onboarding/first-run-workspace.ts +44 -2
- package/src/components/onboarding/onboarding-frame.tsx +11 -2
- package/src/components/onboarding/onboarding-keyboard.ts +20 -0
- package/src/components/onboarding/onboarding-wizard.tsx +16 -11
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +62 -1
- package/src/components/onboarding/use-onboarding-progress.ts +12 -4
- package/src/components/pane-settings-dialog/desktop.tsx +2 -2
- package/src/components/pane-settings-dialog/tui.tsx +2 -2
- package/src/components/pane-settings-dialog/value.ts +6 -0
- package/src/components/pane-settings-dialog.tsx +3 -3
- package/src/components/reader/detail-reader.tsx +4 -0
- package/src/components/ui/button.tsx +2 -0
- package/src/components/ui/choice-dialog.tsx +1 -0
- package/src/components/ui/data-table/index.tsx +4 -3
- package/src/components/ui/index.ts +1 -1
- package/src/components/ui/list-view.tsx +7 -12
- package/src/components/ui/loading.tsx +10 -3
- package/src/components/ui/menu.tsx +6 -2
- package/src/components/ui/page-stack-view.tsx +3 -0
- package/src/components/ui/pane-link-chip.tsx +269 -54
- package/src/components/ui/query-bar.tsx +2 -1
- package/src/components/ui/quote.ts +14 -1
- package/src/components/ui/tabs.tsx +97 -19
- package/src/core/state/app/layout-reducer.ts +7 -0
- package/src/core/state/app/layout.ts +44 -7
- package/src/core/state/app/state.ts +1 -1
- package/src/core/state/app/types.ts +22 -2
- package/src/data/config/layout.ts +5 -2
- package/src/docs/snapshot.json +54 -13
- package/src/i18n/es.ts +9 -8
- package/src/i18n/ja.ts +9 -8
- package/src/i18n/ko.ts +9 -8
- package/src/i18n/zh-cn.ts +9 -8
- package/src/i18n/zh-tw.ts +9 -8
- package/src/layout/pane-manager/floating-actions.ts +17 -0
- package/src/layout/pane-manager/floating-stack.ts +187 -0
- package/src/layout/pane-manager/floating.ts +4 -2
- package/src/layout/pane-manager/gridlock.ts +5 -1
- package/src/layout/pane-manager/index.ts +11 -0
- package/src/layout/pane-manager/layout-state.ts +10 -3
- package/src/market-data/depositary-pair.ts +5 -3
- package/src/market-data/futures-board.ts +46 -1
- package/src/market-data/futures-contract.ts +12 -3
- package/src/market-data/fx-interventions.ts +270 -0
- package/src/market-data/market/dated-previous-close.ts +94 -15
- package/src/market-data/market/status.ts +17 -1
- package/src/news/news-model.ts +44 -2
- package/src/plugins/builtin/alerts/cli.ts +4 -4
- package/src/plugins/builtin/alerts/format.ts +1 -2
- package/src/plugins/builtin/alerts/headless.ts +1 -2
- package/src/plugins/builtin/alerts/move-checks.ts +12 -6
- package/src/plugins/builtin/alerts/move.ts +30 -9
- package/src/plugins/builtin/alerts/pane.tsx +0 -2
- package/src/plugins/builtin/alerts/storage.ts +4 -2
- package/src/plugins/builtin/alerts/types.ts +12 -0
- package/src/plugins/builtin/analytics/risk-client.ts +10 -4
- package/src/plugins/builtin/analytics/risk-episodes.ts +5 -4
- package/src/plugins/builtin/analytics/risk-headless.ts +4 -2
- package/src/plugins/builtin/analytics/risk-sectors.ts +91 -0
- package/src/plugins/builtin/awards/index.tsx +1 -1
- package/src/plugins/builtin/buildout/index.tsx +1 -0
- package/src/plugins/builtin/catalysts/index.tsx +2 -2
- package/src/plugins/builtin/cds/headless.ts +4 -0
- package/src/plugins/builtin/changelog/index.tsx +292 -101
- package/src/plugins/builtin/changelog/versions.ts +293 -0
- package/src/plugins/builtin/chart-composer/headless.ts +2 -1
- package/src/plugins/builtin/chart-composer/index.tsx +1 -0
- package/src/plugins/builtin/chart-composer/intervention-events.ts +105 -0
- package/src/plugins/builtin/chart-composer/pane.tsx +21 -7
- package/src/plugins/builtin/chat/content/composer.tsx +5 -4
- package/src/plugins/builtin/chat/content/index.tsx +12 -2
- package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -3
- package/src/plugins/builtin/chat/content/open-targets.ts +3 -3
- package/src/plugins/builtin/chat/layout.ts +5 -2
- package/src/plugins/builtin/chat/message/pane-chip.tsx +61 -40
- package/src/plugins/builtin/chat/message/render-state.ts +2 -5
- package/src/plugins/builtin/chat/message/terminal.tsx +13 -15
- package/src/plugins/builtin/chat/pane-links/previews.ts +51 -5
- package/src/plugins/builtin/chat/pane-links/share-card.ts +36 -0
- package/src/plugins/builtin/cloud/askg/attached-pane.tsx +10 -5
- package/src/plugins/builtin/cloud/askg/controller.ts +141 -5
- package/src/plugins/builtin/cloud/askg/executor.ts +113 -4
- package/src/plugins/builtin/cloud/askg/manifest.ts +28 -13
- package/src/plugins/builtin/cloud/askg/model.ts +14 -4
- package/src/plugins/builtin/cloud/askg/pane.tsx +70 -46
- package/src/plugins/builtin/cloud/askg/tool-display.ts +1 -0
- package/src/plugins/builtin/cloud/askg/turn-parts.tsx +70 -0
- package/src/plugins/builtin/cloud/terminal-relay/engine.ts +50 -130
- package/src/plugins/builtin/cloud/terminal-relay/policy.ts +327 -7
- package/src/plugins/builtin/cloud/terminal-relay/prompts.tsx +2 -1
- package/src/plugins/builtin/cloud/terminal-relay/redact.ts +52 -9
- package/src/plugins/builtin/commodities-energy/index.tsx +1 -3
- package/src/plugins/builtin/commodities-energy/view-state.ts +3 -0
- package/src/plugins/builtin/commodity-balances/index.tsx +1 -0
- package/src/plugins/builtin/company-attention/index.tsx +1 -1
- package/src/plugins/builtin/company-kpis/headless.ts +3 -1
- package/src/plugins/builtin/company-kpis/index.tsx +2 -2
- package/src/plugins/builtin/cot/headless.ts +14 -2
- package/src/plugins/builtin/cot/index.tsx +1 -1
- package/src/plugins/builtin/cpi/index.tsx +1 -1
- package/src/plugins/builtin/crypto-board/index.tsx +1 -0
- package/src/plugins/builtin/dividend-yield/index.tsx +1 -0
- package/src/plugins/builtin/doe/index.tsx +1 -1
- package/src/plugins/builtin/earnings/index.tsx +2 -2
- package/src/plugins/builtin/earnings-calls/headless.ts +5 -1
- package/src/plugins/builtin/earnings-calls/index.tsx +1 -0
- package/src/plugins/builtin/econ/calendar-model.ts +74 -1
- package/src/plugins/builtin/econ/fred-catalog.ts +3 -1
- package/src/plugins/builtin/econ/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +6 -0
- package/src/plugins/builtin/estimate-revisions/index.tsx +1 -0
- package/src/plugins/builtin/executives/index.tsx +1 -0
- package/src/plugins/builtin/filing-events/index.tsx +1 -0
- package/src/plugins/builtin/fixed-income/index.tsx +1 -0
- package/src/plugins/builtin/futures/index.tsx +25 -4
- package/src/plugins/builtin/futures/model.ts +28 -32
- package/src/plugins/builtin/futures/series.ts +4 -3
- package/src/plugins/builtin/futures/table.tsx +16 -9
- package/src/plugins/builtin/futures/use-board-terms.ts +3 -3
- package/src/plugins/builtin/futures-curve/headless.ts +3 -3
- package/src/plugins/builtin/futures-curve/index.tsx +1 -1
- package/src/plugins/builtin/futures-curve/model.ts +18 -0
- package/src/plugins/builtin/gpu/index.tsx +1 -1
- package/src/plugins/builtin/help/functions-table.tsx +1 -1
- package/src/plugins/builtin/help/index.tsx +14 -4
- package/src/plugins/builtin/help/keybindings-editor.tsx +19 -5
- package/src/plugins/builtin/holders/index.tsx +1 -0
- package/src/plugins/builtin/holders/report-header.ts +2 -2
- package/src/plugins/builtin/insider/index.tsx +1 -0
- package/src/plugins/builtin/iv-history/index.tsx +1 -1
- package/src/plugins/builtin/jobs/index.tsx +1 -0
- package/src/plugins/builtin/layout-manager/index.tsx +8 -8
- package/src/plugins/builtin/macro-day/headless.ts +27 -8
- package/src/plugins/builtin/macro-day/index.tsx +1 -1
- package/src/plugins/builtin/macro-day/model.ts +19 -3
- package/src/plugins/builtin/macro-day/pane.tsx +14 -9
- package/src/plugins/builtin/macro-day/releases.ts +25 -7
- package/src/plugins/builtin/market-valuation/index.tsx +1 -0
- package/src/plugins/builtin/market-valuation/pane.tsx +8 -0
- package/src/plugins/builtin/members/index.tsx +1 -1
- package/src/plugins/builtin/mna/index.tsx +1 -0
- package/src/plugins/builtin/news/headless.ts +2 -2
- package/src/plugins/builtin/news/index.tsx +4 -3
- package/src/plugins/builtin/news/wire/index.tsx +5 -1
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +4 -0
- package/src/plugins/builtin/news/wire/news/list-search.ts +5 -2
- package/src/plugins/builtin/options/index.tsx +1 -0
- package/src/plugins/builtin/options-positioning/index.tsx +1 -0
- package/src/plugins/builtin/pe-band/index.tsx +1 -1
- package/src/plugins/builtin/perps/markets-section.tsx +5 -2
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +11 -11
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +25 -0
- package/src/plugins/builtin/portfolio-list/headless.ts +15 -6
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +3 -1
- package/src/plugins/builtin/power/index.tsx +1 -1
- package/src/plugins/builtin/realized-vol/index.tsx +1 -1
- package/src/plugins/builtin/research/event-model.ts +9 -1
- package/src/plugins/builtin/research/event-sources.ts +22 -0
- package/src/plugins/builtin/research/headless.ts +11 -5
- package/src/plugins/builtin/research/index.tsx +4 -0
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/research-search/pane.tsx +8 -0
- package/src/plugins/builtin/revenue-breakdown/index.tsx +1 -0
- package/src/plugins/builtin/reverse-dcf/index.tsx +1 -1
- package/src/plugins/builtin/risk-factors/index.tsx +1 -0
- package/src/plugins/builtin/scanner/headless.ts +52 -13
- package/src/plugins/builtin/seasonality/index.tsx +1 -1
- package/src/plugins/builtin/sec/index.tsx +1 -0
- package/src/plugins/builtin/series-inventory.ts +1 -1
- package/src/plugins/builtin/shared/cloud-upgrade.ts +27 -3
- package/src/plugins/builtin/shared/scanner-capture.ts +11 -3
- package/src/plugins/builtin/shared/series-list-detail.tsx +5 -0
- package/src/plugins/builtin/short-interest/index.tsx +1 -0
- package/src/plugins/builtin/social-mentions/index.tsx +1 -1
- package/src/plugins/builtin/supply-chain/index.tsx +1 -0
- package/src/plugins/builtin/thirteenf/data.ts +43 -10
- package/src/plugins/builtin/thirteenf/headless.ts +55 -11
- package/src/plugins/builtin/thirteenf/model.ts +25 -9
- package/src/plugins/builtin/thirteenf/report-notes.ts +27 -6
- package/src/plugins/builtin/thirteenf/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +1 -1
- package/src/plugins/builtin/ticker-detail/financials/model.ts +12 -0
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +5 -5
- package/src/plugins/builtin/ticker-detail/headless.ts +18 -13
- package/src/plugins/builtin/ticker-detail/index.tsx +4 -0
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +54 -5
- package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +34 -17
- package/src/plugins/builtin/ticker-detail/pane.tsx +7 -2
- package/src/plugins/builtin/time-sales/client.ts +9 -11
- package/src/plugins/builtin/time-sales/index.tsx +1 -1
- package/src/plugins/builtin/treasury-auctions/after.ts +267 -0
- package/src/plugins/builtin/treasury-auctions/cache.ts +18 -3
- package/src/plugins/builtin/treasury-auctions/client.ts +33 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +109 -19
- package/src/plugins/builtin/treasury-auctions/index.tsx +14 -4
- package/src/plugins/builtin/treasury-auctions/model.ts +256 -28
- package/src/plugins/builtin/treasury-auctions/pane.tsx +139 -28
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +5 -2
- package/src/plugins/builtin/treasury-auctions/types.ts +7 -1
- package/src/plugins/builtin/vol-surface/index.tsx +1 -1
- package/src/plugins/builtin/world-venue-map/index.ts +1 -0
- package/src/plugins/builtin/yield-curve/curves.ts +10 -4
- package/src/plugins/builtin/yield-curve/headless.ts +6 -2
- package/src/plugins/builtin/yield-curve/index.tsx +3 -3
- package/src/plugins/builtin/yield-curve/series.ts +10 -0
- package/src/plugins/builtin/yield-curve/world.ts +3 -1
- package/src/plugins/installer.ts +45 -0
- package/src/portfolio/column-values.ts +2 -1
- package/src/public/__snapshots__/public-api.test.ts.snap +4 -0
- package/src/public/remote.ts +7 -1
- package/src/remote/client.ts +191 -11
- package/src/remote/controller-utils.ts +13 -1
- package/src/remote/controller.ts +88 -26
- package/src/remote/endpoint.ts +24 -0
- package/src/remote/form.ts +59 -4
- package/src/remote/resources.ts +56 -19
- package/src/remote/schema.ts +22 -9
- package/src/remote/secrets.ts +12 -0
- package/src/remote/semantic-helpers.ts +29 -1
- package/src/remote/semantic-tree.tsx +44 -15
- package/src/remote/server.ts +2 -1
- package/src/remote/surface.tsx +192 -0
- package/src/remote/types.ts +5 -0
- package/src/renderers/cloudflare/worker.ts +16 -1
- package/src/renderers/dom/styles.css +40 -6
- package/src/renderers/opentui/host.tsx +6 -0
- package/src/renderers/share/layout-view.tsx +1 -1
- package/src/series/standalone.ts +2 -2
- package/src/shares/api.ts +21 -4
- package/src/shares/item.ts +73 -0
- package/src/shares/pane-item.ts +205 -0
- package/src/shares/pane.ts +4 -0
- package/src/shares/payload.ts +9 -5
- package/src/sources/gloomberb-cloud/news.ts +37 -12
- package/src/state/opening-ticker-panes.ts +47 -0
- package/src/test-support/cli-context.ts +2 -0
- package/src/test-support/preload.ts +4 -1
- package/src/tickers/instrument-kind.ts +23 -3
- package/src/tickers/renamed-listings.ts +105 -0
- package/src/tickers/search/index.ts +103 -16
- package/src/time-series/resolve.ts +2 -2
- package/src/types/config.ts +5 -0
- package/src/types/context-menu.ts +2 -0
- package/src/types/financials.ts +1 -0
- package/src/types/plugin-commands.ts +140 -0
- package/src/types/plugin-context.ts +125 -0
- package/src/types/plugin-contributions.ts +55 -0
- package/src/types/plugin-definition.ts +234 -0
- package/src/types/plugin-notifications.ts +38 -0
- package/src/types/plugin-pane-settings.ts +116 -0
- package/src/types/plugin-pane-templates.ts +160 -0
- package/src/types/plugin-panes.ts +243 -0
- package/src/types/plugin-reports.ts +35 -0
- package/src/types/plugin-shared.ts +14 -0
- package/src/types/plugin-state.ts +71 -0
- package/src/types/plugin.ts +14 -1169
- package/src/ui/index.tsx +14 -3
- package/src/updater/github-releases.ts +23 -0
- package/src/utils/central-banks.ts +86 -1
- package/src/utils/cli-output.ts +22 -9
- package/src/utils/datetime-format.ts +12 -3
- package/src/utils/depositary-receipt.ts +28 -3
- package/src/utils/fundamentals.ts +14 -0
- package/src/utils/max-drawdown.ts +97 -16
- package/src/utils/untrusted-text.ts +29 -0
|
@@ -29,28 +29,40 @@ import { useAsyncResource } from "../../../react/async-resource";
|
|
|
29
29
|
import { useAutoRefresh } from "../../../react/auto-refresh";
|
|
30
30
|
import { useCommandValue } from "../shared/command-tab";
|
|
31
31
|
import { FIXED_INCOME_PANE_ID } from "../fixed-income/model";
|
|
32
|
+
import {
|
|
33
|
+
afterLoadWindow, afterWindowStart, AUCTION_VIEWS, loadAuctionCurves, projectAuctionAfter, widerAfterWindow, type AuctionAfter, type AuctionView,
|
|
34
|
+
} from "./after";
|
|
32
35
|
import { loadTreasuryAuctions } from "./cache";
|
|
36
|
+
import type { AuctionHistoryWindow } from "./client";
|
|
33
37
|
import {
|
|
38
|
+
AUCTION_AFTER_SORT_COLUMN_IDS,
|
|
34
39
|
AUCTION_FILTERS,
|
|
35
40
|
AUCTION_SEARCH_FIELDS,
|
|
36
41
|
AUCTION_SORT_COLUMN_IDS,
|
|
42
|
+
AUCTION_SORT_NAMES,
|
|
37
43
|
DEFAULT_AUCTION_SORT,
|
|
38
44
|
auctionDatesShowYear,
|
|
39
45
|
auctionHistoryPhrase,
|
|
40
46
|
auctionHistoryWindow,
|
|
41
47
|
auctionSize,
|
|
48
|
+
auctionSortColumn,
|
|
42
49
|
buildAuctionColumns,
|
|
43
50
|
dealerPct,
|
|
44
51
|
directPct,
|
|
45
52
|
firstAuctionSortDirection,
|
|
46
53
|
formatAuctionRate,
|
|
47
54
|
indirectPct,
|
|
55
|
+
isAfterColumn,
|
|
56
|
+
isBill,
|
|
48
57
|
isPendingAuction,
|
|
49
58
|
nextAuctionHistoryWindow,
|
|
50
59
|
nextFilter,
|
|
51
60
|
rateLabel,
|
|
52
61
|
rateValue,
|
|
53
|
-
|
|
62
|
+
middleRateLabel,
|
|
63
|
+
publishesMedian,
|
|
64
|
+
stopOutLabel,
|
|
65
|
+
stopOutVsAvgBp,
|
|
54
66
|
visibleAuctions,
|
|
55
67
|
type AuctionColumn,
|
|
56
68
|
type AuctionColumnId,
|
|
@@ -81,11 +93,18 @@ function formatPct(value: number | null, auction?: TreasuryAuction): string {
|
|
|
81
93
|
return `${value.toFixed(1)}%`;
|
|
82
94
|
}
|
|
83
95
|
|
|
84
|
-
/** The stop-out against the
|
|
96
|
+
/** The stop-out against the median reads in basis points, like an FRN margin. */
|
|
85
97
|
function formatBp(value: number | null): string {
|
|
86
98
|
return value == null ? "—" : `${value.toFixed(1)}bp`;
|
|
87
99
|
}
|
|
88
100
|
|
|
101
|
+
/** A yield's move after the auction, in whole bp under a header that says bp; blank until the session is in. */
|
|
102
|
+
function formatMove(value: number | null): string {
|
|
103
|
+
return value == null ? "" : `${value > 0 ? "+" : ""}${value.toFixed(0)}`;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const VIEW_OPTIONS = AUCTION_VIEWS.map((value) => ({ value, label: value === "after" ? "After" : "Results" }));
|
|
107
|
+
|
|
89
108
|
function formatMoney(value: number | null): string {
|
|
90
109
|
return value == null ? "—" : `$${formatCompact(value)}`;
|
|
91
110
|
}
|
|
@@ -118,6 +137,7 @@ function renderAuctionCell(
|
|
|
118
137
|
column: AuctionColumn,
|
|
119
138
|
rowState: { selected: boolean },
|
|
120
139
|
showYear: boolean,
|
|
140
|
+
after: AuctionAfter | undefined,
|
|
121
141
|
): DataTableCell {
|
|
122
142
|
const selected = rowState.selected ? colors.selectedText : undefined;
|
|
123
143
|
const dimmed = selected ?? colors.textDim;
|
|
@@ -144,7 +164,7 @@ function renderAuctionCell(
|
|
|
144
164
|
? { text: RESULTS_PENDING, color: dimmed }
|
|
145
165
|
: { text: formatAuctionRate(auction, rateValue(auction), "—"), color: selected ?? colors.textBright };
|
|
146
166
|
case "stopOut":
|
|
147
|
-
return { text: formatBp(
|
|
167
|
+
return { text: formatBp(stopOutVsAvgBp(auction)), color: selected ?? colors.text };
|
|
148
168
|
case "btc":
|
|
149
169
|
return { text: formatRatio(auction.bidToCoverRatio, auction), color: selected ?? colors.text };
|
|
150
170
|
case "indirect":
|
|
@@ -155,11 +175,26 @@ function renderAuctionCell(
|
|
|
155
175
|
return { text: formatPct(dealerPct(auction), auction), color: selected ?? colors.text };
|
|
156
176
|
case "size":
|
|
157
177
|
return { text: formatMoney(auctionSize(auction)), color: dimmed };
|
|
178
|
+
case "cusip":
|
|
179
|
+
return { text: auction.cusip ?? "", color: dimmed };
|
|
180
|
+
case "btcPctl":
|
|
181
|
+
case "indirectPctl":
|
|
182
|
+
case "dealerPctl": {
|
|
183
|
+
const key = column.id === "btcPctl" ? "btcPercentile" : column.id === "indirectPctl" ? "indirectPercentile" : "dealerPercentile";
|
|
184
|
+
const value = after?.[key] ?? null;
|
|
185
|
+
return { text: value == null ? "" : String(value), value, color: selected ?? colors.text };
|
|
186
|
+
}
|
|
187
|
+
case "after1d":
|
|
188
|
+
case "after5d":
|
|
189
|
+
case "after20d": {
|
|
190
|
+
const value = after?.[column.id] ?? null;
|
|
191
|
+
return { text: formatMove(value), value, color: selected ?? colors.text };
|
|
192
|
+
}
|
|
158
193
|
}
|
|
159
194
|
}
|
|
160
195
|
|
|
161
196
|
|
|
162
|
-
function TreasuryAuctionDetail({ auction, width }: { auction: TreasuryAuction; width: number }) {
|
|
197
|
+
function TreasuryAuctionDetail({ auction, width, after }: { auction: TreasuryAuction; width: number; after?: AuctionAfter }) {
|
|
163
198
|
const share = (value: number | null, total: number | null): string => (
|
|
164
199
|
value == null || !total ? formatMoney(value) : `${formatMoney(value)} (${((value / total) * 100).toFixed(1)}%)`
|
|
165
200
|
);
|
|
@@ -174,16 +209,22 @@ function TreasuryAuctionDetail({ auction, width }: { auction: TreasuryAuction; w
|
|
|
174
209
|
</Box>
|
|
175
210
|
<Box height={1} />
|
|
176
211
|
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label={rateLabel(auction)} value={formatAuctionRate(auction, rateValue(auction), "—")} />
|
|
212
|
+
{isBill(auction) && auction.highDiscountRate != null && (
|
|
213
|
+
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="High discount rate" value={formatRate(auction.highDiscountRate)} />
|
|
214
|
+
)}
|
|
215
|
+
{isBill(auction) && auction.avgMedDiscountRate != null && (
|
|
216
|
+
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label={middleRateLabel(auction, "discount rate")} value={formatRate(auction.avgMedDiscountRate)} />
|
|
217
|
+
)}
|
|
177
218
|
{auction.avgMedYield != null && (
|
|
178
|
-
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="
|
|
219
|
+
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label={middleRateLabel(auction, "yield")} value={formatRate(auction.avgMedYield)} />
|
|
179
220
|
)}
|
|
180
|
-
{
|
|
181
|
-
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label=
|
|
221
|
+
{stopOutVsAvgBp(auction) != null && (
|
|
222
|
+
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label={stopOutLabel(auction)} value={formatBp(stopOutVsAvgBp(auction))} />
|
|
182
223
|
)}
|
|
183
224
|
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Bid-to-cover" value={formatRatio(auction.bidToCoverRatio)} />
|
|
184
225
|
<Box height={1} />
|
|
185
226
|
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="High price" value={auction.highPrice?.toFixed(4) ?? "—"} />
|
|
186
|
-
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="
|
|
227
|
+
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label={publishesMedian(auction) ? "Median price" : "Average price"} value={auction.avgMedPrice?.toFixed(4) ?? "—"} />
|
|
187
228
|
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Low price" value={auction.lowPrice?.toFixed(4) ?? "—"} />
|
|
188
229
|
<Box height={1} />
|
|
189
230
|
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Offering" value={formatMoney(auction.offeringAmount)} />
|
|
@@ -192,6 +233,16 @@ function TreasuryAuctionDetail({ auction, width }: { auction: TreasuryAuction; w
|
|
|
192
233
|
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Indirect" value={share(auction.indirectAccepted, auction.competitiveAccepted)} />
|
|
193
234
|
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Direct" value={share(auction.directAccepted, auction.competitiveAccepted)} />
|
|
194
235
|
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Primary dealer" value={share(auction.primaryDealerAccepted, auction.competitiveAccepted)} />
|
|
236
|
+
{after && <>
|
|
237
|
+
<Box height={1} />
|
|
238
|
+
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="B/C percentile" value={after.btcPercentile == null ? "—" : String(after.btcPercentile)} />
|
|
239
|
+
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Indirect percentile" value={after.indirectPercentile == null ? "—" : String(after.indirectPercentile)} />
|
|
240
|
+
<KeyValueRow labelWidth={22} width={Math.max(1, width - 2)} emphasis={false} label="Dealer percentile" value={after.dealerPercentile == null ? "—" : String(after.dealerPercentile)} />
|
|
241
|
+
{after.cmt && ([[1, after.after1d], [5, after.after5d], [20, after.after20d]] as const).map(([sessions, value]) => (
|
|
242
|
+
<KeyValueRow key={sessions} labelWidth={22} width={Math.max(1, width - 2)} emphasis={false}
|
|
243
|
+
label={`${after.cmt} yield +${sessions}d`} value={value == null ? "—" : `${formatMove(value)}bp`} />
|
|
244
|
+
))}
|
|
245
|
+
</>}
|
|
195
246
|
</Box>
|
|
196
247
|
</ScrollBox>
|
|
197
248
|
);
|
|
@@ -199,11 +250,52 @@ function TreasuryAuctionDetail({ auction, width }: { auction: TreasuryAuction; w
|
|
|
199
250
|
|
|
200
251
|
const NO_AUCTIONS: TreasuryAuction[] = [];
|
|
201
252
|
|
|
253
|
+
/** A sort as kept in pane state and typed after --sort: the column's name, and `:asc` or `:desc` once the pane flips it. */
|
|
254
|
+
function readSort(value: string | null): AuctionSortPreference | null {
|
|
255
|
+
if (!value) return null;
|
|
256
|
+
const [name, direction] = value.split(":");
|
|
257
|
+
const columnId = auctionSortColumn(name ?? "");
|
|
258
|
+
if (!columnId) return null;
|
|
259
|
+
return { columnId, direction: direction === "asc" || direction === "desc" ? direction : firstAuctionSortDirection(columnId) };
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function writeSort(sort: AuctionSortPreference): string | null {
|
|
263
|
+
const name = AUCTION_SORT_NAMES.find((entry) => entry.column === sort.columnId)?.value;
|
|
264
|
+
return name ? `${name}:${sort.direction}` : null;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** A command's value for this pane's auctions tab, from `AUCT 7Y --view after` and the like. */
|
|
268
|
+
const auctionParam = (key: string) => (params: Readonly<Record<string, string>>) => params.view === "auctions" ? params[key] ?? null : null;
|
|
269
|
+
|
|
202
270
|
export function TreasuryAuctionsPane({ focused, width, height }: PaneProps) {
|
|
203
271
|
const historyDays = auctionHistoryWindow(usePaneInstance()?.settings);
|
|
272
|
+
const [viewChoice, setView] = useCommandValue<string>(FIXED_INCOME_PANE_ID, "view", auctionParam("auctionView"), "results");
|
|
273
|
+
const [sortValue, setSortValue] = useCommandValue<string | null>(FIXED_INCOME_PANE_ID, "sortColumn", auctionParam("auctionSort"), null);
|
|
274
|
+
const sortPreference = useMemo(() => readSort(sortValue) ?? DEFAULT_AUCTION_SORT, [sortValue]);
|
|
275
|
+
const setSortPreference = useCallback((next: AuctionSortPreference | ((current: AuctionSortPreference) => AuctionSortPreference)) => {
|
|
276
|
+
setSortValue(writeSort(typeof next === "function" ? next(readSort(sortValue) ?? DEFAULT_AUCTION_SORT) : next));
|
|
277
|
+
}, [setSortValue, sortValue]);
|
|
278
|
+
// A sort by an after column shows the after view, as `fn AUCT --sort btc-pctl` does.
|
|
279
|
+
const view: AuctionView = viewChoice === "after" || isAfterColumn(sortPreference.columnId) ? "after" : "results";
|
|
280
|
+
const [filter, setFilter] = useCommandValue<AuctionFilter>(FIXED_INCOME_PANE_ID, "activeTab",
|
|
281
|
+
(params) => AUCTION_FILTERS.find((entry) => entry.value === auctionParam("auctionFilter")(params))?.value ?? null, "all");
|
|
282
|
+
// `AUCT 10Y` opens on that search, as `fn AUCT 10Y` reads it; a later `AUCT 5Y` replaces it.
|
|
283
|
+
const [searchQuery, setSearchQuery] = useCommandValue(
|
|
284
|
+
FIXED_INCOME_PANE_ID,
|
|
285
|
+
"search",
|
|
286
|
+
(params) => params.view === "auctions" ? params.search ?? "" : null,
|
|
287
|
+
"",
|
|
288
|
+
);
|
|
289
|
+
// The after view reads more than it lists, until each listed tenor has its 24 before the oldest row
|
|
290
|
+
// (widerAfterWindow); the widening holds for one list, and a new search, group or window starts over.
|
|
291
|
+
const listKey = `${historyDays}|${filter}|${searchQuery}`;
|
|
292
|
+
const [widened, setWidened] = useState<{ key: string; window: AuctionHistoryWindow } | null>(null);
|
|
293
|
+
const loadWindow = view === "after"
|
|
294
|
+
? widened?.key === listKey ? widened.window : afterLoadWindow(historyDays)
|
|
295
|
+
: historyDays;
|
|
204
296
|
const loadAuctions = useCallback(
|
|
205
|
-
(force: boolean) => loadTreasuryAuctions(force, undefined,
|
|
206
|
-
[
|
|
297
|
+
(force: boolean) => loadTreasuryAuctions(force, undefined, loadWindow).then((result) => ({ ...result, window: loadWindow })),
|
|
298
|
+
[loadWindow],
|
|
207
299
|
);
|
|
208
300
|
// A new history window keeps the loaded auctions up until its own answer.
|
|
209
301
|
const resource = useAsyncResource(loadAuctions, { keepPreviousData: true });
|
|
@@ -216,25 +308,34 @@ export function TreasuryAuctionsPane({ focused, width, height }: PaneProps) {
|
|
|
216
308
|
const error = resource.error ?? (resource.loading || savedAt != null ? null : resource.data?.refreshError ?? null);
|
|
217
309
|
// Once auctions have loaded, a refresh runs without a loading state.
|
|
218
310
|
const loading = resource.loading && !resource.data;
|
|
219
|
-
const [filter, setFilter] = usePluginPaneState<AuctionFilter>("activeTab", "all");
|
|
220
311
|
const [selectedId, setSelectedId] = usePluginPaneState<string | null>("selectedId", null);
|
|
221
312
|
const [detailOpen, setDetailOpen] = usePluginPaneState<boolean>("detailOpen", false);
|
|
222
|
-
const [sortPreference, setSortPreference] = useState<AuctionSortPreference>(DEFAULT_AUCTION_SORT);
|
|
223
|
-
// `AUCT 10Y` opens on that search, as `fn AUCT 10Y` reads it; a later `AUCT 5Y` replaces it.
|
|
224
|
-
const [searchQuery, setSearchQuery] = useCommandValue(
|
|
225
|
-
FIXED_INCOME_PANE_ID,
|
|
226
|
-
"search",
|
|
227
|
-
(params) => params.view === "auctions" ? params.search ?? "" : null,
|
|
228
|
-
"",
|
|
229
|
-
);
|
|
230
313
|
const { active: searchFocused, focus: focusSearch, blur: blurSearch, searchProps } = useQueryBarSearch();
|
|
231
314
|
|
|
232
315
|
// The cache decides whether a tick becomes a request; only [r] forces it.
|
|
233
316
|
useAutoRefresh(stale ? null : fetchedAt, resource.load);
|
|
234
317
|
|
|
318
|
+
const listed = useMemo(
|
|
319
|
+
() => visibleAuctions(auctions, { filter, query: searchQuery, sort: DEFAULT_AUCTION_SORT,
|
|
320
|
+
...(view === "after" ? { from: afterWindowStart(historyDays) } : {}) }),
|
|
321
|
+
[auctions, filter, historyDays, searchQuery, view],
|
|
322
|
+
);
|
|
323
|
+
const loadedWindow = resource.data?.window ?? null;
|
|
324
|
+
useEffect(() => {
|
|
325
|
+
if (view !== "after" || loadedWindow !== loadWindow) return;
|
|
326
|
+
const wider = widerAfterWindow(listed, auctions, loadWindow);
|
|
327
|
+
if (wider) setWidened({ key: listKey, window: wider });
|
|
328
|
+
}, [auctions, listKey, listed, loadWindow, loadedWindow, view]);
|
|
329
|
+
const curvesFrom = afterWindowStart(historyDays) ?? null;
|
|
330
|
+
const loadCurves = useCallback(() => loadAuctionCurves(listed, curvesFrom), [curvesFrom, listed]);
|
|
331
|
+
const curves = useAsyncResource(view === "after" ? loadCurves : null, { keepPreviousData: true });
|
|
332
|
+
// Percentiles need only the board; the yield moves fill in when the curves arrive.
|
|
333
|
+
const after = useMemo(() => view === "after" ? projectAuctionAfter(listed, auctions, curves.data?.curves ?? new Map()) : null,
|
|
334
|
+
[auctions, curves.data, listed, view]);
|
|
335
|
+
const yieldsError = view === "after" ? curves.error ?? curves.data?.errors[0] ?? null : null;
|
|
235
336
|
const rows = useMemo(
|
|
236
|
-
() => visibleAuctions(
|
|
237
|
-
[
|
|
337
|
+
() => visibleAuctions(listed, { filter: "all", query: "", sort: sortPreference, ...(after ? { after } : {}) }),
|
|
338
|
+
[after, listed, sortPreference],
|
|
238
339
|
);
|
|
239
340
|
const selected = rows.find((auction) => auction.id === selectedId) ?? null;
|
|
240
341
|
|
|
@@ -257,15 +358,21 @@ export function TreasuryAuctionsPane({ focused, width, height }: PaneProps) {
|
|
|
257
358
|
setDetailOpen(false);
|
|
258
359
|
}, []);
|
|
259
360
|
const cycleFilter = useCallback(() => {
|
|
260
|
-
setFilter(
|
|
361
|
+
setFilter(nextFilter(filter));
|
|
261
362
|
setDetailOpen(false);
|
|
262
|
-
}, []);
|
|
363
|
+
}, [filter, setFilter]);
|
|
263
364
|
const cycleSort = useCallback((step: 1 | -1) => {
|
|
264
365
|
setSortPreference((current) => {
|
|
265
|
-
const next = cycleSortPreference<AuctionColumnId>(AUCTION_SORT_COLUMN_IDS, current, step);
|
|
366
|
+
const next = cycleSortPreference<AuctionColumnId>(view === "after" ? AUCTION_AFTER_SORT_COLUMN_IDS : AUCTION_SORT_COLUMN_IDS, current, step);
|
|
266
367
|
return { columnId: next.columnId ?? DEFAULT_AUCTION_SORT.columnId, direction: next.direction };
|
|
267
368
|
});
|
|
268
|
-
}, []);
|
|
369
|
+
}, [setSortPreference, view]);
|
|
370
|
+
const selectView = useCallback((next: AuctionView) => {
|
|
371
|
+
setView(next);
|
|
372
|
+
// A sort the next view has no column for goes back to the newest first.
|
|
373
|
+
const columns = next === "after" ? AUCTION_AFTER_SORT_COLUMN_IDS : AUCTION_SORT_COLUMN_IDS;
|
|
374
|
+
if (!columns.includes(sortPreference.columnId)) setSortValue(null);
|
|
375
|
+
}, [setSortValue, setView, sortPreference.columnId]);
|
|
269
376
|
|
|
270
377
|
usePaneRefreshKey(() => void resource.reload(), { focused, enabled: !searchFocused });
|
|
271
378
|
|
|
@@ -296,16 +403,18 @@ export function TreasuryAuctionsPane({ focused, width, height }: PaneProps) {
|
|
|
296
403
|
}, [focusSearch, handlePaneKey]);
|
|
297
404
|
|
|
298
405
|
const showYear = auctionDatesShowYear(historyDays);
|
|
299
|
-
|
|
406
|
+
// A table that scrolls down keeps a cell for its scrollbar.
|
|
407
|
+
const columns = useMemo(() => buildAuctionColumns({ showYear, view, rows, width: width - 1 }), [rows, showYear, view, width]);
|
|
300
408
|
const renderAuctionRow = useCallback((
|
|
301
409
|
auction: TreasuryAuction,
|
|
302
410
|
column: AuctionColumn,
|
|
303
411
|
_index: number,
|
|
304
412
|
rowState: { selected: boolean },
|
|
305
|
-
) => renderAuctionCell(auction, column, rowState, showYear), [showYear]);
|
|
413
|
+
) => renderAuctionCell(auction, column, rowState, showYear, after?.get(auction.id)), [after, showYear]);
|
|
306
414
|
|
|
307
415
|
usePaneFooter(TREASURY_AUCTIONS_PANE_ID, () => {
|
|
308
416
|
const info = loadingErrorFooterInfo(loading, error);
|
|
417
|
+
if (yieldsError) info.push({ id: "yields", parts: [{ text: "Treasury yields unavailable", tone: "warning" as const }] });
|
|
309
418
|
if (savedAt != null) info.push(...savedCopyFooterInfo([savedAt]));
|
|
310
419
|
else if (stale) info.push(STALE_SEGMENT);
|
|
311
420
|
if (fetchedAt && savedAt == null) {
|
|
@@ -325,6 +434,7 @@ export function TreasuryAuctionsPane({ focused, width, height }: PaneProps) {
|
|
|
325
434
|
cycleFilter,
|
|
326
435
|
detailOpen,
|
|
327
436
|
error,
|
|
437
|
+
yieldsError,
|
|
328
438
|
fetchedAt,
|
|
329
439
|
focusSearch,
|
|
330
440
|
loading,
|
|
@@ -379,7 +489,7 @@ export function TreasuryAuctionsPane({ focused, width, height }: PaneProps) {
|
|
|
379
489
|
focused={focused && !searchFocused}
|
|
380
490
|
detailOpen={detailOpen && !!selected}
|
|
381
491
|
onBack={() => setDetailOpen(false)}
|
|
382
|
-
detailContent={selected ? <TreasuryAuctionDetail auction={selected} width={width} /> : null}
|
|
492
|
+
detailContent={selected ? <TreasuryAuctionDetail auction={selected} width={width} after={after?.get(selected.id)} /> : null}
|
|
383
493
|
detailTitle={selected ? `${selected.secType} ${selected.securityTerm}` : undefined}
|
|
384
494
|
rootBefore={(
|
|
385
495
|
<QueryBar
|
|
@@ -391,6 +501,7 @@ export function TreasuryAuctionsPane({ focused, width, height }: PaneProps) {
|
|
|
391
501
|
focused: focused && !detailOpen,
|
|
392
502
|
...searchProps,
|
|
393
503
|
}}
|
|
504
|
+
view={{ value: view, options: VIEW_OPTIONS, onChange: selectView }}
|
|
394
505
|
/>
|
|
395
506
|
)}
|
|
396
507
|
onRootKeyDown={handleRootKeyDown}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ApiRequestError } from "../../../api-client/errors";
|
|
2
2
|
import { createThrottledFetch } from "../../../utils/throttled-fetch";
|
|
3
|
+
import { inClearingOrder } from "./client";
|
|
3
4
|
import type { TreasuryAuction } from "./types";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -78,7 +79,7 @@ export function normalizeDirectAuction(raw: unknown): TreasuryAuction | null {
|
|
|
78
79
|
const securityType = text(record.securityType);
|
|
79
80
|
if (!cusip || !auctionDate || !securityType) return null;
|
|
80
81
|
const bill = securityType === "Bill";
|
|
81
|
-
return {
|
|
82
|
+
return inClearingOrder({
|
|
82
83
|
id: `${cusip}|${auctionDate}`,
|
|
83
84
|
cusip,
|
|
84
85
|
secType: text(record.inflationProtected) === "Yes" ? "TIPS" : text(record.floatingRate) === "Yes" ? "FRN" : securityType,
|
|
@@ -88,9 +89,11 @@ export function normalizeDirectAuction(raw: unknown): TreasuryAuction | null {
|
|
|
88
89
|
// A bill's `highRate` is its discount rate; a note or bond states its coupon elsewhere.
|
|
89
90
|
highDiscountRate: bill ? toNumber(record.highRate) : null,
|
|
90
91
|
avgMedDiscountRate: bill ? toNumber(record.medianRate) : null,
|
|
92
|
+
lowDiscountRate: bill ? toNumber(record.lowRate) : null,
|
|
91
93
|
highDiscountMargin: toNumber(record.highDiscountMargin),
|
|
92
94
|
highYield: toNumber(record.highYield),
|
|
93
95
|
avgMedYield: toNumber(record.medianYield),
|
|
96
|
+
lowYield: toNumber(record.lowYield),
|
|
94
97
|
highPrice: toNumber(record.highPrice),
|
|
95
98
|
lowPrice: toNumber(record.lowPrice),
|
|
96
99
|
avgMedPrice: toNumber(record.averagePrice),
|
|
@@ -101,7 +104,7 @@ export function normalizeDirectAuction(raw: unknown): TreasuryAuction | null {
|
|
|
101
104
|
primaryDealerAccepted: toNumber(record.primaryDealersCompetitiveParAwarded),
|
|
102
105
|
totalAccepted: toNumber(record.grandTotalParAwarded),
|
|
103
106
|
offeringAmount: toNumber(record.offeringAmount),
|
|
104
|
-
};
|
|
107
|
+
});
|
|
105
108
|
}
|
|
106
109
|
|
|
107
110
|
/**
|
|
@@ -22,12 +22,16 @@ export interface TreasuryAuction {
|
|
|
22
22
|
highDiscountMargin?: number | null;
|
|
23
23
|
/** Bill high (stop-out) discount rate, in percentage points. */
|
|
24
24
|
highDiscountRate: number | null;
|
|
25
|
-
/** Bill
|
|
25
|
+
/** Bill median discount rate, in percentage points (Treasury's average/median discount rate). */
|
|
26
26
|
avgMedDiscountRate: number | null;
|
|
27
|
+
/** Bill low discount rate, in percentage points. */
|
|
28
|
+
lowDiscountRate?: number | null;
|
|
27
29
|
/** High (stop-out) yield, reported by Notes, Bonds, and TIPS. */
|
|
28
30
|
highYield: number | null;
|
|
29
31
|
/** Median yield for notes, bonds and TIPS, as Treasury publishes it. */
|
|
30
32
|
avgMedYield: number | null;
|
|
33
|
+
/** Low yield for notes, bonds and TIPS. */
|
|
34
|
+
lowYield?: number | null;
|
|
31
35
|
highPrice: number | null;
|
|
32
36
|
lowPrice: number | null;
|
|
33
37
|
avgMedPrice: number | null;
|
|
@@ -54,6 +58,7 @@ export interface TreasuryAuctionRaw {
|
|
|
54
58
|
high_investment_rate?: string;
|
|
55
59
|
high_yield?: string;
|
|
56
60
|
avg_med_yield?: string;
|
|
61
|
+
low_yield?: string;
|
|
57
62
|
high_price?: string;
|
|
58
63
|
low_price?: string;
|
|
59
64
|
avg_med_price?: string;
|
|
@@ -69,4 +74,5 @@ export interface TreasuryAuctionRaw {
|
|
|
69
74
|
high_discnt_margin?: string;
|
|
70
75
|
high_discnt_rate?: string;
|
|
71
76
|
avg_med_discnt_rate?: string;
|
|
77
|
+
low_discnt_rate?: string;
|
|
72
78
|
}
|
|
@@ -5,7 +5,7 @@ import { volSurfaceHeadless } from "./headless";
|
|
|
5
5
|
export const volSurfaceModule: PluginModule = {
|
|
6
6
|
panes: [{
|
|
7
7
|
id: "vol-surface", name: "Volatility Surface", icon: "V", get component(): typeof import("./pane").VolSurfacePane { const { VolSurfacePane } = require("./pane"); return VolSurfacePane; },
|
|
8
|
-
defaultPosition: "right", tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 126, height: 36 },
|
|
8
|
+
defaultPosition: "right", shareItem: { ticker: true }, tickerFollower: true, defaultMode: "floating", defaultFloatingSize: { width: 126, height: 36 },
|
|
9
9
|
tableExport: true, headless: volSurfaceHeadless,
|
|
10
10
|
settings: {
|
|
11
11
|
title: "Volatility Surface Settings",
|
|
@@ -49,6 +49,7 @@ export const worldVenueMapModule: PluginModule = {
|
|
|
49
49
|
defaultMode: "floating",
|
|
50
50
|
defaultFloatingSize: { width: 124, height: 36 },
|
|
51
51
|
// Linked to a list, a map with the app's own layers (facilities) shows the selected company's.
|
|
52
|
+
shareItem: { ticker: true, argument: true },
|
|
52
53
|
tickerFollower: mapFollowsTicker,
|
|
53
54
|
// The layer picker comes from the server's catalog; without one the pane keeps its old settings.
|
|
54
55
|
settings: (context) => buildMapSettingsDef(context.settings, peekGeoCatalog()?.layers) ?? { fields: [] },
|
|
@@ -29,6 +29,8 @@ export const CURVE_OPTIONS: readonly CurveOption[] = [
|
|
|
29
29
|
{ id: "gb", label: "Gilt", aliases: ["gilt", "gilts", "uk", "gb", "gbp"] },
|
|
30
30
|
{ id: "jp", label: "JGB", aliases: ["jgb", "jgbs", "jp", "japan", "jpy"] },
|
|
31
31
|
{ id: "ca", label: "Canada", aliases: ["canada", "ca", "goc", "cad"] },
|
|
32
|
+
{ id: "mx", label: "Mexico", aliases: ["mexico", "mx", "mbono", "mbonos", "bono", "bonos", "cetes", "mxn"] },
|
|
33
|
+
{ id: "br", label: "Brazil", aliases: ["brazil", "br", "brl", "prefixado", "ltn", "ntn-f", "ntnf"] },
|
|
32
34
|
];
|
|
33
35
|
|
|
34
36
|
export function isCurveId(value: unknown): value is CurveId {
|
|
@@ -50,7 +52,7 @@ export function curveOption(id: CurveId): CurveOption {
|
|
|
50
52
|
* `GC`, `GC 2026-01-02`, `GC JGB`, `GC TIPS 2024-01-02`: a curve word and a
|
|
51
53
|
* date, either order. Words with no digit are no date: one that names no
|
|
52
54
|
* curve (`GC world`, `GC "South Africa"`) lists the curves and points at the
|
|
53
|
-
* world tab, which
|
|
55
|
+
* world tab, which sets them side by side, as does a second curve word.
|
|
54
56
|
*/
|
|
55
57
|
export function parseCurveArgument(value: unknown, now = new Date()): { curve: CurveId | null; date: string } {
|
|
56
58
|
const words = typeof value === "string" ? value.trim().split(/\s+/).filter(Boolean) : [];
|
|
@@ -58,7 +60,11 @@ export function parseCurveArgument(value: unknown, now = new Date()): { curve: C
|
|
|
58
60
|
const rest: string[] = [];
|
|
59
61
|
for (const word of words) {
|
|
60
62
|
const match = CURVE_OPTIONS.find((option) => option.aliases.includes(word.toLowerCase()));
|
|
61
|
-
if (match &&
|
|
63
|
+
if (match && curve && match.id !== curve) {
|
|
64
|
+
throw new Error(`GC shows one curve: ${curveOption(curve).aliases[0]} or ${match.aliases[0]}. `
|
|
65
|
+
+ "The world tab sets every market's 2- and 10-year yields side by side: gloom fn GC --tab world.");
|
|
66
|
+
}
|
|
67
|
+
if (match) curve = match.id;
|
|
62
68
|
else rest.push(word);
|
|
63
69
|
}
|
|
64
70
|
const text = rest.join(" ");
|
|
@@ -66,11 +72,11 @@ export function parseCurveArgument(value: unknown, now = new Date()): { curve: C
|
|
|
66
72
|
return { curve, date: yieldCurveDate(text || null, now) };
|
|
67
73
|
}
|
|
68
74
|
|
|
69
|
-
/** `Unknown curve "world"`, with the curves there are and where
|
|
75
|
+
/** `Unknown curve "world"`, with the curves there are and where they are side by side. */
|
|
70
76
|
export function unknownCurveMessage(word: string): string {
|
|
71
77
|
const names = CURVE_OPTIONS.map((option) => option.aliases[0]);
|
|
72
78
|
return `Unknown curve "${word}"; the curves are ${names.slice(0, -1).join(", ")} and ${names.at(-1)}. `
|
|
73
|
-
+ "
|
|
79
|
+
+ "The world tab sets their 2- and 10-year yields side by side: gloom fn GC --tab world.";
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
/**
|
|
@@ -112,6 +112,8 @@ const CURVE_PUBLISHERS: Record<CurveId, string> = {
|
|
|
112
112
|
gb: "Bank of England",
|
|
113
113
|
jp: "Japan Ministry of Finance",
|
|
114
114
|
ca: "Bank of Canada",
|
|
115
|
+
mx: "Banxico",
|
|
116
|
+
br: "Tesouro Nacional",
|
|
115
117
|
};
|
|
116
118
|
|
|
117
119
|
/** Whose business days each curve's dates are, so a report names the day it means. */
|
|
@@ -124,6 +126,8 @@ const CURVE_MARKETS: Record<CurveId, string> = {
|
|
|
124
126
|
gb: "UK",
|
|
125
127
|
jp: "Japan",
|
|
126
128
|
ca: "Canada",
|
|
129
|
+
mx: "Mexico",
|
|
130
|
+
br: "Brazil",
|
|
127
131
|
};
|
|
128
132
|
|
|
129
133
|
export function createYieldCurveHeadless(
|
|
@@ -136,10 +140,10 @@ export function createYieldCurveHeadless(
|
|
|
136
140
|
return {
|
|
137
141
|
shape: "rows",
|
|
138
142
|
argument: { kind: "free-text", optional: true, placeholder: "[curve] [date]",
|
|
139
|
-
description: "A curve (ust, tips, breakeven, euro, bund, gilt, jgb, canada) and a historical as-of date; omit for the latest UST curve." },
|
|
143
|
+
description: "A curve (ust, tips, breakeven, euro, bund, gilt, jgb, canada, mexico, brazil) and a historical as-of date; omit for the latest UST curve." },
|
|
140
144
|
options: [
|
|
141
145
|
{ key: "date", type: "string", settingKey: "asOfDate", placeholder: "date", description: `Historical as-of date, as ${DATE_OPTION_EXAMPLES}; uses the latest session on or before it.` },
|
|
142
|
-
{ key: "curve", type: "string", description: "ust (default), tips, breakeven, euro, bund, gilt, jgb or
|
|
146
|
+
{ key: "curve", type: "string", description: "ust (default), tips, breakeven, euro, bund, gilt, jgb, canada, mexico or brazil." },
|
|
143
147
|
{ key: "compare", type: "string", description: `Compare with a date (${DATE_OPTION_EXAMPLES}) or a span back from the curve's session (1D, 1W, 1M, 3M, 1Y).` },
|
|
144
148
|
{ key: "view", type: "enum", values: [{ value: "curve" }, { value: "difference", aliases: ["diff"] }],
|
|
145
149
|
description: "With a compare date: both curves, or the bp change by tenor as bars.",
|
|
@@ -415,8 +415,8 @@ const WORLD_COLUMNS: DataTableColumn[] = [
|
|
|
415
415
|
{ id: "asOf", label: "As of", width: 10, align: "left" },
|
|
416
416
|
];
|
|
417
417
|
const worldKey = (row: WorldRow) => row.id;
|
|
418
|
-
/** Palette slots far enough apart that
|
|
419
|
-
const MARKET_COLOR_SLOTS = [0, 1, 2, 3, 4, 7] as const;
|
|
418
|
+
/** Palette slots far enough apart that the markets' curves on one axis read apart; the orange and green come last. */
|
|
419
|
+
const MARKET_COLOR_SLOTS = [0, 1, 2, 3, 4, 7, 5, 8] as const;
|
|
420
420
|
|
|
421
421
|
/** One row per market, each on the session its publisher last printed. */
|
|
422
422
|
function WorldTab({ onOpen, focused, width, height }: {
|
|
@@ -504,7 +504,7 @@ export const yieldCurveModule: PluginModule = {
|
|
|
504
504
|
label: "Yield Curve",
|
|
505
505
|
description: "Government bond curves, a world grid, and USD SOFR swap rates, swap spreads and tenor history.",
|
|
506
506
|
keywords: ["yield", "curve", "treasury", "bonds", "rates", "gc", "interest", "tips", "breakeven", "bund", "gilt", "jgb",
|
|
507
|
-
"sovereign", "world", "forward", "swaps", "sofr", "ois", "swap spread", "2s10s", "steepener", "flattener"],
|
|
507
|
+
"mbono", "cetes", "prefixado", "sovereign", "world", "forward", "swaps", "sofr", "ois", "swap spread", "2s10s", "steepener", "flattener"],
|
|
508
508
|
shortcut: { prefix: "GC", argPlaceholder: "[curve] [date]", argKind: "text", argOptional: true },
|
|
509
509
|
headless: yieldCurveHeadless,
|
|
510
510
|
createInstance: (_context, options) => {
|
|
@@ -57,6 +57,16 @@ const CURVES: ReadonlyArray<{
|
|
|
57
57
|
name: (tenor) => BILL_TENORS.has(tenor) ? `Canada ${tenor} Treasury bill yield` : `Canada ${tenor} benchmark yield`,
|
|
58
58
|
tenors: ["1M", "3M", "6M", "1Y", "2Y", "3Y", "5Y", "7Y", "10Y", "30Y"],
|
|
59
59
|
},
|
|
60
|
+
{
|
|
61
|
+
curve: "mx", publisher: "Banxico", tags: ["Mexico", "M bono", "Mbono", "Cetes", "peso"],
|
|
62
|
+
name: (tenor) => tenor === "2Y" ? "Mexico 2Y Cetes yield" : `Mexico ${tenor} M bono yield`,
|
|
63
|
+
tenors: ["2Y", "10Y"],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
curve: "br", publisher: "Tesouro Nacional", tags: ["Brazil", "prefixado", "LTN", "NTN-F", "real"],
|
|
67
|
+
name: (tenor) => `Brazil ${tenor} prefixado yield`,
|
|
68
|
+
tenors: ["2Y", "10Y"],
|
|
69
|
+
},
|
|
60
70
|
{
|
|
61
71
|
curve: "eu-aaa", publisher: "ECB", tags: ["euro area", "AAA", "euro"],
|
|
62
72
|
name: (tenor) => `Euro area AAA ${tenor} yield`,
|
|
@@ -25,7 +25,9 @@ export interface WorldRow {
|
|
|
25
25
|
points: CloudCurvePoint[];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const MARKETS: Record<string, string> = {
|
|
28
|
+
const MARKETS: Record<string, string> = {
|
|
29
|
+
us: "US", de: "Germany", gb: "UK", jp: "Japan", ca: "Canada", "eu-aaa": "Euro AAA", mx: "Mexico", br: "Brazil",
|
|
30
|
+
};
|
|
29
31
|
|
|
30
32
|
const valueAt = (points: readonly CloudCurvePoint[] | undefined, tenor: string) => {
|
|
31
33
|
const value = points?.find((point) => point.tenor === tenor)?.yield;
|
package/src/plugins/installer.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { existsSync, lstatSync, mkdirSync, readdirSync, renameSync, rmSync, syml
|
|
|
4
4
|
import { execFile as execFileCallback, execFileSync, spawn } from "child_process";
|
|
5
5
|
import { promisify } from "util";
|
|
6
6
|
import { findAbsorbedPlugin, type AbsorbedPlugin } from "./absorbed";
|
|
7
|
+
import { checkPluginCompatibility, readPluginManifest } from "./compat";
|
|
7
8
|
import type { PluginPin } from "./marketplace/store";
|
|
8
9
|
import { bunCommand, missingPluginDependencies, recordDependencyInstall } from "./dependencies";
|
|
9
10
|
import { linkHostPackages, missingPeerPlugins } from "./host-link";
|
|
@@ -849,6 +850,50 @@ export function installedPluginDirectories(): string[] {
|
|
|
849
850
|
.map((entry) => entry.name);
|
|
850
851
|
}
|
|
851
852
|
|
|
853
|
+
/**
|
|
854
|
+
* The id an installed plugin goes by: the one its gloom.json declares, which
|
|
855
|
+
* every registry plugin has and which its export repeats, else its folder.
|
|
856
|
+
* Read without importing the plugin.
|
|
857
|
+
*/
|
|
858
|
+
export function installedPluginId(directory: string): string {
|
|
859
|
+
return readPluginManifest(join(PLUGINS_DIR, directory)).id ?? directory;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* The installed folders `name` names: the folder itself, or else every
|
|
864
|
+
* folder whose plugin goes by that id. `gloom install` names the folder for
|
|
865
|
+
* the repository (`gloom-hackernews`) while `gloom plugins` and `plugin
|
|
866
|
+
* enable` use the id (`hackernews`), so every command takes either. Two
|
|
867
|
+
* checkouts of one plugin, a clone and a linked copy, share an id.
|
|
868
|
+
*/
|
|
869
|
+
export function installedPluginDirectoriesNamed(name: string): string[] {
|
|
870
|
+
const dirs = installedPluginDirectories();
|
|
871
|
+
if (dirs.includes(name)) return [name];
|
|
872
|
+
return dirs.filter((dir) => installedPluginId(dir) === name);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* The id the plugin in `directory` registers under, which is what the running
|
|
877
|
+
* app keys it by. Read from gloom.json when it declares one, which the export
|
|
878
|
+
* repeats (`plugin doctor` warns when it does not); otherwise from the export,
|
|
879
|
+
* but only for a checkout the loader would import, so the import is the one
|
|
880
|
+
* it already made. Null when neither answers.
|
|
881
|
+
*/
|
|
882
|
+
export async function installedPluginRegistryId(directory: string): Promise<string | null> {
|
|
883
|
+
const dir = join(PLUGINS_DIR, directory);
|
|
884
|
+
const declared = readPluginManifest(dir).id;
|
|
885
|
+
if (declared) return declared;
|
|
886
|
+
if (findAbsorbedCheckout(dir) || checkPluginCompatibility(dir)) return null;
|
|
887
|
+
const entry = await resolvePluginEntry(dir);
|
|
888
|
+
if (!entry) return null;
|
|
889
|
+
try {
|
|
890
|
+
return pluginFromModule(await import(entry))?.id ?? null;
|
|
891
|
+
} catch (error) {
|
|
892
|
+
logFailure("plugin-installer", "Installed plugin id read failed")(error);
|
|
893
|
+
return null;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
852
897
|
/**
|
|
853
898
|
* Makes a local checkout an installed plugin without cloning it. The link is
|
|
854
899
|
* what the loader sees, so edits are live on the next reload or restart.
|
|
@@ -774,7 +774,8 @@ export function getColumnValue(
|
|
|
774
774
|
// An export writes the date with it, as ISO: 16:49 alone says nothing of which day.
|
|
775
775
|
const iso = new Date(time.time).toISOString();
|
|
776
776
|
return {
|
|
777
|
-
|
|
777
|
+
// Every row names its day: a bare 00:47 beside Fri 21:00 reads as the same evening.
|
|
778
|
+
text: time.dateOnly ? formatShortDate(time.time, MONTH_DAY) : formatFeedTime(time.time, ctx.now, "—", { utc: true, dayToday: true }),
|
|
778
779
|
value: time.dateOnly ? iso.slice(0, 10) : iso,
|
|
779
780
|
};
|
|
780
781
|
}
|
|
@@ -309,6 +309,10 @@ exports[`the runtime exports of every public subpath are the reviewed ones 1`] =
|
|
|
309
309
|
"useViewport",
|
|
310
310
|
],
|
|
311
311
|
"./remote": [
|
|
312
|
+
"RemoteAppAmbiguousError",
|
|
313
|
+
"RemoteAppError",
|
|
314
|
+
"RemoteAppNotRunningError",
|
|
315
|
+
"RemoteAppUnreachableError",
|
|
312
316
|
"sendRemoteControlRequest",
|
|
313
317
|
],
|
|
314
318
|
"./test-support": [
|
package/src/public/remote.ts
CHANGED
|
@@ -13,7 +13,13 @@
|
|
|
13
13
|
* compile, which is the correct answer for a browser context.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
export {
|
|
16
|
+
export {
|
|
17
|
+
RemoteAppAmbiguousError,
|
|
18
|
+
RemoteAppError,
|
|
19
|
+
RemoteAppNotRunningError,
|
|
20
|
+
RemoteAppUnreachableError,
|
|
21
|
+
sendRemoteControlRequest,
|
|
22
|
+
} from "../remote/client";
|
|
17
23
|
export type { SendRemoteControlRequestOptions } from "../remote/client";
|
|
18
24
|
export type {
|
|
19
25
|
RemoteAppKind,
|