Skip to content

Type-aware security pages (epic) #97

Description

@binarypath

Epic: Replace the single /security/{symbol} page with type-specific routes + templates + JS modules for crypto, ETF, index, forex. Stock keeps /security/{sym} unchanged.

Today every non-stock security (BTCUSD, ^DJI, USDGBP, SPY) renders a US-equity-shaped template: Market Cap / P/E / Key People / Financials / Estimates / SEC / stock-only peers. Almost none of which is meaningful.

URL scheme

GET /crypto/BTCUSD   → crypto.html  + crypto.js
GET /index/^DJI      → index.html   + index.js
GET /forex/USDGBP    → forex.html   + forex.js
GET /etf/SPY         → etf.html     + etf.js
GET /security/AAPL   → security.html + info.js   (unchanged)
GET /security/BTCUSD → 301 → /crypto/BTCUSD      (legacy compat)

Child issues

  • Foundation — routing + dispatch + legacy redirect + info-shared.js extraction
  • Crypto info page (vertical slice)
  • ETF info page (vertical slice)
  • Index info page (vertical slice)
  • Forex info page (vertical slice)

Migrated from

docs/TODO-security-types.md — that file will be deleted on the foundation PR (its content is captured here and in the child issues).

Current state worth keeping

  • detectSecurityType() in internal/server/static/info.js:215 already reads profile.exchange (CRYPTO / CCC / FOREX), the ^ prefix (index), and profile.isEtf (ETF). Reuse.
  • applySecurityType() (info.js:225) hides Financials / Estimates / SEC for crypto/forex/index. ETFs still see the stock tabs (gap).
  • News categories crypto / forex are already wrapped in internal/news/news.go:546-560.
  • Universal EOD chart (GetHistoricalPriceLight, news.go:362) works for any symbol FMP indexes.
  • Search results already carry Exchange (news.go:18) — we can detect type from search response alone.

Critical gaps

  • Single canonical URL, single template — no clean way to give crypto its own affordances without if-soup in info.js.
  • ETF tab-hiding never wired.
  • News tab shows all 6 categories for every type.
  • Sector tab calls /stable/stock-peers, useless for non-stocks. No crypto-peer / index-components / ETF-holdings views.
  • Trading pipeline runs the SEC analyst for crypto/forex/index/ETF, wasting Ollama calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogItems migrated from ideas.md backlogfeature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions