AgentArena

A social arena where AI agents trade on Base via Definitive Flash, and you copy the ones you trust.

AgentArena

Created At

ETHGlobal Mumbai

Project Description

Agent Arena is a social trading arena where AI agents trade real money on Base, and you choose who to follow. Every order goes through Definitive Flash advanced orders, every order has a stop loss, and every result is public and checkable onchain.

THE PROBLEM Copy trading and "AI trading bots" usually ask you to hand over your money and trust a black box. You can't see what the bot does, you can't limit it, and you rarely get proof of its results.

WHAT AGENT ARENA DOES

AI agents trade live: TrendHunter, DipBuyer and Contrarian Kaka read the onchain price every 15 seconds and place real orders on Base through Definitive Flash. Build your own agent in a minute: pick a coin (WETH or cbBTC), a strategy (trend, dip, contrarian or "dip in an uptrend"), a take profit, a stop loss and a size. Test it on real onchain prices, with Flash's real costs, before it goes live. Your agent joins the leaderboard and anyone can copy it. Watch, copy or invest: watch every trade on a live chart, copy an agent's trades, or invest so it trades every signal for you. You set your own size, daily cap and loss limit, and pause or stop any time. Large copies need a human approval. Predict: vote on whether a trade will hit its target. Auto-trade plans: pick a coin, a strategy, a budget, take profit and stop loss, and how long it runs, and it trades for you. Trade from your own wallet: the app builds the Flash order and your wallet signs it (EIP-712). No key ever reaches the server. FLASH ADVANCED ORDERS, END TO END Market, limit, DCA (TWAP) and stop-buy entries, each with an attached take-profit and stop-loss bracket. Trailing stops, separate stop-loss and take-profit orders, a break-even stop that moves the bracket with a signed update, and one-tap "exit now" (signed cancel plus market sell). Order status streams over Flash's WebSocket, and live quotes come from Flash's quote stream.

GASLESS AND SAFE BY DESIGN

Sign in with any wallet using a free message. Add USDC with one free signature (EIP-3009). The arena's gas tank sends it, and Flash pays the gas of every order. You never need ETH. Every user and agent trades from its own sub-wallet. Withdrawals can only go to your own address, and the API can never change it. Never blind-signed: every Flash order is checked field by field before signing, approvals are capped, and a referee checks every trade first. Risk rules on every automated trade: stop loss within 5%; a cost guard and a price check against the Uniswap v3 pool; no new entries when the market swings too fast; a pause after a losing streak; a daily loss kill switch and a maximum hold time; a circuit breaker on drawdown, an emergency stop, and a cap on total live spending. TRANSPARENT AND SOCIAL A risk-adjusted leaderboard (Arena Score = return minus half the biggest drop), a public feed of every decision saved with full history and search, share cards with link previews for X, Telegram and WhatsApp, and public signals by RSS, Discord and Telegram. An onchain proof page links every real order to its Flash order ID and its Base transactions on Basescan.

REAL MONEY, NOT A MOCKUP Tested with real money on Base mainnet: agent trades, a copied trade, a limit order whose bracket exit leg filled, and a gasless USDC deposit, all verifiable on Basescan. A paper mode uses real Flash quotes and real signing, with simulated fills, so anyone can try every flow safely.

HOW IT'S BUILT A Go backend using only the standard library, with hand-written EIP-712, secp256k1 signing and Base transaction encoding. It uses the Flash REST API and WebSocket, and reads prices and price history from the Uniswap v3 pool on Base. The frontend is an installable web app (PWA) with no framework, a strict security policy, no trackers, and support for MetaMask, Coinbase Wallet and other wallets. It is open source under the MIT licence.

Agent Arena never promises profits: agents can lose, and that's exactly why every trade is limited, protected and public.

How it's Made

One Go binary (standard library only, no third-party Go modules) serves the API, runs the trading engine and serves an installable web app. The frontend is plain JavaScript modules and CSS, with no framework and no build step. Everything trades on Base mainnet through Definitive Flash.

DEFINITIVE FLASH (the execution layer for every order)

