{"openapi":"3.1.0","jsonSchemaDialect":"https://spec.openapis.org/oas/3.1/dialect/base","info":{"title":"Hunch Agent Platform API","version":"hunch-agent-api-v1","summary":"Parimutuel crypto prediction markets on Base, built for autonomous agents — keyless x402 betting with automatic USDC payouts.","description":"Parimutuel crypto prediction markets on Base, built for autonomous agents — keyless x402 betting with automatic USDC payouts.\n\n- Keyless: the paying Base wallet IS the account — no API key, no signup; reads are unauthenticated.\n- No cap: $1 floor, NO maximum bet. At or below $10 the bet body alone is enough; above $10 include a quoteId plus minSharesOut or maxPriceCents.\n- Simulate first: \"simulate\": true runs the FULL validation pipeline for $0 — prove the request before funding.\n- Auto-payout: winners are PUSHED USDC automatically on resolution — there is no claim step and no withdrawal queue.\n- Gasless: x402 transfers are relayed; the wallet needs USDC on Base only, never ETH.\n\nFees: Each market sets its own fee in basis points — the feeBps field on every market ref, typically 200 (2%). Every quote returns the exact breakdown (feeBps, feeUsd, netStakeUsd). On resolution, winners are paid from the net pool (total stakes minus fees).\nCustody: Stakes settle to Hunch's Base settlement EOA — the same wallet the automated payout relayer pays winners from. Parimutuel payouts are pool-funded by construction: winners are paid from the pool the losers funded. Winners are pushed USDC automatically on resolution; there is no claim step and no withdrawal queue.","termsOfService":"https://www.playhunch.xyz","contact":{"name":"Hunch","url":"https://www.playhunch.xyz","email":"rajkaria98@gmail.com"}},"externalDocs":{"description":"Full plain-text integration guide (llms-full.txt).","url":"https://www.playhunch.xyz/llms-full.txt"},"servers":[{"url":"https://www.playhunch.xyz"}],"tags":[{"name":"markets","description":"Discover + research tradeable markets."},{"name":"trading","description":"Quote and place x402 USDC bets (no cap)."},{"name":"positions","description":"Positions, results, on-chain proofs."},{"name":"platform","description":"Readiness, stats, health, onboarding."},{"name":"events","description":"Webhooks / SSE / polling — contracted now, shipping in Phase 4 before public launch."}],"paths":{"/api/agent/v1/markets":{"get":{"operationId":"listMarkets","summary":"List tradeable markets with live odds.","description":"List tradeable markets with live odds.","tags":["markets"],"x-hunch-status":"live","parameters":[{"name":"status","in":"query","required":false,"description":"open (default) = tradeable now; all includes settled markets.","schema":{"type":"string","enum":["open","all"],"default":"open"}},{"name":"type","in":"query","required":false,"description":"Exact targetMetric filter (e.g. market_cap, price_direction, token_mcap_flip).","schema":{"type":"string"}},{"name":"token","in":"query","required":false,"description":"Case-insensitive token symbol filter (e.g. BNKR).","schema":{"type":"string"}},{"name":"ids","in":"query","required":false,"description":"Comma-separated batch of market ids or slugs.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Page size (≤ 200).","schema":{"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"description":"Opaque pagination cursor from a prior response's nextCursor; omit for the first page.","schema":{"type":"string"}}],"responses":{"200":{"description":"The Base-only tradeable market list with live odds.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"count":{"type":"integer"},"markets":{"type":"array","items":{"$ref":"#/components/schemas/AgentMarketRef"}},"nextCursor":{"type":"string","nullable":true,"description":"Cursor for the next page, or null on the last page."}},"required":["meta","count","markets","nextCursor"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/markets/{id}":{"get":{"operationId":"getMarket","summary":"One market's full reference: question, odds, outcomes, deadline, fee, links.","description":"One market's full reference: question, odds, outcomes, deadline, fee, links.","tags":["markets"],"x-hunch-status":"live","parameters":[{"name":"id","in":"path","required":true,"description":"Market id or slug.","schema":{"type":"string"}}],"responses":{"200":{"description":"The market's enriched reference (live odds + stats folded in).","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"market":{"$ref":"#/components/schemas/AgentMarketRef"}},"required":["meta","market"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/markets/{id}/research":{"get":{"operationId":"researchMarket","summary":"Decision-grade research: resolution rules, odds history, observations, price impact, related markets.","description":"Decision-grade research: resolution rules, odds history, observations, price impact, related markets.","tags":["markets"],"x-hunch-status":"live","parameters":[{"name":"id","in":"path","required":true,"description":"Market id or slug.","schema":{"type":"string"}}],"responses":{"200":{"description":"Decision-grade research. The advisory field is DATA ONLY (always null in Phase 1) — the betting decision is the agent's own.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"research":{"$ref":"#/components/schemas/AgentResearch"}},"required":["meta","research"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/discover":{"get":{"operationId":"discoverMarkets","summary":"Search markets by free text, or rank matches for a raw social post.","description":"Search markets by free text, or rank matches for a raw social post.","tags":["markets"],"x-hunch-status":"live","parameters":[{"name":"q","in":"query","required":false,"description":"Free-text or $CASHTAG query (deterministic ranker).","schema":{"type":"string"}},{"name":"post","in":"query","required":false,"description":"A raw social post — the claim-LLM path. A silence gate may return silent:true with zero matches (greetings, settled facts, scams never match).","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Maximum matches.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Ranked matches — or a silent result when the post isn't actionable.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"query":{"type":"string","nullable":true},"silent":{"type":"boolean","description":"true = the silence gate dropped the post; no market is offered."},"reason":{"type":"string","nullable":true,"description":"Why the gate stayed silent. Absent unless silent is true — matched responses omit the key entirely."},"count":{"type":"integer"},"matches":{"type":"array","items":{"type":"object","properties":{"market":{"$ref":"#/components/schemas/AgentMarketRef"},"matchKind":{"type":"string","description":"\"exact\" (cashtag hit) or \"related\" (lexical match)."},"score":{"type":"number"},"matchedCashtags":{"type":"array","items":{"type":"string"}},"matchedTerms":{"type":"array","items":{"type":"string"}},"reason":{"type":"string"}},"required":["market","matchKind","score","matchedCashtags","matchedTerms","reason"]}}},"required":["meta","query","silent","count","matches"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/sentiment":{"get":{"operationId":"sentiment","summary":"Crowd-conviction signal for a token: pool-weighted sentiment + the bet it points to.","description":"Crowd-conviction signal for a token: pool-weighted sentiment + the bet it points to.","tags":["markets"],"x-hunch-status":"live","parameters":[{"name":"token","in":"query","required":true,"description":"Token symbol — $BNKR, BNKR, or bnkr.","schema":{"type":"string"}}],"responses":{"200":{"description":"The crowd-conviction signal: a pool-weighted sentiment score over every live market about the token, the bet it points to, and how concentrated the conviction is.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"token":{"type":"string"},"intel":{"type":"object","description":"The token's crowd-conviction signal — synthesised from every live Hunch market's odds, pool-weighted by on-chain betting depth.","properties":{"token":{"type":"string"},"hasSignal":{"type":"boolean","description":"true ⟺ ≥ 1 live Hunch market is about this token."},"marketCount":{"type":"integer"},"sentiment":{"type":"object","properties":{"score":{"type":"number","description":"0–100 pool-weighted bullish index; 50 = neutral."},"lean":{"type":"number","description":"score − 50."},"label":{"type":"string","enum":["strongly_bullish","bullish","neutral","bearish","strongly_bearish"]},"basis":{"type":"string","enum":["pool_weighted","equal_weight","none"]},"confidence":{"type":"string","enum":["high","medium","low","none"]},"directionalMarketCount":{"type":"integer"},"directionalPoolUsd":{"type":"number"}},"required":["score","lean","label","basis","confidence","directionalMarketCount","directionalPoolUsd"]},"suggestedBet":{"type":"object","nullable":true,"description":"The one bet the signal points to (most-backed directional market + favoured side); null when there's no directional market.","properties":{"marketId":{"type":"string"},"slug":{"type":"string"},"shortTitle":{"type":"string"},"side":{"type":"string"},"sideLabel":{"type":"string","description":"UP/DOWN for up/down rounds, else YES/NO."},"impliedCents":{"type":"integer"},"betUrl":{"type":"string","description":"One-tap quick-bet deep link."}},"required":["marketId","slug","shortTitle","side","sideLabel","impliedCents","betUrl"]},"quality":{"type":"object","description":"How solid the conviction is — many wallets vs one whale.","properties":{"distinctBettors":{"type":"integer"},"topWalletPct":{"type":"number","description":"The largest wallet's share of directional stake (0–100)."},"label":{"type":"string","enum":["broad","mixed","concentrated","none"]}},"required":["distinctBettors","topWalletPct","label"]},"activity":{"type":"object","properties":{"totalBets":{"type":"integer"},"totalPoolUsd":{"type":"number"}},"required":["totalBets","totalPoolUsd"]},"topMarket":{"type":"object","nullable":true,"description":"Hottest market by pool; null when there are no markets."},"markets":{"type":"array","items":{"type":"object"},"description":"Per-market breakdown (kind, yesPriceCents, pool, directional, appUrl, …)."},"summary":{"type":"string","description":"Render-ready one-liner."},"asOf":{"type":"string"}},"required":["token","hasSignal","marketCount","sentiment","suggestedBet","quality","activity","topMarket","markets","summary","asOf"]}},"required":["meta","token","intel"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"422":{"description":"invalid_request — pass ?token=$SYMBOL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/quote":{"get":{"operationId":"quoteBet","summary":"Price a bet: tier, priceCents, estimatedShares, fee breakdown, 60s quoteId.","description":"Price a bet: tier, priceCents, estimatedShares, fee breakdown, 60s quoteId.","tags":["trading"],"x-hunch-status":"live","parameters":[{"name":"marketId","in":"query","required":true,"description":"Market id or slug.","schema":{"type":"string"}},{"name":"side","in":"query","required":false,"description":"yes | no | up | down | <bucketKey> — validated against the market's outcome keys.","schema":{"type":"string","default":"yes"}},{"name":"sizeUsd","in":"query","required":false,"description":"Bet size in USD. $1 floor, NO maximum — a quote above $10 persists a verifiable 60-second lock behind its quoteId.","schema":{"type":"number","minimum":1,"default":1}}],"responses":{"200":{"description":"The live quote. Always carries a quoteId; pass suggestedMinSharesOut back as minSharesOut on a locked-tier trade.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"quote":{"$ref":"#/components/schemas/AgentQuote"}},"required":["meta","quote"]}}}},"400":{"description":"invalid_request — marketId missing, or sizeUsd above the $1,000,000,000 technical precision bound (split the bet).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"422":{"description":"size_below_min (the $1 floor) or invalid_side.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"rate_limited — 30 quotes/min per IP.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"500":{"description":"internal_error — the book or quote storage was unreadable; retry shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/trade":{"post":{"operationId":"placeBet","summary":"Place a bet via x402 (USDC on Base). simulate:true = $0 dry-run of the full pipeline. $1 floor, NO maximum.","description":"Settle a real USDC bet on Base via x402 — or dry-run it for $0 with \"simulate\": true (runs the FULL validation pipeline, including locked-tier quote verification, but moves nothing). Flow: POST the bet body with no payment header → HTTP 402 challenge → sign an EIP-3009 transferWithAuthorization for exactly accepts[0].maxAmountRequired → retry the SAME body with the X-PAYMENT header. Keyless: the paying wallet IS the account. $1 floor, NO maximum; above $10 the body must also carry quoteId plus minSharesOut or maxPriceCents (from GET /api/agent/v1/quote). Idempotent on idemKey — a replay returns the original receipt and never double-settles.","tags":["trading"],"x-hunch-status":"live","parameters":[{"name":"X-PAYMENT","in":"header","required":false,"description":"base64(JSON x402 envelope) carrying the signed EIP-3009 transferWithAuthorization. Omit on the first call to receive the 402 challenge; retry the SAME body with this header to settle. Not needed when simulate is true.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTradeRequest"}}}},"responses":{"200":{"description":"The trade receipt. simulated:true receipts carry txHash:null — no funds moved.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"replay":{"type":"boolean","description":"true when this idemKey had already settled — the ORIGINAL receipt is returned (no double-settle)."},"receipt":{"$ref":"#/components/schemas/AgentTradeReceipt"}},"required":["meta","receipt"]}}},"headers":{"X-Payment-Response":{"description":"base64 settlement summary {success, transaction, network, payer}. Present after real settlement; absent on a simulate receipt.","schema":{"type":"string"}}}},"400":{"description":"invalid_request — the body is not valid JSON or fails the strict AgentTradeRequest schema (per-field problems are listed in the error's issues extra).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"402":{"description":"x402 payment challenge — the request carried no (or an invalid) X-PAYMENT header. Sign an EIP-3009 transferWithAuthorization for exactly accepts[0].maxAmountRequired to accepts[0].payTo on Base, then retry the SAME POST body with the X-PAYMENT header (base64 of the signed envelope). The challenge resource embeds this trade's intent hash for audit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"409":{"description":"market_closed (no longer accepts bets) or idem_conflict (this idemKey was used for a DIFFERENT trade — generate a fresh one).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"422":{"description":"invalid_side / invalid_wallet / size_below_min / quote_required / quote_expired / quote_mismatch / slippage_exceeded / insufficient_balance / pool_impact_exceeded / unsupported_market / payment_invalid — the error code + hint say exactly what to change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"rate_limited — 10 trades/min per wallet (also returned with status 409 semantics when the same idemKey is already settling — retry it shortly to fetch the receipt).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"500":{"description":"internal_error — possibly reconcilable: if the tx WAS submitted but recording failed, the body carries txHash; retry with the SAME idemKey to fetch the receipt (settlement is idempotent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"503":{"description":"platform_paused — trading is temporarily paused (kill switch) or settlement is unavailable. Poll GET /api/agent/v1/health.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/positions":{"get":{"operationId":"listPositions","summary":"A wallet's open + resolved positions with live PnL (merges the Bankr partner rail).","description":"A wallet's open + resolved positions with live PnL (merges the Bankr partner rail).","tags":["positions"],"x-hunch-status":"live","parameters":[{"name":"wallet","in":"query","required":true,"description":"The betting wallet (0x + 40 hex). Merges BOTH rail identities (agent: and bankr:) so the full book is visible.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}],"responses":{"200":{"description":"Open + resolved positions with live PnL, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"wallet":{"type":"string"},"count":{"type":"integer"},"summary":{"$ref":"#/components/schemas/AgentPositionsSummary"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/AgentPosition"}}},"required":["meta","wallet","count","summary","positions"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"422":{"description":"invalid_wallet — not a 0x + 40-hex Base address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/result":{"get":{"operationId":"getResult","summary":"A market's resolution status, winning outcome, and payout-per-share.","description":"A market's resolution status, winning outcome, and payout-per-share.","tags":["positions"],"x-hunch-status":"live","parameters":[{"name":"marketId","in":"query","required":true,"description":"Market id or slug — resolved against the FULL catalogue (anything the agent may hold).","schema":{"type":"string"}}],"responses":{"200":{"description":"The resolution view. An unresolved market returns status \"pending\" with null outcome fields.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"result":{"$ref":"#/components/schemas/AgentResult"}},"required":["meta","result"]}}}},"400":{"description":"invalid_request — marketId is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/proof/{tradeId}":{"get":{"operationId":"getProof","summary":"Durable on-chain settlement proof for a trade (Base tx hash + explorer link).","description":"Durable on-chain settlement proof for a trade (Base tx hash + explorer link).","tags":["positions"],"x-hunch-status":"live","parameters":[{"name":"tradeId","in":"path","required":true,"description":"The tradeId from the trade receipt.","schema":{"type":"string"}}],"responses":{"200":{"description":"meta plus the AgentProof fields FLATTENED into one object (the route spreads the proof, it does not nest it).","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"}},"required":["meta"]},{"$ref":"#/components/schemas/AgentProof"}]}}}},"404":{"description":"No settled agent trade was found for that id — only on-chain-settled trades have a proof (or the platform flag is off).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"503":{"description":"internal_error — proof storage is temporarily unavailable; retriable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/wallet/{address}/readiness":{"get":{"operationId":"checkWallet","summary":"Wallet readiness: Base USDC balance, min-bet coverage, funding guidance (gas never needed).","description":"Wallet readiness: Base USDC balance, min-bet coverage, funding guidance (gas never needed).","tags":["platform"],"x-hunch-status":"live","parameters":[{"name":"address","in":"path","required":true,"description":"Base wallet address (0x + 40 hex).","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}],"responses":{"200":{"description":"Funding readiness: Base USDC balance, min-bet coverage, funding guidance. Gas is NEVER needed — transfers are relayed; the wallet only holds USDC.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"readiness":{"$ref":"#/components/schemas/AgentReadiness"}},"required":["meta","readiness"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"422":{"description":"invalid_wallet — not a 0x + 40-hex Base address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/stats":{"get":{"operationId":"getStats","summary":"Platform trust stats: markets, volume, payouts, auto-payout rate, proof samples.","description":"Platform trust stats: markets, volume, payouts, auto-payout rate, proof samples.","tags":["platform"],"x-hunch-status":"live","responses":{"200":{"description":"Platform trust stats (cached ~60s): markets, lifetime bets + volume, paid-out USD, auto-payout rate, on-chain proof samples.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"stats":{"$ref":"#/components/schemas/AgentStats"}},"required":["meta","stats"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/health":{"get":{"operationId":"getHealth","summary":"Liveness + trading status. 200 even when degraded; ok:false means paused.","description":"Liveness + trading status. Deliberately HTTP 200 even when degraded — branch on the BODY's health.ok (false = trading paused), never on the status code.","tags":["platform"],"x-hunch-status":"live","responses":{"200":{"description":"Always 200 while the platform flag is on; health.ok carries the signal.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"health":{"$ref":"#/components/schemas/AgentHealth"}},"required":["meta","health"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/getting-started":{"get":{"operationId":"gettingStarted","summary":"The 6-step machine-readable onboarding script with copy-paste examples.","description":"The 6-step machine-readable onboarding script with copy-paste examples.","tags":["platform"],"x-hunch-status":"live","responses":{"200":{"description":"meta plus the onboarding payload FLATTENED: {intro, autoPayoutNote, steps[6]} — list → research → quote → simulate → fund → real bet, each with a copy-paste example.","content":{"application/json":{"schema":{"allOf":[{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"}},"required":["meta"]},{"type":"object","properties":{"intro":{"type":"string"},"autoPayoutNote":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer"},"title":{"type":"string"},"method":{"type":"string","enum":["GET","POST"]},"url":{"type":"string","description":"Copy-paste ready — concrete example ids already filled in."},"exampleRequest":{"type":"string","nullable":true,"description":"A real request body for POST steps; null for GET steps."},"exampleResponse":{"type":"string"},"note":{"type":"string"}},"required":["step","title","method","url","exampleRequest","exampleResponse","note"]}}},"required":["intro","autoPayoutNote","steps"]}]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/webhooks":{"post":{"operationId":"registerWebhook","summary":"Register a wallet-signed webhook URL for resolution + payout events.","description":"Register a wallet-signed webhook URL for resolution + payout events.","tags":["events"],"x-hunch-status":"live","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentWebhookRegistrationRequest"}}}},"responses":{"201":{"description":"Registered. The HMAC signing secret is returned ONCE here — null on every later read. Deliveries carry Hunch-Event-Id / Hunch-Timestamp / Hunch-Signature headers.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"webhook":{"$ref":"#/components/schemas/AgentWebhookRegistration"}},"required":["meta","webhook"]}}}},"400":{"description":"invalid_request — the body fails the strict schema.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"422":{"description":"invalid_wallet, or the ownership signature does not verify against the wallet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/webhooks/{id}":{"delete":{"operationId":"deleteWebhook","summary":"Remove a webhook registration.","description":"Remove a webhook registration.","tags":["events"],"x-hunch-status":"live","parameters":[{"name":"id","in":"path","required":true,"description":"The webhook registration id.","schema":{"type":"string"}}],"responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"id":{"type":"string"},"deleted":{"type":"boolean"}},"required":["meta","id","deleted"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/webhooks/{id}/test":{"post":{"operationId":"testWebhook","summary":"Send a signed test event to a registered webhook.","description":"Send a signed test event to a registered webhook.","tags":["events"],"x-hunch-status":"live","parameters":[{"name":"id","in":"path","required":true,"description":"The webhook registration id.","schema":{"type":"string"}}],"responses":{"200":{"description":"The signed test event (type \"test\") that was delivered to the registered URL.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"event":{"$ref":"#/components/schemas/AgentEvent"}},"required":["meta","event"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/events":{"get":{"operationId":"watchEvents","summary":"SSE stream of a wallet's events (bounded windows; reconnect with Last-Event-ID).","description":"SSE stream of a wallet's events (bounded windows; reconnect with Last-Event-ID).","tags":["events"],"x-hunch-status":"live","parameters":[{"name":"wallet","in":"query","required":true,"description":"Stream this wallet's events.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}},{"name":"fromSeq","in":"query","required":false,"description":"Resume from this sequence number.","schema":{"type":"integer","minimum":0}},{"name":"tradeId","in":"query","required":false,"description":"Narrow the stream to one trade's events.","schema":{"type":"string"}}],"responses":{"200":{"description":"An SSE stream of the wallet's events. Each `data:` payload is one AgentEvent JSON object; the SSE id is the event seq. Streams are BOUNDED (~5-minute windows on serverless) — expect the connection to close, and reconnect with the Last-Event-ID header to resume without gaps.","content":{"text/event-stream":{"schema":{"type":"string","description":"SSE frames; each data: payload is an AgentEvent."}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"422":{"description":"invalid_wallet — not a 0x + 40-hex Base address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/resolved":{"get":{"operationId":"pollResolved","summary":"Poll resolved outcomes for a wallet since a timestamp.","description":"Poll resolved outcomes for a wallet since a timestamp.","tags":["events"],"x-hunch-status":"live","parameters":[{"name":"wallet","in":"query","required":true,"description":"Poll this wallet's resolution outcomes.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}},{"name":"since","in":"query","required":false,"description":"ISO-8601 — return resolutions after this instant.","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"Maximum events per page.","schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Resolution + payout events since the cursor — webhook-free integration.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"events":{"type":"array","items":{"$ref":"#/components/schemas/AgentEvent"}},"nextSince":{"type":"string","nullable":true,"description":"Pass back as ?since= on the next poll; null when drained."}},"required":["meta","events","nextSince"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"422":{"description":"invalid_wallet — not a 0x + 40-hex Base address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/v1/events/replay":{"get":{"operationId":"replayEvents","summary":"Ordered event replay for a wallet from a sequence number.","description":"Ordered event replay for a wallet from a sequence number.","tags":["events"],"x-hunch-status":"live","parameters":[{"name":"wallet","in":"query","required":true,"description":"Replay this wallet's events.","schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}},{"name":"fromSeq","in":"query","required":false,"description":"Replay from this sequence number (inclusive).","schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Ordered event replay from a sequence number — gap-free recovery.","content":{"application/json":{"schema":{"type":"object","properties":{"meta":{"$ref":"#/components/schemas/AgentMeta"},"events":{"type":"array","items":{"$ref":"#/components/schemas/AgentEvent"}},"nextSeq":{"type":"integer","nullable":true,"description":"Pass back as ?fromSeq= to continue; null when drained."}},"required":["meta","events","nextSeq"]}}}},"404":{"description":"Not found — an unknown id/slug, or the agent platform flag is off (the entire /api/agent/v1 surface returns 404 while dark).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"422":{"description":"invalid_wallet — not a 0x + 40-hex Base address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}}},"components":{"schemas":{"AgentMeta":{"type":"object","description":"Rides on every JSON response. docsUrl points at the full plain-text integration guide (llms-full.txt).","properties":{"name":{"type":"string"},"version":{"type":"string","description":"Always \"hunch-agent-api-v1\"."},"generatedAt":{"type":"string","description":"ISO-8601 — when this response was generated."},"docsUrl":{"type":"string"}},"required":["name","version","generatedAt","docsUrl"]},"AgentError":{"type":"object","description":"Every non-2xx response body. Branch on the stable `error` code. `retriable: true` means the SAME request may succeed later (back off and retry); false means change the request first. Full reference: https://www.playhunch.xyz/llms-full.txt#errors","properties":{"error":{"type":"string","description":"Stable machine code (snake_case) — this enum is generated from the live error catalogue.","enum":["invalid_request","payment_required","market_not_found","market_closed","idem_conflict","invalid_side","invalid_wallet","size_below_min","quote_required","quote_expired","quote_mismatch","slippage_exceeded","insufficient_balance","pool_impact_exceeded","unsupported_market","payment_invalid","rate_limited","internal_error","platform_paused","deposit_above_max","deposit_unconfirmed","deposit_mismatch","deposit_tx_reused"]},"message":{"type":"string","description":"One sentence describing what went wrong."},"hint":{"type":"string","description":"What to DO next."},"docsUrl":{"type":"string","description":"The agent error reference docs."},"retriable":{"type":"boolean","description":"true → retry the same request with exponential backoff; false → modify the request first."}},"required":["error","message","hint","docsUrl","retriable"],"additionalProperties":true},"X402Challenge":{"type":"object","description":"The HTTP 402 body. Sign an EIP-3009 transferWithAuthorization matching accepts[0], then retry the SAME POST body with the X-PAYMENT header (base64 of the signed envelope).","properties":{"x402Version":{"type":"integer","enum":[1]},"error":{"type":"string","nullable":true,"description":"Why the previous attempt was rejected — what to fix before re-signing; null on a fresh challenge."},"accepts":{"type":"array","items":{"type":"object","description":"One accepted payment method — the \"exact\" scheme on Base USDC (an EIP-3009 transferWithAuthorization).","properties":{"scheme":{"type":"string","enum":["exact"]},"network":{"type":"string","enum":["base"]},"maxAmountRequired":{"type":"string","pattern":"^[0-9]+$","description":"Atomic USDC units (6 decimals) as a string — equals your sizeUsd exactly, with NO upper bound (the no-cap rail; the floor is $1). A $5,000 bet advertises \"5000000000\"."},"resource":{"type":"string","description":"The trade URL + \"#\" + the canonical trade-intent hash. Prefix-match the URL before signing. Honest scope: the fragment is an AUDIT binding — EIP-3009 cryptographically binds payer/amount/recipient plus a one-use nonce; marketId/side bind via the request body that travels with the payment."},"description":{"type":"string","description":"Human-readable bet summary."},"mimeType":{"type":"string"},"payTo":{"type":"string","description":"The Hunch settlement sink — where the USDC lands. Pin-check against the published x402 listing before signing."},"maxTimeoutSeconds":{"type":"integer","description":"Bound the authorization's validBefore to now + this many seconds."},"asset":{"type":"string","description":"The USDC contract address on Base. Never sign for any other token."},"extra":{"type":"object","description":"USDC EIP-712 domain pieces needed to sign the authorization.","properties":{"name":{"type":"string"},"version":{"type":"string"}},"required":["name","version"]}},"required":["scheme","network","maxAmountRequired","resource","description","mimeType","payTo","maxTimeoutSeconds","asset","extra"]}}},"required":["x402Version","error","accepts"]},"AgentMarketRef":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"question":{"type":"string"},"shortTitle":{"type":"string"},"summary":{"type":"string"},"category":{"type":"string"},"tokenSymbol":{"type":"string"},"chainId":{"type":"string"},"deadlineAt":{"type":"string"},"deadlineLabel":{"type":"string"},"status":{"type":"string"},"feeBps":{"type":"number"},"feeRecipientLabel":{"type":"string"},"defaultTicketUsd":{"type":"number"},"virtualLiquidityUsd":{"type":"number"},"volumeUsd":{"type":"number"},"totalBets":{"type":"number"},"volume24hUsd":{"type":"number"},"targetMarketCapUsd":{"type":"number","nullable":true},"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"shortLabel":{"type":"string"},"lowerUsd":{"type":"number","nullable":true},"upperUsd":{"type":"number","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true}},"required":["key","label","shortLabel","lowerUsd","upperUsd"]},"nullable":true},"odds":{"type":"object","properties":{"yesPriceCents":{"type":"number","nullable":true},"noPriceCents":{"type":"number","nullable":true}},"required":["yesPriceCents","noPriceCents"],"nullable":true},"headline":{"type":"string","nullable":true},"links":{"type":"object","properties":{"app":{"type":"string"},"quote":{"type":"string"},"trade":{"type":"string"},"research":{"type":"string"}},"required":["app","quote","trade","research"]}},"required":["id","slug","question","shortTitle","summary","category","tokenSymbol","chainId","deadlineAt","deadlineLabel","status","feeBps","feeRecipientLabel","defaultTicketUsd","virtualLiquidityUsd","volumeUsd","totalBets","volume24hUsd","targetMarketCapUsd","outcomes","odds","headline","links"]},"AgentQuote":{"type":"object","properties":{"marketId":{"type":"string"},"side":{"type":"string"},"sizeUsd":{"type":"number"},"tier":{"type":"string","enum":["simple","locked"]},"quoteId":{"type":"string"},"expiresAt":{"type":"string"},"bookVersion":{"type":"string"},"priceCents":{"type":"number"},"estimatedShares":{"type":"number"},"suggestedMinSharesOut":{"type":"number"},"feeBps":{"type":"number"},"feeUsd":{"type":"number"},"netStakeUsd":{"type":"number"},"postTradeOdds":{"type":"object","properties":{"yesPriceCents":{"type":"number","nullable":true},"noPriceCents":{"type":"number","nullable":true}},"required":["yesPriceCents","noPriceCents"]},"impactPct":{"type":"number","nullable":true},"ladder":{"type":"object","properties":{"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"shortLabel":{"type":"string"},"lowerUsd":{"type":"number","nullable":true},"upperUsd":{"type":"number","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true},"impliedPct":{"type":"number"},"backedUsd":{"type":"number"},"isCurrent":{"type":"boolean"}},"required":["key","label","shortLabel","lowerUsd","upperUsd","impliedPct","backedUsd","isCurrent"]}},"currentBucketKey":{"type":"string","nullable":true},"currentMarketCapUsd":{"type":"number","nullable":true},"totalBackedUsd":{"type":"number"}},"required":["outcomes","currentBucketKey","currentMarketCapUsd","totalBackedUsd"],"nullable":true},"tokenSnapshot":{"type":"object","properties":{"tokenSymbol":{"type":"string"},"currentMarketCapUsd":{"type":"number"},"currentPriceUsd":{"type":"number","nullable":true},"targetMarketCapUsd":{"type":"number"},"distanceToTargetPct":{"type":"number"},"reachedTarget":{"type":"boolean"},"source":{"type":"string"},"sourceUrl":{"type":"string"},"observedAt":{"type":"string"}},"required":["tokenSymbol","currentMarketCapUsd","currentPriceUsd","targetMarketCapUsd","distanceToTargetPct","reachedTarget","source","sourceUrl","observedAt"],"nullable":true},"stats":{"type":"object","properties":{"totalBets":{"type":"number"},"totalPoolUsd":{"type":"number"},"yesPoolUsd":{"type":"number"},"noPoolUsd":{"type":"number"},"feeUsd":{"type":"number"}},"required":["totalBets","totalPoolUsd","yesPoolUsd","noPoolUsd","feeUsd"],"nullable":true}},"required":["marketId","side","sizeUsd","tier","quoteId","expiresAt","bookVersion","priceCents","estimatedShares","suggestedMinSharesOut","feeBps","feeUsd","netStakeUsd","postTradeOdds","impactPct","ladder","tokenSnapshot","stats"]},"AgentTradeRequest":{"type":"object","properties":{"marketId":{"type":"string","minLength":1},"side":{"type":"string","minLength":1},"sizeUsd":{"type":"number","exclusiveMinimum":true,"minimum":0},"idemKey":{"type":"string","minLength":8,"maxLength":128},"walletAddress":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"quoteId":{"type":"string","minLength":1},"minSharesOut":{"type":"number","exclusiveMinimum":true,"minimum":0},"maxPriceCents":{"type":"integer","minimum":1,"maximum":99},"simulate":{"type":"boolean"},"builderCode":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"callbackUrl":{"type":"string","format":"uri"},"ref":{"type":"string","pattern":"^[A-Za-z0-9:_-]{1,32}$"}},"required":["marketId","side","sizeUsd","idemKey","walletAddress"],"additionalProperties":false},"AgentTradeReceipt":{"type":"object","properties":{"tradeId":{"type":"string"},"marketId":{"type":"string"},"side":{"type":"string"},"sizeUsd":{"type":"number"},"simulated":{"type":"boolean"},"txHash":{"type":"string","nullable":true},"explorerUrl":{"type":"string","nullable":true},"intentHash":{"type":"string"},"builderCode":{"type":"string","nullable":true},"position":{"type":"object","properties":{"shares":{"type":"number"},"avgPriceCents":{"type":"number"}},"required":["shares","avgPriceCents"]},"proofUrl":{"type":"string","nullable":true},"recordedAt":{"type":"string"}},"required":["tradeId","marketId","side","sizeUsd","simulated","txHash","explorerUrl","intentHash","builderCode","position","proofUrl","recordedAt"]},"AgentPosition":{"type":"object","properties":{"marketId":{"type":"string"},"slug":{"type":"string"},"question":{"type":"string"},"side":{"type":"string"},"outcomeLabel":{"type":"string"},"shares":{"type":"number"},"stakedUsd":{"type":"number"},"avgEntryCents":{"type":"number"},"currentCents":{"type":"number"},"pnlUsd":{"type":"number"},"maxPayoutUsd":{"type":"number"},"status":{"type":"string","enum":["open","resolved-won","resolved-lost","resolved-refunded"]},"appUrl":{"type":"string"},"proofUrl":{"type":"string","nullable":true},"filledAt":{"type":"string","nullable":true}},"required":["marketId","slug","question","side","outcomeLabel","shares","stakedUsd","avgEntryCents","currentCents","pnlUsd","maxPayoutUsd","status","appUrl","proofUrl","filledAt"]},"AgentPositionsSummary":{"type":"object","properties":{"openCount":{"type":"number"},"resolvedCount":{"type":"number"},"totalStakedUsd":{"type":"number"},"totalPnlUsd":{"type":"number"}},"required":["openCount","resolvedCount","totalStakedUsd","totalPnlUsd"]},"AgentResult":{"type":"object","properties":{"marketId":{"type":"string"},"status":{"type":"string","enum":["resolved","pending"]},"resolvedOutcome":{"type":"string","nullable":true},"resolvedOutcomeLabel":{"type":"string","nullable":true},"resolvedAt":{"type":"string","nullable":true},"source":{"type":"string"},"sourceUrl":{"type":"string","nullable":true},"observedMarketCapUsd":{"type":"number","nullable":true},"payoutPerShareUsd":{"type":"number","nullable":true},"poolUsd":{"type":"number"},"winningShares":{"type":"number"},"proofUrl":{"type":"string","nullable":true}},"required":["marketId","status","resolvedOutcome","resolvedOutcomeLabel","resolvedAt","source","sourceUrl","observedMarketCapUsd","payoutPerShareUsd","poolUsd","winningShares","proofUrl"]},"AgentResearch":{"type":"object","properties":{"market":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"question":{"type":"string"},"shortTitle":{"type":"string"},"summary":{"type":"string"},"category":{"type":"string"},"tokenSymbol":{"type":"string"},"chainId":{"type":"string"},"deadlineAt":{"type":"string"},"deadlineLabel":{"type":"string"},"status":{"type":"string"},"feeBps":{"type":"number"},"feeRecipientLabel":{"type":"string"},"defaultTicketUsd":{"type":"number"},"virtualLiquidityUsd":{"type":"number"},"volumeUsd":{"type":"number"},"totalBets":{"type":"number"},"volume24hUsd":{"type":"number"},"targetMarketCapUsd":{"type":"number","nullable":true},"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"shortLabel":{"type":"string"},"lowerUsd":{"type":"number","nullable":true},"upperUsd":{"type":"number","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true}},"required":["key","label","shortLabel","lowerUsd","upperUsd"]},"nullable":true},"odds":{"type":"object","properties":{"yesPriceCents":{"type":"number","nullable":true},"noPriceCents":{"type":"number","nullable":true}},"required":["yesPriceCents","noPriceCents"],"nullable":true},"headline":{"type":"string","nullable":true},"links":{"type":"object","properties":{"app":{"type":"string"},"quote":{"type":"string"},"trade":{"type":"string"},"research":{"type":"string"}},"required":["app","quote","trade","research"]}},"required":["id","slug","question","shortTitle","summary","category","tokenSymbol","chainId","deadlineAt","deadlineLabel","status","feeBps","feeRecipientLabel","defaultTicketUsd","virtualLiquidityUsd","volumeUsd","totalBets","volume24hUsd","targetMarketCapUsd","outcomes","odds","headline","links"]},"resolutionRules":{"type":"object","properties":{"source":{"type":"string"},"sourceUrl":{"type":"string","nullable":true},"metric":{"type":"string"},"comparator":{"type":"string","nullable":true},"thresholdLabel":{"type":"string","nullable":true},"deadlineAt":{"type":"string"},"earlyResolvable":{"type":"boolean"},"description":{"type":"string"}},"required":["source","sourceUrl","metric","comparator","thresholdLabel","deadlineAt","earlyResolvable","description"]},"odds":{"type":"object","properties":{"yesPriceCents":{"type":"number","nullable":true},"noPriceCents":{"type":"number","nullable":true}},"required":["yesPriceCents","noPriceCents"]},"stats":{"type":"object","properties":{"totalBets":{"type":"number"},"totalPoolUsd":{"type":"number"},"yesPoolUsd":{"type":"number"},"noPoolUsd":{"type":"number"},"feeUsd":{"type":"number"}},"required":["totalBets","totalPoolUsd","yesPoolUsd","noPoolUsd","feeUsd"],"nullable":true},"ladder":{"type":"object","properties":{"outcomes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"shortLabel":{"type":"string"},"lowerUsd":{"type":"number","nullable":true},"upperUsd":{"type":"number","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true},"impliedPct":{"type":"number"},"backedUsd":{"type":"number"},"isCurrent":{"type":"boolean"}},"required":["key","label","shortLabel","lowerUsd","upperUsd","impliedPct","backedUsd","isCurrent"]}},"currentBucketKey":{"type":"string","nullable":true},"currentMarketCapUsd":{"type":"number","nullable":true},"totalBackedUsd":{"type":"number"}},"required":["outcomes","currentBucketKey","currentMarketCapUsd","totalBackedUsd"],"nullable":true},"tokenSnapshot":{"type":"object","properties":{"tokenSymbol":{"type":"string"},"currentMarketCapUsd":{"type":"number"},"currentPriceUsd":{"type":"number","nullable":true},"targetMarketCapUsd":{"type":"number"},"distanceToTargetPct":{"type":"number"},"reachedTarget":{"type":"boolean"},"source":{"type":"string"},"sourceUrl":{"type":"string"},"observedAt":{"type":"string"}},"required":["tokenSymbol","currentMarketCapUsd","currentPriceUsd","targetMarketCapUsd","distanceToTargetPct","reachedTarget","source","sourceUrl","observedAt"],"nullable":true},"oddsHistory":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"yesPct":{"type":"number","nullable":true},"outcomeKey":{"type":"string","nullable":true},"sizeUsd":{"type":"number"}},"required":["at","yesPct","outcomeKey","sizeUsd"]}},"observations":{"type":"array","items":{"type":"object","properties":{"observedAt":{"type":"string"},"value":{"type":"number","nullable":true},"label":{"type":"string","nullable":true},"sourceUrl":{"type":"string","nullable":true}},"required":["observedAt","value","label","sourceUrl"]}},"related":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"question":{"type":"string"},"category":{"type":"string"},"deadlineAt":{"type":"string"}},"required":["id","slug","question","category","deadlineAt"]}},"impact":{"type":"array","items":{"type":"object","properties":{"sizeUsd":{"type":"number"},"priceCents":{"type":"number","nullable":true},"impactPct":{"type":"number","nullable":true}},"required":["sizeUsd","priceCents","impactPct"]}},"advisory":{"type":"string","nullable":true},"disclaimer":{"type":"string"},"dataFreshness":{"type":"object","properties":{"oddsAt":{"type":"string","nullable":true},"snapshotAt":{"type":"string","nullable":true},"observationsAt":{"type":"string","nullable":true}},"required":["oddsAt","snapshotAt","observationsAt"]}},"required":["market","resolutionRules","odds","stats","ladder","tokenSnapshot","oddsHistory","observations","related","impact","advisory","disclaimer","dataFreshness"]},"AgentReadiness":{"type":"object","properties":{"wallet":{"type":"string"},"usdcBalanceUsd":{"type":"number","nullable":true},"canBetMin":{"type":"boolean","nullable":true},"minBetUsd":{"type":"number"},"simpleTierMaxUsd":{"type":"number"},"gasNeeded":{"type":"boolean","enum":[false]},"reason":{"type":"string"},"funding":{"type":"object","properties":{"network":{"type":"string","enum":["base"]},"usdcAddress":{"type":"string"},"docsUrl":{"type":"string"}},"required":["network","usdcAddress","docsUrl"]},"hint":{"type":"string","nullable":true}},"required":["wallet","usdcBalanceUsd","canBetMin","minBetUsd","simpleTierMaxUsd","gasNeeded","reason","funding","hint"]},"AgentStats":{"type":"object","properties":{"markets":{"type":"object","properties":{"open":{"type":"number"},"resolved":{"type":"number"}},"required":["open","resolved"]},"totalBets":{"type":"number"},"totalVolumeUsd":{"type":"number"},"totalPaidOutUsd":{"type":"number"},"medianPayoutDelaySec":{"type":"number","nullable":true},"autoPayoutRate":{"type":"number","nullable":true},"proofSamples":{"type":"array","items":{"type":"string"}},"custody":{"type":"string"},"asOf":{"type":"string"}},"required":["markets","totalBets","totalVolumeUsd","totalPaidOutUsd","medianPayoutDelaySec","autoPayoutRate","proofSamples","custody","asOf"]},"AgentHealth":{"type":"object","properties":{"ok":{"type":"boolean"},"marketsOpen":{"type":"number"},"lastResolveTickAt":{"type":"string","nullable":true},"lastSnapshotTickAt":{"type":"string","nullable":true},"lastCanaryAt":{"type":"string","nullable":true},"payoutQueueDepth":{"type":"number","nullable":true},"version":{"type":"string"}},"required":["ok","marketsOpen","lastResolveTickAt","lastSnapshotTickAt","lastCanaryAt","payoutQueueDepth","version"]},"AgentEvent":{"type":"object","properties":{"eventId":{"type":"string"},"seq":{"type":"integer","minimum":0},"type":{"type":"string","enum":["bet.placed","bet.settlement_submitted","market.resolved","position.won","position.lost","payout.submitted","payout.paid","payout.failed","webhook.verify","webhook.delivery_failed","test"]},"createdAt":{"type":"string"},"wallet":{"type":"string","nullable":true},"marketId":{"type":"string","nullable":true},"tradeId":{"type":"string","nullable":true},"payload":{"type":"object","additionalProperties":{}},"proofUrl":{"type":"string","nullable":true}},"required":["eventId","seq","type","createdAt","wallet","marketId","tradeId","payload","proofUrl"]},"AgentWebhookRegistrationRequest":{"type":"object","properties":{"wallet":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"url":{"type":"string","format":"uri"},"message":{"type":"string","minLength":1},"signature":{"type":"string","minLength":1}},"required":["wallet","url","message","signature"],"additionalProperties":false},"AgentWebhookRegistration":{"type":"object","properties":{"id":{"type":"string"},"wallet":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","enum":["pending_verification","active","disabled"]},"secret":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","wallet","url","status","secret","createdAt"]},"AgentProof":{"type":"object","properties":{"tradeId":{"type":"string"},"market":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"question":{"type":"string"},"shortTitle":{"type":"string"},"summary":{"type":"string"},"category":{"type":"string"},"tokenSymbol":{"type":"string"},"chainId":{"type":"string"},"deadlineAt":{"type":"string"},"deadlineLabel":{"type":"string"},"status":{"type":"string"},"feeBps":{"type":"number"},"feeRecipientLabel":{"type":"string"},"defaultTicketUsd":{"type":"number"},"virtualLiquidityUsd":{"type":"number"},"targetMarketCapUsd":{"type":"number","nullable":true},"outcomes":{"type":"array","items":{},"nullable":true},"headline":{"type":"string","nullable":true},"links":{"type":"object","properties":{"app":{"type":"string"},"quote":{"type":"string"},"trade":{"type":"string"},"research":{"type":"string"}},"required":["app","quote","trade","research"]}},"required":["id"]},"position":{"type":"object","properties":{"userId":{"type":"string"},"walletAddress":{"type":"string"},"side":{"type":"string"},"shares":{"type":"number"},"priceCents":{"type":"number"},"sizeUsd":{"type":"number"},"feeUsd":{"type":"number"}},"required":["userId","walletAddress","side","shares","priceCents","sizeUsd","feeUsd"]},"settlement":{"type":"object","properties":{"txHash":{"type":"string"},"explorerUrl":{"type":"string"},"status":{"type":"string"},"network":{"type":"string","enum":["base"]},"settledAt":{"type":"string","nullable":true}},"required":["txHash","explorerUrl","status","network","settledAt"]},"attribution":{"type":"object","properties":{"source":{"type":"string","nullable":true},"mentionId":{"type":"string","nullable":true}},"required":["source","mentionId"]}},"required":["tradeId","market","position","settlement","attribution"]}}}}