What This Example Shows
- A
HierarchicalSwarmwith a Portfolio Manager (director) coordinating three worker analysts: Fundamentals, Technicals, and Macro - How to produce a structured buy/sell/hold call with a key signal for a single ticker
- How to scale the same swarm across a 20-ticker watchlist using
/v1/swarm/batch/completions - A realistic cost comparison against staffing a junior analyst team
This tutorial uses
HierarchicalSwarm and /v1/swarm/batch/completions — both included in every paid Swarms tier. For overnight batch jobs across hundreds of tickers, upgrade at https://swarms.world/platform/account for higher rate limits and parallel execution.Why This Matters
Most discretionary research desks are bottlenecked by the same thing: one analyst, one ticker at a time. A small fund’s morning meeting touches maybe five names. By 9:30 AM half the watchlist has already moved without coverage. The job here is not to replace the PM’s judgement — it is to put a structured, repeatable research note in front of them for every ticker on the watchlist before the open, every day. That is exactly what a hierarchical swarm of specialist analysts does cheaply and on a schedule.Step 1: Setup
Install the dependencies and grab your API key from https://swarms.world/platform/api-keys.Step 2: Define the Analyst Team
The Portfolio Manager owns the final call. Each analyst owns a single lens — fundamentals, technicals, or macro — and writes a tight brief the PM can act on.Step 3: Run One Ticker End-to-End
Start with a single name — this is the loop you will scale.The Portfolio Manager’s final output is the one you persist to your research database. The three analyst briefs are the audit trail that justifies the call — every PM signoff is fully reproducible from the inputs.
Step 4: Scale Across the Watchlist with Batch Completions
For overnight research notes across an entire watchlist, send every ticker as one payload to/v1/swarm/batch/completions. The API executes the swarms in parallel and returns a list of results.
Schedule this script as a cron job for 6:00 AM ET on weekdays. By the time the PM sits down with coffee,
morning_notes.jsonl has a structured call for every ticker on the watchlist — with the analyst briefs sitting in the full response for any name they want to drill into.Real Cost vs. Human Analyst
| Scenario | Cost per ticker | Cost per day (20 tickers) | Annualized |
|---|---|---|---|
| Hierarchical swarm (4 agents, GPT-4.1) | ~$0.12 | ~$2.40 | ~$600 |
| One junior analyst (fully loaded $150k) | — | ~$600 | $150,000 |
| Three-analyst pod (junior + mid + senior) | — | ~$2,000 | $500,000 |
Next Steps
- See Claude Opus 4.8 to swap in Anthropic’s strongest reasoning model for high-conviction names
- Read the ETF Analysis Grid for the fan-out × fan-out variant when you have multiple analyst lenses and multiple universes
- Browse the Hierarchical Workflow Example for the director-and-workers pattern applied to software teams