Case study
SwoopAgent
A Claude agent that traded newly launched tokens on Base with real money. I built it alone in under three weeks, around one rule: the agent decides, and plain backend code checks, signs and executes every trade.
- Role
- Sole engineer: backend, agent, dashboard
- Built
- February 2026
- Agent
- Claude on OpenClaw
- Stack
- TypeScript, Next.js, PostgreSQL, Redis, Docker, 0x on Base
What it did
The agent watched new token launches, scored each one against a checklist and traded the few that passed, within limits set from a web dashboard where you could also chat with it.
How a trade moved
The agent could only propose. A buy went to the backend, which ran its own checks again at execution time, signed the trade, swapped through 0x and waited for the on-chain receipt before it recorded anything. The agent never held a key.
- AgentClaude proposes
- BackendChecks every buy
- BackendSigns and swaps
- DatabaseRecords on receipt
- Every 30 secondsSafety loop
- The agent proposes a buy of a new token that passed its checklist.
- The backend checks it again: position size, open positions, daily spend, duplicates, contract security, the pool and the circuit breaker.
- It signs the trade and swaps USDC for the token through 0x.
- The receipt confirms on-chain. The position and the trade are written in one transaction.
The hard parts
Safety could not depend on the model
A loop in the backend repriced every open position every 30 seconds, enforced stop-losses and staged take-profits, and sold anything whose price had gone stale for 30 minutes, even with the agent down. A daily circuit breaker stopped new buys after a bad day.
Exits could not fail quietly
Sells skipped the limits so an exit was never blocked, retried with more slippage when a swap reverted, and counted only once the receipt confirmed. A sale closed a position only if it was still open, in the same database transaction as its trade, so two exits could not both be booked.
Lessons became code
Early live buys of tokens whose only pool was on Uniswap V4 went through, but every sale reverted: the swap routers could not reach V4. Instead of trusting the agent to remember, I blocked V4-only pools in the backend, filtered them out of the token feed and added the rule to the agent.