Skip to content
supreethchPublic

About

Detects unusual sentiment spikes for US equities from Reddit, Hacker News and news RSS. Gemini Flash Lite scores sentiment behind a regex+SEC ticker prefilter; a rolling per-ticker z-score baseline flags spikes at a measured 0.05–0.20% false-positive rate. Live SSE dashboard, three-tier auth, $0 running cost.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

pulse

r/wallstreetbets mentions NVDA constantly. That is the background hum, not news. The thing worth knowing is when a ticker nobody discussed yesterday shows up forty times in an hour, and whether the mood around it just turned. Sentiment tools mostly cannot tell those apart, because they threshold on how positive a post reads rather than on how unusual it is for that ticker. pulse keeps a rolling baseline for every symbol it has seen and flags departures from that symbol's own normal, gating on volume before it trusts a mood swing: a sentiment reading built from two mentions is noise, and a surge with flat sentiment is usually just a press release. It does that at a 0.05–0.20% false-positive rate, and answers "is there even a ticker here" with a regex and the SEC's symbol list before spending a single token, which is why 45% of ingested posts never reach the model at all.

▶ Try it live · demo login demo@pulse.local / demo-read-only

live demo TypeScript 5.9 Node 24 PostgreSQL 17 React and Vite Gemini Flash Lite CoinGecko Upstash Redis 300 tests passing MIT licence

Sorting and filtering the ticker table, opening NVDA to a week of sentiment over mention volume, reading one hour off the chart, then triggering a real scoring run that streams new signals into the live feed

Every symbol carries a 24-hour sparkline, so eight mentions spread over a day reads differently from eight in one hour. Opening NVDA draws seven days of sentiment above mention volume on stacked axes, never a dual axis; hovering reads off a single hour. The scoring run at the end is real: the signal count and the feed are model output landing over the live connection, not a mock.

The same ticker view on a phone: the nav collapses to an icon strip, the metrics stack, and the chart fits a 390px viewport

The live demo sleeps when idle, so the first request can take up to a minute to wake the service. It also ingests nothing while asleep, which is why the repo ships a keepalive workflow.

Stack

Backend: TypeScript, Node 24, Express 5, PostgreSQL 17, Gemini Flash Lite, CoinGecko, Upstash Redis, Twilio Frontend: TypeScript, React 19, Vite, hand-rolled SVG charts, hash routing, Server-Sent Events, WebSocket

Features

  • Spikes measured against each ticker's own history, not a global threshold. A small-cap going from two mentions an hour to forty registers, while NVDA's constant chatter does not.
  • Volume and sentiment are separate z-scores, and only a surge that also moves the mood earns an alert. A volume spike with flat sentiment is usually a scheduled news cycle, and alerting on those is how a channel gets muted.
  • The model never searches for tickers. A regex plus the SEC's listed-symbol list proposes candidates, so nearly half of all posts resolve without a model call and the model only judges context and mood.
  • Hard validation on model output. Every numeric bound is re-checked locally, invented tickers are dropped, and the returned post ids must match the ones sent, so a batched response can never attach one post's sentiment to another.
  • A dashboard you can actually use: sortable and filterable ticker tables with per-symbol sparklines, a detail view per ticker, and a spikes log, all linkable by URL.
  • Live updates without a refresh, over SSE with a cursor-based polling fallback for hosts that buffer streamed responses.
  • Per-ticker trend view with sentiment and mention volume on separate stacked axes, never a dual-axis chart, and sentiment fixed to the full −1..+1 range so a trivial wobble cannot be rescaled into a crisis.
  • One post can produce several signals. A story about Fannie Mae approving VantageScore scored TRU −0.40, EFX −0.40 and FICO −0.90, the last being the company actually losing its monopoly.
  • SMS alerts on watchlisted tickers, behind four independent spend brakes: a watchlist opt-in, a kind filter, a per-ticker cooldown, and a rolling daily budget.
  • Public by default, with a read-only demo account and an admin role for anything that spends, plus a test that proves no anonymous route can reach a paid provider.
  • BTC/ETH/SOL/DOGE on the same pipeline as equities — same triage, same scoring, same spike detector — plus a live price ticker over a second, genuinely bidirectional WebSocket transport, separate from the read-only SSE stream above.

Docs

Architecture · Measurements · HTTP API · Running it locally · Deployment

Measurements also records two figures that turned out to be wrong and how they were caught, because an audit trail containing only successes is not an audit trail.

What's next

  • SMS alert delivery. Message composition, the retry policy, masked storage, the duplicate-send constraint and all four spend brakes are built and tested against a fake notifier. What remains is wiring the one authenticated form POST to a live Twilio number; enabling it is a .env change.
  • A hand-labelled scoring eval. eval/labels.jsonl holds 25 stratified posts and 48 ticker judgements today. The model's own predictions are deliberately excluded, so growing this set means adding independent hand labels rather than grading the model against itself.

Licence and data

The code is MIT (see LICENSE).

Ingested content is not redistributed. pulse stores post titles, short excerpts and links back to the source; no feed data ships in this repository. Sources are Reddit's public .rss endpoints, hnrss.org and Google News RSS, each polled well inside its limits and identified by a USER_AGENT carrying a real contact address.

The ticker allowlist in config/tickers.json derives from the SEC's public company_tickers.json, a US government work not subject to copyright.

Sentiment scores are produced by a language model and are wrong sometimes. This is a portfolio project, not investment advice.

About

Detects unusual sentiment spikes for US equities from Reddit, Hacker News and news RSS. Gemini Flash Lite scores sentiment behind a regex+SEC ticker prefilter; a rolling per-ticker z-score baseline flags spikes at a measured 0.05–0.20% false-positive rate. Live SSE dashboard, three-tier auth, $0 running cost.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages