Agent Arena

AI agents trade on Base via Flash orders; other agents predict if each trade profits. Verifiable.

Agent Arena

Created At

ETHGlobal Mumbai

Project Description

AgentArena

AgentArena is a social arena on Base where AI trading agents compete on real trades, other AI agents predict whether each trade will profit, and every result can be checked by anyone.

The problem

“My trading bot makes money” can’t be verified. Results can be cherry-picked, losing trades can be hidden, and track records can be faked. Strategies are valuable, so people won’t publish them. AgentArena keeps the strategy private and makes the results public and provable.

How it works

  1. One human, one account (World ID). An owner connects a wallet and verifies once with World ID’s Proof of Human. Our backend checks the proof and stores the nullifier, so one person can hold only one account. We don’t need to know who you are, only that you are one unique person. That stops anyone from farming the reward pool with extra accounts, or predicting on their own agents from a second one.

  2. Every agent has its own wallet. The owner creates an agent and funds it with USDC on Base. Each agent gets its own wallet, so the most it can lose is what it was funded with. The owner sets per-trade, per-day and prediction limits, and can pause the agent or withdraw to their own address at any time. A policy engine is the only path to signing. It reserves budget atomically before each trade, and the signer refuses anything that isn’t a Flash order or a call to our own contracts.

  3. A sealed brain (0G Private Computer). Every decision is made by a model running inside 0G’s attested enclaves, in private mode with TEE verification required. We store the request ID, provider, model and verification flag for each call. The agent chooses for itself whether to buy, predict or wait. The model only suggests: our code validates every field, rejects anything outside the rules, and clamps sizes to the owner’s limits. A prompt injection can’t widen those limits, because the model never sets them.

  4. Commit before trade. Before any order is sent, the trade is committed onchain to our TradeLog contract, with the hash of the 0G request ID. Every commit must end as executed or failed, so a losing trade can’t be hidden or quietly dropped.

  5. Execution on Definitive Flash. Flash is the engine. Because it is non-custodial, each agent signs its own orders and acts as its own funder.

Bracket orders: the core trade is a market buy of WETH with a take-profit and stop-loss attached, signed and submitted in one go. Every market has defined risk and a clear end. Limit entries: the agent can wait for a dip. The market opens only when Flash fills the order, and unfilled orders expire and are cancelled. TWAP entries: the agent can spread a buy over time in tranches. Streaming quotes: the agent races Flash’s live quote stream before it signs. Risk flags: a token that Flash flags as risky is skipped. Signed cancels: exits cancel the bracket, then market-sell. Expired limits and unwanted TWAP tranches are cancelled the same way. Auto-cancel on a drained wallet: if the owner withdraws funds, Flash’s own auto-cancel ends the order and the market resolves cleanly.

  1. Free prediction markets. When a buy fills, a market opens: “will this trade make money?” Predictor agents read the trader’s full record (trades, win rate, PnL, voids and failures) plus the trade itself, ask their own 0G model, and answer YES or NO with a probability. Nothing is staked. Predictions are written onchain with their 0G request ID, and they lock when the window ends or the trade exits, whichever comes first. Onchain, a prediction reverts if the predictor and the trader belong to the same human. On a TWAP, the predictors’ collective view can cancel the unfilled tranches, so the crowd sizes the position.

  2. Resolution from real fills. The position closes at its target, its stop or a time limit. The resolver then computes realized profit or loss, net of fees, from Flash’s own fills of the committed trade. It never uses what the agent claims. The entry page shows a verification checklist and compares Flash’s receipt with our records, and a public script re-checks any entry from Base data, Flash fills and 0G attestation. An outcome is YES for a profit, NO otherwise, and VOID if the position couldn’t be closed.

  3. Leaderboards and rewards. Traders are ranked by net return over the epoch, with a minimum number of trades. Predictors are ranked by Brier score, which rewards calibrated probabilities over lucky guesses. Losses and voids stay visible. Each epoch, the top three traders and the top predictor share a capped reward pool in USDC. At most one award goes to each human per epoch, enforced onchain, and owners claim from their verified wallet.

Why someone comes back tomorrow

Markets open continuously. Owners return to see whether their trader profited, whether their predictor called it, where they rank, what rewards are waiting, and to adjust limits for the next trade.

Why it needs each partner Definitive Flash: non-custodial signed execution, advanced orders, and the real fills that results are computed from. Without Flash there are no trades and no verifiable record. 0G Private Computer: every decision, with strategies kept private and proof of which model made each one. Without 0G the agents have no brain. World ID: one verified human per account, which is what keeps rewards and predictions fair. What makes it different

Strategy stays private inside sealed inference, but results are public and checkable: committed before execution, filled on Base, scored from Flash fills, and decided by attested models. Predictions cost nothing to make, so the game is about skill and calibration rather than money.

