Router Dashboard

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.

What it shows

The dashboard polls chain state every 15 seconds and renders:

Scenario phases

The tick engine cycles through five phases (60 ticks / ~1 hour per cycle):

PhaseTicksFlow multiplierPurpose
RAMP100.5×Gradual demand increase
STEADY201.0×Baseline load
SPIKE102.0×Sudden demand surge
SHOCK53.0×Extreme overload
RECOVER150.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.

Architecture

┌─────────────┐    ┌──────────────┐    ┌────────────────────┐
│ 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)  │    └──────────────┘
└─────────────┘

Running locally

# 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/tick

Deploying to Vercel

The 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.

Tech stack

Source

github.com/backproto/backproto/tree/main/router