{ "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. Pass `status` as a comma-separated list of MarketStatus values to narrow the list to those lifecycle states.", "tags": [ "Markets" ], "parameters": [ { "name": "chainId", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "since", "in": "query", "required": false, "schema": { "type": "string" } }, { "name": "status", "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" } } } } } } }, "/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. Gets the local chain past the market graduation deadline, calls PregradManager.markRefundable, and updates the indexed market projection. Where the local chain cannot warp its clock the deadline is waited out in real time, so the call takes as long as the market has left in its graduation window and refuses outright when that is more than 90 seconds.", "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}/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. The market's resolution gate and any dispute window are reached first; where the local chain cannot warp its clock they are waited out in real time, so the call takes as long as those windows have left and refuses outright when either is more than 90 seconds away.", "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, gets the local chain past any configured challenge window (a no-op while the window is zero, and otherwise waited out in real time where the chain cannot warp), 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}/price-history": { "get": { "operationId": "getMarketPriceHistory", "summary": "Get a market's whole-life price history", "description": "Returns the market's price path across its whole trading life as fractional YES and NO cents: the virtual LMSR's implied probabilities over the receipt book (an opening point at creation, one point per receipt), then — once graduated — a synthesized handoff point where the venue pools were initialized at the pre-graduation closing price, followed by one point per indexed taker swap with the untouched outcome carried forward. The point shape is identical across the seam; graduatedAt is a chart annotation, not a phase marker on points. Histories are downsampled to a fixed ceiling, always keeping the opening and latest samples. Supersedes the venue-only read (repo ADR 0025).", "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/MarketPriceHistory" } } } }, "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" } } } } } } }, "/markets/{chainId}/{marketId}/resolution-finalize": { "post": { "operationId": "requestResolutionFinalization", "summary": "Settle a market whose dispute window has closed", "description": "Public settlement failsafe for a proposal the keeper has not finalized — the finalize sibling of the graduation trigger and the resolution-check poke (repo ADR 0024). The keeper discovers pending proposals from the indexed market status, so a proposal the indexer missed is one nothing settles automatically: the market stays in ResolutionPending and winners cannot redeem. Safe unauthenticated and unbonded: finalizeResolution() is permissionless on the contract and takes no payment, so the server signs nothing the caller could not sign themselves, and the outcome is the one already proposed. Cost is bounded by the contract, not by caller identity — chain state is read first and no transaction is sent unless the market is genuinely settleable, so repeat requests are free reads (409).", "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/ResolutionFinalizeAccepted" } } } }, "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/ResolutionFinalizeRefused" } } } } } } }, "/drafts": { "get": { "operationId": "listMarketDrafts", "summary": "List the caller's market drafts", "description": "Every live (non-deleted) draft owned by the authenticated user, most recently touched first, each with its latest review.", "tags": [ "Drafts" ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraftList" } } } }, "401": { "description": "Response for status 401", "content": { "text/plain": { "schema": { "type": "string" } } } }, "501": { "description": "Response for status 501", "content": { "text/plain": { "schema": { "type": "string" } } } } } }, "post": { "operationId": "createMarketDraft", "summary": "Create a market draft", "description": "Creates a fresh editing draft (optionally a template) owned by the authenticated user.", "tags": [ "Drafts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraftWrite" } }, "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/MarketDraftWrite" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MarketDraftWrite" } } } }, "responses": { "201": { "description": "Response for status 201", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraft" } } } }, "401": { "description": "Response for status 401", "content": { "text/plain": { "schema": { "type": "string" } } } }, "501": { "description": "Response for status 501", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/drafts/credit": { "get": { "operationId": "getMarketDraftReviewCredit", "summary": "Read a wallet's review credit", "description": "The wallet's prepaid review credit: indexed deposits minus metered charges, the per-review rate, and run counts. metered=false means no vault is configured and submission is ungated.", "tags": [ "Drafts" ], "parameters": [ { "name": "address", "in": "query", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraftReviewCredit" } } } }, "401": { "description": "Response for status 401", "content": { "text/plain": { "schema": { "type": "string" } } } }, "422": { "description": "Response for status 422", "content": { "text/plain": { "schema": { "type": "string" } } } }, "501": { "description": "Response for status 501", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/drafts/{draftId}": { "get": { "operationId": "getMarketDraft", "summary": "Read one market draft", "tags": [ "Drafts" ], "parameters": [ { "name": "draftId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraft" } } } }, "401": { "description": "Response for status 401", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "501": { "description": "Response for status 501", "content": { "text/plain": { "schema": { "type": "string" } } } } } }, "patch": { "operationId": "updateMarketDraft", "summary": "Update a market draft", "description": "Edits draft content. Any content change on a reviewed draft returns it to editing and clears its review snapshot, so stale approvals can never publish changed text.", "tags": [ "Drafts" ], "parameters": [ { "name": "draftId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraftWrite" } }, "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/MarketDraftWrite" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MarketDraftWrite" } } } }, "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraft" } } } }, "401": { "description": "Response for status 401", "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": { "text/plain": { "schema": { "type": "string" } } } }, "501": { "description": "Response for status 501", "content": { "text/plain": { "schema": { "type": "string" } } } } } }, "delete": { "operationId": "deleteMarketDraft", "summary": "Soft-delete a market draft", "tags": [ "Drafts" ], "parameters": [ { "name": "draftId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Response for status 401", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "501": { "description": "Response for status 501", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/drafts/clone": { "post": { "operationId": "cloneMarketDraft", "summary": "Clone a draft or market into a new draft", "description": "The universal clone (ADR 0022): seeds a new editing draft verbatim from one of the caller's drafts or from any indexed market.", "tags": [ "Drafts" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraftCloneRequest" } }, "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/MarketDraftCloneRequest" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MarketDraftCloneRequest" } } } }, "responses": { "201": { "description": "Response for status 201", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraft" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Response for status 401", "content": { "text/plain": { "schema": { "type": "string" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "501": { "description": "Response for status 501", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/drafts/{draftId}/submit": { "post": { "operationId": "submitMarketDraft", "summary": "Submit a draft for AI review", "description": "Snapshots the draft content, locks it in review, and enqueues a review job. The review lands asynchronously; poll the draft until its status leaves in_review.", "tags": [ "Drafts" ], "parameters": [ { "name": "draftId", "in": "path", "required": true, "schema": { "type": "string" } } ], "responses": { "202": { "description": "Response for status 202", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraft" } } } }, "401": { "description": "Response for status 401", "content": { "text/plain": { "schema": { "type": "string" } } } }, "402": { "description": "Response for status 402", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraftBondShortfall" } } } }, "404": { "description": "Response for status 404", "content": { "text/plain": { "schema": { "type": "string" } } } }, "409": { "description": "Response for status 409", "content": { "text/plain": { "schema": { "type": "string" } } } }, "422": { "description": "Response for status 422", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraftValidationErrors" } } } }, "501": { "description": "Response for status 501", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/drafts/{draftId}/publish-params": { "post": { "operationId": "buildMarketDraftPublishParams", "summary": "Mint publish-time createMarket params for an approved draft", "description": "Re-checks the draft is approved and unchanged, then resolves its relative deadline windows into absolute timestamps anchored at current chain time (ADR 0022 decision 4). The caller signs createMarket with these params plus its configured collateral.", "tags": [ "Drafts" ], "parameters": [ { "name": "draftId", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "creatorAddress", "in": "query", "required": false, "schema": { "pattern": "^0x[0-9a-fA-F]{40}$", "type": "string" } } ], "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraftPublishParams" } } } }, "401": { "description": "Response for status 401", "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": { "text/plain": { "schema": { "type": "string" } } } }, "501": { "description": "Response for status 501", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/drafts/{draftId}/published": { "post": { "operationId": "markMarketDraftPublished", "summary": "Record a confirmed publish transaction", "description": "Links the draft to the market it became and bridge-approves the market on-chain (the review already happened on the draft).", "tags": [ "Drafts" ], "parameters": [ { "name": "draftId", "in": "path", "required": true, "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraftPublishedWrite" } }, "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/MarketDraftPublishedWrite" } }, "multipart/form-data": { "schema": { "$ref": "#/components/schemas/MarketDraftPublishedWrite" } } } }, "responses": { "200": { "description": "Response for status 200", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDraftPublished" } } } }, "400": { "description": "Response for status 400", "content": { "text/plain": { "schema": { "type": "string" } } } }, "401": { "description": "Response for status 401", "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": { "text/plain": { "schema": { "type": "string" } } } }, "501": { "description": "Response for status 501", "content": { "text/plain": { "schema": { "type": "string" } } } } } } }, "/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" } } }, "AiReviewProvider": { "type": "string", "enum": [ "anthropic", "claude-cli", "codex-cli", "heuristic", "ollama", "openai" ] }, "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" } } } }, "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" ] } } }, "ResolutionFinalizeAccepted": { "type": "object", "required": [ "message", "status", "transactionHash" ], "properties": { "message": { "type": "string" }, "status": { "type": "string", "enum": [ "settled" ] }, "transactionHash": { "type": "string" } } }, "ResolutionFinalizeRefused": { "type": "object", "required": [ "message", "status" ], "properties": { "message": { "type": "string" }, "status": { "type": "string", "enum": [ "not_graduated", "no_pending_proposal", "window_open", "disputed", "already_resolved" ] } } }, "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" } } }, "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" }, "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" } } }, "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" } } }, "MarketOrderBook": { "type": "object", "required": [ "chainId", "marketId" ], "properties": { "chainId": { "type": "number" }, "marketId": { "type": "string" }, "no": { "$ref": "#/components/schemas/VenueOrderBookPool" }, "yes": { "$ref": "#/components/schemas/VenueOrderBookPool" } } }, "MarketPriceHistory": { "type": "object", "required": [ "chainId", "marketId", "points" ], "properties": { "chainId": { "type": "number" }, "graduatedAt": { "type": "string" }, "marketId": { "type": "string" }, "points": { "type": "array", "items": { "$ref": "#/components/schemas/PricePoint" } }, "streams": { "additionalProperties": { "type": "number" }, "type": "object" } } }, "MarketStatus": { "type": "string", "enum": [ "under_review", "bootstrap", "graduating", "graduated", "resolved", "refunded", "cancelled", "rejected", "resolution_pending", "disputed" ] }, "PricePoint": { "type": "object", "required": [ "at", "noCents", "yesCents" ], "properties": { "at": { "type": "string" }, "noCents": { "type": "number" }, "yesCents": { "type": "number" } } }, "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" ] }, "DraftFeedbackField": { "type": "string", "enum": [ "question", "description", "resolutionCriteria", "resolutionSources" ] }, "DraftFeedbackItem": { "type": "object", "required": [ "howToFix", "issue", "severity", "title" ], "properties": { "field": { "$ref": "#/components/schemas/DraftFeedbackField" }, "howToFix": { "type": "string" }, "issue": { "type": "string" }, "severity": { "$ref": "#/components/schemas/DraftFeedbackSeverity" }, "title": { "type": "string" } } }, "DraftFeedbackSeverity": { "type": "string", "enum": [ "blocker", "warning", "info" ] }, "DraftReviewFeedback": { "type": "object", "required": [ "items", "summary" ], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/DraftFeedbackItem" } }, "summary": { "type": "string" } } }, "MarketDraft": { "type": "object", "required": [ "category", "createdAt", "description", "graduationWindowSeconds", "id", "intendedCreatorAddress", "isTemplate", "liquidityParameter", "openingProbability", "outcomeNo", "outcomeYes", "publishedAt", "publishedChainId", "publishedMarketId", "publishedTransactionHash", "question", "resolutionCriteria", "resolutionSources", "resolutionUrl", "resolutionWindowSeconds", "reviewedAt", "status", "submittedAt", "updatedAt" ], "properties": { "category": { "type": "string" }, "createdAt": { "type": "string" }, "description": { "type": "string" }, "graduationWindowSeconds": { "type": "number" }, "id": { "type": "string" }, "intendedCreatorAddress": { "type": "string", "nullable": true }, "isTemplate": { "type": "boolean" }, "latestReview": { "$ref": "#/components/schemas/MarketDraftReview" }, "liquidityParameter": { "type": "number" }, "openingProbability": { "type": "number" }, "outcomeNo": { "type": "string" }, "outcomeYes": { "type": "string" }, "publishedAt": { "type": "string", "nullable": true }, "publishedChainId": { "type": "number", "nullable": true }, "publishedMarketId": { "type": "string", "nullable": true }, "publishedTransactionHash": { "type": "string", "nullable": true }, "question": { "type": "string" }, "resolutionCriteria": { "type": "string" }, "resolutionSources": { "type": "string" }, "resolutionUrl": { "type": "string" }, "resolutionWindowSeconds": { "type": "number" }, "reviewedAt": { "type": "string", "nullable": true }, "status": { "$ref": "#/components/schemas/MarketDraftStatus" }, "submittedAt": { "type": "string", "nullable": true }, "updatedAt": { "type": "string" } } }, "MarketDraftBondShortfall": { "type": "object", "required": [ "availableWad", "message", "requiredWad", "runsUsed" ], "properties": { "availableWad": { "type": "string" }, "message": { "type": "string" }, "requiredWad": { "type": "string" }, "runsUsed": { "anyOf": [ { "format": "integer", "default": 0, "type": "string" }, { "type": "integer" } ] } } }, "MarketDraftCloneRequest": { "type": "object", "properties": { "asTemplate": { "type": "boolean" }, "fromDraftId": { "type": "string" }, "fromMarket": { "type": "object", "required": [ "chainId", "marketId" ], "properties": { "chainId": { "minimum": 1, "multipleOf": 1, "type": "number" }, "marketId": { "type": "string" } } } } }, "MarketDraftReviewCredit": { "type": "object", "required": [ "availableWad", "metered", "rateWad", "runsRemaining", "runsUsed" ], "properties": { "availableWad": { "type": "string" }, "metered": { "type": "boolean" }, "rateWad": { "type": "string" }, "runsRemaining": { "anyOf": [ { "format": "integer", "default": 0, "type": "string" }, { "type": "integer" } ] }, "runsUsed": { "anyOf": [ { "format": "integer", "default": 0, "type": "string" }, { "type": "integer" } ] } } }, "MarketDraftList": { "type": "array", "items": { "$ref": "#/components/schemas/MarketDraft" } }, "MarketDraftPublishAuthorization": { "type": "object", "required": [ "expiry", "nonce", "signature" ], "properties": { "expiry": { "type": "string" }, "nonce": { "type": "string" }, "signature": { "type": "string" } } }, "MarketDraftPublished": { "type": "object", "required": [ "draft" ], "properties": { "draft": { "$ref": "#/components/schemas/MarketDraft" } } }, "MarketDraftPublishedWrite": { "type": "object", "required": [ "chainId", "marketId", "transactionHash" ], "properties": { "chainId": { "minimum": 1, "multipleOf": 1, "type": "number" }, "marketId": { "type": "string" }, "transactionHash": { "type": "string" } } }, "MarketDraftPublishParams": { "type": "object", "required": [ "bypassAiResolution", "collateral", "graduationDeadline", "graduationThreshold", "liquidityParameter", "metadata", "metadataHash", "openingProbabilityWad", "resolutionTime", "yesNotBefore" ], "properties": { "authorization": { "$ref": "#/components/schemas/MarketDraftPublishAuthorization" }, "bypassAiResolution": { "type": "boolean" }, "collateral": { "type": "string" }, "graduationDeadline": { "type": "string" }, "graduationThreshold": { "type": "string" }, "liquidityParameter": { "type": "string" }, "metadata": { "type": "string" }, "metadataHash": { "type": "string" }, "openingProbabilityWad": { "type": "string" }, "resolutionTime": { "type": "string" }, "yesNotBefore": { "type": "string" } } }, "MarketDraftReview": { "type": "object", "required": [ "feedback", "id", "metadataHash", "modelId", "provider", "reasons", "reviewedAt", "scoreRationales", "scores", "verdict" ], "properties": { "feedback": { "$ref": "#/components/schemas/DraftReviewFeedback" }, "id": { "type": "number" }, "metadataHash": { "type": "string" }, "modelId": { "type": "string", "nullable": true }, "provider": { "$ref": "#/components/schemas/AiReviewProvider" }, "reasons": { "type": "array", "items": { "type": "string" } }, "reviewedAt": { "type": "string" }, "scoreRationales": { "$ref": "#/components/schemas/AiReviewScoreRationales" }, "scores": { "$ref": "#/components/schemas/AiReviewScores" }, "verdict": { "$ref": "#/components/schemas/AiReviewVerdict" } } }, "MarketDraftStatus": { "type": "string", "enum": [ "editing", "in_review", "changes_requested", "rejected", "approved", "published" ] }, "MarketDraftValidationErrors": { "type": "object", "required": [ "errors", "message" ], "properties": { "errors": { "type": "object", "properties": { "category": { "type": "string" }, "graduationWindowSeconds": { "type": "string" }, "liquidityParameter": { "type": "string" }, "openingProbability": { "type": "string" }, "outcomeNo": { "type": "string" }, "outcomeYes": { "type": "string" }, "question": { "type": "string" }, "resolutionCriteria": { "type": "string" }, "resolutionWindowSeconds": { "type": "string" } } }, "message": { "type": "string" } } }, "MarketDraftWrite": { "type": "object", "properties": { "category": { "maxLength": 40, "type": "string" }, "description": { "maxLength": 10000, "type": "string" }, "graduationWindowSeconds": { "minimum": 1, "multipleOf": 1, "type": "number" }, "intendedCreatorAddress": { "type": "string", "nullable": true }, "isTemplate": { "type": "boolean" }, "liquidityParameter": { "minimum": 1, "multipleOf": 1, "type": "number" }, "openingProbability": { "maximum": 100, "minimum": 0, "multipleOf": 1, "type": "number" }, "outcomeNo": { "maxLength": 200, "type": "string" }, "outcomeYes": { "maxLength": 200, "type": "string" }, "question": { "maxLength": 500, "type": "string" }, "resolutionCriteria": { "maxLength": 10000, "type": "string" }, "resolutionSources": { "maxLength": 5000, "type": "string" }, "resolutionUrl": { "maxLength": 2000, "type": "string" }, "resolutionWindowSeconds": { "minimum": 1, "multipleOf": 1, "type": "number" } } }, "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" } } } } } }