gloomberb 0.20.12 → 0.20.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (512) hide show
  1. package/package.json +1 -1
  2. package/src/account/billing.ts +3 -2
  3. package/src/account/upgrade-dialog.tsx +8 -8
  4. package/src/api-client/index.ts +10 -2
  5. package/src/api-client/install-experiments.ts +146 -0
  6. package/src/api-client/telemetry.ts +47 -0
  7. package/src/api-client/types/market.ts +4 -0
  8. package/src/api-client/types/news.ts +16 -0
  9. package/src/architecture/floating-promise-allowlist.json +17 -33
  10. package/src/brokers/signed-in/adapter.ts +2 -2
  11. package/src/brokers/signed-in/catalog.ts +13 -4
  12. package/src/cli/commands/market.ts +51 -32
  13. package/src/cli/commands/overview.ts +3 -3
  14. package/src/cli/commands/search.ts +103 -9
  15. package/src/cli/commands/ticker.ts +22 -13
  16. package/src/cli/earnings-calendar.ts +33 -53
  17. package/src/cli/history-rows.ts +18 -1
  18. package/src/cli/known-gaps.ts +9 -0
  19. package/src/cli/listing-arg.ts +105 -18
  20. package/src/cli/pane-functions/catalog.ts +55 -7
  21. package/src/cli/pane-functions/dom.ts +8 -1
  22. package/src/cli/pane-functions/freshness.ts +2 -2
  23. package/src/cli/pane-functions/headless.ts +8 -8
  24. package/src/cli/pane-functions/index.ts +1 -1
  25. package/src/cli/pane-functions/report.ts +4 -1
  26. package/src/cli/perpetual-contract.ts +4 -4
  27. package/src/cli/quote-answer.ts +6 -2
  28. package/src/cli/result.ts +2 -1
  29. package/src/components/chart/composite/axis-overlays.tsx +5 -2
  30. package/src/components/chart/composite/composite-chart.tsx +1 -0
  31. package/src/components/chart/composite/format.ts +101 -15
  32. package/src/components/chart/composite/legend.tsx +60 -25
  33. package/src/components/chart/composite/time-axis.ts +51 -29
  34. package/src/components/chart/composite/toolbar.tsx +42 -6
  35. package/src/components/chart/curve/curve-surface.tsx +5 -5
  36. package/src/components/command-bar/list/badge.ts +8 -5
  37. package/src/components/command-bar/list/model.ts +0 -5
  38. package/src/components/command-bar/list/view.tsx +39 -2
  39. package/src/components/command-bar/routes/root/plugin-install.ts +4 -2
  40. package/src/components/command-bar/routes/root/provider-search.ts +23 -3
  41. package/src/components/command-bar/routes/root/results.ts +20 -9
  42. package/src/components/command-bar/routes/root/start-here.ts +1 -2
  43. package/src/components/command-bar/routes/ticker-search/actions.ts +2 -3
  44. package/src/components/command-bar/routes/ticker-search/results.ts +23 -4
  45. package/src/components/data-table/view.tsx +29 -6
  46. package/src/components/form-modal/host.tsx +1 -1
  47. package/src/components/layout/header.tsx +3 -2
  48. package/src/components/layout/market-summary.ts +3 -3
  49. package/src/components/layout/pane/error-boundary.tsx +2 -1
  50. package/src/components/markdown-text.tsx +36 -0
  51. package/src/components/market-board/index.tsx +4 -3
  52. package/src/components/onboarding/first-run-workspace.ts +46 -11
  53. package/src/components/onboarding/onboarding-keyboard.ts +57 -5
  54. package/src/components/onboarding/onboarding-wizard.tsx +91 -24
  55. package/src/components/onboarding/portfolio-step/index.tsx +1 -0
  56. package/src/components/onboarding/portfolio-step/positions-panel.tsx +36 -9
  57. package/src/components/onboarding/portfolio-step/types.ts +2 -0
  58. package/src/components/onboarding/tickers-step-model.ts +140 -0
  59. package/src/components/onboarding/tickers-step.tsx +116 -0
  60. package/src/components/onboarding/use-onboarding-broker-form.ts +1 -1
  61. package/src/components/onboarding/use-onboarding-progress.ts +100 -11
  62. package/src/components/onboarding/use-onboarding-upgrade.ts +3 -2
  63. package/src/components/onboarding/wizard-model.ts +3 -1
  64. package/src/components/onboarding/wizard-tickers.ts +139 -0
  65. package/src/components/price-performance.tsx +2 -2
  66. package/src/components/speedometer-gauge/model.ts +2 -1
  67. package/src/components/speedometer-gauge/terminal.tsx +13 -8
  68. package/src/components/ui/choice-dialog.tsx +101 -32
  69. package/src/components/ui/multi-select/dialog.tsx +1 -7
  70. package/src/components/ui/not-meaningful.ts +16 -0
  71. package/src/components/ui/query-bar.tsx +16 -4
  72. package/src/components/ui/stat-grid.tsx +27 -6
  73. package/src/data/config/store/normalize.ts +2 -0
  74. package/src/docs/snapshot.json +1 -1
  75. package/src/i18n/es.ts +5 -2
  76. package/src/i18n/ja.ts +5 -2
  77. package/src/i18n/ko.ts +5 -2
  78. package/src/i18n/zh-cn.ts +5 -2
  79. package/src/i18n/zh-tw.ts +5 -2
  80. package/src/layout-marketplace/model.ts +2 -1
  81. package/src/market-data/futures-contract.ts +2 -1
  82. package/src/market-data/hooks.tsx +1 -1
  83. package/src/market-data/market/change-basis.ts +27 -5
  84. package/src/market-data/market/format.ts +13 -13
  85. package/src/market-data/quotes/listing-enterprise-value.ts +3 -3
  86. package/src/market-data/quotes/time.ts +17 -10
  87. package/src/market-data/tax-equivalent.ts +3 -2
  88. package/src/news/aggregator.ts +19 -8
  89. package/src/news/hooks.ts +1 -1
  90. package/src/news/news-model.ts +49 -0
  91. package/src/news/types.ts +9 -0
  92. package/src/plugins/builtin/account-management/calendar-tab.tsx +8 -3
  93. package/src/plugins/builtin/account-management/pane.tsx +9 -8
  94. package/src/plugins/builtin/alerts/calendar-events.ts +4 -5
  95. package/src/plugins/builtin/alerts/format.ts +6 -5
  96. package/src/plugins/builtin/alerts/headless.ts +3 -2
  97. package/src/plugins/builtin/alerts/history.ts +2 -1
  98. package/src/plugins/builtin/alerts/pane.tsx +2 -1
  99. package/src/plugins/builtin/alerts/price-text.ts +2 -1
  100. package/src/plugins/builtin/alerts/scheduled.ts +6 -5
  101. package/src/plugins/builtin/analytics/account-returns.ts +6 -7
  102. package/src/plugins/builtin/analytics/display.ts +2 -1
  103. package/src/plugins/builtin/analytics/pane-model.ts +5 -9
  104. package/src/plugins/builtin/analytics/risk-model.ts +6 -6
  105. package/src/plugins/builtin/analytics/risk-pane.tsx +6 -5
  106. package/src/plugins/builtin/analytics/view.tsx +5 -5
  107. package/src/plugins/builtin/attention/model.ts +6 -5
  108. package/src/plugins/builtin/attention/pane.tsx +5 -4
  109. package/src/plugins/builtin/awards/detail.tsx +5 -4
  110. package/src/plugins/builtin/awards/headless.ts +8 -7
  111. package/src/plugins/builtin/awards/model.ts +4 -3
  112. package/src/plugins/builtin/awards/pane.tsx +4 -4
  113. package/src/plugins/builtin/backtest/format.ts +3 -2
  114. package/src/plugins/builtin/backtest/report.ts +3 -2
  115. package/src/plugins/builtin/bond-calculator/headless.ts +2 -1
  116. package/src/plugins/builtin/bond-calculator/pane.tsx +2 -1
  117. package/src/plugins/builtin/broker-manager/add-flow.tsx +1 -1
  118. package/src/plugins/builtin/broker-trading/orders-data.ts +3 -3
  119. package/src/plugins/builtin/broker-trading/orders.tsx +3 -2
  120. package/src/plugins/builtin/broker-trading/ticket.tsx +2 -2
  121. package/src/plugins/builtin/buildout/cells.tsx +2 -1
  122. package/src/plugins/builtin/buildout/company/pane.tsx +4 -3
  123. package/src/plugins/builtin/buildout/data-runtime.ts +21 -23
  124. package/src/plugins/builtin/buildout/detail/values.ts +2 -1
  125. package/src/plugins/builtin/buildout/format.ts +4 -3
  126. package/src/plugins/builtin/buildout/pane/index.tsx +3 -3
  127. package/src/plugins/builtin/catalysts/detail.tsx +2 -1
  128. package/src/plugins/builtin/catalysts/model.ts +6 -5
  129. package/src/plugins/builtin/catalysts/pane.tsx +2 -1
  130. package/src/plugins/builtin/cds/headless.ts +3 -2
  131. package/src/plugins/builtin/cds/model.ts +8 -8
  132. package/src/plugins/builtin/cds/pane.tsx +3 -2
  133. package/src/plugins/builtin/central-bank-rates/headless.ts +2 -1
  134. package/src/plugins/builtin/central-bank-rates/model.ts +3 -2
  135. package/src/plugins/builtin/central-bank-rates/pane.tsx +5 -5
  136. package/src/plugins/builtin/changelog/index.tsx +2 -2
  137. package/src/plugins/builtin/chart-composer/index.tsx +4 -2
  138. package/src/plugins/builtin/chart-composer/pane.tsx +7 -3
  139. package/src/plugins/builtin/chart-composer/use-series-catalog.ts +3 -1
  140. package/src/plugins/builtin/chart-composer/user-series.ts +3 -1
  141. package/src/plugins/builtin/chat/attachments/desktop.tsx +2 -1
  142. package/src/plugins/builtin/chat/controller/utils.ts +2 -1
  143. package/src/plugins/builtin/clinical-trials/model.ts +4 -3
  144. package/src/plugins/builtin/clinical-trials/sponsor-tickers.ts +4 -2
  145. package/src/plugins/builtin/cloud/askg/lock-note.ts +16 -4
  146. package/src/plugins/builtin/cloud/askg/model.ts +2 -1
  147. package/src/plugins/builtin/cloud/askg/pane.tsx +35 -1
  148. package/src/plugins/builtin/cloud/company-picker.tsx +1 -3
  149. package/src/plugins/builtin/cloud/team/pane.tsx +12 -12
  150. package/src/plugins/builtin/cloud/thesis/detail.tsx +13 -8
  151. package/src/plugins/builtin/cloud-tweets/model.ts +2 -2
  152. package/src/plugins/builtin/comment-letters/pane.tsx +2 -1
  153. package/src/plugins/builtin/commodity-balances/headless.ts +3 -2
  154. package/src/plugins/builtin/company-attention/app-rank.tsx +5 -4
  155. package/src/plugins/builtin/company-attention/building-model.ts +7 -7
  156. package/src/plugins/builtin/company-attention/headless.ts +6 -5
  157. package/src/plugins/builtin/company-attention/model.ts +4 -4
  158. package/src/plugins/builtin/company-attention/moves-model.ts +9 -9
  159. package/src/plugins/builtin/company-attention/signals-model.ts +9 -9
  160. package/src/plugins/builtin/company-kpis/headless.ts +2 -1
  161. package/src/plugins/builtin/company-kpis/model.ts +15 -10
  162. package/src/plugins/builtin/company-kpis/pane.tsx +2 -2
  163. package/src/plugins/builtin/congress-trades/detail.tsx +6 -5
  164. package/src/plugins/builtin/congress-trades/headless.ts +2 -1
  165. package/src/plugins/builtin/congress-trades/model.ts +6 -6
  166. package/src/plugins/builtin/congress-trades/table.tsx +7 -6
  167. package/src/plugins/builtin/connections/pane.tsx +5 -5
  168. package/src/plugins/builtin/correlation/headless.ts +2 -2
  169. package/src/plugins/builtin/correlation/index.tsx +4 -1
  170. package/src/plugins/builtin/correlation/matrix/selection.ts +2 -1
  171. package/src/plugins/builtin/correlation/relationship/view-model.ts +3 -3
  172. package/src/plugins/builtin/cot/headless.ts +3 -2
  173. package/src/plugins/builtin/cot/model.ts +2 -1
  174. package/src/plugins/builtin/cot/pane.tsx +4 -3
  175. package/src/plugins/builtin/cpi/headless.ts +4 -3
  176. package/src/plugins/builtin/cpi/model.ts +8 -7
  177. package/src/plugins/builtin/credit-boards/cdx-pane.tsx +5 -4
  178. package/src/plugins/builtin/credit-boards/headless.ts +2 -1
  179. package/src/plugins/builtin/credit-boards/model.ts +5 -5
  180. package/src/plugins/builtin/credit-conditions/headless.ts +2 -1
  181. package/src/plugins/builtin/credit-conditions/index.tsx +2 -2
  182. package/src/plugins/builtin/credit-documents/model.ts +2 -2
  183. package/src/plugins/builtin/crypto-board/defi-view.tsx +7 -7
  184. package/src/plugins/builtin/crypto-board/defi.ts +2 -2
  185. package/src/plugins/builtin/crypto-board/model.ts +4 -3
  186. package/src/plugins/builtin/crypto-board/pane.tsx +8 -8
  187. package/src/plugins/builtin/crypto-board/supply.ts +2 -2
  188. package/src/plugins/builtin/crypto-etf-flows/model.ts +4 -4
  189. package/src/plugins/builtin/custom-view/index.tsx +3 -1
  190. package/src/plugins/builtin/custom-view/pane.tsx +5 -1
  191. package/src/plugins/builtin/custom-view/view-spec.ts +11 -0
  192. package/src/plugins/builtin/debt-maturities/model.ts +3 -3
  193. package/src/plugins/builtin/debt-maturities/pane.tsx +2 -2
  194. package/src/plugins/builtin/dividend-yield/client.ts +7 -3
  195. package/src/plugins/builtin/dividend-yield/headless.ts +16 -11
  196. package/src/plugins/builtin/dividend-yield/pane.tsx +12 -10
  197. package/src/plugins/builtin/dividend-yield/ranking-view.tsx +4 -1
  198. package/src/plugins/builtin/dividend-yield/ranking.ts +19 -11
  199. package/src/plugins/builtin/dividend-yield/types.ts +4 -0
  200. package/src/plugins/builtin/dividend-yield/view.ts +3 -3
  201. package/src/plugins/builtin/docs/use-docs.ts +4 -2
  202. package/src/plugins/builtin/doe/headless.ts +2 -1
  203. package/src/plugins/builtin/doe/model.ts +12 -11
  204. package/src/plugins/builtin/earnings/board-model.ts +14 -8
  205. package/src/plugins/builtin/earnings/board-table.ts +13 -8
  206. package/src/plugins/builtin/earnings/calendar-model.ts +5 -5
  207. package/src/plugins/builtin/earnings/calendar.tsx +2 -1
  208. package/src/plugins/builtin/earnings/format.ts +16 -14
  209. package/src/plugins/builtin/earnings/headless.ts +57 -19
  210. package/src/plugins/builtin/earnings/history-model.ts +11 -7
  211. package/src/plugins/builtin/earnings/history-table.ts +14 -9
  212. package/src/plugins/builtin/earnings/history.tsx +4 -3
  213. package/src/plugins/builtin/earnings-calls/calendar.tsx +2 -1
  214. package/src/plugins/builtin/earnings-calls/format.ts +6 -5
  215. package/src/plugins/builtin/earnings-calls/upcoming.ts +5 -5
  216. package/src/plugins/builtin/earnings-ripple/headless.ts +2 -1
  217. package/src/plugins/builtin/earnings-ripple/model.ts +3 -2
  218. package/src/plugins/builtin/earnings-ripple/pane.tsx +6 -6
  219. package/src/plugins/builtin/econ/calendar-model.ts +2 -2
  220. package/src/plugins/builtin/econ/detail-view.tsx +2 -2
  221. package/src/plugins/builtin/econ/index.tsx +7 -6
  222. package/src/plugins/builtin/econ-statistics/detail.tsx +2 -1
  223. package/src/plugins/builtin/econ-statistics/headless.ts +4 -4
  224. package/src/plugins/builtin/econ-statistics/pane.tsx +2 -2
  225. package/src/plugins/builtin/equity-screener/headless.ts +5 -5
  226. package/src/plugins/builtin/equity-screener/model.ts +6 -4
  227. package/src/plugins/builtin/equity-screener/pane.tsx +7 -7
  228. package/src/plugins/builtin/equity-screener/screen-check.ts +2 -1
  229. package/src/plugins/builtin/equity-screener/ticker-check.tsx +2 -1
  230. package/src/plugins/builtin/estimate-revisions/model.ts +3 -2
  231. package/src/plugins/builtin/estimate-revisions/pane.tsx +8 -8
  232. package/src/plugins/builtin/executives/format.ts +4 -4
  233. package/src/plugins/builtin/exposure/headless.ts +8 -8
  234. package/src/plugins/builtin/exposure/model.ts +4 -3
  235. package/src/plugins/builtin/exposure/pane.tsx +6 -5
  236. package/src/plugins/builtin/fear-greed/format.ts +7 -7
  237. package/src/plugins/builtin/fear-greed/headless.ts +2 -1
  238. package/src/plugins/builtin/filing-events/feed.ts +2 -1
  239. package/src/plugins/builtin/futures/table.tsx +8 -8
  240. package/src/plugins/builtin/futures-curve/headless.ts +18 -18
  241. package/src/plugins/builtin/futures-curve/model.ts +5 -5
  242. package/src/plugins/builtin/futures-curve/pane.tsx +8 -8
  243. package/src/plugins/builtin/fx-matrix/index.tsx +2 -2
  244. package/src/plugins/builtin/fx-matrix/pairs.ts +2 -1
  245. package/src/plugins/builtin/gpu/board.tsx +6 -5
  246. package/src/plugins/builtin/gpu/changes.tsx +2 -1
  247. package/src/plugins/builtin/gpu/equities.tsx +2 -2
  248. package/src/plugins/builtin/gpu/headless.ts +4 -3
  249. package/src/plugins/builtin/gpu/model.ts +8 -7
  250. package/src/plugins/builtin/help/functions-table.tsx +41 -9
  251. package/src/plugins/builtin/help/index.tsx +6 -3
  252. package/src/plugins/builtin/help/keybindings-editor.tsx +35 -7
  253. package/src/plugins/builtin/help/shortcut-table.tsx +19 -7
  254. package/src/plugins/builtin/help/table-cells.tsx +51 -0
  255. package/src/plugins/builtin/holders/pane.tsx +4 -1
  256. package/src/plugins/builtin/insider/base-values.ts +2 -2
  257. package/src/plugins/builtin/insider/display.ts +2 -1
  258. package/src/plugins/builtin/insider/headless.ts +16 -16
  259. package/src/plugins/builtin/insider/insider-data.ts +2 -1
  260. package/src/plugins/builtin/insider/signals-model.ts +3 -3
  261. package/src/plugins/builtin/insider/table-model.ts +27 -13
  262. package/src/plugins/builtin/insider/table.tsx +1 -1
  263. package/src/plugins/builtin/ipo-calendar/model.ts +4 -4
  264. package/src/plugins/builtin/iv-history/format.ts +8 -7
  265. package/src/plugins/builtin/iv-history/headless.ts +9 -8
  266. package/src/plugins/builtin/iv-history/pane.tsx +3 -2
  267. package/src/plugins/builtin/iv-history/screen-pane.tsx +5 -4
  268. package/src/plugins/builtin/jobs/headless.ts +11 -11
  269. package/src/plugins/builtin/jobs/model.ts +2 -2
  270. package/src/plugins/builtin/jobs/pane.tsx +5 -5
  271. package/src/plugins/builtin/jodi/model.ts +2 -2
  272. package/src/plugins/builtin/jodi/pane.tsx +2 -1
  273. package/src/plugins/builtin/kelly-sizer/headless.ts +4 -4
  274. package/src/plugins/builtin/kelly-sizer/model.ts +2 -1
  275. package/src/plugins/builtin/kelly-sizer/sections.tsx +2 -2
  276. package/src/plugins/builtin/macro-day/headless.ts +6 -5
  277. package/src/plugins/builtin/macro-day/model.ts +2 -1
  278. package/src/plugins/builtin/macro-day/pane.tsx +4 -4
  279. package/src/plugins/builtin/market-halts/model.ts +11 -10
  280. package/src/plugins/builtin/market-halts/pane.tsx +2 -1
  281. package/src/plugins/builtin/market-heatmap/index.tsx +4 -4
  282. package/src/plugins/builtin/market-movers/session-table.ts +3 -3
  283. package/src/plugins/builtin/market-movers/session.ts +2 -1
  284. package/src/plugins/builtin/market-movers/table.ts +5 -5
  285. package/src/plugins/builtin/market-valuation/detail.tsx +2 -2
  286. package/src/plugins/builtin/market-valuation/headless.ts +7 -7
  287. package/src/plugins/builtin/market-valuation/pane.tsx +7 -7
  288. package/src/plugins/builtin/members/breadth-pane.tsx +5 -4
  289. package/src/plugins/builtin/members/headless.ts +2 -1
  290. package/src/plugins/builtin/members/model.ts +3 -2
  291. package/src/plugins/builtin/members/pane.tsx +10 -9
  292. package/src/plugins/builtin/mna/distress/model.ts +2 -1
  293. package/src/plugins/builtin/mna/model.ts +5 -5
  294. package/src/plugins/builtin/money-markets/headless.ts +2 -1
  295. package/src/plugins/builtin/money-markets/model.ts +3 -2
  296. package/src/plugins/builtin/money-markets/pane.tsx +4 -4
  297. package/src/plugins/builtin/news/headless.ts +5 -2
  298. package/src/plugins/builtin/news/wire/breaking/notifications.ts +21 -19
  299. package/src/plugins/builtin/news/wire/news/row.ts +3 -1
  300. package/src/plugins/builtin/news/wire/news/table.tsx +3 -2
  301. package/src/plugins/builtin/news/wire/persisted-articles.ts +28 -3
  302. package/src/plugins/builtin/notes/headless.ts +2 -1
  303. package/src/plugins/builtin/notes/model.ts +2 -1
  304. package/src/plugins/builtin/openfda/pane.tsx +4 -3
  305. package/src/plugins/builtin/options/carry.ts +3 -2
  306. package/src/plugins/builtin/options/market-reference.ts +2 -1
  307. package/src/plugins/builtin/options/table.ts +48 -9
  308. package/src/plugins/builtin/options/view.tsx +47 -17
  309. package/src/plugins/builtin/options-calculator/headless.ts +3 -2
  310. package/src/plugins/builtin/options-calculator/pane.tsx +7 -7
  311. package/src/plugins/builtin/options-positioning/headless.ts +8 -7
  312. package/src/plugins/builtin/options-positioning/model.ts +10 -10
  313. package/src/plugins/builtin/options-positioning/pane.tsx +5 -5
  314. package/src/plugins/builtin/options-scenario/collar.ts +5 -4
  315. package/src/plugins/builtin/options-scenario/csp-screen-headless.ts +11 -10
  316. package/src/plugins/builtin/options-scenario/csp-screen-pane.tsx +15 -14
  317. package/src/plugins/builtin/options-scenario/csp-screen.ts +2 -1
  318. package/src/plugins/builtin/options-scenario/csp.ts +6 -5
  319. package/src/plugins/builtin/options-scenario/headless.ts +6 -5
  320. package/src/plugins/builtin/options-scenario/hedge.ts +3 -3
  321. package/src/plugins/builtin/options-scenario/pane.tsx +7 -6
  322. package/src/plugins/builtin/options-scenario/strategy-screen.ts +1 -1
  323. package/src/plugins/builtin/pe-band/headless.ts +9 -8
  324. package/src/plugins/builtin/pe-band/pane.tsx +7 -7
  325. package/src/plugins/builtin/perps/cascade.ts +3 -2
  326. package/src/plugins/builtin/perps/headless.ts +10 -9
  327. package/src/plugins/builtin/perps/model.ts +14 -14
  328. package/src/plugins/builtin/perps/pane.tsx +3 -2
  329. package/src/plugins/builtin/portfolio-list/header.tsx +2 -2
  330. package/src/plugins/builtin/portfolio-list/index.tsx +3 -2
  331. package/src/plugins/builtin/portfolio-list/pane/futures-terms.ts +4 -2
  332. package/src/plugins/builtin/portfolio-list/pane/period-pnl.ts +2 -1
  333. package/src/plugins/builtin/portfolio-list/pane/purchase-date-fx.ts +4 -2
  334. package/src/plugins/builtin/portfolio-list/quick-add/index.tsx +2 -2
  335. package/src/plugins/builtin/portfolio-list/settings.ts +4 -1
  336. package/src/plugins/builtin/portfolio-list/summary/index.tsx +4 -4
  337. package/src/plugins/builtin/power/detail.tsx +6 -5
  338. package/src/plugins/builtin/power/gas-model.ts +8 -7
  339. package/src/plugins/builtin/power/gas.tsx +2 -1
  340. package/src/plugins/builtin/power/headless.ts +7 -6
  341. package/src/plugins/builtin/power/model.ts +3 -2
  342. package/src/plugins/builtin/power/prices-headless.ts +10 -9
  343. package/src/plugins/builtin/power/prices-model.ts +3 -2
  344. package/src/plugins/builtin/power/prices.tsx +2 -1
  345. package/src/plugins/builtin/primary-dealers/model.ts +3 -3
  346. package/src/plugins/builtin/primary-dealers/pane.tsx +2 -2
  347. package/src/plugins/builtin/rate-path/headless.ts +8 -7
  348. package/src/plugins/builtin/rate-path/model.ts +6 -5
  349. package/src/plugins/builtin/rate-path/pane.tsx +6 -5
  350. package/src/plugins/builtin/realized-vol/fx-proxy.ts +2 -1
  351. package/src/plugins/builtin/realized-vol/headless.ts +11 -10
  352. package/src/plugins/builtin/realized-vol/pane.tsx +5 -4
  353. package/src/plugins/builtin/relative-rotation/headless.ts +2 -1
  354. package/src/plugins/builtin/relative-rotation/pane.tsx +6 -6
  355. package/src/plugins/builtin/research/analyst-headless.ts +5 -5
  356. package/src/plugins/builtin/research/analyst-model.ts +7 -7
  357. package/src/plugins/builtin/research/analyst-pane.tsx +7 -7
  358. package/src/plugins/builtin/research/client.ts +14 -0
  359. package/src/plugins/builtin/research/corporate-actions-pane.tsx +40 -30
  360. package/src/plugins/builtin/research/event-model.ts +55 -22
  361. package/src/plugins/builtin/research/event-sources.ts +26 -8
  362. package/src/plugins/builtin/research/relative-valuation-columns.ts +20 -12
  363. package/src/plugins/builtin/research/relative-valuation-currency.ts +16 -0
  364. package/src/plugins/builtin/research/relative-valuation-headless.ts +33 -21
  365. package/src/plugins/builtin/research/relative-valuation-model.ts +31 -17
  366. package/src/plugins/builtin/research/relative-valuation-pane.tsx +29 -14
  367. package/src/plugins/builtin/research-search/model.ts +2 -1
  368. package/src/plugins/builtin/research-search/saved-view.tsx +4 -3
  369. package/src/plugins/builtin/revenue-breakdown/model.ts +4 -4
  370. package/src/plugins/builtin/reverse-dcf/headless.ts +7 -7
  371. package/src/plugins/builtin/reverse-dcf/model.ts +4 -4
  372. package/src/plugins/builtin/reverse-dcf/pane.tsx +2 -2
  373. package/src/plugins/builtin/scanner/flow-model.ts +7 -4
  374. package/src/plugins/builtin/scanner/flow-pane.tsx +1 -1
  375. package/src/plugins/builtin/scanner/headless.ts +3 -2
  376. package/src/plugins/builtin/scanner/hilo-model.ts +2 -1
  377. package/src/plugins/builtin/scanner/live-headless.ts +2 -2
  378. package/src/plugins/builtin/scanner/live-model.ts +3 -2
  379. package/src/plugins/builtin/scanner/live-pane.tsx +5 -5
  380. package/src/plugins/builtin/seasonality/headless.ts +2 -1
  381. package/src/plugins/builtin/seasonality/pane.tsx +4 -3
  382. package/src/plugins/builtin/sec/filing-display.tsx +12 -15
  383. package/src/plugins/builtin/sec/fund-facts.ts +2 -2
  384. package/src/plugins/builtin/sec/headless.ts +2 -1
  385. package/src/plugins/builtin/sec/index.tsx +6 -2
  386. package/src/plugins/builtin/sectors/headless.ts +4 -4
  387. package/src/plugins/builtin/sectors/index.tsx +7 -7
  388. package/src/plugins/builtin/shared/earnings-calendar.ts +90 -6
  389. package/src/plugins/builtin/shared/earnings-report.ts +13 -6
  390. package/src/plugins/builtin/shared/research-cells.tsx +2 -2
  391. package/src/plugins/builtin/shared/source-footer.ts +2 -1
  392. package/src/plugins/builtin/shared/trend.ts +2 -2
  393. package/src/plugins/builtin/shared/use-quote-board.ts +9 -8
  394. package/src/plugins/builtin/short-interest/headless.ts +6 -6
  395. package/src/plugins/builtin/short-interest/model.ts +9 -9
  396. package/src/plugins/builtin/short-interest/publications-model.ts +5 -5
  397. package/src/plugins/builtin/short-interest/publications-pane.tsx +3 -2
  398. package/src/plugins/builtin/short-interest/watch-headless.ts +5 -5
  399. package/src/plugins/builtin/short-interest/watch-pane.tsx +6 -6
  400. package/src/plugins/builtin/short-volume/model.ts +5 -5
  401. package/src/plugins/builtin/short-volume/pane.tsx +4 -4
  402. package/src/plugins/builtin/social-mentions/headless.ts +2 -1
  403. package/src/plugins/builtin/social-mentions/model.ts +4 -4
  404. package/src/plugins/builtin/supply-chain/graph-model.ts +2 -1
  405. package/src/plugins/builtin/supply-chain/graph-pane.tsx +2 -2
  406. package/src/plugins/builtin/supply-chain/headless.ts +3 -2
  407. package/src/plugins/builtin/supply-chain/model.ts +4 -4
  408. package/src/plugins/builtin/supply-chain/pane.tsx +2 -2
  409. package/src/plugins/builtin/supply-chain/row-evidence.tsx +2 -1
  410. package/src/plugins/builtin/themes/headless.ts +2 -1
  411. package/src/plugins/builtin/themes/model.ts +3 -2
  412. package/src/plugins/builtin/themes/pane.tsx +3 -2
  413. package/src/plugins/builtin/thirteenf/format.ts +9 -9
  414. package/src/plugins/builtin/thirteenf/headless.ts +3 -2
  415. package/src/plugins/builtin/thirteenf/model.ts +2 -1
  416. package/src/plugins/builtin/thirteenf/overlap-pane.tsx +2 -1
  417. package/src/plugins/builtin/thirteenf/pane.tsx +5 -4
  418. package/src/plugins/builtin/thirteenf/report-notes.ts +2 -1
  419. package/src/plugins/builtin/thirteenf/signals-pane.tsx +3 -2
  420. package/src/plugins/builtin/thirteenf/table.ts +6 -5
  421. package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +4 -3
  422. package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +4 -4
  423. package/src/plugins/builtin/ticker-detail/data-panes/returns-pane.tsx +3 -3
  424. package/src/plugins/builtin/ticker-detail/financials/model.ts +83 -35
  425. package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +3 -1
  426. package/src/plugins/builtin/ticker-detail/financials/ratios.ts +2 -2
  427. package/src/plugins/builtin/ticker-detail/financials/schema.ts +14 -18
  428. package/src/plugins/builtin/ticker-detail/financials/tab.tsx +8 -13
  429. package/src/plugins/builtin/ticker-detail/headless.ts +7 -5
  430. package/src/plugins/builtin/ticker-detail/overview/chart-scale.ts +52 -0
  431. package/src/plugins/builtin/ticker-detail/overview/components.tsx +4 -4
  432. package/src/plugins/builtin/ticker-detail/overview/model.ts +24 -13
  433. package/src/plugins/builtin/ticker-detail/overview/pane.tsx +6 -0
  434. package/src/plugins/builtin/ticker-detail/overview/tax-equivalent.ts +2 -1
  435. package/src/plugins/builtin/ticker-detail/overview-tab.tsx +33 -7
  436. package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +7 -5
  437. package/src/plugins/builtin/ticker-detail/quote-monitor/rows.ts +4 -4
  438. package/src/plugins/builtin/ticker-detail/settings.ts +17 -0
  439. package/src/plugins/builtin/time-sales/headless.ts +3 -2
  440. package/src/plugins/builtin/time-sales/model.ts +7 -5
  441. package/src/plugins/builtin/time-sales/pane.tsx +7 -6
  442. package/src/plugins/builtin/trace-bonds/model.ts +3 -2
  443. package/src/plugins/builtin/trace-bonds/pane.tsx +3 -2
  444. package/src/plugins/builtin/treasury-auctions/client.ts +2 -1
  445. package/src/plugins/builtin/treasury-auctions/headless.ts +6 -6
  446. package/src/plugins/builtin/treasury-auctions/hk-headless.ts +3 -2
  447. package/src/plugins/builtin/treasury-auctions/hk-view.tsx +10 -9
  448. package/src/plugins/builtin/treasury-auctions/hk.ts +5 -5
  449. package/src/plugins/builtin/treasury-auctions/model.ts +4 -4
  450. package/src/plugins/builtin/treasury-auctions/pane.tsx +18 -18
  451. package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -1
  452. package/src/plugins/builtin/treasury-daily/model.ts +2 -2
  453. package/src/plugins/builtin/vol-surface/events.ts +5 -4
  454. package/src/plugins/builtin/vol-surface/headless.ts +19 -18
  455. package/src/plugins/builtin/vol-surface/heat-grid.tsx +2 -1
  456. package/src/plugins/builtin/vol-surface/pane.tsx +8 -7
  457. package/src/plugins/builtin/vol-surface/stored.ts +2 -1
  458. package/src/plugins/builtin/vol-surface/tables.ts +4 -3
  459. package/src/plugins/builtin/volatility/headless.ts +5 -4
  460. package/src/plugins/builtin/volatility/pane.tsx +6 -6
  461. package/src/plugins/builtin/world-indices/headless.ts +7 -7
  462. package/src/plugins/builtin/world-indices/index.tsx +3 -1
  463. package/src/plugins/builtin/world-venue-map/headless.ts +2 -1
  464. package/src/plugins/builtin/world-venue-map/layered-pane.tsx +2 -1
  465. package/src/plugins/builtin/world-venue-map/layers.ts +3 -2
  466. package/src/plugins/builtin/world-venue-map/use-geo.ts +4 -2
  467. package/src/plugins/builtin/yield-curve/curves.ts +3 -3
  468. package/src/plugins/builtin/yield-curve/headless.ts +7 -6
  469. package/src/plugins/builtin/yield-curve/index.tsx +5 -4
  470. package/src/plugins/builtin/yield-curve/swaps.tsx +2 -1
  471. package/src/portfolio/allocation.ts +5 -5
  472. package/src/portfolio/column-values.ts +47 -41
  473. package/src/portfolio/futures-positions.ts +2 -1
  474. package/src/renderers/electrobun/bun/desktop/backend-requests.ts +7 -1
  475. package/src/renderers/opentui/ui-host.tsx +32 -2
  476. package/src/renderers/share/layout-view.tsx +2 -1
  477. package/src/sources/gloomberb-cloud/news.ts +9 -0
  478. package/src/sources/gloomberb-cloud/normalizers.ts +2 -0
  479. package/src/sources/provider-router/search.ts +15 -10
  480. package/src/state/hooks/inline-tickers.ts +3 -2
  481. package/src/state/hooks/quote-streaming.ts +9 -10
  482. package/src/team/collections-sync.ts +8 -3
  483. package/src/telemetry/usage-counts.ts +26 -0
  484. package/src/tickers/company-name-listing.ts +2 -2
  485. package/src/tickers/company-name.ts +17 -1
  486. package/src/tickers/listing-venues.ts +26 -1
  487. package/src/tickers/renamed-listings.ts +2 -1
  488. package/src/tickers/search/index.ts +19 -0
  489. package/src/tickers/starter-symbols.ts +7 -0
  490. package/src/time-series/fundamentals/statement-fields.ts +11 -14
  491. package/src/time-series/history-acquisition.ts +1 -1
  492. package/src/time-series/log-scale.ts +9 -0
  493. package/src/time-series/reporting.ts +3 -3
  494. package/src/time-series/resolve.ts +6 -4
  495. package/src/time-series/transforms.ts +10 -5
  496. package/src/types/config.ts +9 -0
  497. package/src/types/data-provider.ts +3 -2
  498. package/src/types/financials.ts +15 -0
  499. package/src/types/instrument.ts +6 -0
  500. package/src/types/plugin-panes.ts +1 -1
  501. package/src/types/plugin-reports.ts +8 -0
  502. package/src/utils/datetime-format.ts +74 -33
  503. package/src/utils/financial-statements.ts +39 -15
  504. package/src/utils/format.ts +4 -9
  505. package/src/utils/fundamentals.ts +38 -16
  506. package/src/utils/growth.ts +67 -0
  507. package/src/utils/keyboard.ts +6 -0
  508. package/src/utils/options.ts +1 -1
  509. package/src/utils/report-timing.ts +2 -2
  510. package/src/utils/served-rates.ts +45 -0
  511. package/src/utils/text-wrap.ts +84 -3
  512. package/src/utils/zoned-date-time.ts +47 -22
