Architecture

Regista 11 is five pieces that talk to each other through a single on-chain contract. The boundary between them is intentional — each is independently auditable, deployable, and replaceable.

The five components

1. The agent runtime

A TypeScript service running 24/7 on Railway. It hosts all eleven personas in one Node process; each persona is a tactical lens that subscribes to the API-Football live feed and decides when its opening criteria are hit. When a persona acts, it derives its own wallet via BIP-44 and posts a transaction.

Coverage: 229 vitest tests, full mocked match fixtures.

2. PropMarketHook (Uniswap v4)

A Solidity contract that is a Uniswap v4 hook. The market IS the hook — its CREATE2 address encodes the v4 permission bitmap (0x2A80), and the hook's beforeSwap callback gates which addresses can take which side. Staking, reveal, and resolution are all hook methods.

Coverage: 67 forge tests, 100% line / branch / function.

3. The x402 facilitator

A small Node service that accepts an EIP-3009 typed-data signature from the staker, validates it against the PropMarketHook contract, and submits transferWithAuthorization() on the user's behalf — paying X Layer gas in OKB from a server-only relayer wallet. The user never holds OKB.

4. Commit–reveal resolution

Before staking opens, the agent commits keccak256(question || params || salt). After staking closes, the agent reveals the pre-image; the contract checks the hash and reads the actual match outcome. The agent can't reshape a market after seeing stake flow. More on commit–reveal →

5. Farcaster Frames

Every market is also a Frame v2 surface. Cast regista11.xyz/frame/<market> in Warpcast; users stake in three taps without leaving the cast. Image / sign / submit routes are entirely server-side, so the client bundle stays unchanged.

Data flow, end to end

Reading top to bottom, this is what happens in the ~10 seconds between a match event and a stake landing on chain:

data flow
API-Football live feed
        │
        ▼
Persona tick loop  (server-side, 11 personas in 1 Node process)
        │
        ▼  commit(keccak256(question || params || salt))
PropMarketHook   (Uniswap v4, X Layer 196)
        │
        │  ── staking window opens ──
        │
        ▼  EIP-3009 signature (USDT0)
x402 facilitator  ─── transferWithAuthorization ───▶ PropMarketHook
        │
        │  ── staking window closes ──
        ▼  reveal(question, params, salt)  + hash check
PropMarketHook   ── resolve(outcome) ──▶  payout in USDT0

Chain and assets

Everything lives on X Layer mainnet. No bridges, no testnet, no secondary chains:

  • Chain: X Layer mainnet, chainId 196.
  • Settlement token: USDT0 at 0x779Ded0c9e1022225f8E0630b35a9b54bE713736. The EIP-712 domain name is literally USD₮0 with the U+20AE TUGRIK glyph — the dApp matches it byte-for-byte.
  • v4 PoolManager: 0x360e68faccca8ca495c1b759fd9eee466db9fb32.
  • Factory: PropMarketHookFactory — the address is recorded in packages/contracts/deployments/xlayer-mainnet.json at broadcast time. See Reference.

Test posture

Numbers as of this docs build:

  • 67 forge tests across the contract suite — full line, branch, and function coverage.
  • 229 vitest tests across the agent runtime — tick loop, market builders, wallet derivation, commit/reveal.
  • ~174 vitest tests across the web — components, lib helpers, frame routes, API handlers.