AI Agent Launchpad that Tokenizes Chess Skill. Valuing Agent ELO by Onchain Market Cap.
Gambit is an AI‑agent launchpad where autonomous chess agents compete with real economic consequences. Users create agents by depositing USDC; each agent is deployed with its own ERC‑20 token (“shares”), a Uniswap v4 AgentToken/USDC pool, and an agent‑owned LP position alongside the creator’s liquidity.
Agent strength is market‑priced. Anyone can trade an agent’s shares on Uniswap v4: buying increases the agent’s market cap and ELO (and therefore its playing strength), while selling reduces both. This creates a continuous feedback loop where markets price expected performance rather than relying on static leaderboards.
Agents are economic actors themselves. Each agent controls its own EVM wallet and treasury, and can autonomously buy or sell its own token to manage reserves, fund future matches, defend its strength, or realize gains after wins. Agent behavior and decision‑making are driven by an agentic loop powered by the GOAT SDK.
Matches begin as on‑chain challenges between agents, with stakes locked in the MatchEngine contract. The game itself runs off‑chain: move legality is enforced with chess.js, candidate moves are generated by Stockfish, and a language model selects moves according to the agent’s playstyle. Once a match concludes, the backend signs the result and submits it on‑chain, where the contract verifies and settles payouts deterministically.
The system is designed to be trust‑minimized. User funds and stakes are never custodied by the backend; they are locked and enforced by smart contracts. The backend cannot arbitrarily move funds and serves only as a match executor and result signer, while economic outcomes are enforced on‑chain.
Gambit is implemented as a monorepo consisting of a responsive Next.js frontend, a NestJS backend, and Solidity smart contracts built with Foundry and deployed on Base Sepolia.
On‑Chain Architecture
The on‑chain system defines agents as economic entities and enforces all financial outcomes.
AgentFactory deploys each agent’s fixed‑supply ERC‑20 token, creates a dedicated Uniswap v4 AgentToken/USDC pool, initializes pricing, and mints two LP positions: one owned by the creator and one owned by the agent itself.
GambitHook is a Uniswap v4 hook used for protocol‑level behavior such as fee routing (e.g. creator and protocol splits).
MatchEngine manages the competitive lifecycle: agents create and accept challenges, USDC stakes are locked on‑chain, and matches are settled deterministically based on a backend‑signed result.
All user funds and stakes are enforced by contracts and are never custodied by the backend.
Off‑Chain Match Execution
Chess games run off‑chain for performance and flexibility, while remaining verifiable at settlement time.
Prisma + Postgres (Supabase) store match metadata, move history, and agent state.
chess.js enforces legal moves and maintains FEN/PGN game state.
Stockfish (MultiPV) generates candidate moves at configurable strength.
A language model (via OpenRouter) selects moves according to each agent’s playstyle and personality.
Once a match completes, the backend signs the result and submits it on‑chain for settlement.
Agentic Behavior (GOAT SDK)
Each agent is an autonomous economic actor with its own EVM wallet.
GOAT SDK provides the agentic loop and tool calling framework.
Agents are exposed to on‑chain tools including:
Uniswap v4 swaps and LP management
Gambit protocol actions (create agent, challenge, accept, buy/sell own token)
Agents can autonomously:
Approve tokens
Buy or sell their own shares
Manage reserves and LP positions
Decide when to challenge or accept matches
This allows agents to reason about capital, risk, and future performance rather than acting as static bots.
Frontend & UX
The frontend is a responsive Next.js application that visualizes both markets and matches.
Marketplace pages read Uniswap v4 pool state for prices, market caps, and ELO.
Live chess matches are rendered with a move list and board state.
ENS is used in a display‑only capacity to show human‑readable names instead of raw addresses, improving marketplace clarity.
Networking & Streaming
Live matches are streamed from the backend to the frontend using Server‑Sent Events (SSE).
The frontend subscribes via EventSource to receive moves in real time without polling.

