{ "openapi": "3.0.3", "info": { "title": "Pop Charts API", "description": "Read API for Pop Charts indexed market events.", "version": "0.1.0" }, "paths": { "/health": { "get": { "operationId": "getHealth", "summary": "Health check", "tags": [ "System" ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Health" } } } } } } }, "/version": { "get": { "operationId": "getVersion", "summary": "Get API version", "tags": [ "System" ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VersionInfo" } } } } } } }, "/markets": { "get": { "operationId": "listMarkets", "summary": "List indexed markets", "description": "Returns up to 200 markets sorted by latest creation time. Pass an ISO `since` timestamp to fetch markets created after the previous cursor time.", "tags": [ "Markets" ], "parameters": [ { "name": "chainId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "since", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketList" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/markets/{chainId}/metadata": { "post": { "operationId": "saveMarketMetadata", "summary": "Save off-chain market metadata", "description": "Stores human-readable market metadata by chain ID and metadata hash so indexed markets can render their question and resolution context.", "tags": [ "Markets" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketMetadataWrite" } }, "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/MarketMetadataWrite" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MarketMetadataWrite" } } } }, "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketMetadata" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/admin/markets/{chainId}/{marketId}/review": { "post": { "operationId": "requestManualAiReview", "summary": "Admin-only enqueue market AI review", "description": "Local-network development tool: not registered on deployed networks at all (operator actions run locally against the chain, not via the API — repo ADR 0009). On local it additionally requires POPCHARTS_ADMIN_REVIEW_ENABLED=true. Enqueues manual AI review work for the runner; it does not call the AI Review service directly.", "tags": [ "Administration" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "force": { "type": "boolean" }, "model": { "minLength": 1, "type": "string" }, "provider": { "$ref": "#/components/schemas/AiReviewProvider" }, "reason": { "type": "string" } } } }, "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "force": { "type": "boolean" }, "model": { "minLength": 1, "type": "string" }, "provider": { "$ref": "#/components/schemas/AiReviewProvider" }, "reason": { "type": "string" } } } }, "multipart/form-data": { "schema": { "type": "object", "properties": { "force": { "type": "boolean" }, "model": { "minLength": 1, "type": "string" }, "provider": { "$ref": "#/components/schemas/AiReviewProvider" }, "reason": { "type": "string" } } } } } }, "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManualAiReviewExistingJob" } } } }, "201": { "description": "Response for status 201", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManualAiReviewEnqueued" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "409": { "description": "Response for status 409", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManualAiReviewConflict" } } } } } } }, "/dev/markets/{chainId}/{marketId}/close": { "post": { "operationId": "closeDevMarket", "summary": "Dev-only close pre-grad market for refunds", "description": "Local-network development tool: not registered on deployed networks at all. On local it additionally requires POPCHARTS_DEV_TOOLS_ENABLED=true. Fast-forwards the local chain to the market graduation deadline, calls PregradManager.markRefundable, and updates the indexed market projection.", "tags": [ "Development" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevMarketCloseResponse" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "409": { "description": "Response for status 409", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevMarketCloseIneligible" } } } } } } }, "/dev/markets/{chainId}/{marketId}/review": { "post": { "operationId": "forceMarketReview", "summary": "Dev-only force a market review verdict", "description": "Local-only development tool gated on POPCHARTS_DEV_TOOLS_ENABLED. Records a deterministic market review without invoking the AI review service or runner, transitioning approved or rejected markets on-chain before persisting the review.", "tags": [ "Development" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "verdict" ], "properties": { "reasons": { "type": "array", "items": { "type": "string" } }, "verdict": { "type": "string", "enum": [ "approve", "reject", "manual_review" ] } } } }, "application/x-www-form-urlencoded": { "schema": { "type": "object", "required": [ "verdict" ], "properties": { "reasons": { "type": "array", "items": { "type": "string" } }, "verdict": { "type": "string", "enum": [ "approve", "reject", "manual_review" ] } } } }, "multipart/form-data": { "schema": { "type": "object", "required": [ "verdict" ], "properties": { "reasons": { "type": "array", "items": { "type": "string" } }, "verdict": { "type": "string", "enum": [ "approve", "reject", "manual_review" ] } } } } } }, "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevMarketReviewResponse" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "409": { "description": "Response for status 409", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevMarketReviewIneligible" } } } } } } }, "/dev/markets/{chainId}/{marketId}/resolve/{side}": { "post": { "operationId": "resolveDevMarket", "summary": "Dev-only force resolve a postgrad market", "description": "Local-network development tool: not registered on deployed networks at all. On local it additionally requires POPCHARTS_DEV_TOOLS_ENABLED=true. Calls the postgrad market resolver with side `yes` or `no`, waits for the local transaction, and updates the indexed market projection to resolved.", "tags": [ "Development" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "side", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevMarketResolveResponse" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "409": { "description": "Response for status 409", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevMarketResolveIneligible" } } } } } } }, "/dev/markets/{chainId}/{marketId}/graduate": { "post": { "operationId": "graduateDevMarket", "summary": "Dev-only graduate a pre-grad market end to end", "description": "Local-network development tool: not registered on deployed networks at all. On local it additionally requires POPCHARTS_DEV_TOOLS_ENABLED=true. Settles a threshold-eligible market end to end: starts onchain graduation, submits a dev clearing root, jumps the local chain past any configured challenge window, finalizes with the configured postgrad adapter, claims every receipt, and wires + seeds the postgrad venue pools. With force=true it first mints dev collateral and places receipts until the market covers its graduation threshold; without it, a below-threshold market returns 409.", "tags": [ "Development" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "force", "in": "query", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevMarketGraduateResponse" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "409": { "description": "Response for status 409", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DevMarketGraduateIneligible" } } } } } } }, "/markets/{chainId}/{marketId}": { "get": { "operationId": "getMarket", "summary": "Get an indexed market", "tags": [ "Markets" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Market" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/markets/{chainId}/{marketId}/orderbook": { "get": { "operationId": "getMarketOrderBook", "summary": "Get a market's venue order book", "description": "Returns the bounded-venue depth ladder for a graduated market's YES and NO outcome pools, aggregated from indexed open maker orders. Each level quotes the display price (WAD collateral per outcome token) at the tick-range edge nearest the current pool price and the outcome-token quantity its remaining liquidity represents. Markets without indexed venue pools return the book with both ladders omitted.", "tags": [ "Markets" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketOrderBook" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/markets/{chainId}/{marketId}/orders": { "get": { "operationId": "listMarketOrders", "summary": "List a wallet's venue maker orders on one market", "description": "Returns the indexed bounded-venue maker orders one owner placed on a market's outcome pools, newest first. Only open orders are returned unless a status filter is provided; status=all includes every lifecycle state.", "tags": [ "Markets" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "owner", "in": "query", "required": true, "schema": { "type": "string" } }, { "name": "status", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "open", "filled", "cancelled", "all" ] } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VenueOrderList" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/markets/{chainId}/{marketId}/events": { "get": { "operationId": "listMarketEvents", "summary": "Get market chain events", "tags": [ "Markets" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketCreatedEventList" } } } } } } }, "/markets/{chainId}/{marketId}/receipts": { "get": { "operationId": "listMarketReceipts", "summary": "Get market receipt events", "description": "Returns the indexed ReceiptPlaced events for one market ordered oldest first by on-chain sequence, so clients can replay the LMSR price history without touching an RPC provider.", "tags": [ "Markets" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReceiptPlacedEventList" } } } } } } }, "/markets/{chainId}/{marketId}/graduate": { "post": { "operationId": "graduateMarket", "summary": "Request market graduation", "description": "Public graduation failsafe for a market the keeper has not settled. For a market that reaches its threshold, the server runs the manager-keyed on-chain settlement — band-pass clearing, Merkle-root submission, finalize — and never tops up liquidity. Safe unauthenticated: eligibility is re-checked from real receipts before startGraduation and the contract enforces conservation. Below-threshold or wrong-status markets are reported (409), not touched.", "tags": [ "Graduation" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GraduationResponse" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "409": { "description": "Response for status 409", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GraduationIneligible" } } } } } } }, "/markets/{chainId}/{marketId}/resolution-check": { "post": { "operationId": "requestMarketResolutionCheck", "summary": "Request a resolution check", "description": "Public early-resolution nudge for a graduated market past its earliest resolution time — the resolution sibling of the graduation failsafe (repo ADR 0024). Queues one resolver evaluation; the AI resolver still decides the outcome and the on-chain dispute window still guards it, so the endpoint is safe unauthenticated. Cost is bounded by a per-market 24-hour cooldown rather than caller identity: repeat requests inside the window are refused (409) with the next eligible time.", "tags": [ "Resolution" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResolutionCheckAccepted" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "409": { "description": "Response for status 409", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResolutionCheckRefused" } } } } } } }, "/portfolio/{chainId}": { "get": { "operationId": "getPortfolio", "summary": "Get a wallet's full portfolio", "description": "Returns one wallet's cross-market lifecycle view: pre-graduation receipts joined to their settlement results, graduated YES/NO outcome-token positions (held wallet balance plus tokens committed to the wallet's own resting ask orders, valued at the current pool price when available), open venue maker orders, and past resolution-redemption payouts (newest first). Public owner-scoped read; no authentication.", "tags": [ "Portfolio" ], "parameters": [ { "name": "chainId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "owner", "in": "query", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Portfolio" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } } } } } }, "components": { "schemas": { "Health": { "type": "object", "required": [ "status" ], "properties": { "status": { "type": "string" } } }, "VersionInfo": { "type": "object", "required": [ "buildTime", "commitSha", "network", "version" ], "properties": { "buildTime": { "type": "string" }, "commitSha": { "type": "string" }, "network": { "type": "string" }, "version": { "type": "string" } } }, "AiReviewEvidence": { "type": "object", "required": [ "domain", "kind", "sourceTier", "summary", "url" ], "properties": { "domain": { "type": "string" }, "kind": { "type": "string", "enum": [ "provided_url", "search_result", "fetched_page" ] }, "sourceTier": { "$ref": "#/components/schemas/AiReviewSourceTier" }, "summary": { "type": "string" }, "title": { "type": "string" }, "url": { "type": "string" } } }, "AiReviewJobStatus": { "type": "string", "enum": [ "queued", "running", "succeeded", "retryable_failed", "terminal_failed", "cancelled" ] }, "AiReviewJobTrigger": { "type": "string", "enum": [ "automatic", "manual", "retry" ] }, "AiReviewProvider": { "type": "string", "enum": [ "anthropic", "claude-cli", "heuristic", "ollama" ] }, "AiReviewProgress": { "type": "object", "required": [ "phase", "status" ], "properties": { "phase": { "type": "string", "enum": [ "awaiting_queue", "queued", "running", "retrying", "complete", "attention_required" ] }, "status": { "type": "string", "enum": [ "pending", "complete", "attention_required" ] } } }, "AiReviewScoreRationales": { "type": "object", "required": [ "contentSafety", "corroboration", "disputeRisk", "objectivity", "promptInjectionRisk", "publicKnowability", "sourceQuality" ], "properties": { "contentSafety": { "type": "string" }, "corroboration": { "type": "string" }, "disputeRisk": { "type": "string" }, "objectivity": { "type": "string" }, "promptInjectionRisk": { "type": "string" }, "publicKnowability": { "type": "string" }, "sourceQuality": { "type": "string" } } }, "AiReviewScores": { "type": "object", "required": [ "contentSafety", "corroboration", "disputeRisk", "objectivity", "promptInjectionRisk", "publicKnowability", "sourceQuality" ], "properties": { "contentSafety": { "type": "number" }, "corroboration": { "type": "number" }, "disputeRisk": { "type": "number" }, "objectivity": { "type": "number" }, "promptInjectionRisk": { "type": "number" }, "publicKnowability": { "type": "number" }, "sourceQuality": { "type": "number" } } }, "AiReviewSourceCheck": { "type": "object", "required": [ "domain", "notes", "relevant", "sourceTier", "url" ], "properties": { "domain": { "type": "string" }, "notes": { "type": "string" }, "relevant": { "type": "boolean" }, "sourceTier": { "$ref": "#/components/schemas/AiReviewSourceTier" }, "url": { "type": "string" } } }, "AiReviewSourceTier": { "type": "string", "enum": [ "primary", "major_news", "specialist", "ugc", "suspicious", "unreachable", "unknown" ] }, "AiReviewVerdict": { "type": "string", "enum": [ "approve", "reject", "manual_review" ] }, "DevMarketCloseIneligible": { "type": "object", "required": [ "message", "market", "reason", "status" ], "properties": { "message": { "type": "string" }, "market": { "$ref": "#/components/schemas/Market" }, "reason": { "type": "string", "enum": [ "chain_status", "wrong_status" ] }, "status": { "type": "string", "enum": [ "ineligible" ] } } }, "DevMarketCloseResponse": { "type": "object", "required": [ "market", "refundAvailable", "status" ], "properties": { "market": { "$ref": "#/components/schemas/Market" }, "refundAvailable": { "type": "string" }, "status": { "type": "string", "enum": [ "refunded" ] }, "transactionHash": { "type": "string" } } }, "DevMarketGraduateIneligible": { "type": "object", "required": [ "message", "market", "reason", "status" ], "properties": { "message": { "type": "string" }, "market": { "$ref": "#/components/schemas/Market" }, "reason": { "type": "string", "enum": [ "adapter_unconfigured", "below_threshold", "chain_status", "past_deadline", "wrong_status" ] }, "status": { "type": "string", "enum": [ "ineligible" ] } } }, "DevMarketGraduateResponse": { "type": "object", "required": [ "market", "postgrad", "status", "summary", "transactionHashes" ], "properties": { "market": { "$ref": "#/components/schemas/Market" }, "postgrad": { "$ref": "#/components/schemas/MarketPostgrad" }, "status": { "type": "string", "enum": [ "graduated" ] }, "summary": { "$ref": "#/components/schemas/GraduationSummary" }, "transactionHashes": { "type": "array", "items": { "type": "string" } } } }, "DevMarketReviewIneligible": { "type": "object", "required": [ "message", "market", "reason", "status" ], "properties": { "message": { "type": "string" }, "market": { "$ref": "#/components/schemas/Market" }, "reason": { "type": "string", "enum": [ "chain_status", "wrong_status" ] }, "status": { "type": "string", "enum": [ "ineligible" ] } } }, "DevMarketReviewResponse": { "type": "object", "required": [ "market", "status", "verdict" ], "properties": { "market": { "$ref": "#/components/schemas/Market" }, "status": { "type": "string", "enum": [ "reviewed" ] }, "transactionHash": { "type": "string" }, "verdict": { "$ref": "#/components/schemas/AiReviewVerdict" } } }, "DevMarketResolveIneligible": { "type": "object", "required": [ "message", "market", "reason", "status" ], "properties": { "message": { "type": "string" }, "market": { "$ref": "#/components/schemas/Market" }, "reason": { "type": "string", "enum": [ "already_resolved", "chain_status", "postgrad_missing", "wrong_status" ] }, "status": { "type": "string", "enum": [ "ineligible" ] } } }, "DevMarketResolveResponse": { "type": "object", "required": [ "market", "status", "winningSide" ], "properties": { "market": { "$ref": "#/components/schemas/Market" }, "status": { "type": "string", "enum": [ "resolved" ] }, "transactionHash": { "type": "string" }, "winningSide": { "$ref": "#/components/schemas/DevMarketResolveSide" } } }, "DevMarketResolveSide": { "type": "string", "enum": [ "yes", "no" ] }, "GraduationIneligible": { "type": "object", "required": [ "message", "market", "reason", "status", "summary" ], "properties": { "message": { "type": "string" }, "market": { "$ref": "#/components/schemas/Market" }, "reason": { "type": "string", "enum": [ "below_threshold", "clearing_pending", "onchain_settlement_required", "wrong_status" ] }, "status": { "type": "string", "enum": [ "ineligible" ] }, "summary": { "$ref": "#/components/schemas/GraduationSummary" } } }, "ResolutionCheckAccepted": { "type": "object", "required": [ "message", "status" ], "properties": { "message": { "type": "string" }, "status": { "type": "string", "enum": [ "queued", "already_queued" ] } } }, "ResolutionCheckRefused": { "type": "object", "required": [ "message", "status" ], "properties": { "eligibleAt": { "type": "string" }, "message": { "type": "string" }, "status": { "type": "string", "enum": [ "not_eligible", "too_early", "already_evaluated", "cooling_down" ] } } }, "GraduationResponse": { "type": "object", "required": [ "market", "status", "summary" ], "properties": { "market": { "$ref": "#/components/schemas/Market" }, "status": { "type": "string", "enum": [ "graduated" ] }, "summary": { "$ref": "#/components/schemas/GraduationSummary" } } }, "GraduationSummary": { "type": "object", "required": [ "completeSetCount", "graduatedAt", "graduationThreshold", "matchedMarketCap", "noTokens", "receiptCount", "refundedCollateral", "totalEscrowed", "yesTokens" ], "properties": { "completeSetCount": { "type": "string" }, "graduatedAt": { "type": "string" }, "graduationThreshold": { "type": "string" }, "matchedMarketCap": { "type": "string" }, "noTokens": { "type": "string" }, "receiptCount": { "type": "string" }, "refundedCollateral": { "type": "string" }, "totalEscrowed": { "type": "string" }, "yesTokens": { "type": "string" } } }, "ManualAiReviewAlreadyReviewed": { "type": "object", "required": [ "aiReview", "message", "status" ], "properties": { "aiReview": { "$ref": "#/components/schemas/MarketAiReview" }, "message": { "type": "string" }, "status": { "type": "string", "enum": [ "already_reviewed" ] } } }, "ManualAiReviewConflict": { "anyOf": [ { "$ref": "#/components/schemas/ManualAiReviewAlreadyReviewed" }, { "$ref": "#/components/schemas/ManualAiReviewIneligible" } ] }, "ManualAiReviewEnqueued": { "type": "object", "required": [ "job", "status" ], "properties": { "job": { "$ref": "#/components/schemas/MarketAiReviewJob" }, "status": { "type": "string", "enum": [ "enqueued" ] } } }, "ManualAiReviewExistingJob": { "type": "object", "required": [ "job", "message", "status" ], "properties": { "job": { "$ref": "#/components/schemas/MarketAiReviewJob" }, "message": { "type": "string" }, "status": { "type": "string", "enum": [ "already_queued" ] } } }, "ManualAiReviewIneligible": { "type": "object", "required": [ "message", "reason", "status" ], "properties": { "marketStatus": { "$ref": "#/components/schemas/MarketStatus" }, "message": { "type": "string" }, "reason": { "type": "string", "enum": [ "missing_metadata", "wrong_status" ] }, "status": { "type": "string", "enum": [ "ineligible" ] } } }, "ManualAiReviewRequest": { "type": "object", "properties": { "force": { "type": "boolean" }, "model": { "minLength": 1, "type": "string" }, "provider": { "$ref": "#/components/schemas/AiReviewProvider" }, "reason": { "type": "string" } } }, "Market": { "type": "object", "required": [ "bypassAiResolution", "chainId", "collateral", "createdAt", "createdBlockNumber", "createdBlockTimestamp", "createdLogIndex", "createdTransactionHash", "creator", "graduationThreshold", "graduationTime", "liquidityParameter", "marketId", "matchedMarketCap", "metadataHash", "noShares", "openingProbabilityWad", "receiptCount", "resolutionTime", "status", "totalEscrowed", "updatedAt", "yesShares" ], "properties": { "aiReview": { "$ref": "#/components/schemas/MarketAiReview" }, "aiReviewProgress": { "$ref": "#/components/schemas/AiReviewProgress" }, "bypassAiResolution": { "type": "boolean" }, "chainId": { "type": "number" }, "collateral": { "type": "string" }, "createdAt": { "type": "string" }, "createdBlockNumber": { "type": "string" }, "createdBlockTimestamp": { "type": "string" }, "createdLogIndex": { "type": "number" }, "createdTransactionHash": { "type": "string" }, "creator": { "type": "string" }, "graduationThreshold": { "type": "string" }, "graduationTime": { "type": "string" }, "liquidityParameter": { "type": "string" }, "marketId": { "type": "string" }, "matchedMarketCap": { "type": "string" }, "metadata": { "$ref": "#/components/schemas/MarketMetadata" }, "metadataHash": { "type": "string" }, "noShares": { "type": "string" }, "openingProbabilityWad": { "type": "string" }, "postgrad": { "$ref": "#/components/schemas/MarketPostgrad" }, "receiptCount": { "type": "string" }, "resolution": { "$ref": "#/components/schemas/MarketResolution" }, "resolutionTime": { "type": "string" }, "status": { "$ref": "#/components/schemas/MarketStatus" }, "totalEscrowed": { "type": "string" }, "updatedAt": { "type": "string" }, "yesShares": { "type": "string" } } }, "MarketAiReview": { "type": "object", "required": [ "createdAt", "evidence", "hardFlags", "id", "metadataHash", "promptVersion", "provider", "reasons", "reviewedAt", "scoreRationales", "scores", "sourceChecks", "verdict" ], "properties": { "createdAt": { "type": "string" }, "evidence": { "type": "array", "items": { "$ref": "#/components/schemas/AiReviewEvidence" } }, "hardFlags": { "type": "array", "items": { "type": "string" } }, "id": { "type": "number" }, "metadataHash": { "type": "string" }, "modelId": { "type": "string" }, "promptVersion": { "type": "string" }, "provider": { "$ref": "#/components/schemas/AiReviewProvider" }, "reasons": { "type": "array", "items": { "type": "string" } }, "reviewedAt": { "type": "string" }, "scoreRationales": { "$ref": "#/components/schemas/AiReviewScoreRationales" }, "scores": { "$ref": "#/components/schemas/AiReviewScores" }, "sourceChecks": { "type": "array", "items": { "$ref": "#/components/schemas/AiReviewSourceCheck" } }, "verdict": { "$ref": "#/components/schemas/AiReviewVerdict" } } }, "MarketPostgrad": { "type": "object", "required": [ "adapterAddress", "completeSetCount", "finalizedAt", "marketAddress", "refundTotal", "retainedCostTotal", "transactionHash" ], "properties": { "adapterAddress": { "type": "string" }, "completeSetCount": { "type": "string" }, "finalizedAt": { "type": "string" }, "marketAddress": { "type": "string" }, "refundTotal": { "type": "string" }, "retainedCostTotal": { "type": "string" }, "transactionHash": { "type": "string" }, "venue": { "$ref": "#/components/schemas/MarketVenue" } } }, "MarketResolution": { "type": "object", "required": [ "kind", "postgradMarket", "resolvedAt", "transactionHash" ], "properties": { "kind": { "type": "string", "enum": [ "resolved", "cancelled" ] }, "postgradMarket": { "type": "string" }, "resolvedAt": { "type": "string" }, "transactionHash": { "type": "string" }, "winningSide": { "$ref": "#/components/schemas/VenuePoolSide" } } }, "MarketVenue": { "type": "object", "required": [ "boundedHookAddress", "live", "noPool", "orderManagerAddress", "poolManagerAddress", "yesPool" ], "properties": { "boundedHookAddress": { "type": "string" }, "live": { "type": "boolean" }, "noPool": { "$ref": "#/components/schemas/MarketVenuePool" }, "orderManagerAddress": { "type": "string" }, "poolManagerAddress": { "type": "string" }, "yesPool": { "$ref": "#/components/schemas/MarketVenuePool" } } }, "MarketVenuePool": { "type": "object", "required": [ "initialized", "outcomeTokenAddress", "poolId", "whitelisted" ], "properties": { "displayPriceWad": { "type": "string" }, "initialized": { "type": "boolean" }, "outcomeTokenAddress": { "type": "string" }, "poolId": { "type": "string" }, "whitelisted": { "type": "boolean" } } }, "MarketAiReviewJob": { "type": "object", "required": [ "attemptCount", "chainId", "createdAt", "id", "marketId", "maxAttempts", "metadataHash", "priority", "runAfter", "status", "trigger", "updatedAt" ], "properties": { "attemptCount": { "type": "number" }, "chainId": { "type": "number" }, "completedAt": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "number" }, "lastError": { "type": "string" }, "leaseUntil": { "type": "string" }, "lockedBy": { "type": "string" }, "marketId": { "type": "string" }, "maxAttempts": { "type": "number" }, "metadataHash": { "type": "string" }, "priority": { "type": "number" }, "requestedModel": { "type": "string" }, "requestedProvider": { "$ref": "#/components/schemas/AiReviewProvider" }, "reviewId": { "type": "number" }, "runAfter": { "type": "string" }, "status": { "$ref": "#/components/schemas/AiReviewJobStatus" }, "trigger": { "$ref": "#/components/schemas/AiReviewJobTrigger" }, "updatedAt": { "type": "string" } } }, "MarketCreatedEvent": { "type": "object", "required": [ "bypassAiResolution", "blockNumber", "blockTimestamp", "chainId", "collateral", "creator", "graduationThreshold", "graduationTime", "graduationTimeUnix", "liquidityParameter", "logIndex", "marketId", "metadata", "metadataHash", "openingProbabilityWad", "resolutionTime", "resolutionTimeUnix", "transactionHash" ], "properties": { "bypassAiResolution": { "type": "boolean" }, "blockNumber": { "type": "string" }, "blockTimestamp": { "type": "string" }, "chainId": { "type": "number" }, "collateral": { "type": "string" }, "creator": { "type": "string" }, "graduationThreshold": { "type": "string" }, "graduationTime": { "type": "string" }, "graduationTimeUnix": { "type": "string" }, "liquidityParameter": { "type": "string" }, "logIndex": { "type": "number" }, "marketId": { "type": "string" }, "metadata": { "type": "string" }, "metadataHash": { "type": "string" }, "openingProbabilityWad": { "type": "string" }, "resolutionTime": { "type": "string" }, "resolutionTimeUnix": { "type": "string" }, "transactionHash": { "type": "string" } } }, "MarketCreatedEventList": { "type": "array", "items": { "$ref": "#/components/schemas/MarketCreatedEvent" } }, "MarketList": { "type": "array", "items": { "$ref": "#/components/schemas/Market" } }, "MarketMetadata": { "type": "object", "required": [ "category", "chainId", "createdAt", "description", "metadataCreatedAt", "metadataHash", "question", "resolutionCriteria", "updatedAt" ], "properties": { "category": { "type": "string" }, "chainId": { "type": "number" }, "createdAt": { "type": "string" }, "description": { "type": "string" }, "metadataCreatedAt": { "type": "string" }, "metadataHash": { "type": "string" }, "outcomeNo": { "type": "string" }, "outcomeYes": { "type": "string" }, "question": { "type": "string" }, "resolutionCriteria": { "type": "string" }, "resolutionSources": { "type": "array", "items": { "type": "string" } }, "resolutionUrl": { "type": "string" }, "updatedAt": { "type": "string" } } }, "MarketMetadataWrite": { "type": "object", "required": [ "category", "createdAt", "description", "metadataHash", "question", "resolutionCriteria" ], "properties": { "category": { "minLength": 1, "type": "string" }, "createdAt": { "minLength": 1, "type": "string" }, "description": { "type": "string" }, "metadataHash": { "pattern": "^0x[0-9a-fA-F]{64}$", "type": "string" }, "outcomeNo": { "maxLength": 40, "minLength": 1, "type": "string" }, "outcomeYes": { "maxLength": 40, "minLength": 1, "type": "string" }, "question": { "minLength": 1, "type": "string" }, "resolutionCriteria": { "minLength": 1, "type": "string" }, "resolutionSources": { "type": "array", "items": { "type": "string" } }, "resolutionUrl": { "type": "string" } } }, "MarketOrderBook": { "type": "object", "required": [ "chainId", "marketId" ], "properties": { "chainId": { "type": "number" }, "marketId": { "type": "string" }, "no": { "$ref": "#/components/schemas/VenueOrderBookPool" }, "yes": { "$ref": "#/components/schemas/VenueOrderBookPool" } } }, "MarketStatus": { "type": "string", "enum": [ "under_review", "bootstrap", "graduating", "graduated", "resolved", "refunded", "cancelled", "rejected", "resolution_pending", "disputed" ] }, "ReceiptPlacedEvent": { "type": "object", "required": [ "blockNumber", "blockTimestamp", "chainId", "cost", "logIndex", "marketId", "owner", "receiptId", "sequence", "shares", "side", "transactionHash" ], "properties": { "blockNumber": { "type": "string" }, "blockTimestamp": { "type": "string" }, "chainId": { "type": "number" }, "cost": { "type": "string" }, "logIndex": { "type": "number" }, "marketId": { "type": "string" }, "owner": { "type": "string" }, "receiptId": { "type": "string" }, "sequence": { "type": "string" }, "shares": { "type": "string" }, "side": { "type": "number" }, "transactionHash": { "type": "string" } } }, "ReceiptPlacedEventList": { "type": "array", "items": { "$ref": "#/components/schemas/ReceiptPlacedEvent" } }, "VenueOrder": { "type": "object", "required": [ "amountIn", "createdBlockTimestamp", "createdTransactionHash", "direction", "orderId", "owner", "poolId", "priceWad", "remainingSizeWad", "side", "sizeWad", "status", "tickLower", "tickUpper" ], "properties": { "amountIn": { "type": "string" }, "createdBlockTimestamp": { "type": "string" }, "createdTransactionHash": { "type": "string" }, "direction": { "$ref": "#/components/schemas/VenueOrderDirection" }, "orderId": { "type": "number" }, "owner": { "type": "string" }, "poolId": { "type": "string" }, "priceWad": { "type": "string" }, "remainingSizeWad": { "type": "string" }, "side": { "$ref": "#/components/schemas/VenuePoolSide" }, "sizeWad": { "type": "string" }, "status": { "$ref": "#/components/schemas/VenueOrderStatus" }, "tickLower": { "type": "number" }, "tickUpper": { "type": "number" } } }, "VenueOrderBookLevel": { "type": "object", "required": [ "orderCount", "priceWad", "sizeWad", "tickLower", "tickUpper" ], "properties": { "orderCount": { "type": "number" }, "priceWad": { "type": "string" }, "sizeWad": { "type": "string" }, "tickLower": { "type": "number" }, "tickUpper": { "type": "number" } } }, "VenueOrderBookPool": { "type": "object", "required": [ "asks", "bids", "outcomeTokenAddress", "poolId", "side" ], "properties": { "asks": { "type": "array", "items": { "$ref": "#/components/schemas/VenueOrderBookLevel" } }, "bids": { "type": "array", "items": { "$ref": "#/components/schemas/VenueOrderBookLevel" } }, "marketPriceWad": { "type": "string" }, "outcomeTokenAddress": { "type": "string" }, "poolId": { "type": "string" }, "side": { "$ref": "#/components/schemas/VenuePoolSide" } } }, "VenueOrderDirection": { "type": "string", "enum": [ "bid", "ask" ] }, "VenueOrderList": { "type": "array", "items": { "$ref": "#/components/schemas/VenueOrder" } }, "VenueOrderStatus": { "type": "string", "enum": [ "open", "filled", "cancelled" ] }, "VenuePoolSide": { "type": "string", "enum": [ "yes", "no" ] }, "Portfolio": { "type": "object", "required": [ "chainId", "openOrders", "owner", "positions", "receipts", "redemptions", "summary" ], "properties": { "chainId": { "type": "number" }, "openOrders": { "type": "array", "items": { "$ref": "#/components/schemas/PortfolioOpenOrder" } }, "owner": { "type": "string" }, "positions": { "type": "array", "items": { "$ref": "#/components/schemas/PortfolioPosition" } }, "receipts": { "type": "array", "items": { "$ref": "#/components/schemas/PortfolioReceipt" } }, "redemptions": { "type": "array", "items": { "$ref": "#/components/schemas/PortfolioRedemption" } }, "summary": { "$ref": "#/components/schemas/PortfolioSummary" } } }, "PortfolioOpenOrder": { "type": "object", "required": [ "marketId", "order" ], "properties": { "marketId": { "type": "string" }, "marketQuestion": { "type": "string" }, "order": { "$ref": "#/components/schemas/VenueOrder" } } }, "PortfolioPosition": { "type": "object", "required": [ "committedInOrders", "heldBalance", "marketId", "outcomeToken", "ownedTotal", "side" ], "properties": { "avgCostWad": { "type": "string" }, "committedInOrders": { "type": "string" }, "currentValueWad": { "type": "string" }, "graduationShares": { "type": "string" }, "heldBalance": { "type": "string" }, "marketId": { "type": "string" }, "marketQuestion": { "type": "string" }, "marketStatus": { "$ref": "#/components/schemas/MarketStatus" }, "outcomeToken": { "type": "string" }, "ownedTotal": { "type": "string" }, "poolId": { "type": "string" }, "poolPriceWad": { "type": "string" }, "resolution": { "$ref": "#/components/schemas/MarketResolution" }, "side": { "$ref": "#/components/schemas/VenuePoolSide" } } }, "PortfolioReceipt": { "type": "object", "required": [ "cost", "marketId", "marketStatus", "placedAt", "priceBandHigh", "priceBandLow", "receiptId", "shares", "side", "status" ], "properties": { "cost": { "type": "string" }, "marketId": { "type": "string" }, "marketQuestion": { "type": "string" }, "marketStatus": { "$ref": "#/components/schemas/MarketStatus" }, "placedAt": { "type": "string" }, "priceBandHigh": { "type": "string" }, "priceBandLow": { "type": "string" }, "receiptId": { "type": "string" }, "settlement": { "$ref": "#/components/schemas/PortfolioReceiptSettlement" }, "shares": { "type": "string" }, "side": { "$ref": "#/components/schemas/VenuePoolSide" }, "status": { "$ref": "#/components/schemas/PortfolioReceiptStatus" } } }, "PortfolioReceiptSettlement": { "type": "object", "required": [ "claimedAt", "refund" ], "properties": { "claimedAt": { "type": "string" }, "refund": { "type": "string" }, "retainedCost": { "type": "string" }, "retainedShares": { "type": "string" } } }, "PortfolioReceiptStatus": { "type": "string", "enum": [ "awaiting_graduation", "claimable", "refund_claimable", "settled", "refunded" ] }, "PortfolioRedemption": { "type": "object", "required": [ "collateralAmount", "kind", "logIndex", "marketId", "redeemedAt", "transactionHash" ], "properties": { "collateralAmount": { "type": "string" }, "kind": { "type": "string", "enum": [ "redeemed", "cancelled_redeemed" ] }, "logIndex": { "type": "number" }, "marketId": { "type": "string" }, "marketQuestion": { "type": "string" }, "noAmount": { "type": "string" }, "outcomeAmount": { "type": "string" }, "redeemedAt": { "type": "string" }, "side": { "$ref": "#/components/schemas/VenuePoolSide" }, "transactionHash": { "type": "string" }, "valueWad": { "type": "string" }, "yesAmount": { "type": "string" } } }, "PortfolioSummary": { "type": "object", "required": [ "claimableReceiptCount", "lockedCollateral", "openOrderCount", "openReceiptCount", "positionCount", "totalPositionValueWad" ], "properties": { "claimableReceiptCount": { "type": "number" }, "lockedCollateral": { "type": "string" }, "openOrderCount": { "type": "number" }, "openReceiptCount": { "type": "number" }, "positionCount": { "type": "number" }, "totalPositionValueWad": { "type": "string" } } } } } }