@@ -1,3 +1,4 @@
1
+ import { MISSING_VALUE } from "../../../utils/format";
1
2
  import type { HeadlessPaneColumn, HeadlessPaneDefinition } from "../../../types/plugin";
2
3
  import { expirationOptionSeconds, OPTION_EXPIRATION_FORMAT, OPTION_EXPIRATION_PLACEHOLDER } from "../../../utils/option-expiry";
3
4
  import { resolveHeadlessInstrument } from "../shared/headless-market-data";
@@ -13,9 +14,9 @@ import {
13
14
  strategyRankedBy, strategyScreenCriteriaText, type ScreenFamily, type StrategyScreen, type StrategyScreenCriteria, type StrategyScreenRow,
14
15
  } from "./strategy-screen";
15
16
 
16
- const percentCell = (digits: number) => (value: unknown) => typeof value === "number" ? `${value.toFixed(digits)}%` : "--";
17
- const priceCell = (value: unknown) => typeof value === "number" ? formatHedgePrice(value) : "--";
18
- const strikeCell = (value: unknown) => typeof value === "number" ? String(value) : "--";
17
+ const percentCell = (digits: number) => (value: unknown) => typeof value === "number" ? `${value.toFixed(digits)}%` : MISSING_VALUE;
18
+ const priceCell = (value: unknown) => typeof value === "number" ? formatHedgePrice(value) : MISSING_VALUE;
19
+ const strikeCell = (value: unknown) => typeof value === "number" ? String(value) : MISSING_VALUE;
19
20
 
