gloomberb 0.20.2 → 0.20.3

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.
Files changed (362) hide show
  1. package/README.md +1 -1
  2. package/README.zh-CN.md +1 -1
  3. package/package.json +2 -1
  4. package/src/account/auth-form.tsx +13 -8
  5. package/src/account/upgrade-dialog.tsx +1 -1
  6. package/src/api-client/central-bank-rates.ts +5 -0
  7. package/src/api-client/data.ts +17 -4
  8. package/src/api-client/debt-maturities.ts +45 -2
  9. package/src/api-client/earnings.ts +4 -2
  10. package/src/api-client/errors.ts +21 -11
  11. package/src/api-client/index.ts +1 -0
  12. package/src/api-client/paths.ts +9 -1
  13. package/src/api-client/social-mentions.ts +47 -0
  14. package/src/api-client/types/econ.ts +4 -0
  15. package/src/app.tsx +11 -1
  16. package/src/cli/command-options.ts +2 -1
  17. package/src/cli/commands/market.ts +111 -29
  18. package/src/cli/commands/options-chain.ts +23 -6
  19. package/src/cli/commands/overview.ts +13 -5
  20. package/src/cli/commands/plugins.ts +49 -18
  21. package/src/cli/commands/search.ts +25 -6
  22. package/src/cli/commands/ticker.ts +4 -2
  23. package/src/cli/fx-quote-rate.ts +49 -1
  24. package/src/cli/glossary.ts +95 -15
  25. package/src/cli/history-rows.ts +9 -25
  26. package/src/cli/index.ts +6 -38
  27. package/src/cli/known-gaps.ts +3 -3
  28. package/src/cli/listing-arg.ts +78 -18
  29. package/src/cli/name-entries.ts +3 -2
  30. package/src/cli/not-a-ticker.ts +6 -2
  31. package/src/cli/pane-functions/capabilities.ts +12 -1
  32. package/src/cli/pane-functions/function-help.ts +23 -11
  33. package/src/cli/pane-functions/headless.ts +3 -1
  34. package/src/cli/pane-functions/index.ts +32 -4
  35. package/src/cli/pane-functions/market-session.ts +8 -3
  36. package/src/cli/pane-functions/resolver.ts +18 -11
  37. package/src/cli/pane-functions/screenshot-payload.ts +36 -6
  38. package/src/cli/pane-functions/screenshot-render.ts +4 -0
  39. package/src/cli/quote-answer.ts +10 -0
  40. package/src/cli/report-tables.ts +22 -2
  41. package/src/cli/result.ts +7 -3
  42. package/src/cli/spreadsheet-hint.ts +43 -0
  43. package/src/cli/symbol-list.ts +58 -4
  44. package/src/cli/symbol-rows.ts +49 -2
  45. package/src/cli/ticker-resolution.ts +98 -5
  46. package/src/cli/unknown-command.ts +88 -0
  47. package/src/components/command-bar/assist/model.ts +6 -1
  48. package/src/components/command-bar/commands/direct/index.ts +9 -1
  49. package/src/components/command-bar/commands/registry.ts +18 -0
  50. package/src/components/command-bar/pane-actions.ts +30 -13
  51. package/src/components/command-bar/panel/index.tsx +6 -3
  52. package/src/components/command-bar/panel/prompt-binding.ts +4 -0
  53. package/src/components/command-bar/panel/types.ts +3 -0
  54. package/src/components/command-bar/routes/header-market.ts +108 -0
  55. package/src/components/command-bar/routes/root/command-items.ts +5 -0
  56. package/src/components/command-bar/routes/root/provider-search.ts +190 -32
  57. package/src/components/command-bar/routes/root/results.ts +3 -0
  58. package/src/components/command-bar/routes/root/runtime.ts +28 -5
  59. package/src/components/command-bar/routes/ticker-search/results.ts +53 -6
  60. package/src/components/command-bar/routing/list-state.ts +38 -0
  61. package/src/components/command-bar/selection-hint.ts +28 -0
  62. package/src/components/command-bar/surface/index.tsx +41 -3
  63. package/src/components/command-bar/view-model.ts +15 -0
  64. package/src/components/command-bar/workflow/tickers.ts +3 -2
  65. package/src/components/company-logo.tsx +20 -2
  66. package/src/components/data-table/export.ts +13 -8
  67. package/src/components/feedback-dialog.tsx +2 -1
  68. package/src/components/form-modal/field-row.tsx +2 -1
  69. package/src/components/input-search-bar.tsx +2 -2
  70. package/src/components/layout/double-escape-close.ts +8 -5
  71. package/src/components/layout/header.tsx +75 -44
  72. package/src/components/layout/market-summary.ts +322 -116
  73. package/src/components/layout/pane/footer/index.tsx +26 -8
  74. package/src/components/layout/pane/footer/model.ts +46 -20
  75. package/src/components/layout/pane/header.tsx +3 -2
  76. package/src/components/layout/shell/chrome.ts +15 -15
  77. package/src/components/layout/status-bar.tsx +8 -7
  78. package/src/components/layout/status-widget-space.ts +8 -0
  79. package/src/components/markdown-editor.tsx +2 -2
  80. package/src/components/onboarding/account-step/form-panel.tsx +0 -3
  81. package/src/components/onboarding/onboarding-keyboard.ts +15 -6
  82. package/src/components/onboarding/onboarding-wizard.tsx +61 -11
  83. package/src/components/onboarding/portfolio-step/broker-fields-panel.tsx +0 -1
  84. package/src/components/onboarding/portfolio-step/positions-panel.tsx +0 -2
  85. package/src/components/price-sparkline/model.ts +26 -10
  86. package/src/components/ticker/list-table-view.tsx +29 -4
  87. package/src/components/ui/button.tsx +13 -2
  88. package/src/components/ui/column-grid.tsx +18 -9
  89. package/src/components/ui/data-table/index.tsx +1 -1
  90. package/src/components/ui/data-table/opentui/index.tsx +2 -1
  91. package/src/components/ui/data-table/types.ts +18 -0
  92. package/src/components/ui/delayed-mark.tsx +3 -2
  93. package/src/components/ui/field-grid.tsx +0 -2
  94. package/src/components/ui/fields.tsx +7 -4
  95. package/src/components/ui/inline-quick-add.tsx +2 -2
  96. package/src/components/ui/key-hint-words.ts +153 -0
  97. package/src/components/ui/key-hints.tsx +73 -0
  98. package/src/components/ui/menu.tsx +3 -1
  99. package/src/components/ui/message-composer.tsx +2 -2
  100. package/src/components/ui/shortcut-hint.tsx +28 -3
  101. package/src/components/ui/tabs.tsx +7 -0
  102. package/src/components/ui/text-prompt-dialog.tsx +2 -1
  103. package/src/core/state/app/command-bar-launch.ts +3 -0
  104. package/src/data/config/store/normalize.ts +6 -0
  105. package/src/docs/snapshot.json +120 -69
  106. package/src/i18n/es.ts +24 -1
  107. package/src/i18n/ja.ts +24 -1
  108. package/src/i18n/ko.ts +24 -1
  109. package/src/i18n/zh-cn.ts +24 -1
  110. package/src/i18n/zh-tw.ts +24 -1
  111. package/src/layout/pane-manager/gridlock.ts +11 -0
  112. package/src/market-data/bars-per-year.ts +27 -9
  113. package/src/market-data/coordinator/quotes.ts +22 -3
  114. package/src/market-data/futures-board.ts +80 -0
  115. package/src/market-data/futures-contract.ts +9 -3
  116. package/src/market-data/market/change-basis.ts +2 -2
  117. package/src/market-data/market/dated-previous-close.ts +163 -47
  118. package/src/market-data/market/format.ts +14 -3
  119. package/src/market-data/market/freshness.ts +24 -7
  120. package/src/market-data/market/header-market.ts +154 -0
  121. package/src/market-data/market/index-level.ts +29 -0
  122. package/src/market-data/market/index-session-venues.ts +44 -0
  123. package/src/market-data/market/status.ts +7 -2
  124. package/src/market-data/market/venue-session.ts +72 -0
  125. package/src/market-data/model-dividend-yield.ts +23 -8
  126. package/src/market-data/options-alternatives.ts +39 -4
  127. package/src/market-data/published-apac-sessions.ts +40 -2
  128. package/src/market-data/quotes/export-identity.ts +76 -0
  129. package/src/market-data/quotes/freshness.ts +22 -0
  130. package/src/market-data/quotes/time.ts +42 -1
  131. package/src/market-data/realized-volatility.ts +11 -7
  132. package/src/market-data/tax-equivalent.ts +145 -27
  133. package/src/plugins/builtin/account-management/pane.tsx +2 -2
  134. package/src/plugins/builtin/alerts/alert-engine.ts +12 -6
  135. package/src/plugins/builtin/alerts/alert-log.ts +6 -2
  136. package/src/plugins/builtin/alerts/calendar-events.ts +74 -12
  137. package/src/plugins/builtin/alerts/cli-forms.ts +11 -1
  138. package/src/plugins/builtin/alerts/cli-move.ts +234 -0
  139. package/src/plugins/builtin/alerts/cli.ts +224 -33
  140. package/src/plugins/builtin/alerts/command.ts +33 -6
  141. package/src/plugins/builtin/alerts/event-rows.ts +18 -4
  142. package/src/plugins/builtin/alerts/events-pane.tsx +6 -2
  143. package/src/plugins/builtin/alerts/events.ts +9 -0
  144. package/src/plugins/builtin/alerts/format.ts +40 -15
  145. package/src/plugins/builtin/alerts/headless.ts +31 -18
  146. package/src/plugins/builtin/alerts/history.ts +1 -0
  147. package/src/plugins/builtin/alerts/index.tsx +86 -12
  148. package/src/plugins/builtin/alerts/live.ts +2 -1
  149. package/src/plugins/builtin/alerts/move-checks.ts +155 -0
  150. package/src/plugins/builtin/alerts/move.ts +160 -0
  151. package/src/plugins/builtin/alerts/pane.tsx +52 -22
  152. package/src/plugins/builtin/alerts/price-text.ts +62 -0
  153. package/src/plugins/builtin/alerts/price.ts +17 -0
  154. package/src/plugins/builtin/alerts/quotes.ts +84 -3
  155. package/src/plugins/builtin/alerts/scheduled-check.ts +7 -1
  156. package/src/plugins/builtin/alerts/storage.ts +20 -7
  157. package/src/plugins/builtin/alerts/types.ts +13 -0
  158. package/src/plugins/builtin/analytics/risk-client.ts +60 -39
  159. package/src/plugins/builtin/analytics/risk-episodes.ts +18 -0
  160. package/src/plugins/builtin/analytics/risk-headless.ts +20 -4
  161. package/src/plugins/builtin/analytics/risk-model.ts +68 -1
  162. package/src/plugins/builtin/analytics/risk-pane.tsx +15 -3
  163. package/src/plugins/builtin/backtest/engine.ts +4 -2
  164. package/src/plugins/builtin/backtest/window.ts +3 -1
  165. package/src/plugins/builtin/broker-manager/sign-in-end.ts +1 -1
  166. package/src/plugins/builtin/central-bank-rates/client.ts +4 -0
  167. package/src/plugins/builtin/central-bank-rates/headless.ts +1 -1
  168. package/src/plugins/builtin/central-bank-rates/model.ts +18 -8
  169. package/src/plugins/builtin/central-bank-rates/pane.tsx +6 -3
  170. package/src/plugins/builtin/chart-composer/cli-options.ts +5 -0
  171. package/src/plugins/builtin/chart-composer/headless-schema.ts +17 -1
  172. package/src/plugins/builtin/chart-composer/headless.ts +2 -0
  173. package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +9 -2
  174. package/src/plugins/builtin/crypto-board/headless.ts +82 -17
  175. package/src/plugins/builtin/crypto-board/index.tsx +24 -2
  176. package/src/plugins/builtin/crypto-board/model.ts +5 -2
  177. package/src/plugins/builtin/crypto-board/pane.tsx +4 -1
  178. package/src/plugins/builtin/debt-maturities/client.ts +111 -6
  179. package/src/plugins/builtin/debt-maturities/headless.ts +84 -1
  180. package/src/plugins/builtin/debt-maturities/model.ts +97 -14
  181. package/src/plugins/builtin/debt-maturities/pane.tsx +165 -15
  182. package/src/plugins/builtin/debt-maturities/series.ts +3 -1
  183. package/src/plugins/builtin/dividend-yield/client.ts +22 -6
  184. package/src/plugins/builtin/dividend-yield/headless.ts +113 -46
  185. package/src/plugins/builtin/dividend-yield/model.ts +5 -2
  186. package/src/plugins/builtin/dividend-yield/pane.tsx +6 -3
  187. package/src/plugins/builtin/dividend-yield/ranking-reads.ts +11 -4
  188. package/src/plugins/builtin/dividend-yield/ranking.ts +113 -18
  189. package/src/plugins/builtin/dividend-yield/types.ts +2 -0
  190. package/src/plugins/builtin/dividend-yield/view.ts +3 -0
  191. package/src/plugins/builtin/econ/calendar-model.ts +21 -3
  192. package/src/plugins/builtin/econ/detail-view.tsx +5 -3
  193. package/src/plugins/builtin/econ/figures.ts +13 -0
  194. package/src/plugins/builtin/econ/fred-catalog.ts +6 -3
  195. package/src/plugins/builtin/econ/index.tsx +5 -3
  196. package/src/plugins/builtin/econ/types.ts +5 -0
  197. package/src/plugins/builtin/equity-screener/footer.ts +45 -0
  198. package/src/plugins/builtin/equity-screener/pane.tsx +4 -18
  199. package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
  200. package/src/plugins/builtin/fixed-income/model.ts +1 -0
  201. package/src/plugins/builtin/futures/table.tsx +1 -1
  202. package/src/plugins/builtin/futures-curve/model.ts +3 -10
  203. package/src/plugins/builtin/help/function-card.tsx +2 -1
  204. package/src/plugins/builtin/help/function-index.ts +1 -0
  205. package/src/plugins/builtin/insider/client.ts +31 -14
  206. package/src/plugins/builtin/insider/signals-model.ts +2 -7
  207. package/src/plugins/builtin/iv-history/headless.ts +1 -2
  208. package/src/plugins/builtin/iv-history/model.ts +33 -23
  209. package/src/plugins/builtin/iv-history/screen-pane.tsx +0 -3
  210. package/src/plugins/builtin/kelly-sizer/headless.ts +64 -16
  211. package/src/plugins/builtin/kelly-sizer/history.ts +37 -28
  212. package/src/plugins/builtin/kelly-sizer/pane.tsx +43 -10
  213. package/src/plugins/builtin/kelly-sizer/sections.tsx +7 -2
  214. package/src/plugins/builtin/kelly-sizer/units.ts +29 -0
  215. package/src/plugins/builtin/news/index.tsx +7 -13
  216. package/src/plugins/builtin/news/overview-headlines.tsx +117 -0
  217. package/src/plugins/builtin/news/ticker-news.ts +35 -0
  218. package/src/plugins/builtin/news/wire/news/detail-view.tsx +8 -6
  219. package/src/plugins/builtin/news/wire/news/row.ts +49 -0
  220. package/src/plugins/builtin/news/wire/news/table.tsx +9 -20
  221. package/src/plugins/builtin/options/analytics.ts +7 -2
  222. package/src/plugins/builtin/options/live-quotes.ts +6 -1
  223. package/src/plugins/builtin/options/table.ts +3 -2
  224. package/src/plugins/builtin/options/view.tsx +11 -9
  225. package/src/plugins/builtin/options-scenario/client.ts +3 -0
  226. package/src/plugins/builtin/options-scenario/headless.ts +1 -1
  227. package/src/plugins/builtin/perps/client.ts +5 -4
  228. package/src/plugins/builtin/perps/headless.ts +134 -124
  229. package/src/plugins/builtin/perps/markets-section.tsx +2 -2
  230. package/src/plugins/builtin/perps/model.ts +8 -4
  231. package/src/plugins/builtin/perps/open-market.ts +4 -4
  232. package/src/plugins/builtin/perps/venue-markets.ts +3 -6
  233. package/src/plugins/builtin/portfolio-list/cell-version.ts +1 -0
  234. package/src/plugins/builtin/portfolio-list/cli/bulk-symbols.ts +34 -10
  235. package/src/plugins/builtin/portfolio-list/cli/period-report.ts +28 -2
  236. package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +7 -3
  237. package/src/plugins/builtin/portfolio-list/cli/render.ts +66 -22
  238. package/src/plugins/builtin/portfolio-list/grid.tsx +5 -3
  239. package/src/plugins/builtin/portfolio-list/pane/data.ts +34 -1
  240. package/src/plugins/builtin/portfolio-list/pane/index.tsx +6 -0
  241. package/src/plugins/builtin/portfolio-list/pane/streaming.ts +15 -6
  242. package/src/plugins/builtin/portfolio-list/quick-add/resolution.ts +19 -7
  243. package/src/plugins/builtin/portfolio-list/table.tsx +30 -4
  244. package/src/plugins/builtin/realized-vol/evidence.ts +33 -6
  245. package/src/plugins/builtin/realized-vol/fx-proxy.ts +135 -0
  246. package/src/plugins/builtin/realized-vol/headless.ts +44 -8
  247. package/src/plugins/builtin/realized-vol/model.ts +9 -5
  248. package/src/plugins/builtin/realized-vol/pane.tsx +49 -15
  249. package/src/plugins/builtin/sec/headless.ts +48 -6
  250. package/src/plugins/builtin/sec/index.tsx +6 -4
  251. package/src/plugins/builtin/sec/model.ts +4 -1
  252. package/src/plugins/builtin/shared/earnings-calendar.ts +2 -0
  253. package/src/plugins/builtin/shared/market-cap-bands.ts +12 -0
  254. package/src/plugins/builtin/shared/report-freshness.ts +3 -1
  255. package/src/plugins/builtin/shared/use-quote-board.ts +5 -3
  256. package/src/plugins/builtin/shared/volatility/options.ts +63 -2
  257. package/src/plugins/builtin/social-mentions/headless.ts +72 -3
  258. package/src/plugins/builtin/social-mentions/index.tsx +8 -4
  259. package/src/plugins/builtin/social-mentions/lock-note.ts +6 -2
  260. package/src/plugins/builtin/social-mentions/outliers-client.ts +101 -0
  261. package/src/plugins/builtin/social-mentions/outliers-model.ts +162 -0
  262. package/src/plugins/builtin/social-mentions/outliers-names.ts +51 -0
  263. package/src/plugins/builtin/social-mentions/outliers.tsx +276 -0
  264. package/src/plugins/builtin/social-mentions/pane.tsx +32 -3
  265. package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
  266. package/src/plugins/builtin/thirteenf/api.ts +36 -2
  267. package/src/plugins/builtin/thirteenf/data.ts +4 -1
  268. package/src/plugins/builtin/thirteenf/headless.ts +14 -6
  269. package/src/plugins/builtin/thirteenf/model.ts +56 -1
  270. package/src/plugins/builtin/thirteenf/pane.tsx +8 -8
  271. package/src/plugins/builtin/thirteenf/report-notes.ts +11 -0
  272. package/src/plugins/builtin/thirteenf/table.ts +2 -1
  273. package/src/plugins/builtin/thirteenf/types.ts +6 -0
  274. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +23 -3
  275. package/src/plugins/builtin/ticker-detail/financials/model.ts +5 -0
  276. package/src/plugins/builtin/ticker-detail/headless-schema.ts +2 -1
  277. package/src/plugins/builtin/ticker-detail/headless.ts +21 -66
  278. package/src/plugins/builtin/ticker-detail/index.tsx +5 -0
  279. package/src/plugins/builtin/ticker-detail/overview/components.tsx +13 -1
  280. package/src/plugins/builtin/ticker-detail/overview/model.ts +6 -4
  281. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +15 -0
  282. package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +69 -0
  283. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +41 -6
  284. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +47 -24
  285. package/src/plugins/builtin/ticker-detail/quote-monitor/export.ts +46 -0
  286. package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +20 -1
  287. package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +120 -0
  288. package/src/plugins/builtin/ticker-detail/research-tabs.ts +1 -5
  289. package/src/plugins/builtin/ticker-detail/settings.ts +6 -6
  290. package/src/plugins/builtin/treasury-auctions/cache.ts +85 -19
  291. package/src/plugins/builtin/treasury-auctions/index.tsx +22 -11
  292. package/src/plugins/builtin/treasury-auctions/model.ts +23 -0
  293. package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +128 -0
  294. package/src/plugins/builtin/world-indices/client.ts +2 -0
  295. package/src/plugins/compat.ts +15 -0
  296. package/src/plugins/host-link.ts +6 -1
  297. package/src/plugins/installer.ts +8 -3
  298. package/src/portfolio/column-values.ts +14 -4
  299. package/src/portfolio/listed-symbol.ts +78 -0
  300. package/src/portfolio/real-return.ts +172 -0
  301. package/src/public/__snapshots__/public-api.test.ts.snap +1 -0
  302. package/src/renderers/browser/config-host.ts +56 -15
  303. package/src/renderers/browser/main.tsx +3 -1
  304. package/src/renderers/browser/ui-host.tsx +1 -0
  305. package/src/renderers/cloudflare/http-proxy.ts +1 -0
  306. package/src/renderers/dom/boot-frame.ts +2 -2
  307. package/src/renderers/dom/data-table/row.tsx +4 -1
  308. package/src/renderers/dom/desktop/controls.tsx +4 -4
  309. package/src/renderers/dom/desktop/dialog-actions.tsx +60 -41
  310. package/src/renderers/dom/dom-ui-host.tsx +3 -1
  311. package/src/renderers/dom/host/input.tsx +4 -1
  312. package/src/renderers/dom/host/tabs.tsx +10 -1
  313. package/src/renderers/dom/styles.css +33 -13
  314. package/src/renderers/electrobun/bun/desktop/app-name.ts +1 -1
  315. package/src/renderers/opentui/host.tsx +2 -1
  316. package/src/sources/gloomberb-cloud/fred-series.ts +12 -0
  317. package/src/sources/gloomberb-cloud/index.ts +31 -2
  318. package/src/sources/gloomberb-cloud/normalizers.ts +29 -3
  319. package/src/sources/provider-router/cached-routes.ts +19 -7
  320. package/src/state/pane-table-export-registry.ts +19 -6
  321. package/src/test-support/preload.ts +5 -1
  322. package/src/theme/colors.ts +9 -1
  323. package/src/theme/themes.ts +62 -15
  324. package/src/theme/tone-contrast.ts +40 -0
  325. package/src/theme/ui-tokens.ts +23 -3
  326. package/src/tickers/batched-lookups.ts +57 -8
  327. package/src/tickers/company-name-listing.ts +156 -14
  328. package/src/tickers/company-name.ts +30 -6
  329. package/src/tickers/list.ts +7 -0
  330. package/src/tickers/search/home-listing.ts +31 -9
  331. package/src/tickers/search/index.ts +13 -3
  332. package/src/tickers/search/listing-index.ts +558 -0
  333. package/src/tickers/search/major-listings.chunk.ts +10 -0
  334. package/src/tickers/search/major-listings.json +3346 -0
  335. package/src/tickers/search/ranking.ts +68 -1
  336. package/src/tickers/search/types.ts +4 -0
  337. package/src/tickers/terminal-codes.ts +26 -1
  338. package/src/time-series/calendar-month-returns.ts +47 -0
  339. package/src/time-series/currency-conversion.ts +130 -0
  340. package/src/time-series/hooks.ts +2 -0
  341. package/src/time-series/price-comparison.ts +34 -11
  342. package/src/time-series/resolve-context.ts +3 -0
  343. package/src/time-series/resolve.ts +14 -2
  344. package/src/time-series/spec.ts +1 -0
  345. package/src/time-series/studies/indicators.ts +4 -1
  346. package/src/time-series/types.ts +8 -0
  347. package/src/types/config.ts +8 -0
  348. package/src/types/data-provider.ts +28 -0
  349. package/src/types/financials.ts +20 -2
  350. package/src/types/headless.ts +12 -0
  351. package/src/ui/host.tsx +8 -0
  352. package/src/utils/datetime-format.ts +17 -3
  353. package/src/utils/display-number.ts +15 -0
  354. package/src/utils/double-escape-close.ts +61 -16
  355. package/src/utils/float32-price.ts +24 -0
  356. package/src/utils/forward-dividend.ts +81 -16
  357. package/src/utils/fx-market-hours.ts +11 -0
  358. package/src/utils/plugin-proxy-hosts.json +2 -1
  359. package/src/utils/price-history.ts +7 -6
  360. package/src/utils/report-timing.ts +62 -0
  361. package/src/utils/sec-filings.ts +32 -0
  362. package/src/utils/utc-time.ts +5 -0