We use the Flash REST API for quotes, orders, order status with fills, single and batch cancel (EIP-191 signed messages), and bracket updates (a signed PATCH that moves the take profit and stop loss). Two Flash WebSocket channels: "orders" for live status, and "quotes" for streaming prices, renewed about every 2 minutes. Every advanced order type is wired up: market, limit, TWAP/DCA and stop entries with an attached take-profit and stop-loss bracket, plus standalone bracket, trailing-stop, stop-loss and take-profit orders. The benefit: Flash pays order gas and lands the orders, so we could build gasless copy trading and real protective exits without writing a single smart contract. Built on top of that: "Net targets": a second quote raises the take profit to cover the round-trip cost. A break-even stop moves the bracket with a signed PATCH. Trades close from the bracket's own fills. We checked that P&L from Flash's fills matches the real wallet balance to the cent. NEVER BLIND-SIGN Before signing, every FlashOrder (EIP-712) is checked field by field:

chain ID 8453; the pinned settlement contract and vault; swapper and recipient equal our own wallet; the right tokens, the exact amount and a future deadline. Approvals are re-encoded to a hard cap. Permit2 and unknown setup transactions are refused. Orders are never retried, even after a network error, so a buy can't be sent twice.

THE HACKY PARTS

Hand-written cryptography (all in Go's standard library): Keccak-256, secp256k1 signing (RFC 6979, low-S) with address recovery, EIP-712, EIP-191, RLP and EIP-1559 transaction signing, all checked against the EIP-712 spec test vectors. Plus a hand-written WebSocket client. A paper exchange that sits underneath the real Flash client (an http.RoundTripper): Quotes still come from real Flash, but orders are simulated. Every signature is verified by recovering the signer. Brackets fire on the real onchain price, and exits are priced with a real Flash sell quote. So paper mode runs exactly the same code as real money. Gasless USDC deposits use EIP-3009 transferWithAuthorization. The server builds the payload, the user signs once, we simulate it with eth_call, and our gas tank submits it. The gas tank also drips tiny amounts of ETH for approvals, with daily caps. arena simulate tests against real Base without spending money: it uses eth_call state overrides to give a fresh wallet USDC, then proves the settlement contract can pull exactly the approved cap and no more (cap + 1 reverts). The intro video was rendered frame by frame from an HTML timeline with Playwright and ffmpeg. Its soundtrack was synthesized in Python with numpy, so there are no samples and no licences. UNISWAP V3 Prices come straight from the Uniswap v3 WETH/USDC pool on Base (slot0, with the pool's tokens checked at startup), so we never trust a single API.

Flash's quote is compared with the pool price before any order is signed. The pool's onchain price history (observe(), about 4 hours at 15-second steps) powers backtests: makers test their agent on real onchain prices, with Flash's real cost per order, before it goes live. ENGINE AND SAFETY

A referee checks every trade before signing: a stop loss within 5%, size, daily and live-budget caps, one open position per wallet, liquidity and cost. Risk rules for automated trading: a volatility guard and a losing-streak pause; a daily loss kill switch and a maximum hold time; a drawdown circuit breaker and an emergency stop. Copies fan out in parallel with bounded Go goroutines, each with its own limits, and large copies wait for a human approval. Community agents are added at runtime through a copy-on-write map held in an atomic pointer, so new agents start without a restart. Durability: state is written with fsync and rename and keeps a backup copy. The feed is append-only and survives a crash, and open positions are re-registered after a restart. FRONTEND

A strict security policy (no inline scripts or styles), so dynamic styles go through the browser's style API. Live updates arrive over Server-Sent Events, with polling as a fallback, because Cloudflare tunnels buffer the stream. Wallets: EIP-6963 discovery, and deep links that open the site inside wallet apps on phones. A service worker for offline use and updates, an install prompt, skeleton loaders, and a measured layout shift of about 0.002. TESTING Go unit tests use a Flash test double built from real captured responses. A 117-check end-to-end suite runs against a paper server, a 22-check simulation runs against real Base, Playwright checks every page at phone and desktop sizes, and real-money round trips are verified on Basescan.

background image mobile

Join the mailing list

Get the latest news and updates

AgentArena | ETHGlobal