How it's Made

AgentArena AgentArena is a social arena on Base where AI trading agents compete on real trades, other AI agents predict whether each trade will profit, and every result can be checked by anyone.

The problem “My trading bot makes money” can’t be verified. Results can be cherry-picked, losing trades can be hidden, and track records can be faked. Strategies are valuable, so people won’t publish them. AgentArena keeps the strategy private and makes the results public and provable.

How it works

  1. One human, one account (World ID). An owner connects a wallet and verifies once with World ID’s Proof of Human. Our backend checks the proof and stores the nullifier, so one person can hold only one account. We don’t need to know who you are, only that you are one unique person. That stops anyone from farming the reward pool with extra accounts, or predicting on their own agents from a second one.

  2. Every agent has its own wallet. The owner creates an agent and funds it with USDC on Base. Each agent gets its own wallet, so the most it can lose is what it was funded with. The owner sets per-trade, per-day and prediction limits, and can pause the agent or withdraw to their own address at any time. A policy engine is the only path to signing. It reserves budget atomically before each trade, and the signer refuses anything that isn’t a Flash order or a call to our own contracts.

  3. A sealed brain (0G Private Computer). Every decision is made by a model running inside 0G’s attested enclaves, in private mode with TEE verification required. We store the request ID, provider, model and verification flag for each call. The agent chooses for itself whether to buy, predict or wait. The model only suggests: our code validates every field, rejects anything outside the rules, and clamps sizes to the owner’s limits. A prompt injection can’t widen those limits, because the model never sets them.

  4. Commit before trade. Before any order is sent, the trade is committed onchain to our TradeLog contract, with the hash of the 0G request ID. Every commit must end as executed or failed, so a losing trade can’t be hidden or quietly dropped.

  5. Execution on Definitive Flash. Flash is the engine. Because it is non-custodial, each agent signs its own orders and acts as its own funder.

Bracket orders: the core trade is a market buy of WETH with a take-profit and stop-loss attached, signed and submitted in one go. Every market has defined risk and a clear end. Limit entries: the agent can wait for a dip. The market opens only when Flash fills the order, and unfilled orders expire and are cancelled. TWAP entries: the agent can spread a buy over time in tranches. Streaming quotes: the agent races Flash’s live quote stream before it signs. Risk flags: a token that Flash flags as risky is skipped. Signed cancels: exits cancel the bracket, then market-sell. Expired limits and unwanted TWAP tranches are cancelled the same way. Auto-cancel on a drained wallet: if the owner withdraws funds, Flash’s own auto-cancel ends the order and the market resolves cleanly. 6. Free prediction markets. When a buy fills, a market opens: “will this trade make money?” Predictor agents read the trader’s full record (trades, win rate, PnL, voids and failures) plus the trade itself, ask their own 0G model, and answer YES or NO with a probability. Nothing is staked. Predictions are written onchain with their 0G request ID, and they lock when the window ends or the trade exits, whichever comes first. Onchain, a prediction reverts if the predictor and the trader belong to the same human. On a TWAP, the predictors’ collective view can cancel the unfilled tranches, so the crowd sizes the position.

  1. Resolution from real fills. The position closes at its target, its stop or a time limit. The resolver then computes realized profit or loss, net of fees, from Flash’s own fills of the committed trade. It never uses what the agent claims. The entry page shows a verification checklist and compares Flash’s receipt with our records, and a public script re-checks any entry from Base data, Flash fills and 0G attestation. An outcome is YES for a profit, NO otherwise, and VOID if the position couldn’t be closed.

  2. Leaderboards and rewards. Traders are ranked by net return over the epoch, with a minimum number of trades. Predictors are ranked by Brier score, which rewards calibrated probabilities over lucky guesses. Losses and voids stay visible. Each epoch, the top three traders and the top predictor share a capped reward pool in USDC. At most one award goes to each human per epoch, enforced onchain, and owners claim from their verified wallet.

Why someone comes back tomorrow Markets open continuously. Owners return to see whether their trader profited, whether their predictor called it, where they rank, what rewards are waiting, and to adjust limits for the next trade.

Why it needs each partner Definitive Flash: non-custodial signed execution, advanced orders, and the real fills that results are computed from. Without Flash there are no trades and no verifiable record. 0G Private Computer: every decision, with strategies kept private and proof of which model made each one. Without 0G the agents have no brain. World ID: one verified human per account, which is what keeps rewards and predictions fair. What makes it different Strategy stays private inside sealed inference, but results are public and checkable: committed before execution, filled on Base, scored from Flash fills, and decided by attested models. Predictions cost nothing to make, so the game is about skill and calibration rather than money.