package/src/i18n/ko.ts CHANGED
@@ -1545,6 +1545,7 @@ export const ko: Record<string, string> = {
1545
1545
  "YOUR WORKSPACE": "내 워크스페이스",
1546
1546
  "Your holdings as a heatmap, a watchlist, and {ticker} charted. Every pane moves; {shortcut} adds more.": "보유 종목 히트맵, 관심 목록, {ticker} 차트. 모든 패널을 옮길 수 있고 {shortcut}로 더 추가합니다.",
1547
1547
  "b: sign in with the browser instead": "b: 브라우저로 로그인",
1548
+ "Esc, then b: sign in with the browser instead": "Esc 다음 b: 브라우저로 로그인",
1548
1549
  "Sign in with the browser instead": "브라우저로 로그인",
1549
1550
  "Real-time market data": "실시간 시장 데이터",
1550
1551
  // ── Onboarding desks ─────────────────────────────────────────
@@ -1564,7 +1565,7 @@ export const ko: Record<string, string> = {
1564
1565
  "Your last payment didn't go through": "지난 결제가 처리되지 않았습니다",
1565
1566
  "Pro is paused until your open invoice is paid. Pay it with another card and real-time data comes straight back.": "미결제 인보이스가 결제될 때까지 Pro가 일시 중지됩니다. 다른 카드로 결제하면 실시간 데이터가 바로 돌아옵니다.",
1566
1567
  "Pay with another card": "다른 카드로 결제",
1567
- "Stop trading on stale prices": "더 이상 지난 시세로 거래하지 마세요",
1568
+ "One better trade pays for Pro": "더 나은 거래 한 번이면 Pro는 본전",
1568
1569
  "Pro is free for {days} days. $0 today, then {price} from {date}. Card required. Cancel before and you pay nothing.": "Pro는 {days}일 동안 무료입니다. 오늘 $0, {date}부터 {price}. 카드 등록 필요. 그 전에 해지하면 요금이 없습니다.",
1569
1570
  "Continue to checkout": "결제로 이동",
1570
1571
  "{price}, billed today. Cancel anytime.": "{price}, 오늘 청구. 언제든 해지.",
@@ -1681,6 +1682,8 @@ export const ko: Record<string, string> = {
1681
1682
  "Denied in {seconds} s": "{seconds}초 후 거부",
1682
1683
  "choose": "고르기",
1683
1684
  "select": "선택",
1685
+ "here": "여기",
1686
+ "new pane": "새 패널",
1684
1687
  "confirm": "확인",
1685
1688
  "presets": "프리셋",
1686
1689
  "add": "추가",
@@ -1735,4 +1738,24 @@ export const ko: Record<string, string> = {
1735
1738
  "Keep on this device": "이 기기에 보관",
1736
1739
  "Daily roundups, the weekly brief, position alerts, the mobile app and Ask Gloom will go without this account.": "일일 요약, 주간 브리핑, 포지션 알림, 모바일 앱, Ask Gloom에 이 계좌가 포함되지 않습니다.",
1737
1740
  "Account data stays on this device, out of Gloom Cloud": "계좌 데이터는 Gloom Cloud에 올라가지 않고 이 기기에 남습니다",
1741
+ "{venue} open": "{venue} 장중",
1742
+ "{venue} lunch": "{venue} 점심 휴장",
1743
+ "{venue} pre-market": "{venue} 장전",
1744
+ "{venue} after-hours": "{venue} 장후",
1745
+ "{venue} closed": "{venue} 휴장",
1746
+ "{venue} holiday": "{venue} 공휴일 휴장",
1747
+ "{time} left": "{time} 남음",
1748
+ "opens {time}": "{time} 개장",
1749
+ "reopens {time}": "{time} 재개",
1750
+ "Header Market": "헤더 시장",
1751
+ "Choose Header Market": "헤더 시장 선택",
1752
+ "Choose the market the header shows": "헤더에 표시할 시장 선택",
1753
+ "Benchmarks": "벤치마크",
1754
+ "{venue} pre": "{venue} 장전",
1755
+ "{venue} post": "{venue} 장후",
1756
+ "open": "장중",
1757
+ "lunch": "점심",
1758
+ "pre": "장전",
1759
+ "post": "장후",
1760
+ "closed": "휴장",
1738
1761
  };
package/src/i18n/zh-cn.ts CHANGED
@@ -1547,6 +1547,7 @@ export const zhCN: Record<string, string> = {
1547
1547
  "YOUR WORKSPACE": "你的工作区",
1548
1548
  "Your holdings as a heatmap, a watchlist, and {ticker} charted. Every pane moves; {shortcut} adds more.": "持仓热力图、自选列表和 {ticker} 的图表。每个面板都可移动;{shortcut} 可添加更多。",
1549
1549
  "b: sign in with the browser instead": "b:改用浏览器登录",
1550
+ "Esc, then b: sign in with the browser instead": "按 Esc 后按 b:改用浏览器登录",
1550
1551
  "Sign in with the browser instead": "改用浏览器登录",
1551
1552
  "Real-time market data": "实时市场数据",
1552
1553
  // ── Onboarding desks ─────────────────────────────────────────
@@ -1566,7 +1567,7 @@ export const zhCN: Record<string, string> = {
1566
1567
  "Your last payment didn't go through": "上次付款未成功",
1567
1568
  "Pro is paused until your open invoice is paid. Pay it with another card and real-time data comes straight back.": "Pro 已暂停,付清未结账单后恢复。换一张卡付款,实时数据立即恢复。",
1568
1569
  "Pay with another card": "换一张卡付款",
1569
- "Stop trading on stale prices": "别再用过时的价格交易",
1570
+ "One better trade pays for Pro": "一笔更好的交易,就能抵上 Pro 的费用",
1570
1571
  "Pro is free for {days} days. $0 today, then {price} from {date}. Card required. Cancel before and you pay nothing.": "Pro 可免费使用 {days} 天。今天 $0,{date} 起 {price}。需要绑卡。在此之前取消则无需付费。",
1571
1572
  "Continue to checkout": "前往结账",
1572
1573
  "{price}, billed today. Cancel anytime.": "{price},今天扣款。随时取消。",
@@ -1683,6 +1684,8 @@ export const zhCN: Record<string, string> = {
1683
1684
  "Denied in {seconds} s": "{seconds} 秒后拒绝",
1684
1685
  "choose": "选择",
1685
1686
  "select": "选定",
1687
+ "here": "此处",
1688
+ "new pane": "新面板",
1686
1689
  "confirm": "确认",
1687
1690
  "presets": "预设",
1688
1691
  "add": "添加",
@@ -1737,4 +1740,24 @@ export const zhCN: Record<string, string> = {
1737
1740
  "Keep on this device": "保留在此设备上",
1738
1741
  "Daily roundups, the weekly brief, position alerts, the mobile app and Ask Gloom will go without this account.": "每日汇总、每周简报、持仓提醒、移动应用和 Ask Gloom 将不再包含此账户。",
1739
1742
  "Account data stays on this device, out of Gloom Cloud": "账户数据保留在此设备上,不上传到 Gloom Cloud",
1743
+ "{venue} open": "{venue} 盘中",
1744
+ "{venue} lunch": "{venue} 午休",
1745
+ "{venue} pre-market": "{venue} 盘前",
1746
+ "{venue} after-hours": "{venue} 盘后",
1747
+ "{venue} closed": "{venue} 休市",
1748
+ "{venue} holiday": "{venue} 假日休市",
1749
+ "{time} left": "剩余 {time}",
1750
+ "opens {time}": "{time} 开盘",
1751
+ "reopens {time}": "{time} 复市",
1752
+ "Header Market": "标题栏市场",
1753
+ "Choose Header Market": "选择标题栏市场",
1754
+ "Choose the market the header shows": "选择标题栏显示的市场",
1755
+ "Benchmarks": "基准指数",
1756
+ "{venue} pre": "{venue} 盘前",
1757
+ "{venue} post": "{venue} 盘后",
1758
+ "open": "盘中",
1759
+ "lunch": "午休",
1760
+ "pre": "盘前",
1761
+ "post": "盘后",
1762
+ "closed": "休市",
1740
1763
  };
package/src/i18n/zh-tw.ts CHANGED
@@ -1547,6 +1547,7 @@ export const zhTW: Record<string, string> = {
1547
1547
  "YOUR WORKSPACE": "你的工作區",
1548
1548
  "Your holdings as a heatmap, a watchlist, and {ticker} charted. Every pane moves; {shortcut} adds more.": "持股熱力圖、觀察清單和 {ticker} 的圖表。每個面板都可移動;{shortcut} 可新增更多。",
1549
1549
  "b: sign in with the browser instead": "b:改用瀏覽器登入",
1550
+ "Esc, then b: sign in with the browser instead": "按 Esc 後按 b:改用瀏覽器登入",
1550
1551
  "Sign in with the browser instead": "改用瀏覽器登入",
1551
1552
  "Real-time market data": "即時市場資料",
1552
1553
  // ── Onboarding desks ─────────────────────────────────────────
@@ -1566,7 +1567,7 @@ export const zhTW: Record<string, string> = {
1566
1567
  "Your last payment didn't go through": "上次付款未成功",
1567
1568
  "Pro is paused until your open invoice is paid. Pay it with another card and real-time data comes straight back.": "Pro 已暫停,付清未結帳單後恢復。換一張卡付款,即時資料立即恢復。",
1568
1569
  "Pay with another card": "換一張卡付款",
1569
- "Stop trading on stale prices": "別再用過時的價格交易",
1570
+ "One better trade pays for Pro": "一筆更好的交易,就能抵上 Pro 的費用",
1570
1571
  "Pro is free for {days} days. $0 today, then {price} from {date}. Card required. Cancel before and you pay nothing.": "Pro 可免費使用 {days} 天。今天 $0,{date} 起 {price}。需要綁卡。在此之前取消則無需付費。",
1571
1572
  "Continue to checkout": "前往結帳",
1572
1573
  "{price}, billed today. Cancel anytime.": "{price},今天扣款。隨時取消。",
@@ -1683,6 +1684,8 @@ export const zhTW: Record<string, string> = {
1683
1684
  "Denied in {seconds} s": "{seconds} 秒後拒絕",
1684
1685
  "choose": "選擇",
1685
1686
  "select": "選定",
1687
+ "here": "此處",
1688
+ "new pane": "新面板",
1686
1689
  "confirm": "確認",
1687
1690
  "presets": "預設",
1688
1691
  "add": "新增",
@@ -1737,4 +1740,24 @@ export const zhTW: Record<string, string> = {
1737
1740
  "Keep on this device": "保留在此裝置上",
1738
1741
  "Daily roundups, the weekly brief, position alerts, the mobile app and Ask Gloom will go without this account.": "每日摘要、每週簡報、持倉提醒、行動應用程式和 Ask Gloom 將不再包含此帳戶。",
1739
1742
  "Account data stays on this device, out of Gloom Cloud": "帳戶資料保留在此裝置上,不上傳至 Gloom Cloud",
1743
+ "{venue} open": "{venue} 盤中",
1744
+ "{venue} lunch": "{venue} 午休",
1745
+ "{venue} pre-market": "{venue} 盤前",
1746
+ "{venue} after-hours": "{venue} 盤後",
1747
+ "{venue} closed": "{venue} 休市",
1748
+ "{venue} holiday": "{venue} 假日休市",
1749
+ "{time} left": "剩餘 {time}",
1750
+ "opens {time}": "{time} 開盤",
1751
+ "reopens {time}": "{time} 復市",
1752
+ "Header Market": "標題欄市場",
1753
+ "Choose Header Market": "選擇標題欄市場",
1754
+ "Choose the market the header shows": "選擇標題欄顯示的市場",
1755
+ "Benchmarks": "基準指數",
1756
+ "{venue} pre": "{venue} 盤前",
1757
+ "{venue} post": "{venue} 盤後",
1758
+ "open": "盤中",
1759
+ "lunch": "午休",
1760
+ "pre": "盤前",
1761
+ "post": "盤後",
1762
+ "closed": "休市",
1740
1763
  };
@@ -97,6 +97,17 @@ export function shouldShowTidyWindows(layout: LayoutConfig): boolean {
97
97
  || analyzeFloatingPaneVisibility(layout).some((pane) => pane.buried);
98
98
  }
99
99
 
100
+ /**
101
+ * Whether a screen of `size` cells holds panes side by side and one above
102
+ * another: as wide as Tidy tiles a grid at, and as tall as two rows of panes
103
+ * that each show a screen of rows. A phone holds no grid, upright or on its
104
+ * side, so a workspace made for one (the web's first visit) comes there as
105
+ * one stack of tabs instead.
106
+ */
107
+ export function holdsPaneGrid(size: { width: number; height: number }): boolean {
108
+ return size.width >= NARROW_TIDY_WIDTH && size.height >= NARROW_TIDY_MIN_ROWS * 2;
109
+ }
110
+
100
111
  function withStacks(node: DockLayoutNode | null, stacks: ReadonlyMap<string, readonly string[]>): DockLayoutNode | null {
101
112
  if (!node || stacks.size === 0) return node;
102
113
  if (node.kind === "pane") {
@@ -1,5 +1,9 @@
1
+ import { isCurrencyPairListing } from "../utils/fx-market-hours";
2
+
1
3
  /** Daily bars in a year for an exchange: one per trading session. */
2
4
  const SESSION_BARS_PER_YEAR = 252;
5
+ /** Daily bars in a year for a currency pair, which trades every weekday, holidays included: 52 weeks of 5. */
6
+ const WEEKDAY_BARS_PER_YEAR = 260;
3
7
  /** Daily bars in a year for an asset that trades every day, such as crypto. */
4
8
  const CALENDAR_BARS_PER_YEAR = 365;
5
9
  /**
@@ -10,17 +14,30 @@ const CALENDAR_BARS_PER_YEAR = 365;
10
14
  const MIN_WEEKEND_DAY_SHARE = 0.05;
11
15
  const DAY_MS = 86_400_000;
12
16
 
13
- export type BarsPerYear = typeof SESSION_BARS_PER_YEAR | typeof CALENDAR_BARS_PER_YEAR;
17
+ export type BarsPerYear = typeof SESSION_BARS_PER_YEAR | typeof WEEKDAY_BARS_PER_YEAR | typeof CALENDAR_BARS_PER_YEAR;
18
+
19
+ /** What the series is a history of, where that sets its year rather than its dates. */
20
+ export interface BarsPerYearInstrument {
21
+ /** A currency pair (USDJPY=X), whose year is every weekday whatever range of it is loaded. */
22
+ currencyPair?: boolean;
23
+ }
24
+
25
+ /** Whether a listing is a currency pair, for `barsPerYear`: USDJPY=X or a CCY listing, not a currency future (6J=F). */
26
+ export function currencyPairInstrument(symbol: string | undefined, exchange?: string): BarsPerYearInstrument {
27
+ return { currencyPair: isCurrencyPairListing(symbol, exchange) };
28
+ }
14
29
 
15
30
  /**
16
- * Daily bars the series holds in a year, read from its own dates: 365 when it
17
- * has both Saturday and Sunday observations (24/7 assets), 252 otherwise
18
- * (exchange sessions). Both days are required so a venue that trades Sunday
19
- * to Thursday, or whose bars start late on the previous evening in UTC, is not
20
- * read as trading every day. Annualised volatility and Sharpe scale with the
21
- * square root of this, and a one-year window is this many bars.
31
+ * Daily bars the series holds in a year: 365 when it has both Saturday and
32
+ * Sunday observations (24/7 assets), 260 for a currency pair, which trades on
33
+ * every weekday with no exchange holidays, and 252 otherwise (exchange
34
+ * sessions). A pair is told by what it is, not by its dates, so a month of it
35
+ * is annualised as a year is. Both weekend days are required so a venue that
36
+ * trades Sunday to Thursday, or whose bars start late on the previous evening
37
+ * in UTC, is not read as trading every day. Annualised volatility and Sharpe
38
+ * scale with the square root of this, and a one-year window is this many bars.
22
39
  */
23
- export function barsPerYear(times: Iterable<Date | string | number>): BarsPerYear {
40
+ export function barsPerYear(times: Iterable<Date | string | number>, instrument: BarsPerYearInstrument = {}): BarsPerYear {
24
41
  const days = new Set<number>();
25
42
  for (const value of times) {
26
43
  const time = value instanceof Date ? value.getTime() : typeof value === "number" ? value : Date.parse(value);
@@ -34,7 +51,8 @@ export function barsPerYear(times: Iterable<Date | string | number>): BarsPerYea
34
51
  else if (weekday === 0) sundays += 1;
35
52
  }
36
53
  const minimum = Math.max(1, days.size * MIN_WEEKEND_DAY_SHARE);
37
- return saturdays >= minimum && sundays >= minimum ? CALENDAR_BARS_PER_YEAR : SESSION_BARS_PER_YEAR;
54
+ if (saturdays >= minimum && sundays >= minimum) return CALENDAR_BARS_PER_YEAR;
55
+ return instrument.currencyPair ? WEEKDAY_BARS_PER_YEAR : SESSION_BARS_PER_YEAR;
38
56
  }
39
57
 
40
58
  /** The one line every report that annualises states its convention in. */
@@ -1,7 +1,7 @@
1
1
  import type { DataProvider, QuoteSubscriptionTarget } from "../../types/data-provider";
2
2
  import type { Quote } from "../../types/financials";
3
3
  import type { InstrumentRef } from "../request-types";
4
- import { marketDataFrames, type DataFrameScheduler } from "../frame-scheduler";
4
+ import { marketDataFrames, type DataFrameRequest, type DataFrameScheduler } from "../frame-scheduler";
5
5
  import { mergeQuoteSubscriptionTargets } from "../quote-subscription-target";
6
6
  import { QueryStore } from "../query-store";
7
7
  import type { QueryEntry } from "../result-types";
@@ -51,6 +51,8 @@ export const QUOTE_SUBSCRIPTION_REMOVE_GRACE_MS = 250;
51
51
  export const QUOTE_SUBSCRIPTION_PRIORITY_UPDATE_DELAY_MS = 100;
52
52
  /** Keys nobody is looking at still feed totals and alerts, just not every frame. */
53
53
  const BACKGROUND_QUOTE_APPLY_INTERVAL_MS = 1_000;
54
+ /** How long past its interval an off-screen key waits for a frame that carries visible quotes. */
55
+ const BACKGROUND_QUOTE_RIDE_MS = 250;
54
56
 
55
57
  /**
56
58
  * Visible and selected keys apply every data frame; every other key waits for
@@ -417,7 +419,24 @@ export class QuoteSubscriptionManager {
417
419
 
418
420
  // Latest tick per key wins; the frame applies whatever is newest.
419
421
  this.pendingStreamQuotes.set(key, { instrument, quote });
420
- this.frames.request(this.streamQuoteFrame, { notBefore: this.streamQuoteDueAt(key, subscription.target) });
422
+ this.frames.request(this.streamQuoteFrame, this.streamQuoteRequest(
423
+ this.streamQuoteDueAt(key, subscription.target),
424
+ isForegroundQuoteTarget(subscription.target),
425
+ ));
426
+ }
427
+
428
+ /**
429
+ * A visible or selected key, and the first tick of any key, sets a frame
430
+ * off itself. An off-screen key held for its interval applies with the next
431
+ * frame that carries visible quotes, and sets a frame off only when none
432
+ * came within BACKGROUND_QUOTE_RIDE_MS of it falling due. A frame of its own
433
+ * spaces the next one: with a list longer than the screen the off-screen
434
+ * keys came due all second long, each held the next visible quote back for a
435
+ * frame interval, and every visible row updated twice as late.
436
+ */
437
+ private streamQuoteRequest(dueAt: number, foreground: boolean): DataFrameRequest {
438
+ if (foreground || dueAt === Number.NEGATIVE_INFINITY) return { notBefore: dueAt };
439
+ return { notBefore: dueAt, rideUntil: Math.max(dueAt, this.frames.now()) + BACKGROUND_QUOTE_RIDE_MS };
421
440
  }
422
441
 
423
442
  private streamQuoteDueAt(key: string, target: QuoteSubscriptionTarget): number {
@@ -447,7 +466,7 @@ export class QuoteSubscriptionManager {
447
466
  due.push(pending);
448
467
  }
449
468
  if (nextDueAt !== Number.POSITIVE_INFINITY) {
450
- this.frames.request(this.streamQuoteFrame, { notBefore: nextDueAt });
469
+ this.frames.request(this.streamQuoteFrame, this.streamQuoteRequest(nextDueAt, false));
451
470
  }
452
471
  if (due.length === 0) return;
453
472
 
@@ -186,6 +186,41 @@ const BY_SYMBOL: ReadonlyMap<string, FuturesContract> = new Map(FUTURES_CONTRACT
186
186
 
187
187
  const typed = (value: unknown) => typeof value === "string" ? value.trim().toUpperCase() : "";
188
188
 
189
+ /**
190
+ * CME's crypto futures, which have a curve (CTM) but no board row, so their
191
+ * name and tick live here. Outright ticks: BTC $5, ETH $0.50, SOL $0.05, XRP
192
+ * $0.0005 (each $25 a contract). Their contracts are listed as ETHX26.CME.
193
+ */
194
+ export const CME_CRYPTO_FUTURES: readonly { code: string; name: string; tick: number }[] = [
195
+ { code: "BTC", name: "Bitcoin", tick: 5 }, { code: "ETH", name: "Ether", tick: 0.5 },
196
+ { code: "SOL", name: "Solana", tick: 0.05 }, { code: "XRP", name: "XRP", tick: 0.0005 },
197
+ ];
198
+
199
+ /**
200
+ * CME's micro crypto futures (Micro Bitcoin, Micro Ether, Micro SOL, Micro
201
+ * XRP): listed as MBTX26.CME, with no curve or board row, so only their codes
202
+ * live here.
203
+ */
204
+ const CME_MICRO_CRYPTO_ROOTS: ReadonlySet<string> = new Set(["MBT", "MET", "MSL", "MXP"]);
205
+
206
+ /** A root, a month letter and a two-digit year: CLZ26, ETHX26, 6EH27. */
207
+ const LISTED_CONTRACT_CODE = /^([A-Z0-9]{1,4})([FGHJKMNQUVXZ])(\d{2})$/;
208
+
209
+ /**
210
+ * A listed contract's code as CTM prints it (ETHX26, CLZ26), as the symbol
211
+ * its quote has (ETHX26.CME, CLZ26.NYM): the code with its root's venue.
212
+ * Null for any other text, and for a root neither the board nor CME crypto,
213
+ * micros included, has.
214
+ */
215
+ export function listedFuturesSymbol(code: unknown): string | null {
216
+ const match = LISTED_CONTRACT_CODE.exec(typed(code));
217
+ if (!match) return null;
218
+ const root = match[1]!;
219
+ const venue = BY_CODE.get(root)?.venue
220
+ ?? (CME_CRYPTO_FUTURES.some((row) => row.code === root) || CME_MICRO_CRYPTO_ROOTS.has(root) ? "CME" : null);
221
+ return venue ? `${match[0]}.${venue}` : null;
222
+ }
223
+
189
224
  /** The board row a bare code names, in any case: NG is Natural Gas whether or not a security also uses NG. */
190
225
  export function futuresContractByCode(code: unknown): FuturesContract | null {
191
226
  return BY_CODE.get(typed(code)) ?? null;
@@ -235,6 +270,51 @@ export function futuresContractByName(value: unknown): FuturesContract | null {
235
270
  return bestNameMatch(FUTURES_CONTRACTS, (contract) => [contract.name, ...contract.aliases ?? []], value);
236
271
  }
237
272
 
273
+ /**
274
+ * The commodity words that name a board row when typed as a symbol, and the
275
+ * future each stands for: energy, metals, grains and softs, livestock. A list,
276
+ * not the words of every row's name, so DOW, NOTE, BOND, DOLLAR, NAT and LIVE,
277
+ * words of index, rate, currency and livestock rows, name none.
278
+ */
279
+ const COMMODITY_WORDS: Readonly<Record<string, string>> = {
280
+ BRENT: "BZ=F",
281
+ WTI: "CL=F",
282
+ OIL: "CL=F",
283
+ CRUDE: "CL=F",
284
+ NATGAS: "NG=F",
285
+ GASOLINE: "RB=F",
286
+ RBOB: "RB=F",
287
+ GOLD: "GC=F",
288
+ SILVER: "SI=F",
289
+ COPPER: "HG=F",
290
+ ALUMINUM: "ALI=F",
291
+ ALUMINIUM: "ALI=F",
292
+ PLATINUM: "PL=F",
293
+ PALLADIUM: "PA=F",
294
+ CORN: "ZC=F",
295
+ WHEAT: "ZW=F",
296
+ SOYBEANS: "ZS=F",
297
+ SOYBEAN: "ZS=F",
298
+ SOY: "ZS=F",
299
+ COFFEE: "KC=F",
300
+ SUGAR: "SB=F",
301
+ COCOA: "CC=F",
302
+ COTTON: "CT=F",
303
+ LUMBER: "LBR=F",
304
+ CATTLE: "LE=F",
305
+ HOGS: "HE=F",
306
+ };
307
+
308
+ /**
309
+ * The board row a commodity's word names when typed as a symbol (BRENT is
310
+ * Brent Crude Oil, BZ=F; WTI, OIL and CRUDE are WTI Crude Oil, CL=F; GOLD is
311
+ * GC=F), from COMMODITY_WORDS alone. Null for any other word.
312
+ */
313
+ export function futuresContractByWord(symbol: unknown): FuturesContract | null {
314
+ const future = COMMODITY_WORDS[typed(symbol).toUpperCase()];
315
+ return future ? FUTURES_CONTRACTS.find((contract) => contract.symbol === future) ?? null : null;
316
+ }
317
+
238
318
  /**
239
319
  * The future a bare symbol typed for a security stands for: a code no listed
240
320
  * security answers to (TTF is TTF=F). Null for every other symbol, and for a
@@ -122,7 +122,7 @@ export function fitFuturesContractLines(lines: readonly FuturesContractLine[], m
122
122
  /**
123
123
  * The exchange settlement dated by its session, `$4,216.30 (2026-10-09)`, as
124
124
  * `ticker` prints a futures price: in the quote's currency, padded to its minor
125
- * unit and at the contract's own precision, with or without a quote to hand.
125
+ * unit and at the contract's own precision (its tick's decimals), with or without a quote to hand.
126
126
  * Without a quote currency the price is a bare number, never a guessed `$`: a
127
127
  * grain settles in cents. A contract without a confirmed settlement reads
128
128
  * `--`: never an older settlement, and never the last trade.
@@ -135,15 +135,21 @@ export function fitFuturesContractLines(lines: readonly FuturesContractLine[], m
135
135
  * session is not confirmed yet. A settlement of that session or a later one
136
136
  * is shown: the same session, or the one the move itself belongs to.
137
137
  */
138
+ /** The contract's tick for a price format (`MarketFormatOptions.tick`), so its prices print to it; none without terms. */
139
+ export function futuresTickOption(terms: { spec?: Pick<FuturesContractSpec, "tick"> | null } | null | undefined): { tick?: number } {
140
+ const tick = terms?.spec?.tick;
141
+ return tick != null && Number.isFinite(tick) && tick > 0 ? { tick } : {};
142
+ }
143
+
138
144
  export function futuresSettleText(
139
- terms: Pick<FuturesContractTermsPayload, "settlement">,
145
+ terms: Pick<FuturesContractTermsPayload, "settlement"> & { spec?: Pick<FuturesContractSpec, "tick"> | null },
140
146
  quote: Pick<Quote, "currency" | "instrumentType" | "priceBasis" | "providerPriceDivisor"> | null | undefined,
141
147
  movesFrom?: string | null,
142
148
  ): string {
143
149
  if (!terms.settlement) return FUTURES_MISSING;
144
150
  if (movesFrom && terms.settlement.date < movesFrom) return `${FUTURES_MISSING} (${movesFrom} not confirmed yet)`;
145
151
  const currency = quote?.currency;
146
- const options = withCurrencyMinorDigits(quoteFormatOptions(quote, "FUTURE"), currency);
152
+ const options = { ...withCurrencyMinorDigits(quoteFormatOptions(quote, "FUTURE"), currency), ...futuresTickOption(terms) };
147
153
  const price = currency ? formatMarketPriceWithCurrency(terms.settlement.price, currency, options) : formatMarketPrice(terms.settlement.price, options);
148
154
  return `${price} (${terms.settlement.date})`;
149
155
  }
@@ -89,8 +89,8 @@ const INDEX_CALENDAR_VENUES: Readonly<Record<string, string>> = {
89
89
  "CHICAGO OPTIONS": "CBOE",
90
90
  };
91
91
 
92
- /** The venue whose published calendar dates the quote's sessions. */
93
- function calendarVenue(quote: Quote): string {
92
+ /** The venue whose published calendar dates the quote's sessions, and whose zone dates its daily bars. */
93
+ export function calendarVenue(quote: Quote): string {
94
94
  const venue = quoteVenue(quote);
95
95
  const index = classifyInstrumentType(quote.instrumentType) === "index" || kindFromListingSyntax(quote.symbol) === "index";
96
96
  return (index && INDEX_CALENDAR_VENUES[venue]) || venue;