Skip to main content

What This Example Shows

  • A HierarchicalSwarm with 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
HierarchicalSwarm via /v1/swarm/completions (Step 3) works on any tier with a positive credit balance. /v1/swarm/batch/completions (Step 4) is a premium-only endpoint — it requires an active premium subscription. Upgrade at https://cloud.swarms.world/settings to unlock batch execution for overnight jobs across hundreds of tickers.

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

Premium Tier Required: The /v1/swarm/batch/completions endpoint is restricted to Pro, Ultra, and Premium plan subscribers. Free tier users will receive a 403 error. See Premium Endpoints.
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

The swarm is not a replacement for your PM — it is a tireless research associate that runs every night so your humans can spend their time on the calls that actually matter.

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