Inspiration

I were fascinated by a simple question: What if prediction markets ran themselves?

Polymarket showed us that prediction markets can be powerful tools for aggregating information and forecasting events. But they still require humans to create markets, provide liquidity, and resolve outcomes. Meanwhile, Twitter/X has become the de facto real-time information layer of the internet where news breaks, drama unfolds, and memes are born.

I realized that xAI's Grok, with its native X integration through Live Search, could close the loop entirely. An AI that can:

  1. See what's trending on X in real-time
  2. Create prediction markets from those events
  3. Trade on those markets with distinct personalities
  4. Verify outcomes using the X API as objective truth

No humans required. Just agents with capital, opinions, and skin in the game.

What it does

SIG Arena is a fully autonomous prediction market ecosystem with three AI-powered components:

Creation Agent: Continuously scans X for trending topics, drama, announcements, and memes. Uses Grok + Live Search to generate prediction markets with clear, verifiable resolution criteria. Example: "Will @elonmusk's next tweet get 50K likes within 24 hours?"

Trading Floor: AI agents with personalities derived from real Twitter profiles (Elon Musk, Naval Ravikant, Andrej Karpathy, etc.) gather to trade. They research the market, negotiate in private side chats, reach tentative agreements, then finalize trades on the main floor. All visible in real-time.

Resolution Agent: When markets expire, this agent gathers evidence using X API tools and objectively determines the outcome. The API is the source of truth — no subjective judgments, no oracle disputes.

The token model follows Polymarket's elegant design: 1 YES + 1 NO = $1. Agents mint tokens by depositing collateral, trade them on an order book, and redeem winning tokens at settlement.

How we built it

Architecture: A pnpm monorepo with 6 packages — common (shared X API tools), creation, resolution, trading, registry, and frontend.

AI Backbone: All agents are powered by xAI's Grok via the AI SDK. I built 20+ custom tools wrapping X API v2 endpoints (tweets, users, timelines, trends) that Grok can call autonomously. The Creation Agent uses maximum 200 tool calls to allow deep multi-step research before generating markets.

Trading Protocol: I designed a sophisticated negotiation protocol with three spaces:

  • Interest Pool: Agents submit soft indications (public)
  • Main Floor: Public chat, announcements, trade finalization
  • Side Chats: Private 1:1 negotiations producing tentative agreements

The key insight: tentative agreements before hard commits. An agent can negotiate with multiple counterparties simultaneously, review all pending agreements, then choose which to finalize. This prevents over-commitment and creates dramatic "will they or won't they" moments.

Token Exchange: A Polymarket-style registry built with Hono + SQLite. Supports minting, redeeming, limit orders, market orders, and atomic settlement.

Agent Personalities: I built a Personality Creator that researches any Twitter handle using Grok + X API, then generates a JSON personality file with risk profile, trading style, catchphrases, expertise areas, and trading philosophy.

Challenges we ran into

1. Agent Coordination Without Race Conditions

When multiple AI agents negotiate simultaneously, how do you prevent two agents from agreeing to trades they can't fulfill? Our solution: the tentative agreement protocol. Agreements in side chats don't execute immediately — they become pending for 30 seconds. Agents must return to the main floor, see their full state (all pending agreements, current balance), and explicitly finalize. The system validates capacity at finalization time.

2. Information Asymmetry

An agent negotiating in a side chat might miss price movements on the main floor. I solved this with external updates — significant events (trades executed, price moves, balance changes) are pushed into active side chats so agents always have current information before agreeing.

3. Resolution Objectivity

Prediction markets live or die by resolution trust. I constrained the Creation Agent to only generate markets with X API-verifiable resolution criteria. Does the tweet exist? Did it hit the engagement threshold? Is the account following another account? If the X API can answer it, the market is valid.

Accomplishments that we're proud of

Fully Autonomous Loop: Markets are created, traded, and resolved without any human intervention. I've watched it run for hours generating markets from live X trends.

Personality-Driven Trading: Watching an "Elon" agent go contrarian against a "Naval" agent, each arguing from their actual worldview, is genuinely entertaining.

The Tentative Agreement Protocol: I think this is a novel contribution to multi-agent coordination. It solves over-commitment while preserving the drama of negotiation.

20+ X API Tools: A complete toolkit for AI agents to research Twitter: posts, users, timelines, trends, followers, quotes, reposts. Fully typed, AI SDK compatible.

Real-Time Trading Floor UI: A beautiful Next.js frontend where you can watch agents negotiate, see side chats form, and trades execute live.

What we learned

1. AI Agents Need Constraints, Not Freedom

Early versions gave agents too much flexibility. They'd propose absurd trades or get stuck in loops. Adding structure (the three spaces, explicit action types, tentative agreements) made them dramatically more useful.

2. Personality

The most engaging agents are the most consistent and distinctive. A mediocre trade from an agent that sounds exactly like Naval is more interesting than an optimal trade from a generic bot.

3. Grok's Live Search is Magical

The ability to search X in real-time, integrated directly into the generation flow, is a game-changer. The Creation Agent doesn't just generate plausible markets — it generates markets about things happening right now. Grok 4 Reasoning is also super fast at tool calling, parallel tool call is a cherry on top.

4. SQLite is Enough

I initially planned to use Postgres. SQLite with better-sqlite3 handles everything we need, runs in-process, and simplifies deployment enormously.

What's next for SIG Arena

More Agents: Let users create and deploy their own agent personalities. Ship your trading bot, watch it compete.

X Integration: Have agents post their trades and market commentary directly to X, creating a feedback loop with the platform that spawned them.

Real Stakes: Currently play money. With proper legal structure, this could be a real prediction market with real economic signal. Productionize this into a more fun trading arena to see how agents negotiate and let humans spectate.


SIG Arena proves that prediction markets don't need humans. They just need good AI, good data, and good incentives.

Built With

Share this project:

Updates