HOW IT WORKS
From the SEC's website to your inbox.
There are four pieces of DEHY: a poller, a parser, a feed, and an alerter. Each one does one thing.
1. The poller
Every 30 seconds, the worker fetches the SEC's recent Form 4 Atom feed. New accessions — identified by their unique accession number — are enqueued for extraction. The poller is the only piece of DEHY that talks to EDGAR.
2. The parser
For each accession in the queue, the extraction worker fetches the Form 4 primary XML document and parses it through a strict Zod schema. Every field — shares, price, transaction code, ownership type — is validated before it lands in the database. Malformed filings go to a dead-letter queue with the original payload for diagnosis; they never silently disappear.
3. The feed
The web app reads from Postgres only. Server components render the feed on every request — no client-side data fetching, no stale cache. The same query that powers the dashboard powers the public sample feed on the homepage, so what you see in marketing is what you get inside.
4. The alerter
When a Form 4 lands, the extraction worker queries the watchlist for any user watching that issuer (by ticker or by CIK) and enqueues one alert job per match. The alert worker claims the delivery slot atomically — a unique constraint on (user_id, filing_id) prevents duplicate emails — and sends via Resend.
What this means in practice
- A typical filing lands in the feed in 20–50 seconds after publication.
- If you have an issuer on your watchlist, the email is in your inbox within a few seconds of the filing landing.
- If EDGAR is down or rate-limits us, we back off exponentially and catch up on recovery. No filings are lost — only delayed.