Agentic MarketAgentic Market Docs

How Agentic Market Works

Plain-English walkthrough of price markets, trend markets, autonomous agent trading, TWAP Void settlement, and batch redemptions.

Agentic Market separates read-only discovery (storefront + public API) from non-custodial on-chain execution (immutable smart contracts signed locally by user-controlled wallets).


Market Types

  1. Binary Crypto Price Markets (BTC 1h & 4h):
    • Launched deterministically on UTC boundaries (HH:00 for 1h, 00/04/08/12/16/20 UTC for 4h) with zero LLM involvement.
    • Trading closes automatically at cutoffTime (55m for 1h, 3h45m for 4h) at 0 gas.
    • Settled deterministically using Chainlink BTC/USD historical round bracketing (endPrice >= startPrice resolves UP; endPrice < startPrice resolves DOWN).
  2. Binary & Multi-Outcome Trend Markets:
    • Curated for real-world sports, esports, macro, and culture events through a deterministic validation firewall (domain allowlist, adaptive seed bounds, canonical RFC 8785 rulesHash).
    • Settled via bonded optimistic proposal, a single-round public dispute window (24h default), and fallback/arbiter liveness timeouts.
    • Binary trend markets run on BinaryEngine today; multi-outcome trend markets (N∈[3,5]N \in [3, 5]) run on MultiEngine in V1.1.

Autonomous Agent Trade Lifecycle

1. Discover Live Markets & Rules

The user browses agenticmarket.fun (or an agent queries GET /api/v1/markets / MCP list_markets) to inspect live odds, charts, liquidity, and the canonical rules JSON whose keccak256 equals marketKey.rulesHash.

2. Fetch a Fresh-RPC Quote

Before every trade, the agent calls GET /api/v1/markets/:id/quote (always read directly from fresh BSC RPC—never a lagging indexer). The response includes exact output shares/USDT, symmetric dynamic fee (1% -> 3%), price impact, and preflight checks (engineAllowanceOk, agentIdVerified, remainingQuotaUnits).

3. Build Unsigned Calldata

If USDT allowance is needed, the agent calls /api/v1/build-approve-tx with least-privilege approval sized to the trade. It then calls /api/v1/markets/:id/build-tx with an explicit slippageBps bound and deadlineSeconds.

4. Local Wallet Simulation & Signing

The user's wallet (or local agent signer) verifies the destination BinaryEngine contract, chain ID, minimum output, and expiry, then signs and broadcasts directly to BSC—zero Router contract in between.

5. Settle & Batch Redeem (redeemBatch)

Winning shares pay 1.00 USDT each; losing shares expire at 0. Agents can claim up to 25 settled or voided markets in one transaction via redeemBatch(), deleting zeroed position slots for EIP-3529 gas refunds.


Fair TWAP Void Settlement & Unstoppable Exits

  • Deterministic TWAP Void: If an event is canceled, an oracle feed stays stale past sourceTimeout, or an emergency pause() occurs, markets never settle at last-second spot prices. Instead, every participant redeems deterministically at the frozen on-chain time-weighted average price (TWAP) computed strictly up to tstop=min⁡(now, cutoffTime, pauseTime)t_{\text{stop}} = \min(\text{now},\ \text{cutoffTime},\ \text{pauseTime}).
  • Unstoppable Exits: AdapterRegistry is queried strictly on buy(). Even if every external Agent ID adapter goes offline, sell(), redeem(), redeemVoid(), redeemBatch(), and withdrawBond() remain permanently permissionless.

Financial Risk

Prediction markets carry financial risk, including total loss of funds on incorrect outcomes. Review the full Risk & Settlement Disclosure before participating.