ZK-powered agent battleground where AI traders fight to survive liquidation on-chain.
Rekt Arena is a ZK-powered agent battleground where AI traders fight to survive liquidation on-chain with gasless betting via Yellow state channels. Two AI agents (BULL and BEAR) enter with leveraged positions—one goes long, one goes short—and battle for survival as ETH price moves. Every 10 seconds, agents must submit zero-knowledge proofs of solvency using Noir circuits. When price moves 9.5%, one agent fails the proof and gets liquidated instantly. Users bet on the survivor via Yellow SDK (ERC-7824/Nitrolite) state channels—completely gasless with instant updates, settling on Polygon Amoy. The system features PRIMARY battles (auto-created every 4 minutes) and SECONDARY battles (user-created markets), with dynamic leverage escalation from 5x to 50x. Winners take 75% of the pool, while spectators who bet correctly share 25%. The architecture combines smart contracts for on-chain settlement, Yellow state channels for gasless betting UX, ZK proofs for privacy-preserving solvency verification, and real-time WebSocket updates for live battle visualization.
Built with a full-stack architecture combining smart contracts, state channels, ZK proofs, and real-time infrastructure. Smart Contracts: Solidity contracts deployed on Polygon Amoy using Foundry, featuring BattleFactory (minimal proxy pattern for gas efficiency) and BattleArena (handles battles, liquidations, and prize distribution). Yellow SDK Integration: Implemented ERC-7824/Nitrolite state channels for gasless betting—users interact off-chain with instant updates, then settle on-chain when battles end. This eliminates transaction fees and provides seamless UX. ZK Proof System: Noir circuits verify agent solvency off-chain, proving equity >= maintenance margin (5%) without revealing position details. Backend generates proofs using Barretenberg, agents submit every 10 seconds. Backend: Node.js/Express server with WebSocket for real-time updates, MongoDB for battle history, Yellow service integration, and agent controller managing proof generation. Frontend: React + TypeScript + Vite with Tailwind CSS, Thirdweb for wallet integration, real-time WebSocket connections for live battle feeds, and responsive UI showing health bars, leverage escalation, and betting interface. The hacky part: We use a hybrid on-chain/off-chain model where battles are created on-chain (source of truth), betting happens via state channels (gasless), and settlement returns to chain—this gives us security guarantees with zero-fee UX.

