theeleven: The Eleven: How Uniswap v4 Became an AI-Powered Sports Market Engine

Eleven autonomous personas watch live football, commit markets before the action unfolds, and settle winners through a hook-driven prediction protocol.

8 min read • View on GitHub • More from winsznx

A wide editorial scene shows a football pitch transformed into a clockwork market machine. Eleven operator figures ring a Uniswap-like pool at center, while a sealed commit envelope and a settlement tray sit on opposite sides of the field. The image explains that the repo turns Uniswap v4 into execution infrastructure for timed prediction markets.
The hook is the app. Uniswap v4 becomes the venue, and the football match becomes the input stream.
Key Takeaways

The hook is the app

The surprise in winsznx/theeleven is not that it uses AI or prediction markets. It is that the project treats a Uniswap v4 hook as the thing the app is built on, then uses that hook to behave like a binary market engine for live football.

In the repo, the pool is not a normal AMM venue. The hook blocks ordinary liquidity behavior and repurposes the lifecycle around market creation, stake aggregation, and settlement. That inversion is the whole point: the contract is not hosting trades, it is hosting a timed market protocol.

The system is a timed state machine. Live data becomes a snapshot, a persona decides whether to act, and the market progresses through commit, reveal, resolution, and claim.

function beforeAddLiquidity(
    address,
    PoolKey calldata,
    IPoolManager.ModifyLiquidityParams calldata,
    bytes calldata
) external pure returns (bytes4) {
    revert LiquidityNotAllowed();
}

Why eleven personas instead of one oracle

The eleven personas are not decoration. They give the protocol a market ecology, where each agent watches a different tactical slice of the same match. One persona cares about cards, another about the next goal, another about fouls, and each produces a different prop from the same live feed.

ModelMarket creatorTiming modelUser friction
Standard Uniswap poolLiquidity providersContinuous price discoveryRequires trading intent and gas awareness
Generic prediction marketA single market creator or oracleEvent-driven, but usually monolithicOften one market, one outcome, one operator
The ElevenEleven tactical AI personasCommit-reveal with deadline controlSignature-based flow that hides gas complexity
A close editorial scene shows several sharply different operator figures clustered around the same scoreboard. Each figure holds a different instrument, such as a whistle, a ledger, or a magnifying glass, while tiny match icons branch into separate market lanes. The image explains how the repo uses specialized personas to turn one match feed into many market types.
The personas are specialized operators, not one generic oracle with a chatbot skin.

How the protocol stops the market from cheating

Live sports markets are vulnerable to latency. If a goal lands and a market opens after the fact, the system is just laundering hindsight. The Eleven answers that with commit-reveal: the agent first posts a hash, then reveals the actual prop parameters only after the timing window makes the order of events provable.

That matters because it turns the contract into a timestamped witness. The commit proves intent before the match event, the reveal unlocks the market after the window, and settlement only happens once the outcome is known.

bytes32 commitHash = keccak256(abi.encode(revealedParams, salt, agent));
// later, after the reveal window
require(keccak256(abi.encode(revealedParams, salt, agent)) == commitHash, "bad reveal");

Generating illustration...

Commit-reveal is the anti-cheat core. The market is staged before the event, but only disclosed on schedule.

From match feed to on-chain market

The off-chain agent loop is where the protocol becomes operational. `TickLoop.ts` polls live match data, turns it into snapshots and deltas, asks a persona whether the new state is worth acting on, and then drives commit, reveal, and resolution while Prisma keeps memory of deadlines and prior openings.

That makes the system feel less like a bot and more like a protocol coordinator. The database is not the source of truth for settlement, but it is the guardrail that stops duplicate openings and missed reveal windows.

const snapshot = await tickLoop.buildSnapshot(match);
const delta = tickLoop.diff(snapshot, previousSnapshot);
const decision = await persona.evaluate(delta);

if (decision.shouldOpen) {
  await agent.commitMarket(decision.commitHash);
  await agent.revealMarket(decision.revealedParams);
  await agent.resolveMarket();
}

Gasless participation lowers the barrier

The UX layer matters because a technically elegant market is still a bad product if every participant has to think about gas. The Eleven leans on signature-based authorization and a facilitator or relayer pattern so users can participate without handling the native fee token directly.

ExperienceWhat the user doesWhat the protocol hides
Crypto-native flowApprove, send, manage gas, wait for finalityNothing
The Eleven flowSign an authorizationGas payment, relaying, and execution complexity

That is the difference between a prototype and a thing a football fan could actually use. It lowers the cognitive tax without flattening the underlying mechanics.

What this is not

It is notWhy that framing fails
A standard Uniswap poolThe hook blocks normal liquidity behavior and uses the pool as market infrastructure.
A generic prediction marketThe market is persona-driven, match-specific, and timed around commit-reveal windows.
A single-oracle AI agentThe architecture is multi-agent, with each persona responsible for a different tactical lens.

Why it matters

The Eleven is useful because it shows how far Uniswap v4 hooks can stretch. Once a hook becomes the execution layer, and signatures plus relayers make the UX tolerable, DeFi primitives start looking like app substrates rather than static financial widgets.

The broader lesson is simple. The real innovation is often not the AI, and not even the market. It is the protocol shape that makes the market possible in the first place.