{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "Reso Trading API",
    "version": "1.0.0",
    "description": "Canonical HTTP contract for Reso managed Trading Accounts. External funding wallets authorize account and funding actions; Reso-managed owner wallets execute trading, and withdrawals return only to the bound funding wallet."
  },
  "servers": [
    { "url": "https://reso.market", "description": "Production" },
    { "url": "/", "description": "Current Reso environment" }
  ],
  "externalDocs": { "description": "End-to-end Trading API integration guide", "url": "/docs/trading-api" },
  "tags": [
    { "name": "System", "description": "Clock and eligibility checks" },
    { "name": "Authentication", "description": "Wallet L1 challenges and Reso or Provider credentials" },
    { "name": "Markets", "description": "Public Sports, Crypto, and BTC 3m market discovery" },
    { "name": "Provider trading", "description": "ADI Sports IOC and Polymarket Crypto FAK orders" },
    { "name": "Funding", "description": "Funding assets, deposit and withdrawal intents, and status" },
    { "name": "Public profiles", "description": "Sanitized wallet positions and activity without authentication" },
    { "name": "Trading account", "description": "Private account, balances, positions, activity, and statements" },
    { "name": "BTC 3m orders", "description": "BTC 3m order, fill, cancellation, heartbeat, and inventory lifecycle" },
    { "name": "Settlement", "description": "Settlement batches and accounting snapshots" }
  ],
  "x-reso-protocol-limits": {
    "maxBatchOrders": 20,
    "maxBatchCancelIds": 100,
    "maxBatchMarketScopes": 32,
    "maxWsBookScopesPerConnection": 32,
    "maxHttpJsonBodyBytes": 262144,
    "maxWsClientMessageBytes": 16384,
    "defaultPageSize": 50,
    "maxPageSize": 200,
    "maxPublicProfilePageSize": 100,
    "outboxReplayRetentionMs": 86400000
  },
  "paths": {
    "/api/trading/time": {
      "get": { "operationId": "getTradingTime", "summary": "Get Trading Time", "tags": ["System"], "security": [], "responses": { "200": { "$ref": "#/components/responses/TradingTime" }, "500": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/eligibility": {
      "get": { "operationId": "getTradingEligibility", "summary": "Get Trading Eligibility", "tags": ["System"], "security": [{}, { "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "responses": { "200": { "$ref": "#/components/responses/Eligibility" }, "503": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/auth/challenges": {
      "post": { "operationId": "createOrConsumeTradingAuthChallenge", "summary": "Create Or Consume Trading Auth Challenge", "tags": ["Authentication"], "description": "Issues or consumes an EIP-712 authorization challenge. Without a cookie session, callers provide fundingWallet and sign with that external wallet. Reso creates or resolves a separate managed owner wallet for the Trading Account. WITHDRAW resources are canonicalized by the server to the managed owner and bound funding-wallet destination; no Provider signature action is returned.", "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthChallengeRequest" } } } }, "responses": { "200": { "description": "Challenge issued or consumed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthChallengeResponse" } } } }, "400": { "$ref": "#/components/responses/Error" }, "401": { "$ref": "#/components/responses/Error" }, "409": { "$ref": "#/components/responses/Error" }, "413": { "$ref": "#/components/responses/Error" }, "503": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/auth/credentials": {
      "get": { "operationId": "listTradingCredentials", "summary": "List Trading Credentials", "tags": ["Authentication"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "responses": { "200": { "description": "Credential metadata", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/CredentialMetadata" } } } } }, "401": { "$ref": "#/components/responses/Error" } } },
      "post": { "operationId": "createTradingCredential", "summary": "Create Trading Credential", "tags": ["Authentication"], "description": "Creates a credential after consuming the authorization challenge carried in the request body. Cookie session is optional.", "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CredentialActionRequest" } } } }, "responses": { "201": { "$ref": "#/components/responses/OneTimeCredential" }, "400": { "$ref": "#/components/responses/Error" }, "401": { "$ref": "#/components/responses/Error" }, "409": { "$ref": "#/components/responses/Error" }, "413": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/auth/credentials/rotate": {
      "post": { "operationId": "rotateTradingCredential", "summary": "Rotate Trading Credential", "tags": ["Authentication"], "description": "Rotates a credential after consuming the authorization challenge carried in the request body. Cookie session is optional.", "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CredentialActionRequest" } } } }, "responses": { "201": { "$ref": "#/components/responses/OneTimeCredential" }, "400": { "$ref": "#/components/responses/Error" }, "401": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" }, "413": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/auth/credentials/{credentialId}": {
      "delete": { "operationId": "revokeTradingCredential", "summary": "Revoke Trading Credential", "tags": ["Authentication"], "description": "Revokes a credential after consuming the authorization challenge carried in the request body. Cookie session is optional.", "security": [], "parameters": [{ "$ref": "#/components/parameters/CredentialId" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CredentialActionRequest" } } } }, "responses": { "200": { "description": "Credential revoked", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CredentialMetadata" } } } }, "401": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" }, "413": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/provider-credentials/polymarket": {
      "put": { "operationId": "registerPolymarketCredential", "summary": "Register Polymarket Credential", "tags": ["Authentication"], "description": "Registers or rotates one encrypted Polymarket CLOB credential after consuming the authorization challenge. Secrets are never returned.", "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PolymarketCredentialRegistrationRequest" } } } }, "responses": { "200": { "description": "Provider credential metadata", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProviderCredentialMetadata" } } } }, "400": { "$ref": "#/components/responses/Error" }, "401": { "$ref": "#/components/responses/Error" }, "403": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" }, "413": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/orders/manual": {
      "post": { "operationId": "createManualProviderOrder", "summary": "Create Manual Provider Order", "tags": ["Provider trading"], "description": "Submits an ADI Sports IOC or Polymarket Crypto FAK order. For a managed owner account, an authenticated L2 request authorizes the platform signer to build the Polymarket FAK order. A legacy self-custody account must include provider-native owner authorization. The market catalog selects the provider.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManualOrderRequest" } } } }, "responses": { "200": { "description": "Idempotent replay", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManualOrderResult" } } } }, "202": { "description": "Order accepted for execution", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManualOrderResult" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "401": { "$ref": "#/components/responses/LegacyError" }, "403": { "$ref": "#/components/responses/LegacyError" }, "409": { "$ref": "#/components/responses/LegacyError" }, "422": { "$ref": "#/components/responses/LegacyError" }, "423": { "$ref": "#/components/responses/LegacyError" }, "429": { "$ref": "#/components/responses/LegacyError" }, "500": { "$ref": "#/components/responses/LegacyError" }, "503": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/positions/close": {
      "post": { "operationId": "closeManualProviderPosition", "summary": "Close Manual Provider Position", "tags": ["Provider trading"], "description": "Closes an ADI or Polymarket position. A managed owner account may authorize the platform signer with its L2 request; a legacy self-custody account must submit the exact owner-signed SELL FAK body. Polymarket closes also require the requested share amount and an Idempotency-Key. Reuse the same key and exact request when the result is unknown.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PositionCloseRequest" } } } }, "responses": { "202": { "description": "Close submitted or idempotently replayed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PositionCloseResult" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "401": { "$ref": "#/components/responses/LegacyError" }, "403": { "$ref": "#/components/responses/LegacyError" }, "409": { "$ref": "#/components/responses/LegacyError" }, "422": { "$ref": "#/components/responses/LegacyError" }, "423": { "$ref": "#/components/responses/LegacyError" }, "429": { "$ref": "#/components/responses/LegacyError" }, "500": { "$ref": "#/components/responses/LegacyError" }, "503": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/orders/{id}": {
      "get": { "operationId": "getManualProviderOrder", "summary": "Get Manual Provider Order", "tags": ["Provider trading"], "description": "Returns a sanitized ADI or Polymarket order owned by the authenticated wallet.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 256 } }], "responses": { "200": { "description": "Sanitized order", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ManualOrderResponse" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "401": { "$ref": "#/components/responses/LegacyError" }, "403": { "$ref": "#/components/responses/LegacyError" }, "404": { "$ref": "#/components/responses/LegacyError" }, "422": { "$ref": "#/components/responses/LegacyError" }, "500": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/portfolio": {
      "get": { "operationId": "getPrivatePortfolio", "summary": "Get Private Portfolio", "tags": ["Provider trading"], "description": "Returns the authenticated wallet's sanitized cross-product portfolio. An explicit wallet query, when present, must match the authenticated account.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "name": "wallet", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/EvmAddress" } }, { "name": "format", "in": "query", "required": false, "schema": { "enum": ["json", "csv", "pdf"], "default": "json" } }, { "name": "period", "in": "query", "required": false, "description": "Used only by PDF reports.", "schema": { "enum": ["weekly", "monthly"], "default": "weekly" } }], "responses": { "200": { "description": "Portfolio JSON or requested report", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PortfolioSummary" } }, "text/csv": { "schema": { "type": "string" } }, "application/pdf": { "schema": { "type": "string", "contentEncoding": "binary" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "401": { "$ref": "#/components/responses/LegacyError" }, "422": { "$ref": "#/components/responses/LegacyError" }, "423": { "$ref": "#/components/responses/LegacyError" }, "500": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/funding/assets": {
      "get": { "operationId": "listFundingAssets", "summary": "List Funding Assets", "tags": ["Funding"], "description": "Lists supported deposit and withdrawal assets and target accounts. L2 reads never trigger wallet provisioning.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "name": "wallet", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/EvmAddress" } }], "responses": { "200": { "description": "Supported assets", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FundingAssetList" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "401": { "$ref": "#/components/responses/LegacyError" }, "409": { "$ref": "#/components/responses/LegacyError" }, "422": { "$ref": "#/components/responses/LegacyError" }, "429": { "$ref": "#/components/responses/LegacyError" }, "500": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/funding/redeem": {
      "post": { "operationId": "redeemResolvedPositions", "summary": "Redeem Resolved Positions", "tags": ["Funding"], "description": "For a wallet-only Polymarket caller, returns exact redeem calls for an owner-signed relayer WALLET batch; Reso L2 never signs or submits the batch. A cookie-session compatibility caller may use the existing server-managed ADI or Polymarket path.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FundingRedeemRequest" } } } }, "responses": { "200": { "description": "No-op, server-managed execution, or owner wallet action", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FundingRedeemResult" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "401": { "$ref": "#/components/responses/LegacyError" }, "403": { "$ref": "#/components/responses/LegacyError" }, "409": { "$ref": "#/components/responses/LegacyError" }, "422": { "$ref": "#/components/responses/LegacyError" }, "423": { "$ref": "#/components/responses/LegacyError" }, "429": { "$ref": "#/components/responses/LegacyError" }, "500": { "$ref": "#/components/responses/LegacyError" }, "503": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/funding/intents": {
      "post": { "operationId": "createFundingIntent", "summary": "Create Funding Intent", "tags": ["Funding"], "description": "Creates or replays a Funding Hub intent for a managed Trading Account. Deposits use the platform-provisioned deposit wallet. Withdrawals require a one-time WITHDRAW challenge signed by the bound external funding wallet; Reso fixes the destination to that funding wallet and executes Provider/vault actions through platform-controlled executors after ledger, position, risk, and idempotency checks. L2 credentials cannot authorize withdrawals, callers cannot provide Provider authorization, and no deposit/vault wallet calls are returned for client execution.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }, {}], "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FundingIntentRequest" } } } }, "responses": { "200": { "description": "Idempotent replay", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FundingIntentResult" } } } }, "202": { "description": "Intent accepted or processing", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FundingIntentResult" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "401": { "$ref": "#/components/responses/LegacyError" }, "403": { "$ref": "#/components/responses/LegacyError" }, "409": { "$ref": "#/components/responses/LegacyError" }, "422": { "$ref": "#/components/responses/LegacyError" }, "423": { "$ref": "#/components/responses/LegacyError" }, "429": { "$ref": "#/components/responses/LegacyError" }, "500": { "$ref": "#/components/responses/LegacyError" }, "503": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/funding/intents/cancel": {
      "post": { "operationId": "cancelPendingDepositIntent", "summary": "Cancel Pending Deposit Intent", "tags": ["Funding"], "description": "Cancels only an authenticated caller's deposit intent that is still AWAITING_ONCHAIN_TRANSFER and has no detected deposit. Supports Cookie Session or Reso L2; it never cancels withdrawals or an intent with chain evidence.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "required": ["intentId"], "properties": { "intentId": { "type": "string", "minLength": 1 } } } } } }, "responses": { "200": { "description": "Cancellation result", "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "required": ["ok", "cancelled"], "properties": { "ok": { "const": true }, "cancelled": { "type": "boolean" } } } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "401": { "$ref": "#/components/responses/LegacyError" }, "413": { "$ref": "#/components/responses/LegacyError" }, "423": { "$ref": "#/components/responses/LegacyError" }, "429": { "$ref": "#/components/responses/LegacyError" }, "500": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/funding/intents/confirm-polymarket-withdrawal": {
      "post": { "operationId": "confirmPolymarketWithdrawalTransfer", "summary": "Confirm Polymarket Withdrawal Transfer", "tags": ["Funding"], "description": "Attaches and verifies the confirmed Polygon pUSD transfer produced by the owner-signed WALLET batch returned from a polymarket_collateral withdrawal intent. L2 only submits evidence for the already owner-authorized intent; it cannot change the amount or destination.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PolymarketWithdrawalConfirmationRequest" } } } }, "responses": { "200": { "description": "Owner transfer confirmed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PolymarketWithdrawalConfirmationResult" } } } }, "202": { "description": "Transaction found but still confirming", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PolymarketWithdrawalConfirmationResult" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "401": { "$ref": "#/components/responses/LegacyError" }, "404": { "$ref": "#/components/responses/LegacyError" }, "409": { "$ref": "#/components/responses/LegacyError" }, "422": { "$ref": "#/components/responses/LegacyError" }, "423": { "$ref": "#/components/responses/LegacyError" }, "429": { "$ref": "#/components/responses/LegacyError" }, "500": { "$ref": "#/components/responses/LegacyError" }, "503": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/funding/status": {
      "get": { "operationId": "getFundingStatus", "summary": "Get Funding Status", "tags": ["Funding"], "description": "Returns sanitized transactions for one statusAddress previously issued to the authenticated account.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "name": "address", "in": "query", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 256 } }, { "name": "wallet", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/EvmAddress" } }], "responses": { "200": { "description": "Funding transactions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FundingStatus" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "401": { "$ref": "#/components/responses/LegacyError" }, "409": { "$ref": "#/components/responses/LegacyError" }, "422": { "$ref": "#/components/responses/LegacyError" }, "423": { "$ref": "#/components/responses/LegacyError" }, "429": { "$ref": "#/components/responses/LegacyError" }, "500": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/public/profiles/{wallet}/positions": {
      "get": { "operationId": "listPublicWalletPositions", "summary": "List Public Wallet Positions", "tags": ["Public profiles"], "description": "Returns locally persisted, sanitized positions for a wallet-only identity. It never calls a provider or returns balances, internal account IDs, credentials, token IDs, or provider order IDs.", "security": [], "parameters": [{ "name": "wallet", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/EvmAddress" } }, { "$ref": "#/components/parameters/PublicProfileProduct" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/PublicProfileLimit" }], "responses": { "200": { "description": "Public wallet positions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicProfilePositionPage" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "404": { "$ref": "#/components/responses/LegacyError" }, "429": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/public/profiles/{wallet}/activity": {
      "get": { "operationId": "listPublicWalletActivity", "summary": "List Public Wallet Activity", "tags": ["Public profiles"], "description": "Returns locally persisted, sanitized fills and settlements for a wallet-only identity. Missing, invalid, and non-public identities all return 404.", "security": [], "parameters": [{ "name": "wallet", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/EvmAddress" } }, { "$ref": "#/components/parameters/PublicProfileProduct" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/PublicProfileLimit" }], "responses": { "200": { "description": "Public wallet activity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicProfileActivityPage" } } } }, "400": { "$ref": "#/components/responses/LegacyError" }, "404": { "$ref": "#/components/responses/LegacyError" }, "429": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/markets": {
      "get": { "operationId": "listPublicSportsMarkets", "summary": "List Public Sports Markets", "tags": ["Markets"], "description": "Lists sanitized ADI Sports markets. Provider routing metadata and token IDs are intentionally absent.", "security": [], "parameters": [{ "name": "category", "in": "query", "schema": { "type": "string" } }, { "name": "q", "in": "query", "schema": { "type": "string" } }, { "name": "team", "in": "query", "schema": { "type": "string" } }, { "name": "risk", "in": "query", "schema": { "enum": ["", "low", "mid", "high"] } }, { "name": "date", "in": "query", "schema": { "type": "string" } }, { "name": "sort", "in": "query", "schema": { "enum": ["", "ai", "liq", "vol", "time"] } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1 } }], "responses": { "200": { "description": "Sports market discovery", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicSportsMarketDiscovery" } } } }, "503": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/markets/{id}": {
      "get": { "operationId": "getPublicSportsMarket", "summary": "Get Public Sports Market", "tags": ["Markets"], "description": "Returns one sanitized ADI Sports market and public trade context without Provider metadata or token IDs.", "security": [], "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 256 } }], "responses": { "200": { "description": "Sports market detail", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicSportsMarket" } } } }, "404": { "$ref": "#/components/responses/LegacyError" }, "503": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/crypto/markets": {
      "get": { "operationId": "listPublicCryptoMarkets", "summary": "List Public Crypto Markets", "tags": ["Markets"], "description": "Lists sanitized Polymarket Crypto markets. conditionId and eventSlug may be used with official Gamma/CLOB APIs; token IDs remain absent.", "security": [], "parameters": [{ "name": "q", "in": "query", "schema": { "type": "string" } }, { "name": "asset", "in": "query", "schema": { "type": "string" } }, { "name": "category", "in": "query", "schema": { "enum": ["", "price", "event", "etf", "policy", "other"] } }, { "name": "sort", "in": "query", "schema": { "enum": ["", "vol", "liq", "time", "price"] } }, { "name": "status", "in": "query", "schema": { "enum": ["active", "resolved", "all"], "default": "active" } }, { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1 } }, { "name": "offset", "in": "query", "schema": { "type": "integer", "minimum": 0 } }], "responses": { "200": { "description": "Crypto market discovery", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicCryptoMarketDiscovery" } } } } } }
    },
    "/api/crypto/markets/{id}/live": {
      "get": { "operationId": "getPublicCryptoMarketLive", "summary": "Get Public Crypto Market Live", "tags": ["Markets"], "description": "Returns cached public Crypto market, history, book and spot display data without token IDs.", "security": [], "parameters": [{ "name": "id", "in": "path", "required": true, "description": "Event slug, event ID, market ID or recurring asset key accepted by the current resolver.", "schema": { "type": "string", "minLength": 1, "maxLength": 256 } }, { "name": "market", "in": "query", "schema": { "type": "string" } }, { "name": "side", "in": "query", "schema": { "enum": ["yes", "no"] } }], "responses": { "200": { "description": "Crypto live display data", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicCryptoMarketLive" } } } }, "404": { "$ref": "#/components/responses/LegacyError" }, "503": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/crypto/markets/{id}/quote": {
      "get": { "operationId": "getPublicCryptoMarketQuote", "summary": "Get Public Crypto Market Quote", "tags": ["Markets"], "description": "Returns current YES and NO buy prices and available best bids for one Reso Crypto market ID.", "security": [], "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 256 } }], "responses": { "200": { "description": "Crypto quote", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicCryptoQuote" } } } }, "404": { "$ref": "#/components/responses/LegacyError" } } }
    },
    "/api/trading/account": {
      "get": { "operationId": "getTradingAccount", "summary": "Get Trading Account", "tags": ["Trading account"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "responses": { "200": { "description": "Trading account", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TradingAccount" } } } }, "401": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/account/snapshot": {
      "get": { "operationId": "getTradingAccountSnapshot", "summary": "Get Trading Account Snapshot", "tags": ["Trading account"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "responses": { "200": { "description": "Transaction-consistent account snapshot", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountSnapshot" } } } }, "401": { "$ref": "#/components/responses/Error" }, "503": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/account/events": {
      "get": { "operationId": "listTradingAccountEvents", "summary": "Replay Trading Account Events", "tags": ["Trading account"], "description": "Replays complete USER event envelopes in ascending sequence order through a caller-supplied account snapshot boundary. Missing retained events fail with RESYNC_REQUIRED instead of returning a partial page.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "name": "afterSequence", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/Uint64String" } }, { "name": "asOfSequence", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/Uint64String" } }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "description": "Contiguous account event replay page", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountEventPage" } } } }, "401": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" }, "409": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/account/activity": {
      "get": { "operationId": "listTradingAccountActivity", "summary": "List Trading Account Activity", "tags": ["Trading account"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "$ref": "#/components/responses/ActivityPage" }, "401": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/account/statement": {
      "get": { "operationId": "listTradingAccountStatement", "summary": "List Trading Account Statement", "tags": ["Trading account"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "$ref": "#/components/responses/StatementPage" }, "401": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/balances": {
      "get": { "operationId": "listTradingBalances", "summary": "List Trading Balances", "tags": ["Trading account"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "responses": { "200": { "description": "Balances", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Balance" } } } } }, "401": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/collateral/transfers": {
      "get": { "operationId": "getTradingCollateralTransfers", "summary": "Get Contract Collateral State", "tags": ["Trading account"], "description": "Returns the authenticated account's ADI available, Contract available and in-flight collateral balances, plus every non-terminal transfer and up to 20 recent terminal transfers. A transferId query returns only that account-owned transfer or 404.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "name": "transferId", "in": "query", "required": false, "schema": { "type": "string", "pattern": "^tct_[0-9a-f]{32}$" } }], "responses": { "200": { "description": "Contract collateral state", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CollateralState" } } } }, "401": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" } } },
      "post": { "operationId": "createTradingCollateralTransfer", "summary": "Allocate or Release Contract Collateral", "tags": ["Trading account"], "description": "Atomically reserves account cash, then asynchronously moves physical collateral. Poll this endpoint until COMPLETED or FAILED; EXTERNAL_PENDING is fail-closed and must not be treated as available cash. Reuse the same Idempotency-Key and exact body after an unknown result.", "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CollateralTransferRequest" } } } }, "responses": { "200": { "description": "Completed idempotent replay", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CollateralTransfer" } } } }, "202": { "description": "Transfer reserved or replayed before completion", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CollateralTransfer" } } } }, "400": { "$ref": "#/components/responses/Error" }, "401": { "$ref": "#/components/responses/Error" }, "409": { "$ref": "#/components/responses/Error" }, "413": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" }, "503": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/positions": {
      "get": { "operationId": "listTradingPositions", "summary": "List Trading Positions", "tags": ["Trading account"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/PageSize" }, { "$ref": "#/components/parameters/MarketIdQuery" }], "responses": { "200": { "description": "Positions", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PositionPage" } } } }, "401": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/orders": {
      "get": { "operationId": "listTradingOrders", "summary": "List Trading Orders", "tags": ["BTC 3m orders"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/PageSize" }, { "$ref": "#/components/parameters/MarketIdQuery" }, { "$ref": "#/components/parameters/OrderStatusQuery" }], "responses": { "200": { "$ref": "#/components/responses/OrderPage" }, "401": { "$ref": "#/components/responses/Error" } } },
      "post": { "operationId": "createTradingOrder", "summary": "Create Trading Order", "tags": ["BTC 3m orders"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SignedOrderRequest" } } } }, "responses": { "201": { "description": "Canonical order and fills", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrderResult" } } } }, "400": { "$ref": "#/components/responses/Error" }, "401": { "$ref": "#/components/responses/Error" }, "403": { "$ref": "#/components/responses/Error" }, "409": { "$ref": "#/components/responses/Error" }, "413": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" }, "503": { "$ref": "#/components/responses/Error" } } },
      "delete": { "operationId": "cancelTradingOrders", "summary": "Cancel Trading Orders", "tags": ["BTC 3m orders"], "security": [{ "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelOrdersRequest" } } } }, "responses": { "200": { "$ref": "#/components/responses/CancelResult" }, "400": { "$ref": "#/components/responses/Error" }, "401": { "$ref": "#/components/responses/Error" }, "413": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/orders/batch": {
      "post": { "operationId": "createTradingOrderBatch", "summary": "Create Trading Order Batch", "tags": ["BTC 3m orders"], "security": [{ "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrderBatchRequest" } } } }, "responses": { "200": { "description": "Per-item batch results", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrderBatchResult" } } } }, "400": { "$ref": "#/components/responses/Error" }, "401": { "$ref": "#/components/responses/Error" }, "413": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/orders/{orderId}": {
      "get": { "operationId": "getTradingOrder", "summary": "Get Trading Order", "tags": ["BTC 3m orders"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/OrderId" }], "responses": { "200": { "description": "Order", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" } } } }, "401": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" } } },
      "delete": { "operationId": "cancelTradingOrder", "summary": "Cancel Trading Order", "tags": ["BTC 3m orders"], "security": [{ "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/OrderId" }], "responses": { "200": { "$ref": "#/components/responses/CancelResult" }, "401": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/orders/cancel-market": {
      "post": { "operationId": "cancelTradingMarketOrders", "summary": "Cancel Trading Market Orders", "tags": ["BTC 3m orders"], "security": [{ "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelMarketRequest" } } } }, "responses": { "200": { "$ref": "#/components/responses/CancelResult" }, "400": { "$ref": "#/components/responses/Error" }, "401": { "$ref": "#/components/responses/Error" }, "413": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/orders/cancel-all": {
      "post": { "operationId": "cancelAllTradingOrders", "summary": "Cancel All Trading Orders", "tags": ["BTC 3m orders"], "security": [{ "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "responses": { "200": { "$ref": "#/components/responses/CancelResult" }, "401": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/fills": {
      "get": { "operationId": "listTradingFills", "summary": "List Trading Fills", "tags": ["BTC 3m orders"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/PageSize" }, { "$ref": "#/components/parameters/MarketIdQuery" }], "responses": { "200": { "$ref": "#/components/responses/FillPage" }, "401": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/fills/{fillId}": {
      "get": { "operationId": "getTradingFill", "summary": "Get Trading Fill", "tags": ["BTC 3m orders"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/FillId" }], "responses": { "200": { "description": "Fill", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Fill" } } } }, "401": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/settlement-batches": {
      "get": { "operationId": "listTradingSettlementBatches", "summary": "List Trading Settlement Batches", "tags": ["Settlement"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "$ref": "#/components/responses/SettlementBatchPage" }, "401": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/settlement-batches/{batchId}": {
      "get": { "operationId": "getTradingSettlementBatch", "summary": "Get Trading Settlement Batch", "tags": ["Settlement"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/BatchId" }], "responses": { "200": { "description": "Settlement batch", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SettlementBatch" } } } }, "401": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/markets": {
      "get": { "operationId": "listTradingMarkets", "summary": "List Trading Markets", "tags": ["Markets"], "security": [], "parameters": [{ "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "$ref": "#/components/responses/MarketPage" }, "422": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/markets/active": {
      "get": { "operationId": "listActiveTradingMarkets", "summary": "List Active Trading Markets", "tags": ["Markets"], "security": [], "responses": { "200": { "description": "Active markets", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Market" } } } } } } }
    },
    "/api/trading/markets/orderbooks": {
      "post": { "operationId": "getTradingOrderbooks", "summary": "Get Trading Orderbooks", "tags": ["Markets"], "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketScopesRequest" } } } }, "responses": { "200": { "description": "Orderbook batch", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrderbookBatch" } } } }, "413": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/markets/prices": {
      "post": { "operationId": "getTradingPrices", "summary": "Get Trading Prices", "tags": ["Markets"], "security": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketScopesRequest" } } } }, "responses": { "200": { "description": "Price batch", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PriceBatch" } } } }, "413": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/markets/{marketId}": {
      "get": { "operationId": "getTradingMarket", "summary": "Get Trading Market", "tags": ["Markets"], "security": [], "parameters": [{ "$ref": "#/components/parameters/MarketId" }], "responses": { "200": { "description": "Market", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Market" } } } }, "404": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/markets/{marketId}/config": {
      "get": { "operationId": "getTradingMarketConfig", "summary": "Get Trading Market Config", "tags": ["Markets"], "security": [], "parameters": [{ "$ref": "#/components/parameters/MarketId" }], "responses": { "200": { "description": "Complete immutable market config", "headers": { "ETag": { "schema": { "type": "string" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketConfig" } } } }, "404": { "$ref": "#/components/responses/Error" }, "503": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/markets/{marketId}/orderbook": {
      "get": { "operationId": "getTradingOrderbook", "summary": "Get Trading Orderbook", "tags": ["Markets"], "security": [], "parameters": [{ "$ref": "#/components/parameters/MarketId" }, { "$ref": "#/components/parameters/OutcomeQuery" }], "responses": { "200": { "description": "Orderbook", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Orderbook" } } } }, "404": { "$ref": "#/components/responses/Error" }, "503": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/markets/{marketId}/trades": {
      "get": { "operationId": "listTradingMarketTrades", "summary": "List Trading Market Trades", "tags": ["Markets"], "security": [], "parameters": [{ "$ref": "#/components/parameters/MarketId" }, { "$ref": "#/components/parameters/Cursor" }, { "$ref": "#/components/parameters/PageSize" }], "responses": { "200": { "$ref": "#/components/responses/PublicTradePage" }, "404": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/contract-products": {
      "get": { "operationId": "listContractProducts", "summary": "List Contract Products", "tags": ["Markets"], "description": "Lists released contract-product families and current public order limits. This route never exposes Provider or wallet internals.", "security": [], "responses": { "200": { "description": "Released contract products", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContractProductCatalog" } } } }, "503": { "description": "Order limits unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ContractProductCatalogUnavailable" } } } } } }
    },
    "/api/contract-products/btc-minute/markets/current": {
      "get": { "operationId": "getCurrentBtcMinuteMarket", "summary": "Get Current BTC Minute Market", "tags": ["Markets"], "description": "Returns the current released BTC 3m market window without Provider internals. Public clock overrides are rejected.", "security": [], "parameters": [{ "name": "tenor", "in": "query", "required": false, "schema": { "const": "3m", "default": "3m" } }], "responses": { "200": { "description": "Current BTC 3m market", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BtcMinuteCurrentMarketResponse" } } } }, "400": { "description": "Legacy market-data error envelope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDataError" } } } }, "500": { "description": "Legacy market-data error envelope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDataError" } } } } } }
    },
    "/api/contract-products/btc-minute/markets": {
      "get": { "operationId": "listBtcMinuteMarketReferences", "summary": "List BTC Minute Market References", "tags": ["Markets"], "security": [], "parameters": [{ "name": "tenor", "in": "query", "required": false, "schema": { "const": "3m", "default": "3m" } }, { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 48, "default": 12 } }], "responses": { "200": { "description": "BTC market windows with opening reference prices when recorded", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BtcMinuteMarketReferencePage" } } } }, "400": { "description": "Legacy market-data error envelope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDataError" } } } }, "500": { "description": "Legacy market-data error envelope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDataError" } } } } } }
    },
    "/api/contract-products/btc-minute/price": {
      "get": { "operationId": "getBtcMinuteLivePrice", "summary": "Get BTC Minute Live Price", "tags": ["Markets"], "security": [], "responses": { "200": { "description": "Aggregated BTC/USD live price", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BtcMinuteLivePriceResponse" } } } }, "503": { "description": "Legacy market-data error envelope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDataError" } } } } } }
    },
    "/api/contract-products/btc-minute/price/history": {
      "get": { "operationId": "getBtcMinutePriceHistory", "summary": "Get BTC Minute Price History", "tags": ["Markets"], "security": [], "responses": { "200": { "description": "Thirty minutes of one-minute BTC/USD OHLC candles", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BtcMinutePriceHistoryResponse" } } } }, "503": { "description": "Legacy market-data error envelope", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketDataError" } } } } } }
    },
    "/api/trading/heartbeats": {
      "get": { "operationId": "getTradingHeartbeat", "summary": "Get Trading Heartbeat", "tags": ["BTC 3m orders"], "security": [{ "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "responses": { "200": { "$ref": "#/components/responses/Heartbeat" }, "401": { "$ref": "#/components/responses/Error" } } },
      "post": { "operationId": "renewTradingHeartbeat", "summary": "Renew Trading Heartbeat", "tags": ["BTC 3m orders"], "security": [{ "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "responses": { "200": { "$ref": "#/components/responses/Heartbeat" }, "401": { "$ref": "#/components/responses/Error" }, "409": { "$ref": "#/components/responses/Error" } } },
      "delete": { "operationId": "disarmTradingHeartbeat", "summary": "Disarm Trading Heartbeat", "tags": ["BTC 3m orders"], "security": [{ "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "responses": { "200": { "$ref": "#/components/responses/Heartbeat" }, "401": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/inventory/split": {
      "post": { "operationId": "splitTradingInventory", "summary": "Split Trading Inventory", "tags": ["BTC 3m orders"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InventoryRequest" } } } }, "responses": { "201": { "$ref": "#/components/responses/InventoryOperation" }, "401": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" }, "503": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/inventory/merge": {
      "post": { "operationId": "mergeTradingInventory", "summary": "Merge Trading Inventory", "description": "Burns equal available UP and DOWN shares, releases the same amount of collateral, and reduces each outcome's acquisition cost proportionally. A fully consumed position always ends with zero cost.", "tags": ["BTC 3m orders"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "parameters": [{ "$ref": "#/components/parameters/IdempotencyKey" }], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InventoryRequest" } } } }, "responses": { "201": { "$ref": "#/components/responses/InventoryOperation" }, "401": { "$ref": "#/components/responses/Error" }, "422": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/trading/accounting/snapshot": {
      "get": { "operationId": "downloadTradingAccountingSnapshot", "summary": "Download Trading Accounting Snapshot", "tags": ["Settlement"], "security": [{ "CookieSession": [] }, { "L2Address": [], "L2ApiKey": [], "L2Passphrase": [], "L2Timestamp": [], "L2Nonce": [], "L2Signature": [] }], "responses": { "200": { "description": "ZIP containing manifest.json and canonical CSV files", "content": { "application/zip": { "schema": { "type": "string", "contentEncoding": "binary" } } } }, "401": { "$ref": "#/components/responses/Error" }, "503": { "$ref": "#/components/responses/Error" } } }
    }
  },
  "components": {
    "securitySchemes": {
      "CookieSession": { "type": "apiKey", "in": "cookie", "name": "reso_auth_email" },
      "L2Address": { "type": "apiKey", "in": "header", "name": "X-RESO-ADDRESS" },
      "L2ApiKey": { "type": "apiKey", "in": "header", "name": "X-RESO-API-KEY" },
      "L2Passphrase": { "type": "apiKey", "in": "header", "name": "X-RESO-PASSPHRASE" },
      "L2Timestamp": { "type": "apiKey", "in": "header", "name": "X-RESO-TIMESTAMP-MS" },
      "L2Nonce": { "type": "apiKey", "in": "header", "name": "X-RESO-NONCE" },
      "L2Signature": { "type": "apiKey", "in": "header", "name": "X-RESO-SIGNATURE" }
    },
    "parameters": {
      "CredentialId": { "name": "credentialId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._~-]{1,128}$" } },
      "OrderId": { "name": "orderId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/OrderId" } },
      "FillId": { "name": "fillId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._~-]{1,128}$" } },
      "BatchId": { "name": "batchId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._~-]{1,128}$" } },
      "MarketId": { "name": "marketId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._~-]{1,128}$" } },
      "MarketIdQuery": { "name": "marketId", "in": "query", "required": false, "schema": { "type": "string", "pattern": "^[A-Za-z0-9._~-]{1,128}$" } },
      "OutcomeQuery": { "name": "outcome", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/Outcome" } },
      "OrderStatusQuery": { "name": "orderStatus", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/OrderStatus" } },
      "Cursor": { "name": "cursor", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/OpaqueCursor" } },
      "PageSize": { "name": "pageSize", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 200, "default": 50 } },
      "PublicProfileProduct": { "name": "product", "in": "query", "required": false, "schema": { "enum": ["all", "sports", "btc-3m", "crypto"], "default": "all" } },
      "PublicProfileLimit": { "name": "limit", "in": "query", "required": false, "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 50 } },
      "IdempotencyKey": { "name": "Idempotency-Key", "in": "header", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 128 } }
    },
    "responses": {
      "Error": { "description": "Standard error envelope", "headers": { "X-Request-Id": { "required": true, "schema": { "type": "string" } }, "Retry-After": { "description": "Seconds to wait after a 429 response", "schema": { "type": "integer", "minimum": 1 } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorEnvelope" } } } },
      "LegacyError": { "description": "Existing product API error envelope", "headers": { "Retry-After": { "description": "Seconds to wait after a 429 response", "schema": { "type": "integer", "minimum": 1 } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LegacyErrorEnvelope" } } } },
      "TradingTime": { "description": "Server time", "headers": { "Cache-Control": { "schema": { "const": "no-store" } }, "Date": { "schema": { "type": "string" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TradingTime" } } } },
      "Eligibility": { "description": "Non-authoritative trading preflight", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Eligibility" } } } },
      "OneTimeCredential": { "description": "Credential secret returned once", "headers": { "Cache-Control": { "schema": { "const": "no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OneTimeCredential" } } } },
      "OrderPage": { "description": "Orders", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OrderPage" } } } },
      "FillPage": { "description": "Fills", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FillPage" } } } },
      "SettlementBatchPage": { "description": "Settlement batches", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SettlementBatchPage" } } } },
      "MarketPage": { "description": "Markets", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MarketPage" } } } },
      "PublicTradePage": { "description": "Public committed trades", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicTradePage" } } } },
      "CancelResult": { "description": "Deterministic per-order cancellation result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelResult" } } } },
      "Heartbeat": { "description": "Persistent account heartbeat state", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Heartbeat" } } } },
      "InventoryOperation": { "description": "Committed inventory operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InventoryOperation" } } } },
      "ActivityPage": { "description": "Business activity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ActivityPage" } } } },
      "StatementPage": { "description": "Append-only account statement", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StatementPage" } } } }
    },
    "schemas": {
      "Uint256String": { "type": "string", "pattern": "^(0|[1-9][0-9]*)$", "maxLength": 78 },
      "Uint64String": { "type": "string", "pattern": "^(0|[1-9][0-9]*)$", "maxLength": 20 },
      "SignedBaseUnitString": { "type": "string", "pattern": "^(0|-?[1-9][0-9]*)$", "maxLength": 79 },
      "UnixMs": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
      "EvmAddress": { "type": "string", "pattern": "^0x[0-9a-f]{40}$" },
      "Bytes32": { "type": "string", "pattern": "^0x[0-9a-f]{64}$" },
      "OrderId": { "$ref": "#/components/schemas/Bytes32" },
      "OpaqueCursor": { "type": "string", "pattern": "^[A-Za-z0-9._~-]{1,512}$" },
      "Outcome": { "enum": ["UP", "DOWN"] },
      "Side": { "enum": ["BUY", "SELL"] },
      "OrderType": { "enum": ["GTC", "GTD", "FOK", "FAK"] },
      "OrderStatus": { "enum": ["OPEN", "PARTIALLY_FILLED", "FILLED", "CANCELED", "EXPIRED"] },
      "ErrorObject": {
        "type": "object", "additionalProperties": false, "required": ["code", "message", "requestId", "retryable", "retryAfterMs"],
        "properties": { "code": { "type": "string", "pattern": "^[A-Z0-9_]+$" }, "message": { "type": "string" }, "requestId": { "type": "string" }, "retryable": { "type": "boolean" }, "retryAfterMs": { "type": ["integer", "null"], "minimum": 0 } }
      },
      "ErrorEnvelope": { "type": "object", "additionalProperties": false, "required": ["error"], "properties": { "error": { "$ref": "#/components/schemas/ErrorObject" } } },
      "LegacyErrorEnvelope": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string" } } },
      "MarketDataError": { "type": "object", "additionalProperties": false, "required": ["error"], "properties": { "error": { "type": "string", "pattern": "^[A-Z0-9_]+$" } } },
      "ContractProductCatalog": { "type": "object", "additionalProperties": false, "required": ["products"], "properties": { "products": { "type": "array", "minItems": 1, "maxItems": 1, "items": { "type": "object", "additionalProperties": false, "required": ["id", "productFamily", "symbol", "collateral", "tenors", "orderLimits"], "properties": { "id": { "const": "btc-minute" }, "productFamily": { "const": "btc-minute" }, "symbol": { "const": "BTC" }, "collateral": { "const": "USDC" }, "tenors": { "type": "array", "prefixItems": [{ "const": "3m" }], "items": false }, "orderLimits": { "type": "object", "additionalProperties": false, "required": ["minSizeUsdc", "maxSizeUsdc", "minPrice", "maxPrice"], "properties": { "minSizeUsdc": { "type": "number", "exclusiveMinimum": 0 }, "maxSizeUsdc": { "type": "number", "exclusiveMinimum": 0 }, "minPrice": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "maxPrice": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 } } } } } } } },
      "ContractProductCatalogUnavailable": { "type": "object", "additionalProperties": false, "required": ["products", "error"], "properties": { "products": { "type": "array", "maxItems": 0 }, "error": { "type": "string" } } },
      "BtcMinuteMarketReference": { "type": "object", "additionalProperties": false, "required": ["id", "productFamily", "symbol", "tenor", "title", "outcomes", "intervalSeconds", "startTimeIso", "endTimeIso", "lockTimeIso", "status", "collateral"], "properties": { "id": { "type": "string" }, "productFamily": { "const": "btc-minute" }, "symbol": { "const": "BTC" }, "tenor": { "const": "3m" }, "title": { "type": "string" }, "outcomes": { "type": "array", "prefixItems": [{ "const": "UP" }, { "const": "DOWN" }], "items": false }, "intervalSeconds": { "const": 180 }, "startTimeIso": { "type": "string", "format": "date-time" }, "endTimeIso": { "type": "string", "format": "date-time" }, "lockTimeIso": { "type": "string", "format": "date-time" }, "status": { "enum": ["CREATED", "OPEN", "LOCKED", "RESOLVED", "CANCELLED"] }, "collateral": { "const": "USDC" }, "openPrice": { "type": "number", "exclusiveMinimum": 0 }, "closePrice": { "type": "number", "exclusiveMinimum": 0 }, "outcome": { "enum": ["UP", "DOWN", "REFUND"] } } },
      "BtcMinuteCurrentMarketResponse": { "type": "object", "additionalProperties": false, "required": ["market"], "properties": { "market": { "$ref": "#/components/schemas/BtcMinuteMarketReference" } } },
      "BtcMinuteMarketReferencePage": { "type": "object", "additionalProperties": false, "required": ["count", "markets"], "properties": { "count": { "type": "integer", "minimum": 0, "maximum": 48 }, "markets": { "type": "array", "maxItems": 48, "items": { "$ref": "#/components/schemas/BtcMinuteMarketReference" } } } },
      "BtcMinuteLivePrice": { "type": "object", "additionalProperties": false, "required": ["symbol", "currency", "price", "observedAtIso", "sourceCount"], "properties": { "symbol": { "const": "BTC" }, "currency": { "const": "USD" }, "price": { "type": "number", "exclusiveMinimum": 0 }, "observedAtIso": { "type": "string", "format": "date-time" }, "sourceCount": { "type": "integer", "minimum": 2, "maximum": 5 } } },
      "BtcMinuteLivePriceResponse": { "type": "object", "additionalProperties": false, "required": ["livePrice"], "properties": { "livePrice": { "$ref": "#/components/schemas/BtcMinuteLivePrice" } } },
      "BtcMinutePriceCandle": { "type": "object", "additionalProperties": false, "required": ["t", "p", "o", "h", "l", "c"], "properties": { "t": { "type": "string", "format": "date-time" }, "p": { "type": "number", "exclusiveMinimum": 0 }, "o": { "type": "number", "exclusiveMinimum": 0 }, "h": { "type": "number", "exclusiveMinimum": 0 }, "l": { "type": "number", "exclusiveMinimum": 0 }, "c": { "type": "number", "exclusiveMinimum": 0 } } },
      "BtcMinutePriceHistory": { "type": "object", "additionalProperties": false, "required": ["symbol", "currency", "windowMinutes", "points"], "properties": { "symbol": { "const": "BTC" }, "currency": { "const": "USD" }, "windowMinutes": { "const": 30 }, "points": { "type": "array", "minItems": 2, "maxItems": 31, "items": { "$ref": "#/components/schemas/BtcMinutePriceCandle" } } } },
      "BtcMinutePriceHistoryResponse": { "type": "object", "additionalProperties": false, "required": ["priceHistory"], "properties": { "priceHistory": { "$ref": "#/components/schemas/BtcMinutePriceHistory" } } },
      "TradingTime": { "type": "object", "additionalProperties": false, "required": ["protocolVersion", "serverTimeMs", "maxRequestSkewMs"], "properties": { "protocolVersion": { "const": 1 }, "serverTimeMs": { "$ref": "#/components/schemas/UnixMs" }, "maxRequestSkewMs": { "const": 30000 } } },
      "Eligibility": { "type": "object", "additionalProperties": false, "required": ["eligible", "tradingMode", "accountStatus", "reasonCode", "checkedAtMs"], "properties": { "eligible": { "type": "boolean" }, "tradingMode": { "enum": ["ACTIVE", "CANCEL_ONLY", "BLOCKED"] }, "accountStatus": { "type": ["string", "null"], "enum": [null, "ACTIVE", "FROZEN", "CANCEL_ONLY"] }, "reasonCode": { "enum": ["ELIGIBLE", "REGION_RESTRICTED", "ACCOUNT_FROZEN", "GLOBAL_PAUSE", "ORACLE_UNHEALTHY", "SETTLEMENT_UNHEALTHY", "ROOT_AUDIT_UNHEALTHY", "FUNDING_RECONCILIATION_UNHEALTHY", "COLLATERAL_SETTLEMENT_UNAVAILABLE"] }, "checkedAtMs": { "$ref": "#/components/schemas/UnixMs" } } },
      "AuthChallengeRequest": {
        "oneOf": [
          { "type": "object", "additionalProperties": false, "required": ["action", "resource"], "properties": { "fundingWallet": { "$ref": "#/components/schemas/EvmAddress", "description": "Required without a cookie session; signs the authorization challenge and never becomes the managed Trading Account owner." }, "action": { "enum": ["CREATE_OR_READ_ACCOUNT", "CREATE_CREDENTIAL", "ROTATE_CREDENTIAL", "REVOKE_CREDENTIAL", "REGISTER_POLYMARKET_CREDENTIAL", "WITHDRAW"] }, "resource": { "type": "object", "description": "Action-specific resource. WITHDRAW owner and destination are overwritten with the managed owner and bound funding wallet." } } },
          { "type": "object", "additionalProperties": false, "required": ["challengeId", "signature"], "properties": { "fundingWallet": { "$ref": "#/components/schemas/EvmAddress", "description": "Required without a cookie session; must match the wallet that received the challenge." }, "challengeId": { "$ref": "#/components/schemas/Bytes32" }, "signature": { "type": "string", "pattern": "^0x[0-9a-fA-F]{130}$" } } }
        ]
      },
      "AuthChallengeResponse": { "type": "object", "additionalProperties": false, "required": ["challengeId", "action", "typedData", "expiresAtMs", "consumed"], "properties": { "challengeId": { "$ref": "#/components/schemas/Bytes32" }, "action": { "enum": ["CREATE_OR_READ_ACCOUNT", "CREATE_CREDENTIAL", "ROTATE_CREDENTIAL", "REVOKE_CREDENTIAL", "REGISTER_POLYMARKET_CREDENTIAL", "WITHDRAW"] }, "typedData": { "type": ["object", "null"] }, "signature": { "type": "string", "pattern": "^0x[0-9a-fA-F]{130}$", "description": "Present for cookie-session authorization signed by the managed owner." }, "expiresAtMs": { "$ref": "#/components/schemas/UnixMs" }, "consumed": { "type": "boolean" }, "account": { "oneOf": [{ "$ref": "#/components/schemas/TradingAccount" }, { "type": "null" }] } } },
      "CredentialActionRequest": { "type": "object", "additionalProperties": false, "required": ["challengeId", "signature"], "properties": { "fundingWallet": { "$ref": "#/components/schemas/EvmAddress", "description": "Required without a cookie session; authorizes changes to the credential owned by the managed Trading Account." }, "challengeId": { "$ref": "#/components/schemas/Bytes32" }, "signature": { "type": "string", "pattern": "^0x[0-9a-fA-F]{130}$" }, "credentialId": { "type": "string", "pattern": "^[A-Za-z0-9._~-]{1,128}$" }, "label": { "type": "string", "maxLength": 64 }, "expiresAtMs": { "oneOf": [{ "$ref": "#/components/schemas/UnixMs" }, { "type": "null" }] } } },
      "CredentialMetadata": { "type": "object", "additionalProperties": false, "required": ["credentialId", "label", "status", "createdAtMs", "expiresAtMs", "lastUsedAtMs"], "properties": { "credentialId": { "type": "string" }, "label": { "type": "string" }, "status": { "enum": ["ACTIVE", "REVOKED", "EXPIRED"] }, "createdAtMs": { "$ref": "#/components/schemas/UnixMs" }, "expiresAtMs": { "oneOf": [{ "$ref": "#/components/schemas/UnixMs" }, { "type": "null" }] }, "lastUsedAtMs": { "oneOf": [{ "$ref": "#/components/schemas/UnixMs" }, { "type": "null" }] } } },
      "OneTimeCredential": { "type": "object", "additionalProperties": false, "required": ["credential", "secret", "passphrase"], "properties": { "credential": { "$ref": "#/components/schemas/CredentialMetadata" }, "secret": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" }, "passphrase": { "type": "string", "minLength": 32, "maxLength": 256 } } },
      "PolymarketCredentialRegistrationRequest": { "type": "object", "additionalProperties": false, "required": ["credentialWallet", "apiKey", "apiSecret", "apiPassphrase", "challengeId", "signature"], "properties": { "fundingWallet": { "$ref": "#/components/schemas/EvmAddress", "description": "Required without a cookie session; authorizes registration for the managed Trading Account." }, "credentialWallet": { "$ref": "#/components/schemas/EvmAddress" }, "apiKey": { "type": "string", "minLength": 1, "maxLength": 256, "writeOnly": true }, "apiSecret": { "type": "string", "minLength": 1, "maxLength": 1024, "writeOnly": true }, "apiPassphrase": { "type": "string", "minLength": 1, "maxLength": 1024, "writeOnly": true }, "challengeId": { "$ref": "#/components/schemas/Bytes32" }, "signature": { "type": "string", "pattern": "^0x[0-9a-fA-F]{130}$" } } },
      "ProviderCredentialMetadata": { "type": "object", "additionalProperties": false, "required": ["provider", "credentialWallet"], "properties": { "provider": { "const": "polymarket" }, "credentialWallet": { "$ref": "#/components/schemas/EvmAddress" } } },
      "AdiManualOrderAuthorization": { "type": "object", "additionalProperties": false, "required": ["protocol", "payload"], "properties": { "protocol": { "const": "ADI_SIGNED_V1" }, "payload": { "type": "object", "additionalProperties": false, "required": ["userWallet", "marketId", "side", "outcome", "price", "quantity", "nonce", "expiry", "maker", "signature", "type", "timeInForce"], "properties": { "userWallet": { "$ref": "#/components/schemas/EvmAddress" }, "marketId": { "type": "string", "minLength": 1 }, "side": { "const": "buy" }, "outcome": { "enum": ["0", "1"] }, "price": { "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$" }, "quantity": { "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$" }, "nonce": { "type": "string", "minLength": 1 }, "expiry": { "const": 0 }, "maker": { "$ref": "#/components/schemas/EvmAddress" }, "signature": { "type": "string", "minLength": 3 }, "clientOrderId": { "type": "string", "minLength": 1, "maxLength": 128 }, "type": { "const": "market" }, "timeInForce": { "const": "ioc" } } } } },
      "PolymarketManualOrderAuthorization": { "type": "object", "additionalProperties": false, "required": ["protocol", "payload"], "properties": { "protocol": { "const": "POLYMARKET_CLOB_V1" }, "payload": { "type": "object", "additionalProperties": false, "required": ["rawBody"], "properties": { "rawBody": { "type": "string", "minLength": 2, "description": "Exact Polymarket POST /order JSON bytes. Build the V2 order with the official CLOB client using SignatureTypeV2.POLY_1271, the prepared funder wallet, and polymarketOrderConfig.builderCode returned by GET /api/trading/account. The owner signer creates the wrapped signature; owner must equal the registered CLOB API key UUID, order.signer and order.maker must both equal the prepared funder wallet, order.builder must equal the current Reso builderCode, signatureType must be 3, orderType must be FAK, and postOnly must be false. Reso sends these same bytes and derives Provider L2 headers from the registered credential. Missing or mismatched Builder attribution is rejected before Provider submission." } } } } },
      "ManualOrderAuthorization": { "oneOf": [{ "$ref": "#/components/schemas/AdiManualOrderAuthorization" }, { "$ref": "#/components/schemas/PolymarketManualOrderAuthorization" }] },
      "ManualOrderRequest": { "type": "object", "additionalProperties": false, "required": ["marketId", "side", "price", "sizeUsdc"], "properties": { "wallet": { "$ref": "#/components/schemas/EvmAddress", "description": "Optional for L2; if present it must match X-RESO-ADDRESS." }, "marketId": { "type": "string", "minLength": 1, "maxLength": 256 }, "side": { "enum": ["YES", "NO"] }, "price": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1 }, "sizeUsdc": { "type": "number", "exclusiveMinimum": 0 }, "kickoffIso": { "type": "string", "format": "date-time" }, "authorization": { "$ref": "#/components/schemas/ManualOrderAuthorization", "description": "Optional only for a managed owner account, where the platform signer builds the Polymarket FAK order after L2 authentication. Required for legacy self-custody L2 requests." } } },
      "SanitizedManualOrder": { "type": "object", "additionalProperties": false, "required": ["id", "state", "riskReasons"], "properties": { "id": { "type": "string", "minLength": 1 }, "state": { "enum": ["CREATED", "RISK_REJECTED", "ACCEPTED", "SUBMITTED", "FAILED", "CANCELLED", "FILLED"] }, "riskReasons": { "type": "array", "items": { "type": "string" } }, "filledShares": { "type": "number", "exclusiveMinimum": 0 }, "failureCode": { "type": "string", "description": "Stable sanitized failure category. Current values are ADI_SIGNATURE_REQUIRED, ADI_SUBMIT_FAILED, LIVE_SUBMIT_FAILED, LIVE_API_KEY_MISMATCH, LIVE_CREDENTIAL_REFRESH_FAILED, LIVE_DEPOSIT_WALLET_REQUIRED, LIVE_MIN_ORDER_SIZE, LIVE_INSUFFICIENT_BALANCE, LIVE_ALLOWANCE_REQUIRED, and GEOBLOCKED_REGION. Clients must tolerate future values and treat unknown values like LIVE_SUBMIT_FAILED.", "examples": ["LIVE_INSUFFICIENT_BALANCE", "ADI_SUBMIT_FAILED", "LIVE_SUBMIT_FAILED"] } } },
      "ManualOrderResult": { "type": "object", "additionalProperties": false, "required": ["replayed", "order"], "properties": { "replayed": { "type": "boolean" }, "order": { "$ref": "#/components/schemas/SanitizedManualOrder" } } },
      "ManualOrderResponse": { "type": "object", "additionalProperties": false, "required": ["order"], "properties": { "order": { "$ref": "#/components/schemas/SanitizedManualOrder" } } },
      "PolymarketPositionCloseAuthorization": { "type": "object", "additionalProperties": false, "required": ["protocol", "payload"], "properties": { "protocol": { "const": "POLYMARKET_CLOB_V1" }, "payload": { "type": "object", "additionalProperties": false, "required": ["rawBody"], "properties": { "rawBody": { "type": "string", "minLength": 2, "description": "Exact Polymarket POST /order JSON bytes for a SELL. Build the V2 order with the official CLOB client, SignatureTypeV2.POLY_1271, the prepared funder wallet, polymarketOrderConfig.builderCode, OrderType.FAK, and postOnly=false. order.signer and order.maker must equal polymarketFunderWallet; order.builder must equal the current Reso builderCode; makerAmount must equal shares and the signed sell price must be at least the server's protected minimum." } } } } },
      "PositionCloseRequest": { "type": "object", "additionalProperties": false, "required": ["marketId", "side"], "properties": { "wallet": { "$ref": "#/components/schemas/EvmAddress", "description": "Optional for L2; if present it must match X-RESO-ADDRESS." }, "marketId": { "type": "string", "minLength": 1, "maxLength": 256 }, "side": { "enum": ["YES", "NO"] }, "shares": { "type": "number", "exclusiveMinimum": 0, "description": "Required for L2. For legacy self-custody it must equal the signed SELL makerAmount in six-decimal share units; for managed owner accounts it bounds the platform-signed close." }, "referencePrice": { "type": "number", "exclusiveMinimum": 0, "exclusiveMaximum": 1, "description": "Current best bid used to build the signed SELL. The server applies its close slippage floor." }, "authorization": { "$ref": "#/components/schemas/PolymarketPositionCloseAuthorization", "description": "Optional only for a managed owner account, where the platform signer builds the SELL FAK after L2 authentication. Required for a legacy self-custody Polymarket L2 close." } } },
      "PositionCloseResult": { "type": "object", "additionalProperties": false, "required": ["ok", "submittedShares", "availableShares", "referencePrice", "worstPrice", "status", "filled"], "properties": { "ok": { "type": "boolean" }, "positionWallet": { "$ref": "#/components/schemas/EvmAddress" }, "submittedShares": { "type": "number", "minimum": 0 }, "filledShares": { "type": "number", "exclusiveMinimum": 0 }, "availableShares": { "type": "number", "minimum": 0 }, "referencePrice": { "type": "number", "minimum": 0 }, "worstPrice": { "type": "number", "minimum": 0 }, "status": { "enum": ["submitted", "not_submitted"] }, "filled": { "type": "boolean" }, "error": { "enum": ["POSITION_NOT_FOUND", "NO_SHARES_TO_CLOSE", "POSITION_CLOSE_BELOW_MARKET_MIN_SIZE", "POSITION_CLOSE_NO_LIQUIDITY", "POSITION_CLOSE_NOT_SUBMITTED"] } } },
      "PortfolioAccountBalance": { "type": "object", "additionalProperties": false, "required": ["account", "label", "availableUsdc", "currency", "status"], "properties": { "account": { "enum": ["adi", "polymarket"] }, "label": { "type": "string" }, "availableUsdc": { "type": "number" }, "pendingUsdc": { "type": "number" }, "currency": { "const": "USDC" }, "status": { "enum": ["synced", "syncing", "unavailable"] } } },
      "PortfolioCurvePoint": { "type": "object", "additionalProperties": false, "required": ["t", "equity"], "properties": { "t": { "type": "string", "format": "date-time" }, "equity": { "type": "number" } } },
      "PortfolioPosition": { "type": "object", "additionalProperties": false, "required": ["market", "side", "size", "avg", "current", "pnl", "status"], "properties": { "marketId": { "type": "string" }, "marketHref": { "type": "string" }, "closeHref": { "type": "string" }, "redeemable": { "type": "boolean" }, "market": { "type": "string" }, "side": { "type": "string" }, "size": { "type": "number" }, "avg": { "type": "number" }, "current": { "type": "number" }, "pnl": { "type": "number", "description": "Unrealized USDC profit/loss for the current open position." }, "valuationAvailable": { "type": "boolean", "description": "True when either a market mark or an explicit cost-basis valuation is available. Cost basis keeps current value at acquisition cost and unrealized PnL at zero; it is not a market quote." }, "status": { "type": "string" } } },
      "PortfolioOrder": { "type": "object", "additionalProperties": false, "required": ["time", "market", "action", "price", "size", "reason"], "properties": { "time": { "type": "string" }, "marketId": { "type": "string" }, "marketHref": { "type": "string" }, "market": { "type": "string" }, "action": { "type": "string" }, "price": { "type": "number" }, "size": { "type": "number" }, "pnl": { "type": "number", "description": "Optional realized USDC profit/loss backed by immutable cost evidence. BUY activity and rows without exact cost evidence omit this field." }, "reason": { "enum": ["failed", "pending", "settled", "position_adjusted", "reward", "trade", "position_update"] } } },
      "PortfolioFundingTransfer": { "type": "object", "additionalProperties": false, "required": ["time", "flow", "status"], "properties": { "time": { "type": "string" }, "flow": { "enum": ["deposit", "withdraw"] }, "amountUsdc": { "type": "number" }, "feeUsdc": { "type": "number" }, "status": { "type": "string" }, "detail": { "type": "string" } } },
      "PortfolioSummary": { "type": "object", "additionalProperties": false, "required": ["totalEquity", "todayPnL", "todayPnLPct", "cumulativePnL", "cumulativeROI", "inFlight", "strategyPositions", "curve", "positions", "orders", "fundingTransfers"], "properties": { "totalEquity": { "type": "number" }, "availableUsdcBalance": { "type": "number" }, "accountBalances": { "type": "array", "items": { "$ref": "#/components/schemas/PortfolioAccountBalance" } }, "todayPnL": { "type": "number" }, "todayPnLPct": { "type": "number" }, "cumulativePnL": { "type": "number" }, "cumulativeROI": { "type": "number" }, "inFlight": { "type": "number" }, "strategyPositions": { "type": "number" }, "curve": { "type": "array", "items": { "type": "number" } }, "curvePoints": { "type": "array", "items": { "$ref": "#/components/schemas/PortfolioCurvePoint" } }, "positions": { "type": "array", "items": { "$ref": "#/components/schemas/PortfolioPosition" } }, "orders": { "type": "array", "items": { "$ref": "#/components/schemas/PortfolioOrder" } }, "fundingTransfers": { "type": "array", "items": { "$ref": "#/components/schemas/PortfolioFundingTransfer" } }, "wallet": { "$ref": "#/components/schemas/EvmAddress" } } },
      "PublicProfileProduct": { "enum": ["sports", "btc-3m", "crypto"] },
      "PublicProfileProductStatus": { "type": "object", "additionalProperties": false, "required": ["status"], "properties": { "status": { "enum": ["fresh", "stale", "unavailable"] }, "lastSyncedAt": { "type": "string", "format": "date-time" } } },
      "PublicProfileProducts": { "type": "object", "additionalProperties": false, "required": ["sports", "btc-3m", "crypto"], "properties": { "sports": { "$ref": "#/components/schemas/PublicProfileProductStatus" }, "btc-3m": { "$ref": "#/components/schemas/PublicProfileProductStatus" }, "crypto": { "$ref": "#/components/schemas/PublicProfileProductStatus" } } },
      "PublicProfilePosition": { "type": "object", "additionalProperties": false, "required": ["product", "marketId", "market", "outcome", "size", "avgPrice", "status"], "properties": { "product": { "$ref": "#/components/schemas/PublicProfileProduct" }, "marketId": { "type": "string", "minLength": 1, "maxLength": 512 }, "market": { "type": "string", "minLength": 1, "maxLength": 512 }, "marketHref": { "type": "string", "pattern": "^/" }, "outcome": { "type": "string", "minLength": 1, "maxLength": 128 }, "size": { "type": "number", "exclusiveMinimum": 0 }, "avgPrice": { "type": "number", "minimum": 0 }, "status": { "enum": ["Open", "Settling"] } } },
      "PublicProfileActivity": { "type": "object", "additionalProperties": false, "required": ["product", "marketId", "market", "action", "price", "amountUsdc", "status", "time"], "properties": { "product": { "$ref": "#/components/schemas/PublicProfileProduct" }, "marketId": { "type": "string", "minLength": 1, "maxLength": 512 }, "market": { "type": "string", "minLength": 1, "maxLength": 512 }, "marketHref": { "type": "string", "pattern": "^/" }, "action": { "type": "string", "minLength": 1, "maxLength": 128 }, "price": { "type": "number", "minimum": 0 }, "amountUsdc": { "type": "number", "minimum": 0 }, "status": { "enum": ["FILLED", "SETTLED"] }, "time": { "type": "string", "format": "date-time" } } },
      "PublicProfilePositionPage": { "type": "object", "additionalProperties": false, "required": ["asOf", "products", "items", "nextCursor"], "properties": { "asOf": { "type": "string", "format": "date-time" }, "products": { "$ref": "#/components/schemas/PublicProfileProducts" }, "items": { "type": "array", "maxItems": 100, "items": { "$ref": "#/components/schemas/PublicProfilePosition" } }, "nextCursor": { "oneOf": [{ "$ref": "#/components/schemas/OpaqueCursor" }, { "type": "null" }] } } },
      "PublicProfileActivityPage": { "type": "object", "additionalProperties": false, "required": ["asOf", "products", "items", "nextCursor"], "properties": { "asOf": { "type": "string", "format": "date-time" }, "products": { "$ref": "#/components/schemas/PublicProfileProducts" }, "items": { "type": "array", "maxItems": 100, "items": { "$ref": "#/components/schemas/PublicProfileActivity" } }, "nextCursor": { "oneOf": [{ "$ref": "#/components/schemas/OpaqueCursor" }, { "type": "null" }] } } },
      "PublicSportsMarket": { "type": "object", "description": "Stable public ADI Sports market fields. The response may add presentation fields, but never Provider routing metadata or token IDs.", "additionalProperties": true, "required": ["id", "title"], "properties": { "id": { "type": "string" }, "category": { "enum": ["match", "winner", "advance", "special"] }, "title": { "type": "string" }, "subtitle": { "type": "string" }, "kickoff": { "type": "string", "format": "date-time" }, "yesPrice": { "type": "number", "minimum": 0, "maximum": 1 }, "noPrice": { "type": "number", "minimum": 0, "maximum": 1 }, "conditionId": { "type": "string" }, "liquidity": { "type": "number", "minimum": 0 }, "volume": { "type": "number", "minimum": 0 } } },
      "PublicSportsMarketDiscovery": { "type": "object", "additionalProperties": true, "required": ["category", "count", "markets", "featuredMarket", "filters", "pagination"], "properties": { "category": { "type": "string" }, "count": { "type": "integer", "minimum": 0 }, "markets": { "type": "array", "items": { "$ref": "#/components/schemas/PublicSportsMarket" } }, "featuredMarket": { "oneOf": [{ "$ref": "#/components/schemas/PublicSportsMarket" }, { "type": "null" }] }, "filters": { "type": "object" }, "pagination": { "$ref": "#/components/schemas/PublicDiscoveryPagination" } } },
      "PublicCryptoOutcome": { "type": "object", "additionalProperties": false, "required": ["side", "label", "price"], "properties": { "side": { "enum": ["yes", "no"] }, "label": { "type": "string" }, "price": { "type": "number", "minimum": 0, "maximum": 1 } } },
      "PublicCryptoMarket": { "type": "object", "description": "Sanitized Reso Crypto market. Resolve token IDs and signing parameters through official Polymarket Gamma/CLOB APIs using eventSlug, slug, eventId or conditionId.", "additionalProperties": true, "required": ["id", "question", "outcomes"], "properties": { "id": { "type": "string" }, "slug": { "type": "string" }, "eventId": { "type": "string" }, "eventSlug": { "type": "string" }, "conditionId": { "type": "string" }, "question": { "type": "string" }, "category": { "enum": ["price", "event", "etf", "policy", "other"] }, "endDate": { "type": "string", "format": "date-time" }, "yesPrice": { "type": "number", "minimum": 0, "maximum": 1 }, "noPrice": { "type": "number", "minimum": 0, "maximum": 1 }, "outcomes": { "type": "array", "items": { "$ref": "#/components/schemas/PublicCryptoOutcome" } }, "status": { "enum": ["active", "resolved"] }, "liquidity": { "type": "number", "minimum": 0 }, "volume": { "type": "number", "minimum": 0 } } },
      "PublicCryptoMarketDiscovery": { "type": "object", "additionalProperties": true, "required": ["count", "markets", "themes", "featuredMarket", "filters", "pagination"], "properties": { "count": { "type": "integer", "minimum": 0, "description": "Number of filtered event themes, not the number of individual market lines." }, "markets": { "type": "array", "items": { "$ref": "#/components/schemas/PublicCryptoMarket" } }, "themes": { "type": "array", "items": { "type": "object", "additionalProperties": true, "required": ["id", "markets"], "properties": { "id": { "type": "string" }, "markets": { "type": "array", "items": { "$ref": "#/components/schemas/PublicCryptoMarket" } } } } }, "featuredMarket": { "oneOf": [{ "$ref": "#/components/schemas/PublicCryptoMarket" }, { "type": "null" }] }, "filters": { "type": "object" }, "pagination": { "$ref": "#/components/schemas/PublicDiscoveryPagination" } } },
      "PublicDiscoveryPagination": { "type": "object", "additionalProperties": true, "required": ["limit", "hasMore", "nextHref"], "properties": { "limit": { "type": "integer", "minimum": 1 }, "hasMore": { "type": "boolean" }, "nextHref": { "type": ["string", "null"] } } },
      "PublicCryptoMarketLive": { "type": "object", "additionalProperties": false, "required": ["selectedSide", "selectedMarket", "activeMarkets", "selectedHistory", "selectedOrderBook"], "properties": { "selectedSide": { "enum": ["yes", "no"] }, "selectedMarket": { "$ref": "#/components/schemas/PublicCryptoMarket" }, "activeMarkets": { "type": "array", "items": { "$ref": "#/components/schemas/PublicCryptoMarket" } }, "selectedHistory": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["t", "p"], "properties": { "t": { "type": "string" }, "p": { "type": "number" } } } }, "selectedOrderBook": { "type": "object" }, "selectedSpotPrice": { "type": "object" }, "latestLiveHref": { "type": "string" } } },
      "PublicCryptoQuote": { "type": "object", "additionalProperties": false, "required": ["marketId", "yesPrice", "noPrice"], "properties": { "marketId": { "type": "string" }, "yesPrice": { "type": "number", "minimum": 0, "maximum": 1 }, "noPrice": { "type": "number", "minimum": 0, "maximum": 1 }, "yesBid": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 }, "noBid": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 } } },
      "FundingTargetAccount": { "enum": ["adi_vault", "polymarket_collateral"] },
      "FundingRedeemRequest": { "type": "object", "additionalProperties": false, "properties": { "wallet": { "$ref": "#/components/schemas/EvmAddress", "description": "Optional for L2; when present it must match X-RESO-ADDRESS." }, "providerId": { "enum": ["adi", "polymarket"], "description": "Wallet-only L2 requests support polymarket." }, "marketId": { "type": "string", "minLength": 1, "maxLength": 512 }, "side": { "enum": ["YES", "NO"] } } },
      "FundingAsset": { "type": "object", "additionalProperties": false, "required": ["chainId", "chainName", "token", "minCheckoutUsd"], "properties": { "id": { "type": "string" }, "chainId": { "type": "string", "pattern": "^[1-9][0-9]*$" }, "chainName": { "type": "string" }, "token": { "type": "object", "additionalProperties": false, "required": ["name", "symbol", "address", "decimals"], "properties": { "name": { "type": "string" }, "symbol": { "type": "string" }, "address": { "$ref": "#/components/schemas/EvmAddress" }, "decimals": { "type": "integer", "minimum": 0, "maximum": 36 } } }, "minCheckoutUsd": { "type": "number", "minimum": 0 }, "minWithdrawUsd": { "type": "number", "minimum": 0 }, "fixedFeeUsd": { "type": "number", "minimum": 0 }, "provider": { "enum": ["polymarket", "adi", "funding_hub"] }, "fundingPath": { "enum": ["bridge", "adi_direct", "adi_settlement", "funding_hub"] }, "supportsDeposit": { "type": "boolean" }, "supportsWithdraw": { "type": "boolean" }, "targetAccounts": { "type": "object", "additionalProperties": false, "properties": { "adi_vault": { "type": "boolean" }, "contract_collateral": { "type": "boolean" }, "polymarket_collateral": { "type": "boolean" } } }, "targetAccountErrorCodes": { "type": "object", "additionalProperties": false, "description": "Safe machine-readable reason when a target account is intentionally unavailable.", "properties": { "polymarket_collateral": { "type": "string", "enum": ["FUNDING_HUB_POLYMARKET_BRIDGE_ROUTE_INCOMPATIBLE"] } } }, "allowedSenderWallets": { "type": "array", "items": { "$ref": "#/components/schemas/EvmAddress" } }, "rpcUrl": { "type": "string" }, "blockExplorerUrl": { "type": "string" } } },
      "FundingAssetList": { "type": "object", "additionalProperties": false, "required": ["assets"], "properties": { "assets": { "type": "array", "items": { "$ref": "#/components/schemas/FundingAsset" } } } },
      "FundingQuoteIntent": { "type": "object", "additionalProperties": false, "required": ["fromAmountBaseUnit", "fromChainId", "fromTokenAddress"], "properties": { "fromAmountBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "fromChainId": { "type": "string", "pattern": "^[1-9][0-9]*$" }, "fromTokenAddress": { "$ref": "#/components/schemas/EvmAddress" }, "toChainId": { "type": "string", "pattern": "^[1-9][0-9]*$" }, "toTokenAddress": { "$ref": "#/components/schemas/EvmAddress" } } },
      "FundingDepositIntentRequest": { "type": "object", "additionalProperties": false, "required": ["flow", "targetAccount", "gasReady", "quote"], "properties": { "flow": { "const": "deposit" }, "targetAccount": { "$ref": "#/components/schemas/FundingTargetAccount" }, "gasReady": { "const": true }, "quote": { "$ref": "#/components/schemas/FundingQuoteIntent" } } },
      "FundingWithdrawalAuthResource": { "type": "object", "additionalProperties": false, "required": ["ownerWallet", "targetAccount", "amountBaseUnit", "fromChainId", "fromTokenAddress", "toChainId", "toTokenAddress", "destinationWallet", "idempotencyKey"], "properties": { "ownerWallet": { "$ref": "#/components/schemas/EvmAddress", "description": "Managed Trading Account owner fixed by Reso." }, "targetAccount": { "$ref": "#/components/schemas/FundingTargetAccount" }, "amountBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "fromChainId": { "type": "string", "pattern": "^[1-9][0-9]*$" }, "fromTokenAddress": { "$ref": "#/components/schemas/EvmAddress" }, "toChainId": { "type": "string", "pattern": "^[1-9][0-9]*$" }, "toTokenAddress": { "$ref": "#/components/schemas/EvmAddress" }, "destinationWallet": { "$ref": "#/components/schemas/EvmAddress", "description": "Bound external funding wallet fixed by Reso; must differ from ownerWallet." }, "idempotencyKey": { "type": "string", "pattern": "^[A-Za-z0-9._~-]{1,128}$" } } },
      "FundingWithdrawalIntentRequest": { "type": "object", "additionalProperties": false, "required": ["fundingWallet", "challengeId", "signature", "flow", "targetAccount", "gasReady", "quote"], "properties": { "fundingWallet": { "$ref": "#/components/schemas/EvmAddress" }, "challengeId": { "$ref": "#/components/schemas/Bytes32" }, "signature": { "type": "string", "pattern": "^0x[0-9a-fA-F]{130}$", "description": "Bound funding-wallet signature over the Reso AuthChallenge typedData." }, "flow": { "const": "withdraw" }, "targetAccount": { "$ref": "#/components/schemas/FundingTargetAccount" }, "gasReady": { "const": true }, "quote": { "allOf": [{ "$ref": "#/components/schemas/FundingQuoteIntent" }, { "required": ["toChainId", "toTokenAddress"] }] } } },
      "FundingIntentRequest": { "oneOf": [{ "$ref": "#/components/schemas/FundingDepositIntentRequest" }, { "$ref": "#/components/schemas/FundingWithdrawalIntentRequest" }] },
      "FundingIntent": { "type": "object", "additionalProperties": false, "required": ["intentId", "flow", "wallet", "createdAt"], "properties": { "intentId": { "type": "string" }, "flow": { "enum": ["deposit", "withdraw"] }, "wallet": { "$ref": "#/components/schemas/EvmAddress" }, "createdAt": { "type": "string", "format": "date-time" }, "status": { "type": "string" }, "amountUsdc": { "type": "number", "description": "Gross USD-denominated amount." }, "feeUsdc": { "type": "number", "minimum": 0 }, "netAmountUsdc": { "type": "number", "minimum": 0, "description": "Deposit credit or withdrawal payout after the fixed fee." }, "depositAddress": { "type": "object", "additionalProperties": false, "properties": { "evm": { "$ref": "#/components/schemas/EvmAddress" } } }, "note": { "type": "string" }, "statusAddress": { "type": "string" }, "onrampUrl": { "type": "string" } } },
      "PolymarketWalletCall": { "type": "object", "additionalProperties": false, "required": ["target", "value", "data"], "properties": { "target": { "$ref": "#/components/schemas/EvmAddress" }, "value": { "const": "0" }, "data": { "type": "string", "pattern": "^0x[0-9a-fA-F]+$" } } },
      "PolymarketOwnerWalletAction": { "type": "object", "additionalProperties": false, "required": ["mode", "protocol", "chainId", "ownerWallet", "sourceWallet", "calls", "confirmation"], "properties": { "mode": { "const": "OWNER_WALLET_ACTION_REQUIRED" }, "protocol": { "const": "POLYMARKET_WALLET_BATCH" }, "chainId": { "const": "137" }, "ownerWallet": { "$ref": "#/components/schemas/EvmAddress" }, "sourceWallet": { "$ref": "#/components/schemas/EvmAddress" }, "calls": { "type": "array", "minItems": 1, "maxItems": 1, "items": { "$ref": "#/components/schemas/PolymarketWalletCall" } }, "confirmation": { "type": "object", "additionalProperties": false, "required": ["method", "path", "body"], "properties": { "method": { "const": "POST" }, "path": { "const": "/api/funding/intents/confirm-polymarket-withdrawal" }, "body": { "type": "object", "additionalProperties": false, "required": ["intentId", "txHash"], "properties": { "intentId": { "type": "string" }, "txHash": { "const": "0x...", "description": "Replace with the confirmed Polygon transaction hash." } } } } } } },
      "PolymarketRedeemOwnerWalletAction": { "type": "object", "additionalProperties": false, "required": ["mode", "protocol", "chainId", "ownerWallet", "sourceWallet", "attemptedConditions", "calls"], "properties": { "mode": { "const": "OWNER_WALLET_ACTION_REQUIRED" }, "protocol": { "const": "POLYMARKET_WALLET_BATCH" }, "chainId": { "const": "137" }, "ownerWallet": { "$ref": "#/components/schemas/EvmAddress" }, "sourceWallet": { "$ref": "#/components/schemas/EvmAddress" }, "attemptedConditions": { "type": "integer", "minimum": 0 }, "calls": { "type": "array", "maxItems": 2000, "items": { "$ref": "#/components/schemas/PolymarketWalletCall" }, "description": "Submit non-empty calls as one official relayer WALLET batch signed by the owner. Empty means no redeemable position matched." } } },
      "FundingRedeemResult": { "type": "object", "additionalProperties": false, "required": ["ok", "replayed"], "properties": { "ok": { "const": true }, "replayed": { "type": "boolean" }, "execution": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["mode"], "properties": { "mode": { "const": "SERVER_MANAGED" } } }, { "$ref": "#/components/schemas/PolymarketRedeemOwnerWalletAction" }] } } },
      "FundingExecution": { "oneOf": [{ "type": "object", "additionalProperties": false, "required": ["mode"], "properties": { "mode": { "const": "SERVER_MANAGED" } } }, { "$ref": "#/components/schemas/PolymarketOwnerWalletAction" }] },
      "FundingIntentResult": { "type": "object", "additionalProperties": false, "required": ["intent", "replayed"], "properties": { "intent": { "$ref": "#/components/schemas/FundingIntent" }, "replayed": { "type": "boolean" }, "chain": { "type": "array", "items": { "type": "string" } }, "supportedUsdcAssets": { "type": "array", "items": { "$ref": "#/components/schemas/FundingAsset" } }, "execution": { "$ref": "#/components/schemas/FundingExecution" } } },
      "PolymarketWithdrawalConfirmationRequest": { "type": "object", "additionalProperties": false, "required": ["intentId", "txHash"], "properties": { "intentId": { "type": "string", "minLength": 1 }, "txHash": { "$ref": "#/components/schemas/Bytes32" } } },
      "PolymarketWithdrawalConfirmationResult": { "type": "object", "additionalProperties": false, "required": ["ok", "status"], "properties": { "ok": { "const": true }, "status": { "enum": ["pending", "confirmed"] }, "reason": { "enum": ["TX_NOT_FOUND", "CONFIRMING"] }, "txHash": { "$ref": "#/components/schemas/Bytes32" } } },
      "FundingTransaction": { "type": "object", "additionalProperties": false, "required": ["fromChainId", "fromTokenAddress", "fromAmountBaseUnit", "toChainId", "toTokenAddress", "status"], "properties": { "intentId": { "type": "string" }, "fromChainId": { "type": "string" }, "fromTokenAddress": { "type": "string" }, "fromAmountBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "toChainId": { "type": "string" }, "toTokenAddress": { "type": "string" }, "createdTimeMs": { "$ref": "#/components/schemas/UnixMs" }, "txHash": { "type": "string" }, "status": { "enum": ["AWAITING_ONCHAIN_TRANSFER", "PENDING", "PROCESSING", "PAYOUT_POOL_LOW", "MANUAL_REVIEW", "DONE", "FAILED"] } } },
      "FundingStatus": { "type": "object", "additionalProperties": false, "required": ["transactions"], "properties": { "transactions": { "type": "array", "items": { "$ref": "#/components/schemas/FundingTransaction" } } } },
      "TradingAccount": { "type": "object", "additionalProperties": false, "required": ["ownerWallet", "status", "createdAtMs"], "properties": { "ownerWallet": { "$ref": "#/components/schemas/EvmAddress" }, "polymarketFunderWallet": { "oneOf": [{ "$ref": "#/components/schemas/EvmAddress" }, { "type": "null" }], "description": "Returned by GET /api/trading/account after managed wallet preparation. For POLY_1271 type 3, use it as the Polymarket order.signer, order.maker, and CLOB client funder. It is omitted from L1 challenge account payloads." }, "polymarketOrderConfig": { "oneOf": [{ "$ref": "#/components/schemas/PolymarketOrderConfig" }, { "type": "null" }], "description": "Trusted Reso Builder attribution required for owner-signed Polymarket V2 orders. A null value means Crypto order submission is unavailable." }, "status": { "enum": ["ACTIVE", "FROZEN", "CANCEL_ONLY"] }, "createdAtMs": { "$ref": "#/components/schemas/UnixMs" } } },
      "PolymarketOrderConfig": { "type": "object", "additionalProperties": false, "required": ["builderCode", "takerFeeBps"], "properties": { "builderCode": { "$ref": "#/components/schemas/Bytes32", "description": "Pass as builderCode to the official Polymarket V2 order builder before owner signing." }, "takerFeeBps": { "type": "integer", "minimum": 1, "maximum": 100, "description": "Informational expected Builder taker fee. The client cannot override it; Polymarket resolves the effective rate for builderCode." } } },
      "Balance": { "type": "object", "additionalProperties": false, "required": ["assetId", "bucket", "amountBaseUnit"], "properties": { "assetId": { "type": "string" }, "bucket": { "enum": ["AVAILABLE_CONTRACT", "ORDER_RESERVED", "MARKET_BACKING", "OUTCOME_AVAILABLE", "OUTCOME_RESERVED", "PENDING_REBATE"] }, "marketId": { "type": ["string", "null"] }, "outcome": { "type": ["string", "null"], "enum": [null, "UP", "DOWN"] }, "amountBaseUnit": { "$ref": "#/components/schemas/SignedBaseUnitString" } } },
      "CollateralTransferRequest": { "type": "object", "additionalProperties": false, "required": ["direction", "amountBaseUnit"], "properties": { "direction": { "enum": ["ALLOCATE", "RELEASE"] }, "amountBaseUnit": { "type": "string", "pattern": "^[1-9][0-9]{0,77}$" } } },
      "CollateralTransfer": { "type": "object", "additionalProperties": false, "required": ["transferId", "direction", "assetId", "amountBaseUnit", "status", "attemptCount", "lastErrorCode", "createdAtMs", "updatedAtMs", "completedAtMs"], "properties": { "transferId": { "type": "string", "pattern": "^tct_[0-9a-f]{32}$" }, "direction": { "enum": ["ALLOCATE", "RELEASE"] }, "assetId": { "const": "polygon-usdc" }, "amountBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "status": { "enum": ["PENDING", "PROCESSING", "EXTERNAL_PENDING", "RETRY_WAIT", "COMPLETED", "FAILED"] }, "attemptCount": { "type": "integer", "minimum": 0 }, "lastErrorCode": { "type": ["string", "null"] }, "createdAtMs": { "$ref": "#/components/schemas/UnixMs" }, "updatedAtMs": { "$ref": "#/components/schemas/UnixMs" }, "completedAtMs": { "oneOf": [{ "$ref": "#/components/schemas/UnixMs" }, { "type": "null" }] } } },
      "CollateralState": { "type": "object", "additionalProperties": false, "required": ["assetId", "availableAdiBaseUnit", "availableContractBaseUnit", "pendingTransferBaseUnit", "transfers"], "properties": { "assetId": { "const": "polygon-usdc" }, "availableAdiBaseUnit": { "$ref": "#/components/schemas/SignedBaseUnitString" }, "availableContractBaseUnit": { "$ref": "#/components/schemas/SignedBaseUnitString" }, "pendingTransferBaseUnit": { "$ref": "#/components/schemas/SignedBaseUnitString" }, "transfers": { "type": "array", "maxItems": 20, "items": { "$ref": "#/components/schemas/CollateralTransfer" } } } },
      "Position": { "type": "object", "additionalProperties": false, "required": ["marketId", "outcome", "fundingAssetId", "availableSharesBaseUnit", "reservedSharesBaseUnit", "costBaseUnit"], "properties": { "marketId": { "type": "string" }, "outcome": { "$ref": "#/components/schemas/Outcome" }, "fundingAssetId": { "type": "string" }, "availableSharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "reservedSharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "costBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "markPriceBaseUnit": { "oneOf": [{ "$ref": "#/components/schemas/Uint256String" }, { "type": "null" }], "description": "Best bid from another account, falling back to the latest trade reference and then acquisition cost per share. COST_BASIS is not a market quote. Market marks do not guarantee enough depth to liquidate the full position." }, "markSource": { "type": ["string", "null"], "enum": [null, "BEST_BID", "LAST_TRADE", "COST_BASIS"], "description": "Identifies whether the value comes from the current best bid, a non-executable latest-trade reference, or explicit cost basis. COST_BASIS is not a market quote." }, "currentValueBaseUnit": { "oneOf": [{ "$ref": "#/components/schemas/Uint256String" }, { "type": "null" }], "description": "Total open position value. For COST_BASIS it equals costBaseUnit exactly; otherwise it is shares valued at markPriceBaseUnit and truncated to funding-asset base units." }, "unrealizedPnlBaseUnit": { "oneOf": [{ "$ref": "#/components/schemas/SignedBaseUnitString" }, { "type": "null" }], "description": "currentValueBaseUnit minus costBaseUnit. It is zero for COST_BASIS and is unrealized PnL, not settlement profit." } } },
      "Order": { "type": "object", "additionalProperties": false, "required": ["orderId", "ownerWallet", "marketId", "marketConfigVersion", "fundingAssetId", "outcome", "side", "orderType", "postOnly", "priceBaseUnit", "sharesBaseUnit", "matchedSharesBaseUnit", "remainingSharesBaseUnit", "closedSharesBaseUnit", "associatedFillIds", "nonce", "expirationMs", "orderStatus", "acceptedAtMs"], "properties": { "orderId": { "$ref": "#/components/schemas/OrderId" }, "ownerWallet": { "$ref": "#/components/schemas/EvmAddress" }, "marketId": { "type": "string" }, "marketConfigVersion": { "$ref": "#/components/schemas/Uint64String" }, "fundingAssetId": { "type": "string" }, "outcome": { "$ref": "#/components/schemas/Outcome" }, "side": { "$ref": "#/components/schemas/Side" }, "orderType": { "$ref": "#/components/schemas/OrderType" }, "postOnly": { "type": "boolean" }, "priceBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "sharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "matchedSharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "remainingSharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "closedSharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "associatedFillIds": { "type": "array", "items": { "type": "string" } }, "filledNotionalBaseUnit": { "$ref": "#/components/schemas/Uint256String", "description": "Sum of actual fill notionals for an authenticated direct account order. Zero when the order has no fills; omitted for Partner-attributed orders." }, "netFeeBaseUnit": { "$ref": "#/components/schemas/SignedBaseUnitString", "description": "Actual taker fees minus maker rebates for an authenticated direct account order. A negative value is a net rebate; omitted for Partner-attributed orders." }, "buyCostBaseUnit": { "$ref": "#/components/schemas/Uint256String", "description": "Exact BUY acquisition cost: actual fill notionals plus taker fees. Maker rebates remain separate and do not reduce position cost. Returned only for authenticated direct BUY orders." }, "sellProceedsBaseUnit": { "$ref": "#/components/schemas/Uint256String", "description": "Exact SELL cash proceeds: actual fill notionals minus taker fees plus maker rebates. Returned only for authenticated direct SELL orders." }, "settlementPayoutBaseUnit": { "$ref": "#/components/schemas/Uint256String", "description": "Exact finalized settlement payout attributed to this BUY order. Omitted unless immutable settlement evidence maps the entire payout and acquisition cost to exactly one order." }, "realizedPnlBaseUnit": { "$ref": "#/components/schemas/SignedBaseUnitString", "description": "Evidence-backed realized PnL for this order. Omitted when attribution is ambiguous, settlement is pending, or historical cost evidence is unavailable." }, "nonce": { "$ref": "#/components/schemas/Uint256String" }, "expirationMs": { "$ref": "#/components/schemas/Uint64String" }, "orderStatus": { "$ref": "#/components/schemas/OrderStatus" }, "acceptedAtMs": { "$ref": "#/components/schemas/UnixMs" } } },
      "SignedOrderRequest": { "type": "object", "additionalProperties": false, "required": ["ownerWallet", "marketId", "marketConfigVersion", "outcome", "side", "orderType", "postOnly", "priceBaseUnit", "sharesBaseUnit", "nonce", "expirationMs", "signature"], "properties": { "ownerWallet": { "$ref": "#/components/schemas/EvmAddress" }, "marketId": { "type": "string" }, "marketConfigVersion": { "$ref": "#/components/schemas/Uint64String" }, "outcome": { "type": "integer", "enum": [0, 1] }, "side": { "type": "integer", "enum": [0, 1] }, "orderType": { "type": "integer", "enum": [0, 1, 2, 3] }, "postOnly": { "type": "boolean" }, "priceBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "sharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "nonce": { "$ref": "#/components/schemas/Uint256String" }, "expirationMs": { "$ref": "#/components/schemas/Uint64String" }, "signature": { "type": "string", "pattern": "^(|0x[0-9a-fA-F]{130})$", "description": "Owner EIP-712 signature. An empty string is accepted for a cookie session or account-bound L2 credential only when managed_derived_owner is enabled and the derived owner matches the authenticated Trading Account; the server signs the normalized order after the normal account, market, collateral, and risk checks." } } },
      "Fill": { "type": "object", "additionalProperties": false, "required": ["fillId", "marketId", "outcome", "fundingAssetId", "makerOrderId", "takerOrderId", "priceBaseUnit", "sharesBaseUnit", "notionalBaseUnit", "takerFeeBaseUnit", "makerRebateBaseUnit", "platformFeeBaseUnit", "executedAtMs"], "properties": { "fillId": { "type": "string" }, "marketId": { "type": "string" }, "outcome": { "$ref": "#/components/schemas/Outcome" }, "fundingAssetId": { "type": "string" }, "makerOrderId": { "$ref": "#/components/schemas/OrderId" }, "takerOrderId": { "$ref": "#/components/schemas/OrderId" }, "priceBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "sharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "notionalBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "takerFeeBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "makerRebateBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "platformFeeBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "sellerCostBaseUnit": { "description": "Exact seller acquisition cost consumed by this fill; omitted for historical fills created before the evidence field existed.", "$ref": "#/components/schemas/Uint256String" }, "accountSide": { "$ref": "#/components/schemas/Side", "description": "Authenticated account side; returned only by private account fill endpoints." }, "liquidityRole": { "enum": ["MAKER", "TAKER"], "description": "Authenticated account liquidity role; returned only by private account fill endpoints." }, "accountFeeBaseUnit": { "$ref": "#/components/schemas/Uint256String", "description": "Taker fee paid by the authenticated account, or zero for its maker fill." }, "accountRebateBaseUnit": { "$ref": "#/components/schemas/Uint256String", "description": "Maker rebate earned by the authenticated account, or zero for its taker fill." }, "realizedPnlBaseUnit": { "$ref": "#/components/schemas/SignedBaseUnitString", "description": "Evidence-backed realized PnL for an authenticated account SELL fill, including its fee or rebate; omitted for BUY or missing historical cost evidence." }, "marketRealizedPnlBaseUnit": { "$ref": "#/components/schemas/SignedBaseUnitString", "description": "Cumulative realized PnL for the authenticated account across the whole market, including fills, inventory operations, finalized settlement payout, and remaining position cost. Omitted for Partner-attributed fills without complete account-level evidence." }, "executedAtMs": { "$ref": "#/components/schemas/UnixMs" } } },
      "OrderResult": { "type": "object", "additionalProperties": false, "required": ["order", "fills"], "properties": { "order": { "$ref": "#/components/schemas/Order" }, "fills": { "type": "array", "items": { "$ref": "#/components/schemas/Fill" } } } },
      "OrderBatchRequest": { "type": "object", "additionalProperties": false, "required": ["mode", "orders"], "properties": { "mode": { "enum": ["BEST_EFFORT", "ALL_OR_NOTHING"] }, "replaceOrderIds": { "type": "array", "maxItems": 100, "uniqueItems": true, "description": "Existing caller-owned orders to cancel in the same transaction. Allowed only with ALL_OR_NOTHING, and all old and new orders must use one market.", "items": { "$ref": "#/components/schemas/OrderId" } }, "orders": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "$ref": "#/components/schemas/SignedOrderRequest" } } } },
      "OrderBatchResult": { "type": "object", "additionalProperties": false, "required": ["results"], "properties": { "results": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "oneOf": [{ "$ref": "#/components/schemas/OrderResult" }, { "type": "object", "additionalProperties": false, "required": ["error"], "properties": { "error": { "$ref": "#/components/schemas/ErrorObject" } } }] } } } },
      "CancelOrdersRequest": { "type": "object", "additionalProperties": false, "required": ["orderIds"], "properties": { "orderIds": { "type": "array", "minItems": 1, "maxItems": 100, "uniqueItems": true, "items": { "$ref": "#/components/schemas/OrderId" } } } },
      "CancelMarketRequest": { "type": "object", "additionalProperties": false, "required": ["marketId"], "properties": { "marketId": { "type": "string" }, "outcome": { "$ref": "#/components/schemas/Outcome" } } },
      "CancelResult": { "type": "object", "additionalProperties": false, "required": ["canceled", "notCanceled"], "properties": { "canceled": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["orderId", "canceledSharesBaseUnit", "alreadyCanceled"], "properties": { "orderId": { "$ref": "#/components/schemas/OrderId" }, "canceledSharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "alreadyCanceled": { "type": "boolean" } } } }, "notCanceled": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["orderId", "code"], "properties": { "orderId": { "$ref": "#/components/schemas/OrderId" }, "code": { "enum": ["ORDER_NOT_FOUND", "ORDER_ALREADY_FILLED", "ORDER_NOT_CANCELABLE"] } } } } } },
      "Heartbeat": { "type": "object", "additionalProperties": false, "required": ["status", "serverTimeMs", "lastHeartbeatAtMs", "expiresAtMs", "heartbeatIntervalMs", "heartbeatTtlMs"], "properties": { "status": { "enum": ["DISARMED", "ARMED", "EXPIRED", "CANCELING"] }, "serverTimeMs": { "$ref": "#/components/schemas/UnixMs" }, "lastHeartbeatAtMs": { "oneOf": [{ "$ref": "#/components/schemas/UnixMs" }, { "type": "null" }] }, "expiresAtMs": { "oneOf": [{ "$ref": "#/components/schemas/UnixMs" }, { "type": "null" }] }, "heartbeatIntervalMs": { "const": 5000 }, "heartbeatTtlMs": { "const": 15000 } } },
      "Market": { "type": "object", "additionalProperties": false, "required": ["marketId", "productFamily", "configVersion", "settlementStatus", "tradingOpensAtMs", "tradingClosesAtMs", "resolveAtMs", "openingPrice", "outcomes", "lifecycleSequence"], "properties": { "marketId": { "type": "string" }, "productFamily": { "const": "btc-minute" }, "configVersion": { "type": "integer", "minimum": 1 }, "settlementStatus": { "enum": ["OPEN", "LOCKED", "RESOLVING", "SETTLED", "REFUNDED"] }, "tradingOpensAtMs": { "$ref": "#/components/schemas/UnixMs" }, "tradingClosesAtMs": { "$ref": "#/components/schemas/UnixMs" }, "resolveAtMs": { "$ref": "#/components/schemas/UnixMs" }, "openingPrice": { "oneOf": [{ "type": "number", "exclusiveMinimum": 0 }, { "type": "null" }], "description": "Canonical threshold opening price; null until the market has a validated opening observation." }, "outcomes": { "type": "array", "prefixItems": [{ "const": "UP" }, { "const": "DOWN" }], "items": false }, "result": { "type": ["string", "null"], "enum": [null, "UP", "DOWN", "REFUND"] }, "lifecycleSequence": { "$ref": "#/components/schemas/Uint64String" } } },
      "MarketConfig": { "type": "object", "additionalProperties": false, "required": ["marketId", "protocolVersion", "configVersion", "productFamily", "tenorSeconds", "settlementStatus", "tradingOpensAtMs", "tradingClosesAtMs", "resolveAtMs", "chainId", "signingDomain", "contracts", "collateral", "outcomes", "priceDecimals", "minimumPriceBaseUnit", "maximumPriceBaseUnit", "minimumTickSizeBaseUnit", "minimumOrderSharesBaseUnit", "minimumOrderNotionalBaseUnit", "maximumOrderNotionalBaseUnit", "supportedOrderTypes", "postOnlySupported", "webOrderPolicy", "feePolicy", "rewardPolicy", "oraclePolicy", "resolutionPolicy", "rootAuditPolicy"], "properties": { "marketId": { "type": "string" }, "protocolVersion": { "const": 1 }, "configVersion": { "type": "integer", "minimum": 1 }, "productFamily": { "const": "btc-minute" }, "tenorSeconds": { "const": 180 }, "settlementStatus": { "enum": ["OPEN", "LOCKED", "RESOLVING", "SETTLED", "REFUNDED"] }, "tradingOpensAtMs": { "$ref": "#/components/schemas/UnixMs" }, "tradingClosesAtMs": { "$ref": "#/components/schemas/UnixMs" }, "resolveAtMs": { "$ref": "#/components/schemas/UnixMs" }, "chainId": { "const": 36900 }, "signingDomain": { "type": "object", "additionalProperties": false, "required": ["name", "version", "chainId", "salt"], "properties": { "name": { "const": "Reso Trading" }, "version": { "const": "1" }, "chainId": { "const": 36900 }, "salt": { "$ref": "#/components/schemas/Bytes32" } } }, "contracts": { "type": "object", "additionalProperties": false, "required": ["settlementRoot"], "properties": { "settlementRoot": { "$ref": "#/components/schemas/EvmAddress" } } }, "collateral": { "type": "object", "additionalProperties": false, "required": ["symbol", "fundingAccount", "fundingAssetIds", "fundingAssetSelection", "singleFundingAssetPerOrder", "crossAssetAggregation", "decimals"], "properties": { "symbol": { "const": "USDC" }, "fundingAccount": { "enum": ["user_available_contract", "user_available_adi"], "description": "New markets use user_available_contract. Historical user_available_adi markets are reduce-only." }, "fundingAssetIds": { "type": "array", "minItems": 1, "maxItems": 1, "items": { "const": "polygon-usdc" } }, "fundingAssetSelection": { "const": "ONLY_CONFIGURED_ASSET" }, "singleFundingAssetPerOrder": { "const": true }, "crossAssetAggregation": { "const": false }, "decimals": { "const": 6 } } }, "outcomes": { "type": "array", "minItems": 2, "maxItems": 2, "items": { "type": "object", "additionalProperties": false, "required": ["outcome", "assetId", "decimals"], "properties": { "outcome": { "$ref": "#/components/schemas/Outcome" }, "assetId": { "type": "string" }, "decimals": { "const": 6 } } } }, "priceDecimals": { "const": 4 }, "minimumPriceBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "maximumPriceBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "minimumTickSizeBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "minimumOrderSharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "minimumOrderNotionalBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "maximumOrderNotionalBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "supportedOrderTypes": { "type": "array", "prefixItems": [{ "const": "GTC" }, { "const": "GTD" }, { "const": "FOK" }, { "const": "FAK" }], "items": false }, "postOnlySupported": { "const": true }, "webOrderPolicy": { "type": "object", "additionalProperties": false, "required": ["orderType", "postOnly", "priceProtectionBps", "userSelectable"], "properties": { "orderType": { "const": "FAK" }, "postOnly": { "const": false }, "priceProtectionBps": { "const": 40 }, "userSelectable": { "const": false } } }, "feePolicy": { "type": "object" }, "rewardPolicy": { "type": "object" }, "oraclePolicy": { "type": "object" }, "resolutionPolicy": { "type": "object" }, "rootAuditPolicy": { "type": "object" } } },
      "BookLevel": { "type": "object", "additionalProperties": false, "required": ["priceBaseUnit", "sharesBaseUnit"], "properties": { "priceBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "sharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" } } },
      "Orderbook": { "type": "object", "additionalProperties": false, "required": ["marketId", "outcome", "sequence", "bookHash", "bids", "asks", "snapshotTimeMs", "earliestGtdExpirationMs"], "properties": { "marketId": { "type": "string" }, "outcome": { "$ref": "#/components/schemas/Outcome" }, "sequence": { "$ref": "#/components/schemas/Uint64String" }, "bookHash": { "$ref": "#/components/schemas/Bytes32" }, "bids": { "type": "array", "items": { "$ref": "#/components/schemas/BookLevel" } }, "asks": { "type": "array", "items": { "$ref": "#/components/schemas/BookLevel" } }, "snapshotTimeMs": { "$ref": "#/components/schemas/UnixMs" }, "earliestGtdExpirationMs": { "oneOf": [{ "$ref": "#/components/schemas/UnixMs" }, { "type": "null" }], "description": "Earliest expiration among resting GTD orders in this snapshot. Null means no resting GTD order; it does not guarantee that GTC liquidity cannot be canceled." } } },
      "MarketScope": { "type": "object", "additionalProperties": false, "required": ["marketId", "outcome"], "properties": { "marketId": { "type": "string" }, "outcome": { "$ref": "#/components/schemas/Outcome" } } },
      "MarketScopesRequest": { "type": "object", "additionalProperties": false, "required": ["markets"], "properties": { "markets": { "type": "array", "minItems": 1, "maxItems": 32, "items": { "$ref": "#/components/schemas/MarketScope" } } } },
      "OrderbookBatch": { "type": "object", "additionalProperties": false, "required": ["asOfMs", "results"], "properties": { "asOfMs": { "$ref": "#/components/schemas/UnixMs" }, "results": { "type": "array", "maxItems": 32, "items": { "oneOf": [{ "$ref": "#/components/schemas/Orderbook" }, { "type": "object", "additionalProperties": false, "required": ["marketId", "outcome", "error"], "properties": { "marketId": { "type": "string" }, "outcome": { "$ref": "#/components/schemas/Outcome" }, "error": { "$ref": "#/components/schemas/ErrorObject" } } }] } } } },
      "Price": { "type": "object", "additionalProperties": false, "required": ["marketId", "outcome", "sequence", "bestBidPriceBaseUnit", "bestAskPriceBaseUnit", "midpointPriceBaseUnit", "spreadPriceBaseUnit", "lastTradePriceBaseUnit", "asOfMs"], "properties": { "marketId": { "type": "string" }, "outcome": { "$ref": "#/components/schemas/Outcome" }, "sequence": { "$ref": "#/components/schemas/Uint64String" }, "bestBidPriceBaseUnit": { "oneOf": [{ "$ref": "#/components/schemas/Uint256String" }, { "type": "null" }] }, "bestAskPriceBaseUnit": { "oneOf": [{ "$ref": "#/components/schemas/Uint256String" }, { "type": "null" }] }, "midpointPriceBaseUnit": { "oneOf": [{ "$ref": "#/components/schemas/Uint256String" }, { "type": "null" }] }, "spreadPriceBaseUnit": { "oneOf": [{ "$ref": "#/components/schemas/Uint256String" }, { "type": "null" }] }, "lastTradePriceBaseUnit": { "oneOf": [{ "$ref": "#/components/schemas/Uint256String" }, { "type": "null" }] }, "asOfMs": { "$ref": "#/components/schemas/UnixMs" } } },
      "PriceBatch": { "type": "object", "additionalProperties": false, "required": ["asOfMs", "results"], "properties": { "asOfMs": { "$ref": "#/components/schemas/UnixMs" }, "results": { "type": "array", "maxItems": 32, "items": { "oneOf": [{ "$ref": "#/components/schemas/Price" }, { "type": "object", "additionalProperties": false, "required": ["marketId", "outcome", "error"], "properties": { "marketId": { "type": "string" }, "outcome": { "$ref": "#/components/schemas/Outcome" }, "error": { "$ref": "#/components/schemas/ErrorObject" } } }] } } } },
      "SettlementBatch": { "type": "object", "additionalProperties": false, "required": ["batchId", "marketId", "result", "batchStatus", "merkleRoot", "leafCount", "totalCostBaseUnit", "totalPayoutBaseUnit", "finalizedAtMs", "rootChainStatus", "rootAttempt", "leaves"], "properties": { "batchId": { "type": "string" }, "marketId": { "type": "string" }, "result": { "enum": ["UP", "DOWN", "REFUND"] }, "batchStatus": { "enum": ["DRAFT", "FINALIZED"] }, "merkleRoot": { "$ref": "#/components/schemas/Bytes32" }, "leafCount": { "type": "integer", "minimum": 0 }, "totalCostBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "totalPayoutBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "finalizedAtMs": { "$ref": "#/components/schemas/UnixMs" }, "rootChainStatus": { "enum": ["NOT_SUBMITTED", "PREPARED", "SIGNED", "BROADCAST", "MINED", "CONFIRMED", "RECONCILING", "FAILED", "EXPIRED"] }, "rootAttempt": { "type": ["object", "null"] }, "leaves": { "type": "array", "items": { "$ref": "#/components/schemas/SettlementLeaf" } } } },
      "SettlementLeaf": { "type": "object", "additionalProperties": false, "required": ["leafIndex", "outcome", "fundingAssetId", "sharesBaseUnit", "payoutBaseUnit", "acquisitionCostBaseUnit", "realizedPnlBaseUnit", "leafHash", "merkleProof"], "properties": { "leafIndex": { "type": "integer", "minimum": 0 }, "outcome": { "$ref": "#/components/schemas/Outcome" }, "fundingAssetId": { "type": "string" }, "sharesBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "payoutBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "acquisitionCostBaseUnit": { "description": "Exact acquisition cost captured before settlement; null for legacy leaves without immutable evidence.", "oneOf": [{ "$ref": "#/components/schemas/Uint256String" }, { "type": "null" }] }, "realizedPnlBaseUnit": { "description": "payoutBaseUnit minus acquisitionCostBaseUnit; null when acquisition cost is unavailable.", "oneOf": [{ "$ref": "#/components/schemas/SignedBaseUnitString" }, { "type": "null" }] }, "leafHash": { "$ref": "#/components/schemas/Bytes32" }, "merkleProof": { "type": "array", "items": { "$ref": "#/components/schemas/Bytes32" } } } },
      "InventoryRequest": { "type": "object", "additionalProperties": false, "required": ["marketId", "amountBaseUnit"], "properties": { "marketId": { "type": "string" }, "amountBaseUnit": { "$ref": "#/components/schemas/Uint256String" } } },
      "InventoryOperation": { "type": "object", "additionalProperties": false, "required": ["operationId", "operationType", "marketId", "fundingAssetId", "amountBaseUnit", "createdAtMs"], "properties": { "operationId": { "type": "string" }, "operationType": { "enum": ["SPLIT", "MERGE"] }, "marketId": { "type": "string" }, "fundingAssetId": { "type": "string" }, "amountBaseUnit": { "$ref": "#/components/schemas/Uint256String" }, "createdAtMs": { "$ref": "#/components/schemas/UnixMs" } } },
      "AccountSnapshot": { "type": "object", "additionalProperties": false, "required": ["accountSequence", "asOfMs", "balances", "positions", "openOrders", "heartbeat"], "properties": { "accountSequence": { "$ref": "#/components/schemas/Uint64String" }, "asOfMs": { "$ref": "#/components/schemas/UnixMs" }, "balances": { "type": "array", "items": { "$ref": "#/components/schemas/Balance" } }, "positions": { "type": "array", "items": { "$ref": "#/components/schemas/Position" } }, "openOrders": { "type": "array", "items": { "$ref": "#/components/schemas/Order" } }, "heartbeat": { "$ref": "#/components/schemas/Heartbeat" } } },
      "AccountEvent": { "type": "object", "additionalProperties": false, "required": ["schemaVersion", "channel", "stream", "scope", "sequence", "eventId", "eventTimeMs", "eventType", "payload"], "properties": { "schemaVersion": { "const": 1 }, "channel": { "const": "USER" }, "stream": { "const": "ACCOUNT" }, "scope": { "type": "string" }, "sequence": { "$ref": "#/components/schemas/Uint64String" }, "eventId": { "type": "string" }, "eventTimeMs": { "$ref": "#/components/schemas/UnixMs" }, "eventType": { "enum": ["ACCOUNT_DELTA", "HEARTBEAT_ARMED", "HEARTBEAT_EXPIRED", "HEARTBEAT_DISARMED"] }, "payload": { "type": "object" } } },
      "AccountEventPage": { "type": "object", "additionalProperties": false, "required": ["asOfSequence", "items", "nextAfterSequence"], "properties": { "asOfSequence": { "$ref": "#/components/schemas/Uint64String" }, "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/AccountEvent" } }, "nextAfterSequence": { "oneOf": [{ "$ref": "#/components/schemas/Uint64String" }, { "type": "null" }] } } },
      "Activity": { "type": "object", "additionalProperties": false, "required": ["eventType", "publicId", "eventTimeMs", "reference"], "properties": { "eventType": { "enum": ["ORDER_ACCEPTED", "ORDER_CANCELED", "ORDER_EXPIRED", "FILL", "FEE", "REBATE", "SPLIT", "MERGE", "SETTLEMENT"] }, "publicId": { "type": "string" }, "eventTimeMs": { "$ref": "#/components/schemas/UnixMs" }, "reference": { "type": "string" } } },
      "StatementEntry": { "type": "object", "additionalProperties": false, "required": ["assetId", "bucket", "deltaBaseUnit", "runningBalanceBaseUnit", "businessType", "reference", "eventTimeMs"], "properties": { "assetId": { "type": "string" }, "bucket": { "type": "string" }, "deltaBaseUnit": { "$ref": "#/components/schemas/SignedBaseUnitString" }, "runningBalanceBaseUnit": { "$ref": "#/components/schemas/SignedBaseUnitString" }, "businessType": { "type": "string" }, "reference": { "type": "string" }, "eventTimeMs": { "$ref": "#/components/schemas/UnixMs" } } },
      "ActivityPage": { "type": "object", "additionalProperties": false, "required": ["asOfSequence", "items", "nextCursor"], "properties": { "asOfSequence": { "$ref": "#/components/schemas/Uint64String" }, "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/Activity" } }, "nextCursor": { "oneOf": [{ "$ref": "#/components/schemas/OpaqueCursor" }, { "type": "null" }] } } },
      "StatementPage": { "type": "object", "additionalProperties": false, "required": ["asOfSequence", "items", "nextCursor"], "properties": { "asOfSequence": { "$ref": "#/components/schemas/Uint64String" }, "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/StatementEntry" } }, "nextCursor": { "oneOf": [{ "$ref": "#/components/schemas/OpaqueCursor" }, { "type": "null" }] } } },
      "OrderPage": { "type": "object", "additionalProperties": false, "required": ["items", "nextCursor"], "properties": { "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/Order" } }, "nextCursor": { "oneOf": [{ "$ref": "#/components/schemas/OpaqueCursor" }, { "type": "null" }] } } },
      "FillPage": { "type": "object", "additionalProperties": false, "required": ["items", "nextCursor"], "properties": { "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/Fill" } }, "nextCursor": { "oneOf": [{ "$ref": "#/components/schemas/OpaqueCursor" }, { "type": "null" }] } } },
      "PositionPage": { "type": "object", "additionalProperties": false, "required": ["items", "nextCursor"], "properties": { "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/Position" } }, "nextCursor": { "oneOf": [{ "$ref": "#/components/schemas/OpaqueCursor" }, { "type": "null" }] } } },
      "SettlementBatchPage": { "type": "object", "additionalProperties": false, "required": ["items", "nextCursor"], "properties": { "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/SettlementBatch" } }, "nextCursor": { "oneOf": [{ "$ref": "#/components/schemas/OpaqueCursor" }, { "type": "null" }] } } },
      "MarketPage": { "type": "object", "additionalProperties": false, "required": ["items", "nextCursor"], "properties": { "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/Market" } }, "nextCursor": { "oneOf": [{ "$ref": "#/components/schemas/OpaqueCursor" }, { "type": "null" }] } } },
      "PublicTradePage": { "type": "object", "additionalProperties": false, "required": ["items", "nextCursor"], "properties": { "items": { "type": "array", "maxItems": 200, "items": { "$ref": "#/components/schemas/Fill" } }, "nextCursor": { "oneOf": [{ "$ref": "#/components/schemas/OpaqueCursor" }, { "type": "null" }] } } }
    }
  }
}
