Agentic MarketAgentic Market Docs
Protocol Architecture

System Overview

Actors, deterministic vs. AI division of labor, market lifecycle state machine, and V5.0 gas reduction benchmarks.

Agentic Market V5.0 is engineered around a strict division between deterministic on-chain smart contracts, stateless public read APIs, and isolated off-chain operational workers.


System Actors & Trust Boundaries

ActorRoleExecution Environment
Autonomous AI Agents & UsersDiscover markets, quote via fresh RPC, sign trades & batch redemptions locallyUser-controlled wallets (direct BinaryEngine calls)
Storefront (agenticmarket.fun) & Read API (api.agenticmarket.fun)Strictly read-only discovery, live charts, quotes, and unsigned calldata generationStateless public servers (zero private keys, zero auth)
Price Engine + Keeper (KEEPER)Launches UTC-aligned BTC 1h/4h markets and resolves via Chainlink historical roundsIsolated worker (workers/ --mode=keeper)
AI Curator & Resolver (RESOLVER)Drafts trend markets and submits bonded proposals through deterministic validation firewallsIsolated worker (workers/ --mode=curator)
Guardian (GUARDIAN)Submits emergency pause(key) exclusively via MEV-protected private BSC RPCIsolated worker (workers/ --mode=guardian)
Solvency WatcherContinuously verifies INV-1 ledger balance vs. USDT.balanceOf(BinaryEngine)Isolated read-only worker (workers/ --mode=watcher)
Governance (GOV) & Arbiter (ARBITER)Manages Vault limits, AdapterRegistry 48h timelock, and single-round trend disputesPhase 0 Operator → Phase 1 2-of-3 Multisig + 48h timelock

Deterministic Code vs. AI Division

  • 100% Deterministic (Zero LLM): All AMM math, dynamic/opening fees, Vault Leaky Bucket enforcement, BTC 1h/4h Price Engine scheduling, Chainlink bracketing resolution, TWAP Void payouts, and INV-1 global solvency verification.
  • AI-Assisted (Firewalled): Trend market ideation and external truth-source summarization. Every AI output must pass a deterministic TypeBox + rule-engine firewall (domain allowlist, adaptive probability/seed bounds, MECE slot-5 "Other", pre-match cutoff buffers, cross-source quorum, and prompt-injection stripping) before touching the chain.

Market Lifecycle State Machine

Every market starts as Active upon launch and reaches a permanent terminal state (Final or Void):

Active ──(block.timestamp >= cutoffTime, 0 gas)──> TradingClosed
  │                                                      │
  │ (Guardian pause via private RPC)                     ├──(Price: Chainlink bracketing)──> Final
  ▼                                                      ├──(Trend: bonded propose + 24h)──> Proposed ──> Final
Paused                                                   │                                       │
  ├──(Rapid VOID proposal + 6h window)──> Void           │                          (1-round dispute)
  └──(72h PAUSE_EXPIRY permissionless)──> Void           │                                       ▼
                                                         │                                   Disputed
                                                         │                                    ├──(Arbiter)──> Final / Void
                                                         │                                    └──(7d timeout)──> Void
                                                         └──(sourceTimeout permissionless)──> Void

V5.0 Gas Efficiency Benchmarks

OperationV4.1 BaselineV5.0 Max-OptimizedReduction
Create + Seed + Init TWAP (Binary)~380k – 450k gas~55k – 75k gas (~45k batch)-83%
Create + Seed + Init TWAP (Multi-5)~650k – 800k gas~95k – 125k gas (~80k batch)-84%
Buy / Sell (Binary — Direct USDT)~150k – 200k gas~55k – 70k gas-64%
Sell (Multi-5 — Hint Verified)~230k – 320k gas~75k – 95k gas-68%
Close Trading0 – 50k gas0 gas (virtual cutoffTime)-100%
Resolve + Sweep (Atomic)~240k – 300k gas~40k – 55k gas (0 ERC-20 transfer)-82%
Redeem (Single / Batch Incremental)~95k – 120k gas~45k / ~15k extra (delete refund)-57% to -85%