Skip to main content
Every twelve seconds the largest wallets on four chains get classified — and an hour before the spot move shows up on a chart, your Slack already knows where the flow is going.

What This Example Shows

  • A ConcurrentWorkflow that 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 the Free tier’s per-day cap after a few hours
  • 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-day cap within a few hours of running. Watch the X-RateLimit-* response headers (or poll GET /v1/rate/limits) so you catch a tightening window before you start dropping blocks to 429s. 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. A ConcurrentWorkflow 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.
The four per-chain agents each point to a different MCP server via the 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 gets post_whale_alert.

Step 3: Define the Concurrent Per-Chain Agents

Each chain monitor runs on gpt-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 xai/grok-4.3 for its real-time bias and willingness to commit to a classification under uncertainty. The Alert Generator runs on claude-sonnet-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.
If wall time on the replay exceeds ETH block time (12 seconds), you have a latency problem and the watcher will fall behind under live load. Lower 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.
The math is brutal:
  • 12-second cadence → 300 calls/hour, 7,200 calls/day
  • Free tier caps are 100/minute, 350/hour, 1,200/day — the per-day cap is breached in 4 hours
  • Paid tiers (Pro, Ultra, Premium) share 2,000/minute, 10,000/hour, 100,000/day, which holds this loop
  • Watch X-RateLimit-Remaining-* on every response (or poll GET /v1/rate/limits) so you can back off before a 429 costs you a block
Live whale tracking is a Premium workload by construction. If you try to run this loop on Free you will hit 429s and miss blocks once the per-day cap is exhausted. See Rate Limits for the per-tier numbers and upgrade at https://cloud.swarms.world/settings.

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.
A simple persistence pattern:

Real Cost vs. Whale Alert Service Subscriptions

Night-mode tip: the API applies its off-peak token-cost discount automatically between 8pm and 6am Pacific (America/Los_Angeles) — no request changes needed. Separately, most chains are quieter in the early-UTC-morning hours; if you want to cut call volume too (not just get the automatic discount), drop the watcher to a 60-second cadence during that quiet window. The point is not that this is cheaper than a Twitter bot. The point is that a Twitter bot is read-only. This is a programmable layer with structured outputs that route into your own systems — execution, risk, research database — at whale-feed latency.

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