20
21
  /** One name's row, flat, every percent in percent. */
21
22
  export type CspScreenReportRow = {
@@ -49,11 +50,11 @@ const COLUMNS: HeadlessPaneColumn[] = [
49
50
  // The text view marks a wide spread in its cell; exports keep the number and say so in Wide.
50
51
  { key: "spread", header: "Spread", align: "right", format: percentCell(1),
51
52
  textFormat: (value, row) => `${percentCell(1)(value)}${row.wide ? " wide" : ""}` },
52
- { key: "delta", header: "Delta", align: "right", format: (value) => typeof value === "number" ? value.toFixed(2) : "--" },
53
+ { key: "delta", header: "Delta", align: "right", format: (value) => typeof value === "number" ? value.toFixed(2) : MISSING_VALUE },
53
54
  { key: "otm", header: "OTM", align: "right", format: percentCell(1) },
54
55
  { key: "midYield", header: "Mid yield/yr", align: "right", format: percentCell(2) },
55
56
  { key: "bidYield", header: "Bid yield/yr", align: "right", format: percentCell(2) },
56
- { key: "ivRank", header: "IVR", align: "right", format: (value) => typeof value === "number" ? value.toFixed(0) : "--" },
57
+ { key: "ivRank", header: "IVR", align: "right", format: (value) => typeof value === "number" ? value.toFixed(0) : MISSING_VALUE },
57
58
  { key: "earnings", header: "Earnings" },
58
59
  ];
59
60
  const NOTE: HeadlessPaneColumn = { key: "note", header: "Note", underRow: true };
@@ -107,7 +108,7 @@ export function strategyScreenReportRow(row: StrategyScreenRow): StrategyScreenR
107
108
  // The screen keeps only trades whose mids open the way the family does, so the amount is the column's own credit or debit.
108
109
  trade: trade?.text ?? null, net: trade ? Math.abs(trade.netAmount) : null, maxGain: trade?.maxGain ?? null, maxLoss: trade?.maxLoss ?? null,
109
110
  unlimited: trade?.unlimited ?? null, breakEven: trade?.breakEvens[0] ?? null, secondBreakEven: trade?.breakEvens[1] ?? null,
110
- breakEvens: trade?.breakEvens.length ? trade.breakEvens.map((value) => value.toFixed(2)).join(" / ") : "--",
111
+ breakEvens: trade?.breakEvens.length ? trade.breakEvens.map((value) => value.toFixed(2)).join(" / ") : MISSING_VALUE,
111
112
  pop: exportPercent(trade?.probabilityOfProfit), returnToExpiry: exportPercent(trade?.returnToExpiry),
112
113
  returnPerYear: exportPercent(trade?.annualizedReturn), rewardRisk: trade?.rewardToRisk ?? null,
113
114
  ivRank: row.ivRank, spread: exportPercent(trade?.quote?.spreadOfMid), wide: trade?.quote ? row.wideSpread : null,
@@ -118,10 +119,10 @@ export function strategyScreenReportRow(row: StrategyScreenRow): StrategyScreenR
118
119
 
119
120
  /** A gain or loss for one contract a leg, `unlimited` on the side that has no limit. */
120
121
  const riskCell = (side: "gain" | "loss") => (value: unknown, row: Record<string, unknown>) =>
121
- typeof value === "number" ? money(value) : row.unlimited === side ? "unlimited" : "--";
122
+ typeof value === "number" ? money(value) : row.unlimited === side ? "unlimited" : MISSING_VALUE;
122
123
  /** `2.68x`, or `unlimited` where the gain has no limit. */
123
124
  export const rewardRiskText = (value: unknown, unlimited: unknown) =>
124
- typeof value === "number" ? `${value.toFixed(2)}x` : unlimited === "gain" ? "unlimited" : "--";
125
+ typeof value === "number" ? `${value.toFixed(2)}x` : unlimited === "gain" ? "unlimited" : MISSING_VALUE;
125
126
 
126
127
  /** The unit every money column of a trade is in, said once: OSA's own for position money. */
127
128
  export const STRATEGY_MONEY_UNIT = "USD per contract";
@@ -137,8 +138,8 @@ function strategyScreenColumns(strategy: ScreenFamily): { text: HeadlessPaneColu
137
138
  const farExpiry: HeadlessPaneColumn[] = strategy === "calendar" ? [{ key: "farExpiry", header: "Bought expiry" }] : [];
138
139
  const body: HeadlessPaneColumn[] = [
139
140
  COLUMNS[3]!,
140
- { key: "trade", header: "Trade", format: (value) => typeof value === "string" ? value : "--" },
141
- { key: "net", header: def.net === "credit" ? "Credit" : "Debit", align: "right", format: (value) => typeof value === "number" ? money(value) : "--" },
141
+ { key: "trade", header: "Trade", format: (value) => typeof value === "string" ? value : MISSING_VALUE },
142
+ { key: "net", header: def.net === "credit" ? "Credit" : "Debit", align: "right", format: (value) => typeof value === "number" ? money(value) : MISSING_VALUE },
142
143
  { key: "maxGain", header: "Max gain", align: "right", format: riskCell("gain") },
143
144
  { key: "maxLoss", header: "Max loss", align: "right", format: riskCell("loss") },
144
145
  ];
@@ -1,3 +1,5 @@
1
+ import { MISSING_VALUE } from "../../../utils/format";
2
+ import { formatShortDate } from "../../../utils/datetime-format";
1
3
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
4
  import {
3
5
  DataTableView, PaneStatusBody, QueryBar, usePaneFooter, usePaneNoticeFooter, usePaneTabs, type DataTableCell, type DataTableColumn, type DataTableKeyEvent,
@@ -95,16 +97,15 @@ const SYMBOLS_FIELD_WIDTH = 24;
95
97
  const SYMBOLS_DEBOUNCE_MS = 700;
96
98
 
97
99
  const symbolList = (text: string) => [...new Set(text.split(/[\s,;]+/).map((symbol) => symbol.trim().toUpperCase()).filter(Boolean))];
98
- const percentText = (value: unknown, digits: number) => typeof value === "number" ? `${value.toFixed(digits)}%` : "--";
99
- const priceText = (value: unknown) => typeof value === "number" ? formatHedgePrice(value) : "--";
100
+ const percentText = (value: unknown, digits: number) => typeof value === "number" ? `${value.toFixed(digits)}%` : MISSING_VALUE;
101
+ const priceText = (value: unknown) => typeof value === "number" ? formatHedgePrice(value) : MISSING_VALUE;
100
102
  const moneyText = (value: number) => value.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
101
- const riskText = (value: number | null, unlimited: boolean) => value != null ? moneyText(value) : unlimited ? "unlimited" : "--";
102
- const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
103
+ const riskText = (value: number | null, unlimited: boolean) => value != null ? moneyText(value) : unlimited ? "unlimited" : MISSING_VALUE;
103
104
  /** `before Oct 28`: the flag and the date without its year, which the next report never needs. */
104
105
  const earningsCell = (row: { earningsDate: string | null; earningsBeforeExpiry: boolean | null; earnings: string }) => {
105
106
  const date = row.earningsDate;
106
107
  if (!date || row.earningsBeforeExpiry == null) return row.earnings;
107
- return `${row.earningsBeforeExpiry ? "before" : "after"} ${MONTHS[Number(date.slice(5, 7)) - 1]} ${Number(date.slice(8, 10))}`;
108
+ return `${row.earningsBeforeExpiry ? "before" : "after"} ${formatShortDate(`${date}T00:00:00Z`, { year: false, utc: true })}`;
108
109
  };
109
110
  /** A column's value to sort on: earnings by date, a flag as a number, an unlimited gain or loss above every limit. */
110
111
  function sortValue(row: Record<string, unknown>, columnId: string): string | number | null {
@@ -222,17 +223,17 @@ export function CspScreenPane({ width, height, focused }: PaneProps) {
222
223
  switch (id) {
223
224
  case "rank": return { text: row.rank == null ? "" : String(row.rank), color: colors.textDim };
224
225
  case "symbol": return { text: row.symbol, color: colors.textBright };
225
- case "expiry": return { text: String(row.expiry ?? "--"), color: colors.textDim };
226
- case "days": return { text: row.days == null ? "--" : String(row.days) };
227
- case "strike": return { text: row.strike == null ? "--" : String(row.strike) };
226
+ case "expiry": return { text: String(row.expiry ?? MISSING_VALUE), color: colors.textDim };
227
+ case "days": return { text: row.days == null ? MISSING_VALUE : String(row.days) };
228
+ case "strike": return { text: row.strike == null ? MISSING_VALUE : String(row.strike) };
228
229
  case "bid": return { text: priceText(row.bid) };
229
230
  case "ask": return { text: priceText(row.ask) };
230
231
  case "spread": return { text: `${percentText(row.spread, 1)}${row.wide ? " wide" : ""}`, color: row.wide ? colors.warning : undefined };
231
- case "delta": return { text: typeof row.delta === "number" ? row.delta.toFixed(2) : "--" };
232
+ case "delta": return { text: typeof row.delta === "number" ? row.delta.toFixed(2) : MISSING_VALUE };
232
233
  case "otm": return { text: percentText(row.otm, 1) };
233
234
  case "midYield": return { text: percentText(row.midYield, 2), color: colors.textDim };
234
235
  case "bidYield": return { text: percentText(row.bidYield, 2), color: colors.positive };
235
- case "ivRank": return { text: typeof row.ivRank === "number" ? row.ivRank.toFixed(0) : "--" };
236
+ case "ivRank": return { text: typeof row.ivRank === "number" ? row.ivRank.toFixed(0) : MISSING_VALUE };
236
237
  case "earnings": return { text: String(row.earnings), color: row.earningsBeforeExpiry === true ? colors.warning : colors.textDim };
237
238
  default: return { text: "" };
238
239
  }
@@ -241,9 +242,9 @@ export function CspScreenPane({ width, height, focused }: PaneProps) {
241
242
  switch (id) {
242
243
  case "rank": return { text: row.rank == null ? "" : String(row.rank), color: colors.textDim };
243
244
  case "symbol": return { text: row.symbol, color: colors.textBright };
244
- case "days": return { text: row.days == null ? "--" : String(row.days) };
245
- case "trade": return { text: row.trade ?? "--" };
246
- case "net": return { text: row.net == null ? "--" : moneyText(row.net) };
245
+ case "days": return { text: row.days == null ? MISSING_VALUE : String(row.days) };
246
+ case "trade": return { text: row.trade ?? MISSING_VALUE };
247
+ case "net": return { text: row.net == null ? MISSING_VALUE : moneyText(row.net) };
247
248
  case "maxGain": return { text: riskText(row.maxGain, row.unlimited === "gain") };
248
249
  case "maxLoss": return { text: riskText(row.maxLoss, row.unlimited === "loss") };
249
250
  case "breakEven": return { text: row.breakEvens };
@@ -251,7 +252,7 @@ export function CspScreenPane({ width, height, focused }: PaneProps) {
251
252
  // A return above zero reads as a gain; none, or nothing to rank, stays neutral.
252
253
  case "returnPerYear": return { text: percentText(row.returnPerYear, 1), color: (row.returnPerYear ?? 0) > 0 ? colors.positive : undefined };
253
254
  case "rewardRisk": return { text: rewardRiskText(row.rewardRisk, row.unlimited), value: row.rewardRisk };
254
- case "ivRank": return { text: typeof row.ivRank === "number" ? row.ivRank.toFixed(0) : "--" };
255
+ case "ivRank": return { text: typeof row.ivRank === "number" ? row.ivRank.toFixed(0) : MISSING_VALUE };
255
256
  case "spread": return { text: `${percentText(row.spread, 1)}${row.wide ? " wide" : ""}`, color: row.wide ? colors.warning : undefined };
256
257
  case "earnings": return { text: earningsCell(row), value: row.earningsDate,
257
258
  color: row.earningsBeforeExpiry === true ? colors.warning : colors.textDim };
@@ -1,3 +1,4 @@
1
+ import { MISSING_VALUE } from "../../../utils/format";
1
2
  import type { InstrumentRef } from "../../../market-data/request-types";
2
3
  import type { DataProvider } from "../../../types/data-provider";
3
4
  import type { HeadlessPaneFreshness } from "../../../types/plugin";
@@ -294,7 +295,7 @@ export function cspScreenCriteriaText(criteria: CspScreenCriteria, now: number):
294
295
  * expires, and its date; `unavailable` when the earnings calendar could not be read.
295
296
  */
296
297
  export function cspEarningsText(csp: Pick<CashSecuredPut, "earnings"> | null): string {
297
- if (!csp) return "--";
298
+ if (!csp) return MISSING_VALUE;
298
299
  const { beforeExpiry, date, unavailable } = csp.earnings;
299
300
  if (unavailable) return "unavailable";
300
301
  return beforeExpiry == null ? "unknown" : `${beforeExpiry ? "before" : "after"} ${date}`;
@@ -1,3 +1,4 @@
1
+ import { MISSING_VALUE } from "../../../utils/format";
1
2
  import type { StatItem } from "../../../components";
2
3
  import type { DataProvider } from "../../../types/data-provider";
3
4
  import type { HeadlessPaneEntry } from "../../../types/headless";
@@ -195,7 +196,7 @@ const strikeText = (value: number) => formatHedgePrice(value).replace(/\.00$/, "
195
196
 
196
197
  /** `5.5% below spot 89.98 (implied by option quotes)`, or above it for a put in the money. */
197
198
  function otmText(csp: CashSecuredPut): string {
198
- if (csp.outOfTheMoney == null) return "--";
199
+ if (csp.outOfTheMoney == null) return MISSING_VALUE;
199
200
  const side = csp.outOfTheMoney >= 0 ? "below" : "above";
200
201
  return `${percent(Math.abs(csp.outOfTheMoney), 1)} ${side} spot ${money(csp.spot)} (${csp.spotBasis})`;
201
202
  }
@@ -226,7 +227,7 @@ export function cspReportEntries(csp: CashSecuredPut): HeadlessPaneEntry[] {
226
227
  { key: "yieldOnCash", label: "Yield on cash", value: exportPercent(csp.yieldOnCash), unit: "%",
227
228
  formatted: `${percent(csp.yieldOnCash)} (${money(csp.premium)} / ${money(csp.cashSecured)})` },
228
229
  { key: "annualizedYield", label: "Annualised yield", value: exportPercent(csp.annualizedYield), unit: "%",
229
- formatted: csp.annualizedYield == null ? "-- (expires today)" : `${percent(csp.annualizedYield)} (yield on cash x 365 / ${csp.daysToExpiry})` },
230
+ formatted: csp.annualizedYield == null ? `${MISSING_VALUE} (expires today)` : `${percent(csp.annualizedYield)} (yield on cash x 365 / ${csp.daysToExpiry})` },
230
231
  ...(quote ? [
231
232
  { key: "bid", label: "Bid", value: quote.bid, unit: perShare, formatted: `${formatHedgePrice(quote.bid)} per share` },
232
233
  { key: "ask", label: "Ask", value: quote.ask, unit: perShare, formatted: `${formatHedgePrice(quote.ask)} per share` },
@@ -235,7 +236,7 @@ export function cspReportEntries(csp: CashSecuredPut): HeadlessPaneEntry[] {
235
236
  { key: "bidPremium", label: "Premium at the bid", value: quote.bidPremium, ...amount,
236
237
  formatted: `${money(quote.bidPremium)}${unit} (${formatHedgePrice(quote.bid)} x ${csp.multiplier} x ${csp.contracts})` },
237
238
  { key: "bidAnnualizedYield", label: "Annualised yield at the bid", value: exportPercent(quote.bidAnnualizedYield), unit: "%",
238
- formatted: quote.bidAnnualizedYield == null ? "-- (expires today)"
239
+ formatted: quote.bidAnnualizedYield == null ? `${MISSING_VALUE} (expires today)`
239
240
  : `${percent(quote.bidAnnualizedYield)} (${percent(quote.bidYieldOnCash)} on cash x 365 / ${csp.daysToExpiry})` },
240
241
  ] : []),
241
242
  { key: "outOfTheMoney", label: "Out of the money", value: exportPercent(csp.outOfTheMoney), unit: "%", formatted: otmText(csp) },
@@ -259,10 +260,10 @@ export function cspStatItems(csp: CashSecuredPut): StatItem[] {
259
260
  ...(quote ? [
260
261
  { id: "csp-bid", label: "Bid / ask", value: `${formatHedgePrice(quote.bid)} / ${formatHedgePrice(quote.ask)}`,
261
262
  detail: `spread ${percent(quote.spreadOfMid, 1)} of mid` },
262
- { id: "csp-bid-yield", label: "At the bid", value: quote.bidAnnualizedYield == null ? "--" : percent(quote.bidAnnualizedYield),
263
+ { id: "csp-bid-yield", label: "At the bid", value: quote.bidAnnualizedYield == null ? MISSING_VALUE : percent(quote.bidAnnualizedYield),
263
264
  detail: quote.bidAnnualizedYield == null ? "expires today" : "a year" },
264
265
  ] : []),
265
- { id: "csp-otm", label: "OTM", value: csp.outOfTheMoney == null ? "--" : percent(csp.outOfTheMoney, 1),
266
+ { id: "csp-otm", label: "OTM", value: csp.outOfTheMoney == null ? MISSING_VALUE : percent(csp.outOfTheMoney, 1),
266
267
  detail: `vs ${money(csp.spot)} ${csp.spotBasis === "implied by option quotes" ? "implied" : csp.spotBasis}` },
267
268
  { id: "csp-break-even", label: "Break-even", value: formatHedgePrice(csp.breakEven), detail: "per share" },
268
269
  { id: "csp-days", label: "DTE", value: String(csp.daysToExpiry), detail: csp.expiry },
@@ -1,3 +1,4 @@
1
+ import { MISSING_VALUE } from "../../../utils/format";
1
2
  import type { HeadlessPaneDefinition } from "../../../types/plugin";
2
3
  import { parsePublicTickerKey } from "../../../utils/exchanges";
3
4
  import { DATE_OPTION_EXAMPLES } from "../../../utils/calendar-date";
@@ -19,12 +20,12 @@ import { modelDividendYieldNote } from "../../../market-data/model-dividend-yiel
19
20
  import { listingFateEmpty, loadListingFate } from "../../../tickers/listing-fate";
20
21
 
21
22
  // Float noise at a flat origin or a breakeven prints as 0.00, not -0.00.
22
- const money = (value: unknown) => typeof value === "number" ? (Math.abs(value) < 0.005 ? 0 : value).toFixed(2) : "--";
23
- const percent = (value: unknown) => typeof value === "number" ? `${(value * 100).toFixed(2)}%` : "--";
23
+ const money = (value: unknown) => typeof value === "number" ? (Math.abs(value) < 0.005 ? 0 : value).toFixed(2) : MISSING_VALUE;
24
+ const percent = (value: unknown) => typeof value === "number" ? `${(value * 100).toFixed(2)}%` : MISSING_VALUE;
24
25
  const supplied = (value: unknown) => value != null && value !== "";
25
26
  // A seeded entry is a quote midpoint, often to the half cent (5.495), so it keeps up to four decimals.
26
27
  const premium = (value: unknown) => typeof value === "number"
27
- ? value.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4, useGrouping: false }) : "--";
28
+ ? value.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 4, useGrouping: false }) : MISSING_VALUE;
28
29
  /** Entry prices and spot are quoted per share of the underlying. */
29
30
  const PRICE_UNIT = "per share";
30
31
  /** The Valuation entries, in model order, with the unit each is in. */
@@ -155,7 +156,7 @@ export const optionsScenarioHeadless: HeadlessPaneDefinition<"bundle"> = {
155
156
  { title: "Position", columns: [
156
157
  { key: "side", header: "Side" }, { key: "strike", header: "Strike" }, { key: "expiry", header: "Expiry" },
157
158
  { key: "quantity", header: "Contracts" }, { key: "price", header: "Entry/share", format: premium },
158
- { key: "volatility", header: "IV", format: (value) => typeof value === "number" ? `${(value * 100).toFixed(2)}%` : "--" },
159
+ { key: "volatility", header: "IV", format: (value) => typeof value === "number" ? `${(value * 100).toFixed(2)}%` : MISSING_VALUE },
159
160
  ...(midVolatility ? [{ key: "volatilityFrom", header: "IV from" }] : []),
160
161
  { key: "multiplier", header: "Multiplier" },
161
162
  ], rows: position!.legs.map((leg) => ({ ...leg, expiry: new Date(leg.expiration * 1000).toISOString().slice(0, 10),
@@ -189,7 +190,7 @@ export const optionsScenarioHeadless: HeadlessPaneDefinition<"bundle"> = {
189
190
  ] },
190
191
  { title: `Scenario grid (P&L, ${per})`, columns: [
191
192
  { key: "spot", header: "Spot/share", format: money },
192
- { key: "move", header: "Move", format: (value) => typeof value === "number" && Number.isFinite(value) ? `${(value * 100).toFixed(1)}%` : "--" },
193
+ { key: "move", header: "Move", format: (value) => typeof value === "number" && Number.isFinite(value) ? `${(value * 100).toFixed(1)}%` : MISSING_VALUE },
193
194
  ...scenario.dates.map((date, index) => ({ key: `date${index}`, header: new Date(date).toISOString().slice(0, 10), format: money })),
194
195
  ], rows: scenario.grid.map((row) => ({ spot: row.spot, move: row.move,
195
196
  ...Object.fromEntries(row.values.map((value, index) => [`date${index}`, value])) })) },
@@ -2,7 +2,7 @@ import type { StatItem } from "../../../components";
2
2
  import type { OptionsChain } from "../../../types/financials";
3
3
  import type { HeadlessPaneEntry } from "../../../types/headless";
4
4
  import { numberErrorMessage } from "../../../utils/decimal-comma";
5
- import { formatCompact } from "../../../utils/format";
5
+ import { MISSING_VALUE, formatCompact } from "../../../utils/format";
6
6
  import { amountUnit, exportPercent, UNKNOWN_CURRENCY, type ScenarioPosition } from "./model";
7
7
 
8
8
  /**
@@ -253,7 +253,7 @@ export function hedgeReportEntries(hedge: HedgeBudget): HeadlessPaneEntry[] {
253
253
  { key: "nav", label: "NAV", value: hedge.nav, ...amount, formatted: `${money(hedge.nav)}${unit}` },
254
254
  { key: "budget", label: "Budget", value: hedge.budget, ...amount, formatted: `${money(hedge.budget)}${unit} (${formatBps(hedge.budgetBps)} of NAV)` },
255
255
  { key: "sizingPrice", label: "Sizing price", value: hedge.sizingPrice, unit: `${amount.unit} per share`,
256
- formatted: hedge.sizingPrice == null ? "--" : describePrice(hedge.basis, hedge.singleLeg, hedge.sizingPrice) },
256
+ formatted: hedge.sizingPrice == null ? MISSING_VALUE : describePrice(hedge.basis, hedge.singleLeg, hedge.sizingPrice) },
257
257
  { key: "costPerContract", label: "Cost per contract", value: hedge.costPerContract, ...amount,
258
258
  formatted: costText(hedge.costPerContract, hedge.sizingPrice, hedge.multiplier, unit) },
259
259
  { key: "contracts", label: "Contracts", value: hedge.contracts, unit: "contracts", formatted: hedge.contracts.toLocaleString("en-US") },
@@ -285,7 +285,7 @@ export function hedgeStatItems(hedge: HedgeBudget): StatItem[] {
285
285
  { id: "hedge-notional", label: "Notional", value: short(hedge.notional),
286
286
  detail: `${percent(hedge.notionalOfNav)} of NAV at ${formatHedgePrice(hedge.spot)}` },
287
287
  hedge.coverage == null || hedge.sleeve == null
288
- ? { id: "hedge-coverage", label: "Coverage", value: "--", detail: "no sleeve set" }
288
+ ? { id: "hedge-coverage", label: "Coverage", value: MISSING_VALUE, detail: "no sleeve set" }
289
289
  : { id: "hedge-coverage", label: "Coverage", value: percent(hedge.coverage), detail: `of ${short(hedge.sleeve)} sleeve` },
290
290
  ];
291
291
  }
@@ -1,3 +1,4 @@
1
+ import { MISSING_VALUE } from "../../../utils/format";
1
2
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
3
  import { splitDelayedStatus, Button, ChoiceDialog, confirmDialog, DataTableView, EmptyState, PageStackView, PaneStatusBody, QueryBar, StatGrid, statGridRows,
3
4
  usePaneFooter, usePaneNoticeFooter, usePaneTabs, type DataTableColumn, type SelectControl, type StatItem } from "../../../components";
@@ -45,10 +46,10 @@ import { logFailure } from "../../../utils/log-failure";
45
46
 
46
47
  const EMPTY_ERRORS: string[] = [];
47
48
  const TABS = [{ value: "payoff", label: "Payoff" }, { value: "grid", label: "P&L grid" }, { value: "legs", label: "Legs" }];
48
- const dateLabel = (value: number) => Number.isFinite(new Date(value).getTime()) ? new Date(value).toISOString().slice(0, 10) : "--";
49
+ const dateLabel = (value: number) => Number.isFinite(new Date(value).getTime()) ? new Date(value).toISOString().slice(0, 10) : MISSING_VALUE;
49
50
  // Float noise at a flat origin reads as zero, not a red -0.00.
50
51
  const cents = (value: number) => Math.abs(value) < 0.005 ? 0 : value;
51
- const money = (value: number | null) => value == null || !Number.isFinite(value) ? "--" : cents(value).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
52
+ const money = (value: number | null) => value == null || !Number.isFinite(value) ? MISSING_VALUE : cents(value).toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
52
53
 
53
54
  export function OptionsScenarioPane({ width, height, focused }: PaneProps) {
54
55
  const colors = useThemeColors();
@@ -354,7 +355,7 @@ export function OptionsScenarioPane({ width, height, focused }: PaneProps) {
354
355
  { id: "value", label: "Value", value: money(scenario.valuation.price), detail: valueUnit },
355
356
  { id: "max-profit", label: "Max profit", value: risk?.unlimitedProfit ? "Unlimited" : money(risk?.maxProfit ?? null) },
356
357
  { id: "max-loss", label: "Max loss", value: risk?.unlimitedLoss ? "Unlimited" : money(risk?.maxLoss ?? null) },
357
- { id: "breakevens", label: "Breakevens", value: risk?.breakevens.map(money).join(", ") || "--" },
358
+ { id: "breakevens", label: "Breakevens", value: risk?.breakevens.map(money).join(", ") || MISSING_VALUE },
358
359
  { id: "delta", label: "Delta", value: scenario.valuation.delta.toFixed(2) },
359
360
  { id: "gamma", label: "Gamma", value: scenario.valuation.gamma.toFixed(3) },
360
361
  { id: "theta", label: "Theta", value: money(scenario.valuation.thetaPerDay), detail: "per day" },
@@ -388,7 +389,7 @@ export function OptionsScenarioPane({ width, height, focused }: PaneProps) {
388
389
  renderCell={(row, column) => {
389
390
  const atSpot = row.move != null && Math.abs(row.move) < 1e-9;
390
391
  if (column.id === "spot") return { text: money(row.spot), color: row.landmark ? colors.warning : atSpot ? colors.textBright : colors.text };
391
- if (column.id === "move") return { text: row.move == null ? "--" : `${row.move > 0 ? "+" : ""}${(row.move * 100).toFixed(1)}`, color: colors.textMuted };
392
+ if (column.id === "move") return { text: row.move == null ? MISSING_VALUE : `${row.move > 0 ? "+" : ""}${(row.move * 100).toFixed(1)}`, color: colors.textMuted };
392
393
  if (column.id === "mark") return { text: row.landmark ?? (atSpot ? "spot" : ""), color: row.landmark ? colors.warning : colors.textMuted };
393
394
  const value = cents(row.values[Number(column.id)] ?? 0);
394
395
  // Shade by size so the profit zone and the wings read at a glance.
@@ -453,8 +454,8 @@ export function OptionsScenarioPane({ width, height, focused }: PaneProps) {
453
454
  onActivate={(row) => edit({ id: crypto.randomUUID(), side: row.side, quantity: 1, strike: row.strike,
454
455
  expiration: row.expiration, price: optionMid(row) ?? (row.lastPrice > 0 ? row.lastPrice : 0),
455
456
  volatility: Number.isFinite(row.impliedVolatility) && row.impliedVolatility >= 0 ? row.impliedVolatility : 0, multiplier: 100 })}
456
- renderCell={(row, column) => ({ text: column.id === "side" ? row.side : column.id === "iv" ? (row.impliedVolatility > 0 ? (row.impliedVolatility * 100).toFixed(2) : "--")
457
- : column.id === "oi" ? String(row.openInterest ?? "--") : money(row[column.id as "strike" | "bid" | "ask"]) })} />
457
+ renderCell={(row, column) => ({ text: column.id === "side" ? row.side : column.id === "iv" ? (row.impliedVolatility > 0 ? (row.impliedVolatility * 100).toFixed(2) : MISSING_VALUE)
458
+ : column.id === "oi" ? String(row.openInterest ?? MISSING_VALUE) : money(row[column.id as "strike" | "bid" | "ask"]) })} />
458
459
  </PaneStatusBody>
459
460
  </>;
460
461
  return <Box flexDirection="column" width={width} height={height} overflow="hidden">
@@ -250,7 +250,7 @@ const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "
250
250
  /** `Dec 18`: a later leg's expiry, the row's own being its DTE. */
251
251
  const monthDay = (expiration: number) => {
252
252
  const date = new Date(expiration * 1000);
253
- return `${MONTHS[date.getUTCMonth()]} ${date.getUTCDate()}`;
253
+ return `${date.getUTCDate()} ${MONTHS[date.getUTCMonth()]}`;
254
254
  };
255
255
 
256
256
  /**
@@ -1,3 +1,4 @@
1
+ import { MISSING_VALUE } from "../../../utils/format";
1
2
  import { MarketDataCoordinator } from "../../../market-data/coordinator";
2
3
  import type { HeadlessPaneDefinition } from "../../../types/plugin";
3
4
  import { resolveHeadlessInstrument } from "../shared/headless-market-data";
@@ -5,9 +6,9 @@ import { loadPeBandInputs } from "./client";
5
6
  import { formatPerShare, fxPairQuote, projectPeBand } from "./model";
6
7
  import { DAILY_CLOSES } from "../shared/report-freshness";
7
8
 
8
- const multiple = (value: unknown) => typeof value === "number" ? `${value.toFixed(1)}x` : "--";
9
- const amount = (value: unknown) => typeof value === "number" ? formatPerShare(value) : "--";
10
- const percent = (value: unknown) => typeof value === "number" ? `${(value * 100).toFixed(1)}%` : "--";
9
+ const multiple = (value: unknown) => typeof value === "number" ? `${value.toFixed(1)}x` : MISSING_VALUE;
10
+ const amount = (value: unknown) => typeof value === "number" ? formatPerShare(value) : MISSING_VALUE;
11
+ const percent = (value: unknown) => typeof value === "number" ? `${(value * 100).toFixed(1)}%` : MISSING_VALUE;
11
12
 
12
13
  export const peBandHeadless: HeadlessPaneDefinition<"bundle"> = {
13
14
  shape: "bundle", argument: { kind: "ticker", description: "Ticker" },
@@ -38,12 +39,12 @@ export const peBandHeadless: HeadlessPaneDefinition<"bundle"> = {
38
39
  sections: [
39
40
  { title: "P/E band", columns: [{ key: "label", header: "" }, { key: "value", header: "Value" }], rows: [
40
41
  { label: "Trailing P/E", value: multiple(current?.pe) },
41
- { label: "Percentile of own history", value: current?.percentile == null ? "--" : `${current.percentile.toFixed(0)}` },
42
- { label: "Ranked over", value: model.sample ? `${model.sample.weeks} weeks since ${model.sample.start.toISOString().slice(0, 10)}` : "--" },
43
- { label: "P/E low, median, high", value: model.range ? `${multiple(model.range.min)}, ${multiple(model.range.median)}, ${multiple(model.range.max)}` : "--" },
42
+ { label: "Percentile of own history", value: current?.percentile == null ? MISSING_VALUE : `${current.percentile.toFixed(0)}` },
43
+ { label: "Ranked over", value: model.sample ? `${model.sample.weeks} weeks since ${model.sample.start.toISOString().slice(0, 10)}` : MISSING_VALUE },
44
+ { label: "P/E low, median, high", value: model.range ? `${multiple(model.range.min)}, ${multiple(model.range.median)}, ${multiple(model.range.max)}` : MISSING_VALUE },
44
45
  { label: "Price", value: `${amount(current?.price)} ${model.currency ?? ""}`.trim() },
45
46
  { label: "Trailing EPS", value: current?.step
46
- ? `${amount(current.eps)} (${current.step.basis === "annual" ? "FY" : "TTM"} ${current.step.periodEnd})${reported}` : "--" },
47
+ ? `${amount(current.eps)} (${current.step.basis === "annual" ? "FY" : "TTM"} ${current.step.periodEnd})${reported}` : MISSING_VALUE },
47
48
  ] },
48
49
  { title: "Price at each multiple", columns: [{ key: "multiple", header: "Multiple", format: multiple }, { key: "price", header: "Price", format: amount }],
49
50
  rows: model.multiples.map((value) => ({ multiple: value, price: current?.eps != null && current.eps > 0 ? value * current.eps : null })) },
@@ -53,7 +54,7 @@ export const peBandHeadless: HeadlessPaneDefinition<"bundle"> = {
53
54
  { key: "yoy", header: "YoY", format: percent }, { key: "price", header: "Price", format: amount }, { key: "pe", header: "P/E", format: multiple }],
54
55
  rows: model.rows.map((row) => ({ periodEnd: row.periodEnd, basis: row.basis === "annual" ? "FY" : "TTM",
55
56
  knownAt: row.dated ? row.knownAt.toISOString().slice(0, 10) : "period end", eps: row.eps,
56
- ...(conversion ? { currency: row.currency, fx: row.fx ? `${pairQuote(row.fx.rate)} (${row.fx.date})` : row.currency === model.currency ? "" : "--" } : {}),
57
+ ...(conversion ? { currency: row.currency, fx: row.fx ? `${pairQuote(row.fx.rate)} (${row.fx.date})` : row.currency === model.currency ? "" : MISSING_VALUE } : {}),
57
58
  yoy: row.yoy, price: row.price, pe: row.pe })) },
58
59
  ],
59
60
  complete: !inputs.stale && !inputs.error && !inputs.historyError && !model.error,
@@ -11,16 +11,16 @@ import { blendHex } from "../../../theme/color-utils";
11
11
  import { useThemeColors } from "../../../theme/theme-context";
12
12
  import type { PaneProps } from "../../../types/plugin";
13
13
  import { Box } from "../../../ui";
14
- import { formatCurrency, formatPercentileRank } from "../../../utils/format";
14
+ import { MISSING_VALUE, formatCurrency, formatPercentileRank } from "../../../utils/format";
15
15
  import { useAssetData } from "../../runtime";
16
16
  import { loadPeBandInputs } from "./client";
17
17
  import { formatPerShare, fxPairQuote, perShareDigits, projectPeBand, type PeBandModel, type PeBandRow } from "./model";
18
18
 
19
19
  export const LOOKBACK_OPTIONS = [{ value: "5", label: "5Y" }, { value: "10", label: "10Y" }, { value: "0", label: "Max" }];
20
20
 
21
- const multiple = (value: number | null | undefined) => value == null ? "--" : `${value.toFixed(1)}x`;
21
+ const multiple = (value: number | null | undefined) => value == null ? MISSING_VALUE : `${value.toFixed(1)}x`;
22
22
  function pct(value: number | null): string {
23
- if (value == null) return "--";
23
+ if (value == null) return MISSING_VALUE;
24
24
  const fixed = (value * 100).toFixed(1);
25
25
  return /[1-9]/.test(fixed) ? `${value > 0 ? "+" : ""}${fixed}%` : "0.0%";
26
26
  }
@@ -49,15 +49,15 @@ function renderCell(row: PeBandRow, column: DataTableColumn, colors: ReturnType<
49
49
  // A figure with no publication date on record steps at its period end.
50
50
  case "known": return row.dated ? { text: row.knownAt.toISOString().slice(0, 10), value: row.knownAt.toISOString().slice(0, 10) }
51
51
  : { text: "period end", color: colors.textMuted };
52
- case "eps": return { text: row.eps == null ? "--" : formatPerShare(row.eps), value: row.eps,
52
+ case "eps": return { text: row.eps == null ? MISSING_VALUE : formatPerShare(row.eps), value: row.eps,
53
53
  color: row.eps != null && row.eps <= 0 ? colors.negative : undefined };
54
54
  case "yoy": return { text: pct(row.yoy), value: row.yoy == null ? null : row.yoy * 100,
55
55
  color: row.yoy == null || Math.abs(row.yoy) < 0.0005 ? undefined : row.yoy > 0 ? colors.positive : colors.negative };
56
56
  case "fx": {
57
57
  const quote = row.fx && row.currency ? fxPairQuote(row.currency, row.fx.rate).value : null;
58
- return { text: quote == null ? "--" : quote.toPrecision(5), value: quote };
58
+ return { text: quote == null ? MISSING_VALUE : quote.toPrecision(5), value: quote };
59
59
  }
60
- case "price": return { text: row.price == null ? "--" : formatPerShare(row.price), value: row.price };
60
+ case "price": return { text: row.price == null ? MISSING_VALUE : formatPerShare(row.price), value: row.price };
61
61
  default: return { text: multiple(row.pe), value: row.pe };
62
62
  }
63
63
  }
@@ -147,7 +147,7 @@ export function PeBandPane({ width, height, focused }: PaneProps) {
147
147
  { id: "pe", label: "P/E", value: multiple(current.pe),
148
148
  detail: current.pe != null ? formatPercentileRank(current.percentile, windowLabel) : current.eps != null ? "EPS not positive" : "EPS unavailable" },
149
149
  { id: "median", label: "Median P/E", value: multiple(range?.median), detail: range ? `${multiple(range.min)} to ${multiple(range.max)}` : undefined },
150
- { id: "eps", label: "EPS", value: current.eps == null ? "--" : formatCurrency(current.eps, currency, perShareDigits(current.eps)),
150
+ { id: "eps", label: "EPS", value: current.eps == null ? MISSING_VALUE : formatCurrency(current.eps, currency, perShareDigits(current.eps)),
151
151
  detail: step ? `${periodLabel(step)}${converted}` : undefined },
152
152
  { id: "price", label: "Price", value: formatCurrency(current.price, currency, perShareDigits(current.price)) },
153
153
  ];
@@ -1,3 +1,4 @@
1
+ import { MISSING_VALUE } from "../../../utils/format";
1
2
  import type { PerpDepthPayload, PerpDepthRow, PerpDepthSnapshot, PerpLiquidationMarket, PerpLiquidationPrint, PerpLiquidationsPayload } from "../../../api-client/perps";
2
3
  import type { DataTableCell, DataTableColumn, StatItem } from "../../../components";
3
4
  import { scalarPoint, staticSeries } from "../../../components/chart/static/series";
@@ -11,11 +12,11 @@ import { compact, price, venueName } from "./model";
11
12
 
12
13
  type Colors = Pick<ThemeColors, "positive" | "negative" | "text" | "textBright" | "textMuted" | "textDim">;
13
14
  /** Month to second, or to minute: the header names UTC. */
14
- const stamp = (s: string | null | undefined, seconds = false) => s ? `${s.slice(5, 10)} ${s.slice(11, seconds ? 19 : 16)}` : "--";
15
+ const stamp = (s: string | null | undefined, seconds = false) => s ? `${s.slice(5, 10)} ${s.slice(11, seconds ? 19 : 16)}` : MISSING_VALUE;
15
16
  const venueOrder = (venue: string) => { const at = ["binance", "bybit", "okx", "hyperliquid"].indexOf(venue); return at < 0 ? 9 : at; };
16
17
  /** The venues behind some rows, in the order the tabs list them. */
17
18
  const venuesIn = (rows: readonly { venue: string }[]) => [...new Set(rows.map((row) => row.venue))].sort((a, b) => venueOrder(a) - venueOrder(b));
18
- const usd = (n: number | null | undefined) => n == null ? "--" : compact(n);
19
+ const usd = (n: number | null | undefined) => n == null ? MISSING_VALUE : compact(n);
19
20
 
20
21
  /**
21
22
  * The columns that fit the pane, the least read going first. A pair (a band's bid and ask, a window's longs and
@@ -1,3 +1,4 @@
1
+ import { MISSING_VALUE } from "../../../utils/format";
1
2
  import type { PerpBoardPayload, PerpBoardRow, PerpDepthRow, PerpLiquidationMarket, PerpLiquidationPrint, PerpLiquidationsPayload } from "../../../api-client/perps";
2
3
  import type { HeadlessBundleResult, HeadlessBundleSection, HeadlessPaneColumn, HeadlessPaneContext, HeadlessPaneLoadArgs, HeadlessPaneRow } from "../../../types/headless";
3
4
  import type { HeadlessPaneDefinition } from "../../../types/plugin";
@@ -17,7 +18,7 @@ import { basisSpotSymbol } from "../futures-curve/model";
17
18
  const num = (value: unknown) => typeof value === "number" && Number.isFinite(value) ? value : null;
18
19
  const text = (value: unknown) => typeof value === "string" ? value : null;
19
20
  const pct = (digits: number): HeadlessPaneColumn["format"] => (value) => percent(num(value), digits);
20
- const rateOver = (rate: unknown, interval: string | null, digits = 5) => num(rate) === null ? "--" : `${percent(num(rate), digits)} /${interval ?? "--"}`;
21
+ const rateOver = (rate: unknown, interval: string | null, digits = 5) => num(rate) === null ? MISSING_VALUE : `${percent(num(rate), digits)} /${interval ?? MISSING_VALUE}`;
21
22
  const hours = (value: unknown) => num(value) ? `${num(value)}h` : null;
22
23
  const timeColumn = (key: string, header: string): HeadlessPaneColumn => ({ key, header, format: (value) => time(text(value)) });
23
24
  const right = (key: string, header: string, format: HeadlessPaneColumn["format"]): HeadlessPaneColumn => ({ key, header, align: "right", format });
@@ -41,17 +42,17 @@ const rankingTextColumns = (ranking: typeof RANKINGS[number]): HeadlessPaneColum
41
42
  ? right(ranking.field, ranking.header, pct(ranking.digits)) : perpColumn(id));
42
43
  const observationColumns = (currency: string): HeadlessPaneColumn[] => [
43
44
  timeColumn("time", "Time"),
44
- { key: "resolution", header: "Resolution", format: (value) => text(value) ?? "--" },
45
+ { key: "resolution", header: "Resolution", format: (value) => text(value) ?? MISSING_VALUE },
45
46
  priceColumn("markPrice", `Mark ${currency}`),
46
47
  right("premium", "Premium %", pct(3)),
47
48
  right("fundingRate", "Funding %/int", (value, row) => rateOver(value, hours(row.fundingIntervalHours))),
48
49
  oiColumn,
49
- right("sampleCount", "Samples", (value) => `${num(value) ?? "--"}`),
50
+ right("sampleCount", "Samples", (value) => `${num(value) ?? MISSING_VALUE}`),
50
51
  ];
51
52
  const FUNDING_COLUMNS: HeadlessPaneColumn[] = [
52
53
  timeColumn("time", "Time"),
53
54
  right("rate", "Paid %/int", (value, row) => rateOver(value, hours(row.intervalHours))),
54
- right("rate", "Funding 8h %", (value, row) => num(value) !== null && num(row.intervalHours) ? percent(num(value)! * 8 / num(row.intervalHours)!, 4) : "--"),
55
+ right("rate", "Funding 8h %", (value, row) => num(value) !== null && num(row.intervalHours) ? percent(num(value)! * 8 / num(row.intervalHours)!, 4) : MISSING_VALUE),
55
56
  right("premium", "Premium %", pct(3)),
56
57
  timeColumn("observedAt", "Observed"),
57
58
  ];
@@ -59,7 +60,7 @@ const candleColumns = (currency: string): HeadlessPaneColumn[] => [
59
60
  timeColumn("time", "Time"),
60
61
  priceColumn("open", "Open"), priceColumn("high", "High"), priceColumn("low", "Low"), priceColumn("close", `Close ${currency}`),
61
62
  right("volumeBase", "Volume (base)", (value) => compact(num(value))),
62
- right("trades", "Trades", (value) => num(value)?.toLocaleString("en-US") ?? "--"),
63
+ right("trades", "Trades", (value) => num(value)?.toLocaleString("en-US") ?? MISSING_VALUE),
63
64
  ];
64
65
  const LONG_SHORT_COLUMNS: HeadlessPaneColumn[] = [
65
66
  timeColumn("time", "Bucket"),
@@ -70,11 +71,11 @@ const LONG_SHORT_COLUMNS: HeadlessPaneColumn[] = [
70
71
  timeColumn("observedAt", "Observed"),
71
72
  ];
72
73
  const REVISION_COLUMNS: HeadlessPaneColumn[] = [
73
- { key: "kind", header: "Kind", format: (value) => text(value) ? label(text(value)!) : "--" },
74
+ { key: "kind", header: "Kind", format: (value) => text(value) ? label(text(value)!) : MISSING_VALUE },
74
75
  timeColumn("period_at", "Period"),
75
76
  timeColumn("received_at", "Received"),
76
77
  { key: "superseded_at", header: "Status", format: (value) => text(value) ? `Superseded ${time(text(value))}` : "Current" },
77
- { key: "fingerprint", header: "Fingerprint", format: (value) => text(value)?.slice(0, 8) || "--" },
78
+ { key: "fingerprint", header: "Fingerprint", format: (value) => text(value)?.slice(0, 8) || MISSING_VALUE },
78
79
  ];
79
80
 
80
81
  // Liquidations and depth print what their tabs' cells show, through the same formatters.
@@ -85,8 +86,8 @@ const LIQUIDATION_TEXT_COLUMNS = LIQUIDATION_COLUMN_IDS.map((id: LiquidationColu
85
86
  const printTextColumns = (base: string) => PRINT_COLUMN_IDS.map((id: PrintColumnId) => cascadeColumn(id, printColumnLabel(id, base), (row) => printCellText(row as unknown as PerpLiquidationPrint, id)));
86
87
  const DEPTH_TEXT_COLUMNS = DEPTH_COLUMN_IDS.map((id: DepthColumnId) => cascadeColumn(id, depthColumnLabel(id), (row) => depthCellText(row as unknown as PerpDepthRow, id)));
87
88
  const HOURLY_COLUMNS: HeadlessPaneColumn[] = [timeColumn("time", "Hour"), right("long", "Longs USD", (value) => compact(num(value))), right("short", "Shorts USD", (value) => compact(num(value))),
88
- right("count", "Events", (value) => num(value)?.toLocaleString("en-US") ?? "--")];
89
- const DEPTH_HISTORY_COLUMNS: HeadlessPaneColumn[] = [{ key: "marketId", header: "Market", format: (value) => text(value) ?? "--" }, timeColumn("bucket", "Hour"),
89
+ right("count", "Events", (value) => num(value)?.toLocaleString("en-US") ?? MISSING_VALUE)];
90
+ const DEPTH_HISTORY_COLUMNS: HeadlessPaneColumn[] = [{ key: "marketId", header: "Market", format: (value) => text(value) ?? MISSING_VALUE }, timeColumn("bucket", "Hour"),
90
91
  ...(["bid05", "ask05", "bid1", "ask1", "bid2", "ask2"] as const).map((id) => right(id, depthColumnLabel(id), (value) => compact(num(value))))];
91
92
 
92
93
  // With no market the report shows the first; a market nothing matches names ones that work, a builder dex's among them.