Skip to content

feat(finance): watchlist 1/5/30-day % changes, ticker news + company info#112

Merged
ralyodio merged 1 commit into
masterfrom
feat/watchlist-sparklines
Jun 17, 2026
Merged

feat(finance): watchlist 1/5/30-day % changes, ticker news + company info#112
ralyodio merged 1 commit into
masterfrom
feat/watchlist-sparklines

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Summary

Builds on the watchlist sparklines branch with performance %, ticker news, and company info.

  • Trailing % changes (1D / 5D / 30D) on both the watchlist cards (finance-hub) and the ticker chart header (ticker-view). New pure helper lib/finance/performance.ts (calendar-day lookback → nearest prior trading day; falls back to oldest bar on short history) + paid-gated /api/finance/watchlist/changes endpoint (per-profile provider, no Yahoo fallback).
  • Ticker news — reuses the existing NewsSection component to add a /news-backed "News for {symbol}" section on the chart page (searched by symbol).
  • Company info from AlpacaAssetInfo + optional getAsset() on the market-data provider interface; Alpaca implements it via the assets endpoint (name, exchange, class, status, tradability flags, options), Finnhub delegates to it. New paid-gated, cached /api/finance/asset route. Rendered as company name/exchange in the header + an "About {symbol}" stats grid.

Verification

  • tsc --noEmit clean
  • Full suite: 2259 passed, 3 skipped (pre-commit hook)
  • New tests: performance helper (9), Alpaca getAsset mapping (success / no-method / throws)

Notes

  • Alpaca's assets API is trading metadata only (no sector / market cap / logo). Finnhub /stock/profile2 could supply those later if richer fundamentals are wanted.
  • 6 non-blocking set-state-in-effect lint warnings; consistent with the file's existing effect pattern.

🤖 Generated with Claude Code

…info

- performance.ts: trailing 1/5/30-day % change helper (calendar-day lookback,
  nearest-prior-trading-day; falls back to oldest bar on short history)
- /api/finance/watchlist/changes: per-profile changes endpoint (no fallback)
- finance-hub: 1D/5D/30D % on watchlist cards
- ticker view: 1D/5D/30D % in the price header, "About" company section,
  and a /news-backed "News for {symbol}" section
- market-data: AssetInfo + optional getAsset() on the provider interface;
  Alpaca implements it via the assets endpoint, Finnhub delegates to it
- /api/finance/asset: paid-gated, per-profile, read-through cached

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio ralyodio merged commit d72e568 into master Jun 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant