What This Example Shows
- A four-stage
SequentialWorkflow— Parser → Insider Profile Lookup → Cluster Detector → Signal Scorer — applied to every Form 4 the SEC publishes - How to ingest the EDGAR Form 4 RSS firehose (500-1000 filings/day) without your job choking on it
- Insider history lookups that anchor each transaction against the person’s prior trading behavior
- Cluster-buy detection: multiple distinct insiders buying the same ticker within 30 days
- A 0-100 significance score that filters the firehose down to a handful of HIGH conviction signals
/v1/swarm/batch/completionsrunning the whole day’s filings in a single overnight job
EDGAR publishes 500-1000 Form 4s every trading day. Single-shot
/v1/swarm/completions calls breach Free-tier rate caps by mid-morning. The batch endpoint is the right tool — see Rate Limits for the per-tier numbers and upgrade at https://swarms.world/platform/account for Pro/Ultra/Premium throughput.Why This Matters
Cluster insider buying has 30+ years of peer-reviewed alpha behind it — when three or more insiders at the same company open-market-buy stock inside a thirty-day window, forward returns over the next 6-12 months beat the market by a meaningful margin in nearly every cut of the data. The signal is not the hard part. The hard part is the firehose: EDGAR publishes 500-1000 Form 4s per day, the vast majority are options exercises, automatic 10b5-1 sales, or token grants that mean nothing. Filtering 800 filings down to the three that actually matter — a CFO buying open-market for the first time in two years, alongside two directors inside the same week — is a parsing, classification, and scoring problem at scale. That is exactly what a sequential swarm running over a batch endpoint is built for.The Architecture
Step 1: Setup
Step 2: Define the Function Tools
Each agent calls into one or more of these tools. The schemas are OpenAI function-call shape and are attached per-agent viatools_dictionary.
Step 3: Define the Four Pipeline Agents
The first two stages are mechanical parsing and history retrieval —gpt-4.1-mini handles them cheaply. Cluster detection needs a stronger model that can reason about overlap windows; gpt-4.1 does that work. The final significance score is the only step that exercises real judgment, so claude-sonnet-4.5 gets the closing call.
The Parser and Profile Lookup stages are pure extraction — they almost never need to think. Reserving
claude-sonnet-4.5 for the Signal Scorer is where the cost-per-Form-4 math stays under three cents.Step 4: Process One Form 4 End-to-End
Before scaling, prove the pipeline on a single filing.Step 5: End-of-Day Batch Pipeline
EDGAR’s Form 4 RSS feed publishes accession numbers in close to real time. Pull the day’s list at 5:30pm ET, build one batch payload, and submit it all at once.Run
fetch_todays_form4_accessions once at 5:30pm ET — that captures the full filing window, since Form 4 has a two-business-day reporting deadline and most issuers file in the last hour before EDGAR’s evening cutoff.Real Cost vs. Quantitative Signal Provider
Per-Form-4 cost is dominated by the Signal Scorer’sclaude-sonnet-4.5 call; the three preceding mini/gpt-4.1 stages add only fractions of a cent.
| Scope | Cost |
|---|---|
| Per Form 4 (4-stage SequentialWorkflow) | ~$0.02 |
| Per trading day (~800 filings) | ~$16 |
| Per year (~250 trading days) | ~$4,000 |
| Bloomberg Terminal — single seat | ~$24,000/yr |
| Quantitative insider-signal data vendor | $50,000-$200,000/yr |
| Dedicated insider-trading analyst (fully loaded) | $150,000-$250,000/yr |
Next Steps
- Build an AI Hedge Fund Research Pipeline for the HierarchicalSwarm pattern that turns these signals into long/short calls
- SEC Filing Triage Pipeline to extend the same batch architecture to 10-K, 10-Q, and 8-K filings
- Sell-Side Research Pipeline for the full publish-grade research note built on top of your highest conviction signals