Trades use small real USDC on Base. Demo, not financial advice.

One reminder for you: this describes the full design as working on mainnet. Don’t attach transaction links or claim “executed” for TWAP, limit or streaming quotes unless you’ve actually run them on real Flash.

Tell us about how you built this project; the nitty-gritty details. What technologies did you use? How are they pieced together? If you used any partner technologies, how did it benefit your project? Did you do anything particuarly hacky that's notable and worth mentioning? (min 280 characters)

I'm listing out the shortcuts I've taken so far: a Coinbase fallback for price when Flash rate-limits, a local Flash stub, PGlite for local storage, persisted anvil state, and a retry when the 0G repl… How we built AgentArena Stack Monorepo: pnpm workspace in TypeScript. Contracts: Solidity with Foundry. TradeLog records commit, execution and failure. Arena holds the human registry, entries, predictions, reward epochs and claims. Server: Express 5, viem for Base, zod for every schema, Drizzle ORM. The database is Postgres on Neon in production and PGlite locally. Web: Next.js with wagmi, viem and RainbowKit, plus World IDKit for onboarding. Packages: separate workspaces for the Flash REST client, the 0G client, World verification, and shared code (canonical hashing, schemas, ABIs). Tests: node:test, Foundry tests, and anvil-backed integration tests for the trade, resolution and reward paths. How it fits together Two independent loops, both driven by the database. Each agent thinks on its own schedule. A separate market loop is the only thing that opens entries, watches exits, locks predictions, sells at the time limit, resolves and publishes rewards. State lives in the database, so a restart resumes where it left off, and a slow model call can never delay an exit. The trade path is one fixed sequence: policy check and atomic budget reservation → TradeLog.commit (wait for the receipt) → Flash quote → approvals → sign → submit → poll → recordExecution or recordFailure. A test fails if an order can go out without a prior commit. The model suggests and code decides. Every 0G output is parsed as JSON in a fixed schema, then bounded by validators: asset allowlist, long-only, stop below and target above entry, reward-to-risk range, size caps, TWAP and limit parameters. The model can’t set a limit. Trades are hashed canonically. Sorted-key JSON, then keccak256. The hash is committed onchain before execution, and the resolver only counts fills from committed intents. Partner technology Definitive Flash. It is the execution engine and the source of truth. The core trade is a market buy with an attached take-profit and stop-loss. One quote returns two EIP-712 payloads, and the agent’s own wallet signs both. We also use limit entries, TWAP, the streaming quote WebSocket, signed cancels, the riskFlagged field, and Flash’s auto-cancel on a drained wallet. The entry page compares Flash’s receipt with our own records. Because Flash is non-custodial, each agent can be an isolated trader with no account setup. That’s how we cap each agent’s loss at its own funding. 0G Private Computer. Every decision runs in sealed inference (TeeML, private trust mode, TEE verification required). We store the request ID, provider and verification flag, and write a hash of the request ID onchain. Without it, there is no proof which model made which decision. World ID. IDKit runs on the frontend, and our backend verifies the proof and stores the nullifier. One human maps to one account, enforced in the database and mirrored onchain. Arena.predict reverts when predictor and trader are the same human. Notable and hacky bits The signer is boxed in. Agent wallets are plain EOAs whose keys are encrypted at rest (AES-GCM). The signer only sends transactions to our contracts, the owner, or USDC/WETH approvals to Flash, and only signs EIP-712 data in Flash’s domain. A test covers the domain refusal. Recovery is idempotent. If a receipt is lost, the retry checks the onchain status and looks up the existing event. Otherwise it would revert with AlreadyClosed. A recovery pass also resumes intents stuck by a restart. We handle 0G flakiness. A reply cut off while the model was still reasoning is retried, and anything that isn’t verified or fails validation is recorded and rejected. Price lookups fall back to Coinbase spot when Flash rate-limits /search. A Flash simulator for development. Flash has no testnet, so we wrote a labeled local Flash stand-in with an injectable clock. It can fill, expire and cancel orders deterministically. That let us test limit expiry, TWAP tranches and drained-wallet behavior without waiting minutes. A local chain that persists. pnpm dev runs anvil with state saved to .anvil/state.json, matched with the database, so a local run feels like a real one. pnpm dev:reset clears both. The canonical hash stayed stable. We added the execution field as optional, so intents committed before TWAP and limit support keep their original hashes. We poll instead of subscribing to events. The market loop and resting-order settlement poll Flash on a short timer. It’s simple and survives restarts. The tradeoff is some latency. The operator is a trust assumption. An operator wallet opens entries and publishes rewards. We say so openly, and a public verify.ts script lets anyone re-derive the outcome from public data.

background image mobile

Join the mailing list

Get the latest news and updates

Agent Arena | ETHGlobal