What This Example Shows
- A
ConcurrentWorkflowthat runs four per-chain monitors (ETH, BTC, SOL, Base) in parallel — one swarm call per block, every block - MCP wiring for Alchemy / Infura / Helius RPC endpoints so each chain agent reads its native mempool and block stream directly
- Function tools that classify every whale tx: CEX inflow/outflow, OTC, DEX swap, or bridge — with wallet-label enrichment
- Sustained polling rate-limit math: ETH block time of 12 seconds compounds to ~7,200 swarm calls/day, blowing through Free and Pro per-hour caps inside the first hour
- Real-time alert routing into Slack and Discord with severity scoring, including programmatic muting on quiet hours
Continuous block-by-block polling breaches the Free tier per-hour cap within the first hour of running. Observability for missed alerts — execution traces, retry queues, and per-agent latency — is Premium-only. See the Rate Limits documentation before you flip this loop on in production.
Why This Matters
Whale wallets historically lead the tape by 15 to 60 minutes — a $40M wBTC pull off Coinbase Prime, a fresh deposit into a Binance OTC sub-account, a bridge from Base to Solana — these are the movements that show up on a price chart later as a green or red candle. The alpha is not in seeing the transaction (any block explorer does that). The alpha is in classifying it inside the same block: is this a market maker rebalancing, an OTC settlement that will hit spot in 20 minutes, or a known fund unwinding into a bridge? Sub-block latency on that classification — and the wallet label that makes it tradeable — is the entire edge. AConcurrentWorkflow lets you process all four major L1/L2 chains in the same swarm call, so when the ETH monitor sees a whale deposit on block N, the Base monitor on that same swarm call has already seen the bridge ack on the other side.
The Architecture
Step 1: Setup
Install the dependencies and pull keys for Swarms, your RPC provider, an explorer for label lookups, and your alert webhook.mcp_url field on the agent config. The Alchemy SSE endpoint is the simplest path for ETH and Base; Helius covers Solana; an Esplora/mempool.space MCP covers BTC. You can run all four as separate containers or terminate them behind a single proxy — the swarm only cares about the URL.
Step 2: Define the Function Tools
Function tools are OpenAI-schema JSON. Define them once, attach them per-agent. The classifier and chain agents share the lookup tools; the alert generator only getspost_whale_alert.
Step 3: Define the Concurrent Per-Chain Agents
Each chain monitor runs ongpt-4.1-mini — fast and cheap is the only thing that matters when you are firing this swarm every 12 seconds. The Movement Classifier runs on grok-4 for its real-time bias and willingness to commit to a classification under uncertainty. The Alert Generator runs on claude-sonnet-4.5 because the natural-language quality of the Slack message is what makes the desk actually read it.
The classifier and alert generator are inside the same
ConcurrentWorkflow call as the chain monitors. The swarm scheduler still gives the chain monitors their parallel fan-out — the later-stage agents simply run with the aggregated outputs as input context. If you want a strict pipeline (fan-out then sequential), wrap the chain monitors in an inner ConcurrentWorkflow and the classifier/alerter in an outer SequentialWorkflow. For a hot loop you want the simpler single-swarm shape.Step 4: Process One Block End-to-End
Before flipping on the watcher, pin to a known block on each chain and dry-run the swarm. This validates MCP wiring, tool schemas, and the classifier’s commitment behavior on a static input.max_tokens on the chain monitors and tighten the classifier prompt before going live.
Step 5: The Continuous Block Watcher
This is the loop that bills. Every ~12 seconds — ETH block time, the slowest of the four — fire a fresh swarm against the latest block on each chain.- 12-second cadence → 300 calls/hour, 7,200 calls/day
- Free tier per-day cap on swarm calls is roughly 100/day — breached in 20 minutes
- Pro per-hour caps are breached in the first hour
- Premium is the only tier that holds this loop without backpressure, and it is the only tier with the execution traces you need to debug missed blocks
Live whale tracking is a Premium workload by construction. If you try to run this loop on Free or Pro you will hit 429s, miss blocks, and have no observability to tell which blocks you missed. See Rate Limits for the per-tier numbers and upgrade at https://swarms.world/platform/account.
Step 6: The Alert Output Schema
The Alert Generator emits structured rows alongside the Slack post — persist these to your warehouse so you can correlate alerts against spot moves later and grade the classifier.Real Cost vs. Whale Alert Service Subscriptions
| Stack | Monthly cost | What you actually get |
|---|---|---|
| This stack (gpt-4.1-mini chains + grok-4 classifier + sonnet-4.5 alerter, night-mode discount on quiet 02:00–06:00 UTC) | ~$750/mo (~$25/day) | Programmable layer you own, four chains, custom whale list, structured outputs to your warehouse |
| Retail whale-alert Twitter / Telegram services | $50 – $500/mo | Read-only Twitter feed, no classification, no programmatic access |
| Nansen Alpha (single chain) | $1,500/mo | Best-in-class labels, read-only dashboard, no programmable layer |
| Arkham Intelligence Pro | $1,000/mo | Strong labels, dashboard + alerts, no per-block classification |
| Building this in-house with engineers | $40,000+/mo | One mid backend + one ML engineer plus infra; what you would actually do without this |
Next Steps
- See Crypto Quant Agent for the single-agent quant analyst that consumes these alerts as a signal stream
- See AI Hedge Fund Research Pipeline for the hierarchical pattern when you want a PM agent grading the whale alerts against a fundamental thesis
- Read MCP Integration for the full Alchemy / Helius / mempool MCP wiring
- Check Rate Limits before going live — the per-tier caps decide what cadence you can sustain