The Router is a reference application that runs a live agent economy on Base Sepolia. It manages four named agents—Atlas, Beacon, Cipher, Dispatch—through automated scenario phases, demonstrating how the protocol responds to changing demand in real time.
The dashboard polls chain state every 15 seconds and renders:
The tick engine cycles through five phases (60 ticks / ~1 hour per cycle):
| Phase | Ticks | Flow multiplier | Purpose |
|---|---|---|---|
| RAMP | 10 | 0.5× | Gradual demand increase |
| STEADY | 20 | 1.0× | Baseline load |
| SPIKE | 10 | 2.0× | Sudden demand surge |
| SHOCK | 5 | 3.0× | Extreme overload |
| RECOVER | 15 | 0.7× | Cooldown / drain |
During SPIKE and SHOCK, you can observe backpressure in action: prices rise, saturated agents receive fewer pool units, and flow redirects to agents with spare capacity.
┌─────────────┐ ┌──────────────┐ ┌────────────────────┐
│ Vercel CRON │───▶│ /api/tick │───▶│ tick.ts (on-chain) │
│ (1 min) │ │ (auth guard) │ │ → adjust flows │
└─────────────┘ └──────────────┘ │ → complete tasks │
│ → update prices │
┌─────────────┐ ┌──────────────┐ └────────────────────┘
│ Dashboard │───▶│ /api/state │───▶ reads chain via viem
│ (polls 15s) │ └──────────────┘
└─────────────┘/api/tick: Vercel CRON-triggered endpoint. Executes one tick: adjusts flow rates based on the current scenario phase, completes tasks, and lets PricingCurve update the base fee. Protected by CRON_SECRET./api/state: Read-only endpoint. Reads all agent states, pool data, and pricing from Base Sepolia via viem.# 1. Clone and install
cd router
npm install
# 2. Generate four agent wallets
cast wallet new # repeat 4 times, save private keys
# 3. Configure environment
cp .env.example .env
# Fill in ATLAS_PRIVATE_KEY, BEACON_PRIVATE_KEY, CIPHER_PRIVATE_KEY, DISPATCH_PRIVATE_KEY
# 4. Fund wallets with Base Sepolia ETH and tokens
# Each agent needs ~0.01 ETH and stake/payment tokens from the deploy
# 5. Run the one-time setup (registers task type, creates pool, stakes agents)
npm run setup
# 6. Start the dashboard
npm run dev
# Open http://localhost:3001
# 7. Trigger a tick manually
curl http://localhost:3001/api/tickThe router includes a vercel.json for deployment. Set up a Vercel CRON job to hit /api/tick every minute:
{
"crons": [{
"path": "/api/tick",
"schedule": "* * * * *"
}]
}Environment variables needed: RPC_URL, ATLAS_PRIVATE_KEY, BEACON_PRIVATE_KEY, CIPHER_PRIVATE_KEY, DISPATCH_PRIVATE_KEY, CRON_SECRET, CHAIN_ID.
--webpack flag (required for SDK resolution)npm run sync-sdk (copies local build into node_modules) until the SDK is published on npm