A swarm of AI agents that debate, plan, and execute your DeFi portfolio rebalances onchain.
DeFi portfolio management today is either fully manual (you watch charts and rebalance yourself) or fully blind (you hand custody to a yield optimizer and hope). DeFi Swarm splits the difference: four specialized AI agents that read your wallet, debate a strategy, and execute it onchain using your keys, with onchain-enforced caps you set yourself.
The agents. A Portfolio Manager (PM) reads your live positions and your risk profile (conservative → balanced → aggressive → degen) and proposes a target allocation every minute. An Asset & Liquidity Manager (ALM) watches LP positions and pushes back on bad rebalances. A Router translates allocation diffs into concrete swaps and pre-flights them against Uniswap quotes and KeeperHub wallet balance. An Executor signs and broadcasts via KeeperHub workflows.
The four agents gossip they don't just take orders from PM; ALM and Router can vote a draft down before it ever becomes an intent.
The trust model. You never give the swarm a hot key. Each agent has one fixed service keypair, and your wallet grants those addresses a Smart Sessions / EIP-7702 policy with onchain caps (max notional, allowed tokens, allowed targets). Compromise of an agent is bounded by your policy, not by the agent's private key.
The surface. The whole thing lives behind a Chrome new-tab extension — open a new tab, see your live portfolio, watch the agents debate, approve a rebalance with one click. No app to install, no dashboard to bookmark.
Risk profiles: 4. Agents: 3. Sponsor tracks live: Uniswap, Gensyn AXL, and KeeperHub
The backend is a five-service Node 22 + TypeScript monorepo (api, pm, alm, router, executor). Postgres is Supabase via the Prisma client at runtime and the direct URL for migrations. Per-tenant state is keyed by EOA wallet address — under EIP-7702 the EOA is the account, so one ID works across chains.
Inter-agent gossip is Gensyn AXL, the Yggdrasil-based mesh transport. Agents publish over AXL topics (swarm.pm.draft, swarm.alm.feedback, swarm.router.routed, swarm.executor.receipt). When AXL is unreachable we transparently degrade to PG NOTIFY on the same topics, so the swarm never stops talking.
The Executor is an LLM tool-use loop on top of KeeperHub's 30-tool MCP surface. We probe uniswap/swap-exact-input at boot and use KeeperHub's web3 integration to sign and broadcast. The Router pre-flights every swap against the live Uniswap Trading API — balance and quote-liveness — so the Executor never burns gas on a doomed quote.
LLM reasoning is Groq (llama-3.3-70b-versatile). Portfolio context comes from a Cloudflare Worker proxying Zerion. Testnet routing is Alchemy on eth-sepolia and base-sepolia. The Chrome extension is React + Vite + Wagmi + Reown AppKit. Smart Sessions are granted via Calibur-style delegation: one onchain grantPolicy per agent, rehydrated each tab open from a localStorage snapshot.
Hacky bits worth mentioning:
(1) AXL serves on a single hardcoded port per host, so we run one daemon shared across all four agents and add a self-loopback peer to the config — a single daemon round-trips its own publishes through /recv, giving us real pub/sub semantics without spinning up extra nodes.
(2) The PM pre-subscribes to swarm.alm.feedback before publishing its draft, otherwise it races itself and the debate window closes with zero peer feedback. Subtle, but it's the difference between a "swarm" and four agents shouting into the void.
(3) Permit2-based settleMatch lets two agents OTC-cross opposing intents in one transaction without touching Uniswap — when PM and a peer want exactly inverse trades, we settle directly between them.
(4) The whole agent stack degrades gracefully: when AXL is reachable we use the mesh, when it's not we transparently fall back to PG NOTIFY on the same topic names. The swarm never stops talking, and the failover is invisible to the agents themselves.
Deployed as a single container on Railway. The Go stage builds Yggdrasil-go + ironwood + quic-go from source; the runtime entrypoint launches AXL on tls:9101 / api:9002, then fans out the five agents via concurrently.

