{
  "openapi": "3.1.0",
  "info": {
    "title": "Predexon API",
    "description": "Prediction market data aggregation and matching API",
    "version": "2.0.0"
  },
  "paths": {
    "/v2/kalshi/orderbooks-subcent": {
      "get": {
        "tags": [
          "kalshi"
        ],
        "summary": "Get Kalshi Orderbooks V2",
        "description": "Fetch historical **sub-cent** orderbook snapshots for a Kalshi market.\n\nIdentical in shape to `/orderbooks`, but prices are decimal-cent strings\n(e.g. \"36.50\") instead of integers, and each snapshot carries a `source`\nfield. All timestamps are in milliseconds.\n\nThe default (`sources=spine`) serves the standard capture streams; experimental\nstreams are excluded unless `sources=all` is passed.",
        "operationId": "get_kalshi_orderbooks_v2_v2_kalshi_orderbooks_subcent_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The Kalshi market ticker",
              "title": "Ticker"
            },
            "description": "The Kalshi market ticker"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Start time in Unix timestamp (milliseconds)",
              "title": "Start Time"
            },
            "description": "Start time in Unix timestamp (milliseconds)"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "End time in Unix timestamp (milliseconds)",
              "title": "End Time"
            },
            "description": "End time in Unix timestamp (milliseconds)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 2000,
              "minimum": 1,
              "description": "Maximum number of snapshots to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of snapshots to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pagination key to get the next chunk of data",
              "title": "Pagination Key"
            },
            "description": "Pagination key to get the next chunk of data"
          },
          {
            "name": "sources",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Which capture sources to include: 'spine' (default, the standard capture streams), 'all' (raw table, may include experimental duplicate streams), or a comma-separated list of exact source names.",
              "default": "spine",
              "title": "Sources"
            },
            "description": "Which capture sources to include: 'spine' (default, the standard capture streams), 'all' (raw table, may include experimental duplicate streams), or a comma-separated list of exact source names."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KalshiOrderbooksV2Response"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallet/pnl/{wallet}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Wallet Pnl",
        "description": "Fetch realized profit and loss (PnL) for a specific wallet address.\n\nReturns realized gains only - from confirmed sells or redeems.\n\nWhen condition_id is provided, returns realized PnL for that specific market only.\nThis handles split/merge operations correctly by aggregating both sides.",
        "operationId": "get_wallet_pnl_v2_polymarket_wallet_pnl__wallet__get",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Wallet address to fetch PnL for",
              "title": "Wallet"
            },
            "description": "Wallet address to fetch PnL for"
          },
          {
            "name": "granularity",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/PnLGranularity",
              "description": "Time granularity for PnL data"
            },
            "description": "Time granularity for PnL data"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for start of range",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for start of range"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for end of range",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for end of range"
          },
          {
            "name": "condition_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to a specific market by condition ID",
              "title": "Condition Id"
            },
            "description": "Filter to a specific market by condition ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPnLResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallet/positions/{wallet}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Wallet Positions",
        "description": "Fetch current positions for a wallet address.\n\nReturns all open positions with cost basis, current market prices, and P&L calculations.\nSupports filtering by market_slug or condition_id.",
        "operationId": "get_wallet_positions_v2_polymarket_wallet_positions__wallet__get",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Wallet address to fetch positions for",
              "title": "Wallet"
            },
            "description": "Wallet address to fetch positions for"
          },
          {
            "name": "include_closed",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include zero-balance (closed) positions",
              "default": false,
              "title": "Include Closed"
            },
            "description": "Include zero-balance (closed) positions"
          },
          {
            "name": "min_shares",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": 0.0,
              "description": "Minimum number of shares to include",
              "default": 0,
              "title": "Min Shares"
            },
            "description": "Minimum number of shares to include"
          },
          {
            "name": "market_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market slug",
              "title": "Market Slug"
            },
            "description": "Filter by market slug"
          },
          {
            "name": "condition_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to a specific market by condition ID",
              "title": "Condition Id"
            },
            "description": "Filter to a specific market by condition ID"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PositionSortBy",
              "description": "Field to sort by",
              "default": "value"
            },
            "description": "Field to sort by"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDirection",
              "description": "Sort order: asc or desc",
              "default": "desc"
            },
            "description": "Sort order: asc or desc"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Maximum number of positions to return (1-200)",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of positions to return (1-200)"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletPositionsResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallet/volume-chart/{wallet}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Wallet Volume Chart",
        "description": "Fetch volume chart data for a wallet, broken down by BUY/SELL side.\n\nReturns per-period total, BUY, and SELL volume aggregated from trade events\nwhere the wallet was the maker (providing liquidity).",
        "operationId": "get_wallet_volume_chart_v2_polymarket_wallet_volume_chart__wallet__get",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Wallet address to fetch volume chart for",
              "title": "Wallet"
            },
            "description": "Wallet address to fetch volume chart for"
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/VolumeChartGranularity",
              "description": "Time granularity: hour, day, or week",
              "default": "hour"
            },
            "description": "Time granularity: hour, day, or week"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Unix timestamp (seconds) for start of time range",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for start of time range"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Unix timestamp (seconds) for end of time range",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for end of time range"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletVolumeChartResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallet/identity/{wallet}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Wallet Identity",
        "description": "Fetch identity + profile metadata for a wallet:\ndisplay name, pseudonym, profile image (pfp), X handle, verified/creator/mod\nbadges, type (proxy/safe/eoa), signer, USDC balance, and timestamps.\n\nLookup matches against either the proxy address (`wallet.id`) or the\nunderlying signer EOA (`wallet.signer`).",
        "operationId": "get_wallet_identity_v2_polymarket_wallet_identity__wallet__get",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Wallet address (proxy or signer EOA)",
              "title": "Wallet"
            },
            "description": "Wallet address (proxy or signer EOA)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletIdentityResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallet/identities": {
      "post": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Wallet Identities",
        "description": "Bulk identity lookup. Accepts up to 200 addresses (proxy or signer EOA);\nreturns a map of lowercase address \u2192 profile. Both `id` and `signer` of each\nmatched row are keys in the result so callers can look up by whichever they\nqueried with. Missing addresses are simply absent from the map.",
        "operationId": "get_wallet_identities_v2_polymarket_wallet_identities_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WalletIdentitiesRequest",
                "description": "Addresses to look up"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletIdentitiesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/candlesticks/{condition_id}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Candlesticks",
        "description": "Fetch historical candlestick data for a market.\n\nReturns combined OHLCV data from both YES and NO tokens, normalized to YES perspective.\nNO token prices are converted as (1 - price) and volumes are combined.",
        "operationId": "get_candlesticks_v2_polymarket_candlesticks__condition_id__get",
        "parameters": [
          {
            "name": "condition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Condition ID for the market",
              "title": "Condition Id"
            },
            "description": "Condition ID for the market"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for start of time range",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for start of time range"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for end of time range",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for end of time range"
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Interval: 0=auto, 1=1m, 5=5m, 15=15m, 60=1h, 1440=1d",
              "default": 0,
              "title": "Interval"
            },
            "description": "Interval: 0=auto, 1=1m, 5=5m, 15=15m, 60=1h, 1440=1d"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandlesticksResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/candlesticks/token/{token_id}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Candlesticks By Token",
        "description": "Fetch historical candlestick data for a single outcome token.\n\nReturns raw OHLCV data for this specific token \u2014 no YES/NO normalization is\napplied, so NO-token prices stay as NO prices (e.g. ~$0.30 in a 70/30 market).\nVolume is only from trades of this token; summing the YES and NO token volumes\nover the same window approximates the condition-level volume.",
        "operationId": "get_candlesticks_by_token_v2_polymarket_candlesticks_token__token_id__get",
        "parameters": [
          {
            "name": "token_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Outcome token ID",
              "title": "Token Id"
            },
            "description": "Outcome token ID"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for start of time range",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for start of time range"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for end of time range",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for end of time range"
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Interval: 0=auto, 1=1m, 5=5m, 15=15m, 60=1h, 1440=1d",
              "default": 0,
              "title": "Interval"
            },
            "description": "Interval: 0=auto, 1=1m, 5=5m, 15=15m, 60=1h, 1440=1d"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CandlesticksResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/market-price/{token_id}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Market Price",
        "description": "Fetch the current or historical market price for a token.\n\nUses last 5 trades across both tokens (Yes/No) of the market:\n- If all prices within $0.10: weighted average by USD amount\n- Otherwise: last traded price",
        "operationId": "get_market_price_v2_polymarket_market_price__token_id__get",
        "parameters": [
          {
            "name": "token_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Token ID for the market",
              "title": "Token Id"
            },
            "description": "Token ID for the market"
          },
          {
            "name": "at_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for historical price",
              "title": "At Time"
            },
            "description": "Unix timestamp (seconds) for historical price"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketPriceResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/activity": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Activity",
        "description": "Fetch activity data for a specific user.\n\nReturns SPLIT, MERGE, REDEEM, and CONVERT events from the unified activity table.\n\nNote on CONVERT rows: these are NegRisk position conversions (sell NO tokens on a\nsubset of conditions, buy YES tokens on the remainder). Their `condition_id` field\nactually carries the NegRisk parent market_id, not a CTF condition_id, so the\nPostgres market-metadata lookup will return empty market_slug/title for them.\nFiltering by condition_id will not match conversions \u2014 conversions are a\nmarket-level operation, not a per-outcome one.",
        "operationId": "get_activity_v2_polymarket_activity_get",
        "parameters": [
          {
            "name": "wallet",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Wallet address",
              "title": "Wallet"
            },
            "description": "Wallet address"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for start",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for start"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for end",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for end"
          },
          {
            "name": "market_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market slug",
              "title": "Market Slug"
            },
            "description": "Filter by market slug"
          },
          {
            "name": "condition_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by condition ID",
              "title": "Condition Id"
            },
            "description": "Filter by condition ID"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/ActivitySortBy",
              "description": "Sort by: timestamp or type",
              "default": "timestamp"
            },
            "description": "Sort by: timestamp or type"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "description": "Number of activities to return (1-500)",
              "default": 100,
              "title": "Limit"
            },
            "description": "Number of activities to return (1-500)"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDirection",
              "description": "Sort order: asc or desc",
              "default": "desc"
            },
            "description": "Sort order: asc or desc"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pagination key for cursor-based pagination",
              "title": "Pagination Key"
            },
            "description": "Pagination key for cursor-based pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/markets/keyset": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Markets",
        "description": "List markets with filtering and sorting.\n\nConsolidates active and closed markets into a single endpoint.\nUse status=open for active markets only.\n\nRolling metrics (volume_1d/7d/30d, trades, OI) are refreshed hourly.",
        "operationId": "get_markets_v2_polymarket_markets_keyset_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/StatusOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status: open or closed",
              "title": "Status"
            },
            "description": "Filter by status: open or closed"
          },
          {
            "name": "min_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum price",
              "title": "Min Price"
            },
            "description": "Minimum price"
          },
          {
            "name": "max_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum price",
              "title": "Max Price"
            },
            "description": "Maximum price"
          },
          {
            "name": "min_open_interest",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum open interest (USD)",
              "title": "Min Open Interest"
            },
            "description": "Minimum open interest (USD)"
          },
          {
            "name": "min_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum volume (USD)",
              "title": "Min Volume"
            },
            "description": "Minimum volume (USD)"
          },
          {
            "name": "tags",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by tag(s)",
              "title": "Tags"
            },
            "description": "Filter by tag(s)"
          },
          {
            "name": "event_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event slug(s)",
              "title": "Event Slug"
            },
            "description": "Filter by event slug(s)"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search in title (minimum 3 characters)",
              "title": "Search"
            },
            "description": "Search in title (minimum 3 characters)"
          },
          {
            "name": "condition_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by condition ID(s)",
              "title": "Condition Id"
            },
            "description": "Filter by condition ID(s)"
          },
          {
            "name": "question_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by question ID(s)",
              "title": "Question Id"
            },
            "description": "Filter by question ID(s)"
          },
          {
            "name": "market_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market ID(s)",
              "title": "Market Id"
            },
            "description": "Filter by market ID(s)"
          },
          {
            "name": "market_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market slug(s)",
              "title": "Market Slug"
            },
            "description": "Filter by market slug(s)"
          },
          {
            "name": "token_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by token ID(s) - matches either side_a or side_b",
              "title": "Token Id"
            },
            "description": "Filter by token ID(s) - matches either side_a or side_b"
          },
          {
            "name": "predexon_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by predexon ID(s) - matches either side_a or side_b",
              "title": "Predexon Id"
            },
            "description": "Filter by predexon ID(s) - matches either side_a or side_b"
          },
          {
            "name": "end_after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to markets ending after this Unix timestamp",
              "title": "End After"
            },
            "description": "Filter to markets ending after this Unix timestamp"
          },
          {
            "name": "end_before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter to markets ending at or before this Unix timestamp",
              "title": "End Before"
            },
            "description": "Filter to markets ending at or before this Unix timestamp"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/app__api__v1__polymarket__markets_list__SortOption",
              "description": "Sort by",
              "default": "volume"
            },
            "description": "Sort by"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Number of markets to return",
              "default": 20,
              "title": "Limit"
            },
            "description": "Number of markets to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned from the previous response",
              "title": "Pagination Key"
            },
            "description": "Cursor returned from the previous response"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Deprecated. Offset pagination has been removed; only 0 is accepted.",
              "default": 0,
              "title": "Offset"
            },
            "description": "Deprecated. Offset pagination has been removed; only 0 is accepted.",
            "deprecated": true
          },
          {
            "name": "min_volume_1d",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum rolling 1-day volume (USD)",
              "title": "Min Volume 1D"
            },
            "description": "Minimum rolling 1-day volume (USD)"
          },
          {
            "name": "min_volume_7d",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum rolling 7-day volume (USD)",
              "title": "Min Volume 7D"
            },
            "description": "Minimum rolling 7-day volume (USD)"
          },
          {
            "name": "min_volume_30d",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum rolling 30-day volume (USD)",
              "title": "Min Volume 30D"
            },
            "description": "Minimum rolling 30-day volume (USD)"
          },
          {
            "name": "min_trades_1d",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum rolling 1-day trade count",
              "title": "Min Trades 1D"
            },
            "description": "Minimum rolling 1-day trade count"
          },
          {
            "name": "min_trades_7d",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum rolling 7-day trade count",
              "title": "Min Trades 7D"
            },
            "description": "Minimum rolling 7-day trade count"
          },
          {
            "name": "min_trades_30d",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum rolling 30-day trade count",
              "title": "Min Trades 30D"
            },
            "description": "Minimum rolling 30-day trade count"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolymarketMarketsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/markets/{token_id}/volume": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Market Volume Time Series",
        "description": "Return historical time series of traded volume for a token (day+ granularity).",
        "operationId": "get_market_volume_time_series_v2_polymarket_markets__token_id__volume_get",
        "parameters": [
          {
            "name": "token_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Token ID for the market",
              "title": "Token Id"
            },
            "description": "Token ID for the market"
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PnLGranularity",
              "description": "Time granularity",
              "default": "day"
            },
            "description": "Time granularity"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for start",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for start"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for end",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for end"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketVolumeTimeSeriesResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/markets/{condition_id}/open_interest": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Market Open Interest Time Series",
        "description": "Provide historical open interest (total value of tokens circulating from split, merge, redeem, and conversion events) with min granularity day.",
        "operationId": "get_market_open_interest_time_series_v2_polymarket_markets__condition_id__open_interest_get",
        "parameters": [
          {
            "name": "condition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Condition ID for the market",
              "title": "Condition Id"
            },
            "description": "Condition ID for the market"
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/PnLGranularity",
              "description": "Time granularity",
              "default": "day"
            },
            "description": "Time granularity"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for start",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for start"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for end",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for end"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketOpenInterestTimeSeriesResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/orderbooks": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Orderbooks",
        "description": "Fetch historical orderbook snapshots for a specific asset (token ID) over a specified time range.\n\nReturns snapshots of the order book including bids, asks, and market metadata in order.\nAll timestamps are in milliseconds. Orderbook data has history starting from January 1st, 2026.",
        "operationId": "get_orderbooks_v2_polymarket_orderbooks_get",
        "parameters": [
          {
            "name": "token_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The token ID (asset) for the Polymarket market",
              "title": "Token Id"
            },
            "description": "The token ID (asset) for the Polymarket market"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Start time in Unix timestamp (milliseconds)",
              "title": "Start Time"
            },
            "description": "Start time in Unix timestamp (milliseconds)"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "End time in Unix timestamp (milliseconds)",
              "title": "End Time"
            },
            "description": "End time in Unix timestamp (milliseconds)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 2000,
              "minimum": 1,
              "description": "Maximum number of snapshots to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of snapshots to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pagination key to get the next chunk of data",
              "title": "Pagination Key"
            },
            "description": "Pagination key to get the next chunk of data"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderbooksResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/trades": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Trades",
        "description": "Fetch historical trade data.\n\nReturns trades from Polymarket with support for:\n- Filtering by market_slug, condition_id, token_id, or wallet\n- Multi-wallet filtering: wallet accepts a comma-separated list (max 50);\n  results are the merged time-ordered feed across all listed wallets\n- Point lookups by order_hash or tx_hash\n- Time range filtering (start_time, end_time)\n- Minimum trade amount filtering (min_total)\n- Cursor-based pagination\n- Global \"all trades\" mode (no filters) - returns trades across all markets\n\n**All Trades Mode:**\nWhen no market/wallet filter is provided, returns global trades newest-first.\n- Only DESC order is supported (returns 400 if order=asc)\n- First page defaults to last 24 hours for fast queries\n- Pagination automatically extends the time range as you page back\n- Provide start_time or end_time to query specific time ranges",
        "operationId": "get_trades_v2_polymarket_trades_get",
        "parameters": [
          {
            "name": "market_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market slug",
              "title": "Market Slug"
            },
            "description": "Filter by market slug"
          },
          {
            "name": "condition_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by condition ID",
              "title": "Condition Id"
            },
            "description": "Filter by condition ID"
          },
          {
            "name": "token_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by token ID",
              "title": "Token Id"
            },
            "description": "Filter by token ID"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for start",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for start"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for end",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for end"
          },
          {
            "name": "min_total",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum trade amount in USD",
              "title": "Min Total"
            },
            "description": "Minimum trade amount in USD"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "description": "Number of trades to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Number of trades to return"
          },
          {
            "name": "wallet",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by wallet address(es) \u2014 single address or comma-separated list (max 50)",
              "title": "Wallet"
            },
            "description": "Filter by wallet address(es) \u2014 single address or comma-separated list (max 50)"
          },
          {
            "name": "builder",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by V2 builder attribution tag (bytes32 hex, 0x + 64 hex chars)",
              "title": "Builder"
            },
            "description": "Filter by V2 builder attribution tag (bytes32 hex, 0x + 64 hex chars)"
          },
          {
            "name": "order_hash",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by order hash (bytes32 hex, 0x + 64 hex chars)",
              "title": "Order Hash"
            },
            "description": "Filter by order hash (bytes32 hex, 0x + 64 hex chars)"
          },
          {
            "name": "tx_hash",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by transaction hash (bytes32 hex, 0x + 64 hex chars)",
              "title": "Tx Hash"
            },
            "description": "Filter by transaction hash (bytes32 hex, 0x + 64 hex chars)"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDirection",
              "description": "Sort order: asc or desc",
              "default": "desc"
            },
            "description": "Sort order: asc or desc"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TradesResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/volume-chart/{condition_id}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Volume Chart",
        "description": "Fetch volume chart data for a market, broken down by YES/NO side.\n\nReturns per-period total, YES, and NO volume aggregated from trade events.",
        "operationId": "get_volume_chart_v2_polymarket_volume_chart__condition_id__get",
        "parameters": [
          {
            "name": "condition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Condition ID for the market",
              "title": "Condition Id"
            },
            "description": "Condition ID for the market"
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/VolumeChartGranularity",
              "description": "Time granularity: hour, day, or week",
              "default": "hour"
            },
            "description": "Time granularity: hour, day, or week"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Unix timestamp (seconds) for start of time range",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for start of time range"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Unix timestamp (seconds) for end of time range",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for end of time range"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VolumeChartResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallet/{wallet}": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Wallet Profile",
        "description": "Get complete smart wallet profile.\n\nReturns all metrics across all time windows and style classifications.",
        "operationId": "get_wallet_profile_v2_polymarket_wallet__wallet__get",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Wallet address (hex)",
              "title": "Wallet"
            },
            "description": "Wallet address (hex)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletProfileResponse"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallets/profiles": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Wallet Profiles Batch",
        "description": "Get wallet profiles for multiple addresses in a single request.\n\nReturns the same data as the single wallet profile endpoint, but for multiple wallets.\nWallets not found are omitted from the response.",
        "operationId": "get_wallet_profiles_batch_v2_polymarket_wallets_profiles_get",
        "parameters": [
          {
            "name": "addresses",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated wallet addresses (max 20)",
              "title": "Addresses"
            },
            "description": "Comma-separated wallet addresses (max 20)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WalletProfileResponse"
                  },
                  "title": "Response Get Wallet Profiles Batch V2 Polymarket Wallets Profiles Get"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/leaderboard": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Leaderboard",
        "description": "Get global leaderboard of smart wallets.\n\nSupports filtering by trading styles and numeric thresholds.",
        "operationId": "get_leaderboard_v2_polymarket_leaderboard_get",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TimeWindow",
              "description": "Time window for metrics",
              "default": "all_time"
            },
            "description": "Time window for metrics"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/LeaderboardSortBy",
              "description": "Sort field",
              "default": "total_pnl"
            },
            "description": "Sort field"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDirection",
              "description": "Sort order",
              "default": "desc"
            },
            "description": "Sort order"
          },
          {
            "name": "style",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated styles to include (OR logic)",
              "title": "Style"
            },
            "description": "Comma-separated styles to include (OR logic)"
          },
          {
            "name": "exclude_style",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated styles to exclude",
              "title": "Exclude Style"
            },
            "description": "Comma-separated styles to exclude"
          },
          {
            "name": "min_realized_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum realized PnL in USD",
              "title": "Min Realized Pnl"
            },
            "description": "Minimum realized PnL in USD"
          },
          {
            "name": "max_realized_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum realized PnL in USD",
              "title": "Max Realized Pnl"
            },
            "description": "Maximum realized PnL in USD"
          },
          {
            "name": "min_total_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum total PnL in USD (realized + unrealized - net fees)",
              "title": "Min Total Pnl"
            },
            "description": "Minimum total PnL in USD (realized + unrealized - net fees)"
          },
          {
            "name": "max_total_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum total PnL in USD (realized + unrealized - net fees)",
              "title": "Max Total Pnl"
            },
            "description": "Maximum total PnL in USD (realized + unrealized - net fees)"
          },
          {
            "name": "min_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum volume in USD",
              "title": "Min Volume"
            },
            "description": "Minimum volume in USD"
          },
          {
            "name": "max_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum volume in USD",
              "title": "Max Volume"
            },
            "description": "Maximum volume in USD"
          },
          {
            "name": "min_trades",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum trade count",
              "title": "Min Trades"
            },
            "description": "Minimum trade count"
          },
          {
            "name": "max_trades",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum trade count",
              "title": "Max Trades"
            },
            "description": "Maximum trade count"
          },
          {
            "name": "min_roi",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum ROI (decimal)",
              "title": "Min Roi"
            },
            "description": "Minimum ROI (decimal)"
          },
          {
            "name": "max_roi",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum ROI (decimal)",
              "title": "Max Roi"
            },
            "description": "Maximum ROI (decimal)"
          },
          {
            "name": "min_profit_factor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum profit factor",
              "title": "Min Profit Factor"
            },
            "description": "Minimum profit factor"
          },
          {
            "name": "max_profit_factor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum profit factor",
              "title": "Max Profit Factor"
            },
            "description": "Maximum profit factor"
          },
          {
            "name": "min_win_rate",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum win rate (decimal)",
              "title": "Min Win Rate"
            },
            "description": "Minimum win rate (decimal)"
          },
          {
            "name": "max_win_rate",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum win rate (decimal)",
              "title": "Max Win Rate"
            },
            "description": "Maximum win rate (decimal)"
          },
          {
            "name": "min_avg_trade_usd",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum avg trade size in USD",
              "title": "Min Avg Trade Usd"
            },
            "description": "Minimum avg trade size in USD"
          },
          {
            "name": "max_avg_trade_usd",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum avg trade size in USD",
              "title": "Max Avg Trade Usd"
            },
            "description": "Maximum avg trade size in USD"
          },
          {
            "name": "min_wallet_age_days",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum wallet age in days",
              "title": "Min Wallet Age Days"
            },
            "description": "Minimum wallet age in days"
          },
          {
            "name": "max_wallet_age_days",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum wallet age in days",
              "title": "Max Wallet Age Days"
            },
            "description": "Maximum wallet age in days"
          },
          {
            "name": "min_avg_buy_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum avg buy price (0-1)",
              "title": "Min Avg Buy Price"
            },
            "description": "Minimum avg buy price (0-1)"
          },
          {
            "name": "max_avg_buy_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum avg buy price (0-1)",
              "title": "Max Avg Buy Price"
            },
            "description": "Maximum avg buy price (0-1)"
          },
          {
            "name": "min_avg_sell_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum avg sell price (0-1)",
              "title": "Min Avg Sell Price"
            },
            "description": "Minimum avg sell price (0-1)"
          },
          {
            "name": "max_avg_sell_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum avg sell price (0-1)",
              "title": "Max Avg Sell Price"
            },
            "description": "Maximum avg sell price (0-1)"
          },
          {
            "name": "min_entry_edge",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": -1.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum entry edge (avg_sell - avg_buy)",
              "title": "Min Entry Edge"
            },
            "description": "Minimum entry edge (avg_sell - avg_buy)"
          },
          {
            "name": "max_entry_edge",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": -1.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum entry edge (avg_sell - avg_buy)",
              "title": "Max Entry Edge"
            },
            "description": "Maximum entry edge (avg_sell - avg_buy)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Results per page",
              "default": 100,
              "title": "Limit"
            },
            "description": "Results per page"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeaderboardResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/leaderboard/market/{condition_id}": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Market Leaderboard",
        "description": "Get leaderboard for a specific market.\n\nShows wallet rankings for trading performance within a single market.",
        "operationId": "get_market_leaderboard_v2_polymarket_leaderboard_market__condition_id__get",
        "parameters": [
          {
            "name": "condition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Market condition ID",
              "title": "Condition Id"
            },
            "description": "Market condition ID"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TimeWindow",
              "description": "Time window",
              "default": "all_time"
            },
            "description": "Time window"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/LeaderboardSortBy",
              "description": "Sort field",
              "default": "total_pnl"
            },
            "description": "Sort field"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDirection",
              "description": "Sort order",
              "default": "desc"
            },
            "description": "Sort order"
          },
          {
            "name": "min_total_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum total PnL in this market (USD, net of fees)",
              "title": "Min Total Pnl"
            },
            "description": "Minimum total PnL in this market (USD, net of fees)"
          },
          {
            "name": "max_total_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum total PnL in this market (USD, net of fees)",
              "title": "Max Total Pnl"
            },
            "description": "Maximum total PnL in this market (USD, net of fees)"
          },
          {
            "name": "min_trades",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum trades in this market",
              "title": "Min Trades"
            },
            "description": "Minimum trades in this market"
          },
          {
            "name": "max_trades",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum trades in this market",
              "title": "Max Trades"
            },
            "description": "Maximum trades in this market"
          },
          {
            "name": "min_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum volume in this market",
              "title": "Min Volume"
            },
            "description": "Minimum volume in this market"
          },
          {
            "name": "max_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum volume in this market",
              "title": "Max Volume"
            },
            "description": "Maximum volume in this market"
          },
          {
            "name": "min_avg_buy_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum avg buy price (0-1)",
              "title": "Min Avg Buy Price"
            },
            "description": "Minimum avg buy price (0-1)"
          },
          {
            "name": "max_avg_buy_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum avg buy price (0-1)",
              "title": "Max Avg Buy Price"
            },
            "description": "Maximum avg buy price (0-1)"
          },
          {
            "name": "min_avg_sell_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum avg sell price (0-1)",
              "title": "Min Avg Sell Price"
            },
            "description": "Minimum avg sell price (0-1)"
          },
          {
            "name": "max_avg_sell_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum avg sell price (0-1)",
              "title": "Max Avg Sell Price"
            },
            "description": "Maximum avg sell price (0-1)"
          },
          {
            "name": "min_entry_edge",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": -1.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum entry edge (avg_sell - avg_buy)",
              "title": "Min Entry Edge"
            },
            "description": "Minimum entry edge (avg_sell - avg_buy)"
          },
          {
            "name": "max_entry_edge",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": -1.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum entry edge (avg_sell - avg_buy)",
              "title": "Max Entry Edge"
            },
            "description": "Maximum entry edge (avg_sell - avg_buy)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Results per page",
              "default": 100,
              "title": "Limit"
            },
            "description": "Results per page"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketLeaderboardResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/market/{condition_id}/top-holders": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Market Top Holders",
        "description": "Get top holders for a specific market, ranked by position size.\n\nUse the 'side' parameter to filter by Yes or No holders:\n- side=yes: Top holders betting on Yes outcome\n- side=no: Top holders betting on No outcome\n\nReturns wallets with the largest positions in this market, including\ntheir position value, entry price, and realized/unrealized PnL.",
        "operationId": "get_market_top_holders_v2_polymarket_market__condition_id__top_holders_get",
        "parameters": [
          {
            "name": "condition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Market condition ID",
              "title": "Condition Id"
            },
            "description": "Market condition ID"
          },
          {
            "name": "side",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^(yes|no)$"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by position side: 'yes' or 'no'",
              "title": "Side"
            },
            "description": "Filter by position side: 'yes' or 'no'"
          },
          {
            "name": "min_shares",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum shares held (normalized)",
              "title": "Min Shares"
            },
            "description": "Minimum shares held (normalized)"
          },
          {
            "name": "min_trades",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum number of trades",
              "title": "Min Trades"
            },
            "description": "Minimum number of trades"
          },
          {
            "name": "include_count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include total holder count (slower query)",
              "default": false,
              "title": "Include Count"
            },
            "description": "Include total holder count (slower query)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Results per page",
              "default": 100,
              "title": "Limit"
            },
            "description": "Results per page"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopHoldersResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/position/{token_id}/top-holders": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Position Top Holders",
        "description": "Get top holders for a specific Polymarket token, ranked by position size.",
        "operationId": "get_position_top_holders_v2_polymarket_position__token_id__top_holders_get",
        "parameters": [
          {
            "name": "token_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Polymarket CTF token ID",
              "title": "Token Id"
            },
            "description": "Polymarket CTF token ID"
          },
          {
            "name": "include_count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include total holder count",
              "default": false,
              "title": "Include Count"
            },
            "description": "Include total holder count"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Results per page",
              "default": 100,
              "title": "Limit"
            },
            "description": "Results per page"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopHoldersResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallet/{wallet}/markets": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Wallet Markets",
        "description": "Get per-market breakdown for a wallet.\n\nShows performance metrics for each market the wallet has traded in.",
        "operationId": "get_wallet_markets_v2_polymarket_wallet__wallet__markets_get",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Wallet address",
              "title": "Wallet"
            },
            "description": "Wallet address"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TimeWindow",
              "description": "Time window",
              "default": "all_time"
            },
            "description": "Time window"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/LeaderboardSortBy",
              "description": "Sort field",
              "default": "total_pnl"
            },
            "description": "Sort field"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDirection",
              "description": "Sort order",
              "default": "desc"
            },
            "description": "Sort order"
          },
          {
            "name": "min_trades",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum trades per market",
              "title": "Min Trades"
            },
            "description": "Minimum trades per market"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Results per page",
              "default": 100,
              "title": "Limit"
            },
            "description": "Results per page"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletMarketsResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallets/filter": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Filter Wallets By Markets",
        "description": "Filter wallets by market trades with AND/OR logic, with metric filters on combined performance.\n\n**Use Cases:**\n- Find all wallets that traded Market A AND Market B AND Market C (intersection)\n- Find all wallets that traded Market A OR Market B OR Market C (union)\n- Filter by combined performance: wallets with combined win_rate > 50% across these markets\n\n**Query Logic:**\n- AND: Returns wallets that have traded ALL specified markets\n- OR: Returns wallets that have traded ANY of the specified markets\n\n**Metrics:**\nAll metrics (realized_pnl, volume, win_rate, roi, profit_factor) are aggregated across the\nspecified markets only. Derived metrics (win_rate, ROI, profit_factor) are properly\ncalculated from underlying sums, not averaged.\n\nUses ClickHouse for fast aggregation across markets.",
        "operationId": "filter_wallets_by_markets_v2_polymarket_wallets_filter_get",
        "parameters": [
          {
            "name": "markets",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Comma-separated market condition IDs (1-10 markets)",
              "examples": [
                "0x123,0x456,0x789"
              ],
              "title": "Markets"
            },
            "description": "Comma-separated market condition IDs (1-10 markets)"
          },
          {
            "name": "market_logic",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/MarketFilterLogic",
              "description": "AND = traded ALL markets, OR = traded ANY market",
              "default": "and"
            },
            "description": "AND = traded ALL markets, OR = traded ANY market"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TimeWindow",
              "description": "Time window for metrics",
              "default": "all_time"
            },
            "description": "Time window for metrics"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/LeaderboardSortBy",
              "description": "Sort field (based on combined metrics)",
              "default": "total_pnl"
            },
            "description": "Sort field (based on combined metrics)"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDirection",
              "description": "Sort order",
              "default": "desc"
            },
            "description": "Sort order"
          },
          {
            "name": "min_realized_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum combined realized PnL across specified markets (USD)",
              "title": "Min Realized Pnl"
            },
            "description": "Minimum combined realized PnL across specified markets (USD)"
          },
          {
            "name": "max_realized_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum combined realized PnL across specified markets (USD)",
              "title": "Max Realized Pnl"
            },
            "description": "Maximum combined realized PnL across specified markets (USD)"
          },
          {
            "name": "min_total_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum combined total PnL across specified markets (USD, net of fees)",
              "title": "Min Total Pnl"
            },
            "description": "Minimum combined total PnL across specified markets (USD, net of fees)"
          },
          {
            "name": "max_total_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum combined total PnL across specified markets (USD, net of fees)",
              "title": "Max Total Pnl"
            },
            "description": "Maximum combined total PnL across specified markets (USD, net of fees)"
          },
          {
            "name": "min_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum combined volume across specified markets (USD)",
              "title": "Min Volume"
            },
            "description": "Minimum combined volume across specified markets (USD)"
          },
          {
            "name": "min_trades",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum combined trade count across specified markets",
              "title": "Min Trades"
            },
            "description": "Minimum combined trade count across specified markets"
          },
          {
            "name": "min_roi",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum combined ROI across specified markets (decimal)",
              "title": "Min Roi"
            },
            "description": "Minimum combined ROI across specified markets (decimal)"
          },
          {
            "name": "min_profit_factor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum combined profit factor",
              "title": "Min Profit Factor"
            },
            "description": "Minimum combined profit factor"
          },
          {
            "name": "min_win_rate",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum combined win rate (decimal)",
              "title": "Min Win Rate"
            },
            "description": "Minimum combined win rate (decimal)"
          },
          {
            "name": "min_avg_buy_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum combined avg buy price (0-1)",
              "title": "Min Avg Buy Price"
            },
            "description": "Minimum combined avg buy price (0-1)"
          },
          {
            "name": "max_avg_buy_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum combined avg buy price (0-1)",
              "title": "Max Avg Buy Price"
            },
            "description": "Maximum combined avg buy price (0-1)"
          },
          {
            "name": "min_avg_sell_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum combined avg sell price (0-1)",
              "title": "Min Avg Sell Price"
            },
            "description": "Minimum combined avg sell price (0-1)"
          },
          {
            "name": "max_avg_sell_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum combined avg sell price (0-1)",
              "title": "Max Avg Sell Price"
            },
            "description": "Maximum combined avg sell price (0-1)"
          },
          {
            "name": "min_entry_edge",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": -1.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum combined entry edge",
              "title": "Min Entry Edge"
            },
            "description": "Minimum combined entry edge"
          },
          {
            "name": "max_entry_edge",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": -1.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum combined entry edge",
              "title": "Max Entry Edge"
            },
            "description": "Maximum combined entry edge"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Results per page",
              "default": 100,
              "title": "Limit"
            },
            "description": "Results per page"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletFilterResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/markets/smart-activity": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Smart Activity Markets",
        "description": "Discover markets where high-performing wallets are active.\n\n**Use Case:** Find alpha by seeing where profitable traders are putting their money.\n\n**How it works:**\n1. Define \"smart wallets\" using the filter criteria (min_realized_pnl, min_total_pnl, min_roi, etc.)\n2. Find all markets these wallets have traded\n3. Rank markets by smart wallet activity (volume, count, realized PnL)\n\n**Filter Requirements:**\n\nAt least one \"strong\" filter must meet configured minimum thresholds.\nDefaults in this service:\n- `min_realized_pnl >= 5000` ($5,000+ PnL)\n- `min_total_pnl >= 5000` ($5,000+ net total PnL)\n- `min_roi >= 0.15` (15%+ ROI)\n- `min_trades >= 100` (100+ trades)\n- `min_volume >= 10000` ($10,000+ volume)\n\nIf using `min_win_rate` or `min_profit_factor` without a strong filter,\nyou must also specify `min_trades >= 50`.\n\nThese requirements ensure meaningful wallet filtering and fast query performance.\n\nReturns markets sorted by smart wallet activity metrics.",
        "operationId": "get_smart_activity_markets_v2_polymarket_markets_smart_activity_get",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TimeWindow",
              "description": "Time window for metrics",
              "default": "all_time"
            },
            "description": "Time window for metrics"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SmartActivitySortBy",
              "description": "Sort markets by this metric",
              "default": "smart_volume"
            },
            "description": "Sort markets by this metric"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDirection",
              "description": "Sort order",
              "default": "desc"
            },
            "description": "Sort order"
          },
          {
            "name": "min_realized_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global realized PnL to be 'smart' (USD)",
              "title": "Min Realized Pnl"
            },
            "description": "Minimum global realized PnL to be 'smart' (USD)"
          },
          {
            "name": "min_total_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global total PnL to be 'smart' (USD, net of fees)",
              "title": "Min Total Pnl"
            },
            "description": "Minimum global total PnL to be 'smart' (USD, net of fees)"
          },
          {
            "name": "min_roi",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global ROI to be 'smart' (decimal)",
              "title": "Min Roi"
            },
            "description": "Minimum global ROI to be 'smart' (decimal)"
          },
          {
            "name": "min_win_rate",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global win rate (decimal)",
              "title": "Min Win Rate"
            },
            "description": "Minimum global win rate (decimal)"
          },
          {
            "name": "min_profit_factor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global profit factor",
              "title": "Min Profit Factor"
            },
            "description": "Minimum global profit factor"
          },
          {
            "name": "min_trades",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global trade count",
              "title": "Min Trades"
            },
            "description": "Minimum global trade count"
          },
          {
            "name": "min_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global volume (USD)",
              "title": "Min Volume"
            },
            "description": "Minimum global volume (USD)"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market status: open or closed",
              "title": "Status"
            },
            "description": "Filter by market status: open or closed"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Results per page",
              "default": 100,
              "title": "Limit"
            },
            "description": "Results per page"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmartActivityResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/market/{condition_id}/smart-money": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Smart Money Positioning",
        "description": "Get smart money positioning for a specific market.\n\n**Use Case:** See what profitable traders are doing on a specific market.\n\n**Filter Requirements:**\n\nAt least one \"strong\" filter must meet these minimum thresholds:\n- `min_realized_pnl >= 1000` ($1,000+ PnL)\n- `min_total_pnl >= 1000` ($1,000+ net total PnL)\n- `min_roi >= 0.15` (15%+ ROI)\n- `min_trades >= 100` (100+ trades)\n- `min_volume >= 10000` ($10,000+ volume)\n\nIf using `min_win_rate` or `min_profit_factor` without a strong filter,\nyou must also specify `min_trades >= 50`.\n\n**Returns:**\n- How many smart wallets are net buyers vs net sellers\n- Average entry prices for smart wallets\n- Total volume and realized PnL from smart wallets",
        "operationId": "get_smart_money_positioning_v2_polymarket_market__condition_id__smart_money_get",
        "parameters": [
          {
            "name": "condition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Market condition ID",
              "title": "Condition Id"
            },
            "description": "Market condition ID"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TimeWindow",
              "description": "Time window for metrics",
              "default": "all_time"
            },
            "description": "Time window for metrics"
          },
          {
            "name": "min_realized_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global realized PnL to be 'smart' (USD)",
              "title": "Min Realized Pnl"
            },
            "description": "Minimum global realized PnL to be 'smart' (USD)"
          },
          {
            "name": "min_total_pnl",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global total PnL to be 'smart' (USD, net of fees)",
              "title": "Min Total Pnl"
            },
            "description": "Minimum global total PnL to be 'smart' (USD, net of fees)"
          },
          {
            "name": "min_roi",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global ROI to be 'smart' (decimal)",
              "title": "Min Roi"
            },
            "description": "Minimum global ROI to be 'smart' (decimal)"
          },
          {
            "name": "min_win_rate",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global win rate (decimal)",
              "title": "Min Win Rate"
            },
            "description": "Minimum global win rate (decimal)"
          },
          {
            "name": "min_profit_factor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global profit factor",
              "title": "Min Profit Factor"
            },
            "description": "Minimum global profit factor"
          },
          {
            "name": "min_trades",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global trade count",
              "title": "Min Trades"
            },
            "description": "Minimum global trade count"
          },
          {
            "name": "min_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum global volume (USD)",
              "title": "Min Volume"
            },
            "description": "Minimum global volume (USD)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmartMoneyResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallet/{wallet}/similar": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Similar Wallets",
        "description": "Find wallets with similar market portfolios (copy-trade detection).\n\n**Use Case:**\n- Find wallets that trade similar markets to a target wallet\n- Detect potential copy-trading patterns\n- Discover traders with similar strategies\n\n**How it works:**\n1. Get all markets the target wallet has traded\n2. Find other wallets that traded the same markets\n3. Rank by overlap percentage and count",
        "operationId": "get_similar_wallets_v2_polymarket_wallet__wallet__similar_get",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Target wallet address",
              "title": "Wallet"
            },
            "description": "Target wallet address"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TimeWindow",
              "description": "Time window for metrics",
              "default": "all_time"
            },
            "description": "Time window for metrics"
          },
          {
            "name": "min_overlap_pct",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "maximum": 1.0,
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum overlap percentage (0-1). E.g., 0.5 = at least 50% market overlap",
              "title": "Min Overlap Pct"
            },
            "description": "Minimum overlap percentage (0-1). E.g., 0.5 = at least 50% market overlap"
          },
          {
            "name": "min_overlap_markets",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum number of overlapping markets",
              "title": "Min Overlap Markets"
            },
            "description": "Minimum number of overlapping markets"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Results per page",
              "default": 50,
              "title": "Limit"
            },
            "description": "Results per page"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletSimilarityResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/cohorts/stats": {
      "get": {
        "tags": [
          "polymarket",
          "smart-wallet"
        ],
        "summary": "Get Cohort Stats",
        "description": "Compare performance across trading style cohorts.\n\n**Use Case:** Understand which trading styles perform best.\n\n**Cohorts:** Based on primary_trading_style classification:\n- WHALE: Large position traders\n- MARKET_MAKER: Balanced buy/sell with frequent trading\n- ACTIVE_TRADER: High trade frequency\n- BUY_AND_HOLD: Long holding periods\n- DEGEN: High-risk patterns\n- HIGH_CONVICTION: Buys at high prices\n- CONTRARIAN: Takes unpopular sides\n- VALUE_HUNTER: Enters at uncertain odds\n\nReturns aggregate statistics for each cohort.",
        "operationId": "get_cohort_stats_v2_polymarket_cohorts_stats_get",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TimeWindow",
              "description": "Time window for metrics",
              "default": "all_time"
            },
            "description": "Time window for metrics"
          },
          {
            "name": "min_trades",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum trades to be included in cohort (filters noise)",
              "default": 10,
              "title": "Min Trades"
            },
            "description": "Minimum trades to be included in cohort (filters noise)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CohortComparisonResponse"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/crypto-updown": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Crypto Updown",
        "description": "List crypto up/down prediction markets.\n\nReturns Bitcoin, Ethereum, Solana, XRP, HYPE, Dogecoin, and BNB up/down\nmarkets across all timeframes (5m, 15m, 1h, 4h, daily). Supports filtering\nby asset, timeframe, status, and time range.\n\n**Common queries:**\n- Current open markets: `?status=open`\n- BTC 15m timeline: `?asset=btc&timeframe=15m&sort=asc`\n- Recent BTC 15m results: `?asset=btc&timeframe=15m&status=closed&limit=20`\n- Time window: `?end_after=<unix_ts>&end_before=<unix_ts>&sort=asc`",
        "operationId": "get_crypto_updown_v2_polymarket_crypto_updown_get",
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/CryptoAsset"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by crypto asset: btc, eth, sol, xrp, hype, doge, bnb",
              "title": "Asset"
            },
            "description": "Filter by crypto asset: btc, eth, sol, xrp, hype, doge, bnb"
          },
          {
            "name": "timeframe",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/CryptoTimeframe"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by timeframe: 5m, 15m, 1h, 4h, daily",
              "title": "Timeframe"
            },
            "description": "Filter by timeframe: 5m, 15m, 1h, 4h, daily"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/StatusFilter"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market status: open, closed",
              "title": "Status"
            },
            "description": "Filter by market status: open, closed"
          },
          {
            "name": "end_after",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only markets with end_time after this Unix timestamp",
              "title": "End After"
            },
            "description": "Only markets with end_time after this Unix timestamp"
          },
          {
            "name": "end_before",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only markets with end_time before or at this Unix timestamp",
              "title": "End Before"
            },
            "description": "Only markets with end_time before or at this Unix timestamp"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SortOrder",
              "description": "Sort by end_time: desc (most recent first) or asc (chronological)",
              "default": "desc"
            },
            "description": "Sort by end_time: desc (most recent first) or asc (chronological)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Number of markets to return",
              "default": 50,
              "title": "Limit"
            },
            "description": "Number of markets to return"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Offset for pagination",
              "default": 0,
              "title": "Offset"
            },
            "description": "Offset for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CryptoUpDownResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/events/keyset": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Events",
        "description": "List events with filtering and sorting.\n\nEvents are top-level groupings that contain one or more markets. Use\nstatus=open for active events only. With include_markets=true, each event\ncarries up to markets_per_event of its markets inline (volume-sorted) \u2014 for\ndeep per-event market pagination use GET /markets?event_slug=.",
        "operationId": "get_events_v2_polymarket_events_keyset_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/EventStatusOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status: open or closed",
              "title": "Status"
            },
            "description": "Filter by status: open or closed"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by category (e.g. Sports, Crypto)",
              "title": "Category"
            },
            "description": "Filter by category (e.g. Sports, Crypto)"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search in title (minimum 3 characters)",
              "title": "Search"
            },
            "description": "Search in title (minimum 3 characters)"
          },
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event ID(s)",
              "title": "Id"
            },
            "description": "Filter by event ID(s)"
          },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event slug(s)",
              "title": "Slug"
            },
            "description": "Filter by event slug(s)"
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by tag slug(s)",
              "title": "Tag"
            },
            "description": "Filter by tag slug(s)"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/EventSortOption",
              "description": "Sort by",
              "default": "created"
            },
            "description": "Sort by"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Number of events to return",
              "default": 20,
              "title": "Limit"
            },
            "description": "Number of events to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned from the previous response",
              "title": "Pagination Key"
            },
            "description": "Cursor returned from the previous response"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Deprecated. Offset pagination has been removed; only 0 is accepted.",
              "default": 0,
              "title": "Offset"
            },
            "description": "Deprecated. Offset pagination has been removed; only 0 is accepted.",
            "deprecated": true
          },
          {
            "name": "include_markets",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Nest each event's markets inline (same shape as /markets)",
              "default": false,
              "title": "Include Markets"
            },
            "description": "Nest each event's markets inline (same shape as /markets)"
          },
          {
            "name": "markets_per_event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "description": "Max markets nested per event when include_markets=true",
              "default": 10,
              "title": "Markets Per Event"
            },
            "description": "Max markets nested per event when include_markets=true"
          },
          {
            "name": "min_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only events with 7d volume >= this (USD)",
              "title": "Min Volume"
            },
            "description": "Only events with 7d volume >= this (USD)"
          },
          {
            "name": "min_open_interest",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Only events with current open interest >= this (USD)",
              "title": "Min Open Interest"
            },
            "description": "Only events with current open interest >= this (USD)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PolymarketEventsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/positions": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get All Positions",
        "description": "Fetch all user positions with filtering and pagination.\n\nDesigned for analytics and streaming use cases where clients need to:\n- Backfill historical position data\n- Stream new position updates as they come in\n\nUse `min_block` to start from a specific block (for backfill).\nUse `order=asc` to get oldest first (for streaming/backfill).\nUse `order=desc` to get latest first (for recent data).\n\nThe pagination cursor encodes the last position's block/timestamp and IDs,\nallowing efficient continuation from any point.",
        "operationId": "get_all_positions_v2_polymarket_positions_get",
        "parameters": [
          {
            "name": "order_by",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/AllPositionsOrderBy",
              "description": "Order by block number or timestamp",
              "default": "block"
            },
            "description": "Order by block number or timestamp"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDirection",
              "description": "Sort order (desc for latest first, asc for streaming from oldest)",
              "default": "desc"
            },
            "description": "Sort order (desc for latest first, asc for streaming from oldest)"
          },
          {
            "name": "min_block",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum block number (inclusive)",
              "title": "Min Block"
            },
            "description": "Minimum block number (inclusive)"
          },
          {
            "name": "max_block",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum block number (inclusive)",
              "title": "Max Block"
            },
            "description": "Maximum block number (inclusive)"
          },
          {
            "name": "min_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum timestamp in Unix seconds (inclusive)",
              "title": "Min Timestamp"
            },
            "description": "Minimum timestamp in Unix seconds (inclusive)"
          },
          {
            "name": "max_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum timestamp in Unix seconds (inclusive)",
              "title": "Max Timestamp"
            },
            "description": "Maximum timestamp in Unix seconds (inclusive)"
          },
          {
            "name": "wallet",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by wallet address",
              "title": "Wallet"
            },
            "description": "Filter by wallet address"
          },
          {
            "name": "token_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by token ID",
              "title": "Token Id"
            },
            "description": "Filter by token ID"
          },
          {
            "name": "condition_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market condition ID",
              "title": "Condition Id"
            },
            "description": "Filter by market condition ID"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "description": "Maximum positions per page (1-500)",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum positions per page (1-500)"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllPositionsResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/uma/market/{condition_id}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Uma Market",
        "description": "Return the current UMA oracle status for a market plus its event timeline.\n\nSet `events_limit=0` if you only want the status header.",
        "operationId": "get_uma_market_v2_polymarket_uma_market__condition_id__get",
        "parameters": [
          {
            "name": "condition_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Polymarket condition ID (bytes32 hex)",
              "title": "Condition Id"
            },
            "description": "Polymarket condition ID (bytes32 hex)"
          },
          {
            "name": "events_limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 0,
              "description": "Max events to return (0 to skip)",
              "default": 100,
              "title": "Events Limit"
            },
            "description": "Max events to return (0 to skip)"
          },
          {
            "name": "events_pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for next event page",
              "title": "Events Pagination Key"
            },
            "description": "Cursor for next event page"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UmaMarketDetailResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/uma/markets": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "List Uma Markets",
        "description": "List UMA questions filtered by state. Sorted by `last_event_at DESC`.",
        "operationId": "list_uma_markets_v2_polymarket_uma_markets_get",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "UMA state: pending|proposed|disputed|reset|resolved.",
              "title": "State"
            },
            "description": "UMA state: pending|proposed|disputed|reset|resolved."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Pagination Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UmaMarketsListResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/builders/leaderboard": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Builder Leaderboard",
        "description": "Ranked list of builders over the window.\n\nDefaults to ranking by attributed volume; `sort_by=fee` ranks by\n`builder_fee_usd` instead (more useful when looking at revenue-earning\nbuilders, since the highest-volume builders often charge 0 bps).\n\n`builder_fee_usd` is computed at the rate in force when each fill\nhappened (ASOF against `builder_fee_rates`), not today's rate.\n`current_taker_bps`/`current_maker_bps` surface today's rate for display.\nExcludes V1 fills, zero-sentinel builders, and rows with sign != 1.",
        "operationId": "get_builder_leaderboard_v2_polymarket_builders_leaderboard_get",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Rolling window: 24h, 7d, 30d, or all",
              "default": "7d",
              "title": "Window"
            },
            "description": "Rolling window: 24h, 7d, 30d, or all"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort field: 'volume' or 'fee'",
              "default": "volume",
              "title": "Sort By"
            },
            "description": "Sort field: 'volume' or 'fee'"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "description": "Max entries to return",
              "default": 50,
              "title": "Limit"
            },
            "description": "Max entries to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuilderLeaderboardResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/builders/{builder_code}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Builder Stats",
        "description": "Single-builder summary plus full (taker_bps, maker_bps) history.",
        "operationId": "get_builder_stats_v2_polymarket_builders__builder_code__get",
        "parameters": [
          {
            "name": "builder_code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Builder code (bytes32 hex)",
              "title": "Builder Code"
            },
            "description": "Builder code (bytes32 hex)"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Rolling window: 24h, 7d, 30d, or all",
              "default": "7d",
              "title": "Window"
            },
            "description": "Rolling window: 24h, 7d, 30d, or all"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuilderStats"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/builders/{builder_code}/timeseries": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Builder Timeseries",
        "description": "Bucketed volume + builder_fee over a window.",
        "operationId": "get_builder_timeseries_v2_polymarket_builders__builder_code__timeseries_get",
        "parameters": [
          {
            "name": "builder_code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Builder code (bytes32 hex)",
              "title": "Builder Code"
            },
            "description": "Builder code (bytes32 hex)"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Rolling window: 24h, 7d, 30d, or all",
              "default": "30d",
              "title": "Window"
            },
            "description": "Rolling window: 24h, 7d, 30d, or all"
          },
          {
            "name": "bucket",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Bucket size: 'day' or 'hour'",
              "default": "day",
              "title": "Bucket"
            },
            "description": "Bucket size: 'day' or 'hour'"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuilderTimeseriesResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/builders/{builder_code}/markets": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Builder Markets",
        "description": "Top markets attributed to a builder over the window.\n\nReads volume_by_builder_market_daily_view (per-(builder, market, day)\naggregate) for the volume/trade_count/uniq_traders, then joins\norder_filled_with_builder_fee_view per-market for the precise\nbuilder_fee_usd (since the daily MV doesn't track maker/taker split).",
        "operationId": "get_builder_markets_v2_polymarket_builders__builder_code__markets_get",
        "parameters": [
          {
            "name": "builder_code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Builder code (bytes32 hex)",
              "title": "Builder Code"
            },
            "description": "Builder code (bytes32 hex)"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Rolling window: 24h, 7d, 30d, or all",
              "default": "7d",
              "title": "Window"
            },
            "description": "Rolling window: 24h, 7d, 30d, or all"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuilderMarketsResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/builders/wallet/{wallet}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Wallet Builder Fees",
        "description": "Total builder fees a wallet has paid, with per-builder breakdown.\n\nPK-probes `order_filled_by_maker` (sorted by `maker`). Each fill is\nscored at the (taker_bps, maker_bps) that was actually in effect at\n`block_timestamp` \u2014 ASOF join against `builder_fee_rates FINAL`, with\na synthesized epoch-anchored row per builder so fills that predate the\nrefresh worker's first observation also get scored.\n\nTime range: pass `window` (24h/7d/30d/all) for convenience, or\n`start_time` + `end_time` (Unix seconds) for arbitrary ranges. If\neither timestamp is set, `window` is ignored.\n\nOptional `builder_code` filters to a single builder.\n\nOn V2, OrderFilled.taker is the exchange contract \u2014 user identity is\nalways `maker`, and `is_taker=1` flags which leg is the taker side.",
        "operationId": "get_wallet_builder_fees_v2_polymarket_builders_wallet__wallet__get",
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Wallet address (0x + 40 hex)",
              "title": "Wallet"
            },
            "description": "Wallet address (0x + 40 hex)"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Rolling window: 24h, 7d, 30d, or all. Ignored if start_time/end_time provided.",
              "default": "all",
              "title": "Window"
            },
            "description": "Rolling window: 24h, 7d, 30d, or all. Ignored if start_time/end_time provided."
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix seconds, inclusive. Overrides `window` if set.",
              "title": "Start Time"
            },
            "description": "Unix seconds, inclusive. Overrides `window` if set."
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix seconds, exclusive. Overrides `window` if set.",
              "title": "End Time"
            },
            "description": "Unix seconds, exclusive. Overrides `window` if set."
          },
          {
            "name": "builder_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Restrict to a single builder (bytes32 hex).",
              "title": "Builder Code"
            },
            "description": "Restrict to a single builder (bytes32 hex)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "description": "Max per-builder breakdown rows",
              "default": 50,
              "title": "Limit"
            },
            "description": "Max per-builder breakdown rows"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletBuilderFeesResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/wallet/{address}/cluster": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Connected wallets for an address (graph-based)",
        "description": "Returns sibling wallets discovered via the on-chain transfer graph (USDC, pUSD, CTF) plus identity-proof signals (shared signer, shared X username, shared first funder). Confidence is 0-100; \u226570 indicates strong evidence. On a cache miss the endpoint returns 202 and computes the cluster in the background \u2014 the next call returns the full result.",
        "operationId": "get_wallet_cluster_v2_polymarket_wallet__address__cluster_get",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Seed wallet address (proxy or signer).",
              "title": "Address"
            },
            "description": "Seed wallet address (proxy or signer)."
          },
          {
            "name": "min_confidence",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 0,
              "description": "Minimum confidence to include (default 70 = strong-only).",
              "default": 70,
              "title": "Min Confidence"
            },
            "description": "Minimum confidence to include (default 70 = strong-only)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Max siblings to return.",
              "default": 50,
              "title": "Limit"
            },
            "description": "Max siblings to return."
          },
          {
            "name": "recompute",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Kick off a fresh background BFS even if a cached result exists.",
              "default": false,
              "title": "Recompute"
            },
            "description": "Kick off a fresh background BFS even if a cached result exists."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletClusterResponse"
                }
              }
            }
          },
          "202": {
            "description": "Compute in progress. Retry after the indicated interval."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/tag/{slug}/subtags": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Tag Subtags",
        "description": "Ranked child subtags for a major tag, each with an event count.\n\nPowers the category sidebar (e.g. ``/tag/politics/subtags`` \u2192\nTrump, Midterms, Primaries...). Each ``count`` equals what\n``GET /events?tag=<child_slug>&status=<status>`` returns. ``source`` is\n``\"gamma\"`` for Polymarket's curated graph or ``\"fallback\"`` when derived\nlocally from co-occurring tags.",
        "operationId": "get_tag_subtags_v2_polymarket_tag__slug__subtags_get",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/StatusOption",
              "description": "Scope for the per-subtag event count (default: open)",
              "default": "open"
            },
            "description": "Scope for the per-subtag event count (default: open)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Max subtags to return",
              "default": 30,
              "title": "Limit"
            },
            "description": "Max subtags to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/tags": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "List Tags",
        "description": "List curated tags with rolled-up volume/OI metrics, ordered by the chosen\nmetric. Drives the tags navigation surface; metrics come from\n``tag_listing_metrics`` (joined by label). ``force_hide`` tags are excluded\nunless ``include_hidden=true``.",
        "operationId": "list_tags_v2_polymarket_tags_get",
        "parameters": [
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/TagSort",
              "description": "Sort metric (default: volume_7d)",
              "default": "volume_7d"
            },
            "description": "Sort metric (default: volume_7d)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Number of tags to return",
              "default": 50,
              "title": "Limit"
            },
            "description": "Number of tags to return"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Offset for pagination",
              "default": 0,
              "title": "Offset"
            },
            "description": "Offset for pagination"
          },
          {
            "name": "include_hidden",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include force_hide tags",
              "default": false,
              "title": "Include Hidden"
            },
            "description": "Include force_hide tags"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/tag/{slug}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Tag Detail",
        "description": "A single curated tag: metadata (label, image, description) plus rolled-up\nmetrics. For the tag's events use ``GET /events?tag=<slug>``; for its child\nsubtags use ``GET /tag/{slug}/subtags``.",
        "operationId": "get_tag_detail_v2_polymarket_tag__slug__get",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/series": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "List Series",
        "description": "List series (recurring market groupings), ordered by open-event count.\n\nExamples:\n- Daily series: ``?recurrence=daily``\n- All series incl. inactive: ``?active=false`` (or omit for active-only).",
        "operationId": "list_series_v2_polymarket_series_get",
        "parameters": [
          {
            "name": "recurrence",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/RecurrenceOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by recurrence: daily, weekly, or monthly",
              "title": "Recurrence"
            },
            "description": "Filter by recurrence: daily, weekly, or monthly"
          },
          {
            "name": "active",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by active status (default: true)",
              "default": true,
              "title": "Active"
            },
            "description": "Filter by active status (default: true)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Number of series to return",
              "default": 50,
              "title": "Limit"
            },
            "description": "Number of series to return"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Offset for pagination",
              "default": 0,
              "title": "Offset"
            },
            "description": "Offset for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/series/{slug}": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Get Series Detail",
        "description": "A single series plus its events (keyset-paginated).\n\nThe crypto up/down feature is just a named series \u2014 e.g.\n``/series/btc-up-or-down-daily`` returns the current Bitcoin up/down events.",
        "operationId": "get_series_detail_v2_polymarket_series__slug__get",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/StatusOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter the series' events by status",
              "title": "Status"
            },
            "description": "Filter the series' events by status"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Number of events to return",
              "default": 50,
              "title": "Limit"
            },
            "description": "Number of events to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor returned from the previous response",
              "title": "Pagination Key"
            },
            "description": "Cursor returned from the previous response"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/categories": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "List Categories",
        "description": "Top-level categories with market counts + active volume/OI, by activity.",
        "operationId": "list_categories_v2_polymarket_categories_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v2/polymarket/search": {
      "get": {
        "tags": [
          "polymarket"
        ],
        "summary": "Unified Search",
        "description": "Cross-surface search over markets, events, and tags (grouped results).",
        "operationId": "unified_search_v2_polymarket_search_get",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "Search query",
              "title": "Q"
            },
            "description": "Search query"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 50,
              "minimum": 1,
              "description": "Max results per type",
              "default": 10,
              "title": "Limit"
            },
            "description": "Max results per type"
          },
          {
            "name": "types",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated subset of: markets,events,tags (default all)",
              "title": "Types"
            },
            "description": "Comma-separated subset of: markets,events,tags (default all)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/kalshi/markets": {
      "get": {
        "tags": [
          "kalshi"
        ],
        "summary": "Get Kalshi Markets",
        "description": "List Kalshi markets with filtering and sorting.\n\nReturns markets from the Kalshi prediction market platform with support for:\n- Status filtering (open, closed)\n- Price range filtering (0-100 scale)\n- Volume and open interest thresholds\n- Text search in titles\n- Filtering by ticker, event ticker, or series ticker\n- Multiple sort options\n- Cursor-based pagination via pagination_key\n\nPrices are returned as decimals (0-1) for API consistency.",
        "operationId": "get_kalshi_markets_v2_kalshi_markets_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/StatusOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status: open or closed",
              "title": "Status"
            },
            "description": "Filter by status: open or closed"
          },
          {
            "name": "min_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 100,
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum last price (0-100)",
              "title": "Min Price"
            },
            "description": "Minimum last price (0-100)"
          },
          {
            "name": "max_price",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 100,
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Maximum last price (0-100)",
              "title": "Max Price"
            },
            "description": "Maximum last price (0-100)"
          },
          {
            "name": "min_open_interest",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum dollar open interest",
              "title": "Min Open Interest"
            },
            "description": "Minimum dollar open interest"
          },
          {
            "name": "min_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum dollar volume",
              "title": "Min Volume"
            },
            "description": "Minimum dollar volume"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search in title (minimum 3 characters)",
              "title": "Search"
            },
            "description": "Search in title (minimum 3 characters)"
          },
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by ticker(s)",
              "title": "Ticker"
            },
            "description": "Filter by ticker(s)"
          },
          {
            "name": "event_ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event ticker(s)",
              "title": "Event Ticker"
            },
            "description": "Filter by event ticker(s)"
          },
          {
            "name": "series_ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by series ticker(s)",
              "title": "Series Ticker"
            },
            "description": "Filter by series ticker(s)"
          },
          {
            "name": "predexon_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by predexon ID(s)",
              "title": "Predexon Id"
            },
            "description": "Filter by predexon ID(s)"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/app__api__v1__kalshi__markets_list__SortOption",
              "description": "Sort by",
              "default": "volume"
            },
            "description": "Sort by"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Number of markets to return",
              "default": 20,
              "title": "Limit"
            },
            "description": "Number of markets to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for next page (from previous response)",
              "title": "Pagination Key"
            },
            "description": "Cursor for next page (from previous response)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KalshiMarketsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/kalshi/trades": {
      "get": {
        "tags": [
          "kalshi"
        ],
        "summary": "Get Kalshi Trades",
        "description": "Fetch historical Kalshi trade data.\n\nReturns trades from the Kalshi prediction market with support for:\n- Filtering by ticker (exact match) or event_ticker (prefix match)\n- Time range filtering\n- Taker side filtering (yes/no)\n- Minimum contract count filtering\n- Cursor-based pagination\n\nAt least one of `ticker` or `event_ticker` must be provided.",
        "operationId": "get_kalshi_trades_v2_kalshi_trades_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market ticker",
              "title": "Ticker"
            },
            "description": "Filter by market ticker"
          },
          {
            "name": "event_ticker",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event ticker (prefix match)",
              "title": "Event Ticker"
            },
            "description": "Filter by event ticker (prefix match)"
          },
          {
            "name": "taker_side",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/KalshiTakerSide"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by taker side: yes or no",
              "title": "Taker Side"
            },
            "description": "Filter by taker side: yes or no"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for start",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for start"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for end",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for end"
          },
          {
            "name": "min_count",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum contract count",
              "title": "Min Count"
            },
            "description": "Minimum contract count"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "description": "Number of trades to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Number of trades to return"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/OrderDirection",
              "description": "Sort order: asc or desc",
              "default": "desc"
            },
            "description": "Sort order: asc or desc"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for pagination",
              "title": "Pagination Key"
            },
            "description": "Cursor for pagination"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KalshiTradesResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/kalshi/orderbooks": {
      "get": {
        "tags": [
          "kalshi"
        ],
        "summary": "Get Kalshi Orderbooks",
        "description": "Fetch historical orderbook snapshots for a Kalshi market over a specified time range.\n\nReturns snapshots of the order book including yes bids, yes asks, and market metadata.\nAll timestamps are in milliseconds. Prices are in cents (1-99 representing $0.01 to $0.99).",
        "operationId": "get_kalshi_orderbooks_v2_kalshi_orderbooks_get",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The Kalshi market ticker",
              "title": "Ticker"
            },
            "description": "The Kalshi market ticker"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Start time in Unix timestamp (milliseconds)",
              "title": "Start Time"
            },
            "description": "Start time in Unix timestamp (milliseconds)"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "End time in Unix timestamp (milliseconds)",
              "title": "End Time"
            },
            "description": "End time in Unix timestamp (milliseconds)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 2000,
              "minimum": 1,
              "description": "Maximum number of snapshots to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of snapshots to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pagination key to get the next chunk of data",
              "title": "Pagination Key"
            },
            "description": "Pagination key to get the next chunk of data"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KalshiOrderbooksResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/binance/ticks/{symbol}": {
      "get": {
        "tags": [
          "binance"
        ],
        "summary": "Get Binance Ticks",
        "description": "Fetch raw book ticker data at microsecond granularity.\n\nReturns bid/ask/mid/spread for each tick. Use cursor-based pagination\nto iterate through large time ranges (e.g. a 15m window is ~63K ticks).",
        "operationId": "get_binance_ticks_v2_binance_ticks__symbol__get",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/BinanceSymbol",
              "description": "Trading pair"
            },
            "description": "Trading pair"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Unix timestamp (seconds) for range start",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for range start"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Unix timestamp (seconds) for range end",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for range end"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 10000,
              "minimum": 1,
              "description": "Max ticks per page",
              "default": 10000,
              "title": "Limit"
            },
            "description": "Max ticks per page"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for next page",
              "title": "Pagination Key"
            },
            "description": "Cursor for next page"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BinanceTicksResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/binance/candles/{symbol}": {
      "get": {
        "tags": [
          "binance"
        ],
        "summary": "Get Binance Candles",
        "description": "Fetch OHLCV candlestick data for a Binance trading pair.\n\nCandle prices are derived from book ticker mid-prices (not trade prices).\n\n**Backtesting crypto up/down markets:**\n- Use `interval=15m` for 15-minute prediction markets\n- Use `interval=1h` for 1-hour prediction markets\n- Use `interval=4h` and `interval=1d` for longer timeframes",
        "operationId": "get_binance_candles_v2_binance_candles__symbol__get",
        "parameters": [
          {
            "name": "symbol",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/BinanceSymbol",
              "description": "Trading pair"
            },
            "description": "Trading pair"
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/BinanceInterval",
              "description": "Candle interval",
              "default": "1m"
            },
            "description": "Candle interval"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for range start",
              "title": "Start Time"
            },
            "description": "Unix timestamp (seconds) for range start"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Unix timestamp (seconds) for range end",
              "title": "End Time"
            },
            "description": "Unix timestamp (seconds) for range end"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1500,
              "minimum": 1,
              "description": "Max candles to return",
              "default": 500,
              "title": "Limit"
            },
            "description": "Max candles to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BinanceCandlesResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/limitless/markets": {
      "get": {
        "tags": [
          "limitless"
        ],
        "summary": "Get Limitless Markets",
        "description": "List Limitless markets with filtering and sorting.\n\nReturns markets from the Limitless prediction market platform with support for:\n- Status filtering (open, closed)\n- Trade type filtering (amm, clob)\n- Text search in titles\n- Category and tag filtering\n- Volume and open interest thresholds\n- Multiple sort options\n- Cursor-based pagination via pagination_key\n\nPrices are normalized to 0-1 range.",
        "operationId": "get_limitless_markets_v2_limitless_markets_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/StatusOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status: open or closed",
              "title": "Status"
            },
            "description": "Filter by status: open or closed"
          },
          {
            "name": "trade_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/TradeTypeOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by trade type: amm or clob",
              "title": "Trade Type"
            },
            "description": "Filter by trade type: amm or clob"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search in title (minimum 3 characters)",
              "title": "Search"
            },
            "description": "Search in title (minimum 3 characters)"
          },
          {
            "name": "categories",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by category(s)",
              "title": "Categories"
            },
            "description": "Filter by category(s)"
          },
          {
            "name": "tags",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by tag(s)",
              "title": "Tags"
            },
            "description": "Filter by tag(s)"
          },
          {
            "name": "min_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum volume (USD)",
              "title": "Min Volume"
            },
            "description": "Minimum volume (USD)"
          },
          {
            "name": "min_open_interest",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum open interest (USD)",
              "title": "Min Open Interest"
            },
            "description": "Minimum open interest (USD)"
          },
          {
            "name": "condition_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by condition ID(s)",
              "title": "Condition Id"
            },
            "description": "Filter by condition ID(s)"
          },
          {
            "name": "market_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market slug(s)",
              "title": "Market Slug"
            },
            "description": "Filter by market slug(s)"
          },
          {
            "name": "predexon_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by predexon ID(s)",
              "title": "Predexon Id"
            },
            "description": "Filter by predexon ID(s)"
          },
          {
            "name": "token_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by token ID(s)",
              "title": "Token Id"
            },
            "description": "Filter by token ID(s)"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/app__api__v1__limitless__markets_list__SortOption",
              "description": "Sort by",
              "default": "volume"
            },
            "description": "Sort by"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Number of markets to return",
              "default": 20,
              "title": "Limit"
            },
            "description": "Number of markets to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for next page (from previous response)",
              "title": "Pagination Key"
            },
            "description": "Cursor for next page (from previous response)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LimitlessMarketsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/limitless/orderbooks": {
      "get": {
        "tags": [
          "limitless"
        ],
        "summary": "Get Limitless Orderbooks",
        "description": "Fetch historical orderbook snapshots for a Limitless market over a specified time range.\n\nReturns YES-side orderbook snapshots. To derive the NO orderbook,\ninvert client-side: flip bids/asks and transform prices to 1 - price.\nAll timestamps are in milliseconds.",
        "operationId": "get_limitless_orderbooks_v2_limitless_orderbooks_get",
        "parameters": [
          {
            "name": "market_slug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "The Limitless market slug",
              "title": "Market Slug"
            },
            "description": "The Limitless market slug"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Start time in Unix timestamp (milliseconds)",
              "title": "Start Time"
            },
            "description": "Start time in Unix timestamp (milliseconds)"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "End time in Unix timestamp (milliseconds)",
              "title": "End Time"
            },
            "description": "End time in Unix timestamp (milliseconds)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Maximum number of snapshots to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of snapshots to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pagination key to get the next chunk of data",
              "title": "Pagination Key"
            },
            "description": "Pagination key to get the next chunk of data"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LimitlessOrderbooksResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/opinion/markets": {
      "get": {
        "tags": [
          "opinion"
        ],
        "summary": "Get Opinion Markets",
        "description": "List Opinion markets with filtering and sorting.\n\nReturns tradeable markets (standalone binaries + categorical outcomes).\nCategorical parent markets are excluded \u2014 use event_id or event_slug to\nquery all outcomes under a categorical grouping.\n\nPrices in outcomes are currently null (future: from WebSocket/orderbook).",
        "operationId": "get_opinion_markets_v2_opinion_markets_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/StatusOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status: open or closed",
              "title": "Status"
            },
            "description": "Filter by status: open or closed"
          },
          {
            "name": "market_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/MarketTypeOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market type: binary or categorical",
              "title": "Market Type"
            },
            "description": "Filter by market type: binary or categorical"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search in title (minimum 3 characters)",
              "title": "Search"
            },
            "description": "Search in title (minimum 3 characters)"
          },
          {
            "name": "labels",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by label(s)",
              "title": "Labels"
            },
            "description": "Filter by label(s)"
          },
          {
            "name": "min_volume",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum total volume (USD)",
              "title": "Min Volume"
            },
            "description": "Minimum total volume (USD)"
          },
          {
            "name": "condition_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by condition ID(s)",
              "title": "Condition Id"
            },
            "description": "Filter by condition ID(s)"
          },
          {
            "name": "market_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market slug(s)",
              "title": "Market Slug"
            },
            "description": "Filter by market slug(s)"
          },
          {
            "name": "market_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market ID(s)",
              "title": "Market Id"
            },
            "description": "Filter by market ID(s)"
          },
          {
            "name": "predexon_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by predexon ID(s)",
              "title": "Predexon Id"
            },
            "description": "Filter by predexon ID(s)"
          },
          {
            "name": "token_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by token ID(s)",
              "title": "Token Id"
            },
            "description": "Filter by token ID(s)"
          },
          {
            "name": "event_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event/parent market ID(s)",
              "title": "Event Id"
            },
            "description": "Filter by event/parent market ID(s)"
          },
          {
            "name": "event_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event slug(s)",
              "title": "Event Slug"
            },
            "description": "Filter by event slug(s)"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/app__api__v1__opinion__markets_list__SortOption",
              "description": "Sort by",
              "default": "volume"
            },
            "description": "Sort by"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Number of markets to return",
              "default": 20,
              "title": "Limit"
            },
            "description": "Number of markets to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for next page (from previous response)",
              "title": "Pagination Key"
            },
            "description": "Cursor for next page (from previous response)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpinionMarketsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/opinion/orderbooks": {
      "get": {
        "tags": [
          "opinion"
        ],
        "summary": "Get Opinion Orderbooks",
        "description": "Fetch historical orderbook snapshots for an Opinion market over a specified time range.\n\nReturns YES-side orderbook snapshots. To derive the NO orderbook,\ninvert client-side: flip bids/asks and transform prices to 1 - price.\nAll timestamps are in milliseconds.",
        "operationId": "get_opinion_orderbooks_v2_opinion_orderbooks_get",
        "parameters": [
          {
            "name": "market_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "The Opinion market ID",
              "title": "Market Id"
            },
            "description": "The Opinion market ID"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Start time in Unix timestamp (milliseconds)",
              "title": "Start Time"
            },
            "description": "Start time in Unix timestamp (milliseconds)"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "End time in Unix timestamp (milliseconds)",
              "title": "End Time"
            },
            "description": "End time in Unix timestamp (milliseconds)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Maximum number of snapshots to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of snapshots to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pagination key to get the next chunk of data",
              "title": "Pagination Key"
            },
            "description": "Pagination key to get the next chunk of data"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpinionOrderbooksResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/predictfun/markets": {
      "get": {
        "tags": [
          "predictfun"
        ],
        "summary": "Get Predict Markets",
        "description": "List Predict.fun markets with filtering and sorting.\n\nReturns markets from the Predict.fun prediction market platform with support for:\n- Status filtering (open, closed)\n- Market variant filtering (DEFAULT, CRYPTO_UP_DOWN, SPORTS_TEAM_MATCH, etc.)\n- Text search in titles\n- Bid depth thresholds\n- Filtering by condition_id, slug, market_id, token_id, event_slug\n- Multiple sort options\n- Cursor-based pagination via pagination_key\n\nMarkets sharing the same slug belong to the same event (e.g. \"2026-nba-champion\").\nUse event_slug to query all outcomes under an event.",
        "operationId": "get_predict_markets_v2_predictfun_markets_get",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/StatusOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status: open or closed",
              "title": "Status"
            },
            "description": "Filter by status: open or closed"
          },
          {
            "name": "market_variant",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/MarketVariantOption"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market variant: DEFAULT, CRYPTO_UP_DOWN, SPORTS_TEAM_MATCH, SPORTS_MATCH, TWEET_COUNT",
              "title": "Market Variant"
            },
            "description": "Filter by market variant: DEFAULT, CRYPTO_UP_DOWN, SPORTS_TEAM_MATCH, SPORTS_MATCH, TWEET_COUNT"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search in title (minimum 3 characters)",
              "title": "Search"
            },
            "description": "Search in title (minimum 3 characters)"
          },
          {
            "name": "min_bid_depth",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "number",
                  "minimum": 0.0
                },
                {
                  "type": "null"
                }
              ],
              "description": "Minimum bid depth",
              "title": "Min Bid Depth"
            },
            "description": "Minimum bid depth"
          },
          {
            "name": "condition_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by condition ID(s)",
              "title": "Condition Id"
            },
            "description": "Filter by condition ID(s)"
          },
          {
            "name": "market_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market slug(s)",
              "title": "Market Slug"
            },
            "description": "Filter by market slug(s)"
          },
          {
            "name": "market_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "integer"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by market ID(s)",
              "title": "Market Id"
            },
            "description": "Filter by market ID(s)"
          },
          {
            "name": "token_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by token ID(s)",
              "title": "Token Id"
            },
            "description": "Filter by token ID(s)"
          },
          {
            "name": "predexon_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by predexon ID(s)",
              "title": "Predexon Id"
            },
            "description": "Filter by predexon ID(s)"
          },
          {
            "name": "event_slug",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by event slug(s) \u2014 returns all outcomes under that event",
              "title": "Event Slug"
            },
            "description": "Filter by event slug(s) \u2014 returns all outcomes under that event"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/app__api__v1__predictfun__markets_list__SortOption",
              "description": "Sort by",
              "default": "created"
            },
            "description": "Sort by"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Number of markets to return",
              "default": 20,
              "title": "Limit"
            },
            "description": "Number of markets to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Cursor for next page (from previous response)",
              "title": "Pagination Key"
            },
            "description": "Cursor for next page (from previous response)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PredictMarketsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v2/predictfun/orderbooks": {
      "get": {
        "tags": [
          "predictfun"
        ],
        "summary": "Get Predictfun Orderbooks",
        "description": "Fetch historical orderbook snapshots for a PredictFun market over a specified time range.\n\nReturns orderbook snapshots including bids, asks, and depth metadata.\nAll timestamps are in milliseconds.",
        "operationId": "get_predictfun_orderbooks_v2_predictfun_orderbooks_get",
        "parameters": [
          {
            "name": "market_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "The PredictFun market ID",
              "title": "Market Id"
            },
            "description": "The PredictFun market ID"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Start time in Unix timestamp (milliseconds)",
              "title": "Start Time"
            },
            "description": "Start time in Unix timestamp (milliseconds)"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "End time in Unix timestamp (milliseconds)",
              "title": "End Time"
            },
            "description": "End time in Unix timestamp (milliseconds)"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Maximum number of snapshots to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum number of snapshots to return"
          },
          {
            "name": "pagination_key",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pagination key to get the next chunk of data",
              "title": "Pagination Key"
            },
            "description": "Pagination key to get the next chunk of data"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PredictFunOrderbooksResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/": {
      "get": {
        "summary": "Root",
        "description": "Root endpoint with API information.",
        "operationId": "root__get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RootResponse"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Health Check",
        "description": "Health check endpoint for Cloud Run.",
        "operationId": "health_check_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/metrics/live": {
      "get": {
        "summary": "Metrics Live",
        "description": "Real-time per-pod latency and concurrency metrics (5-minute rolling window).",
        "operationId": "metrics_live_metrics_live_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v2/data/ticks": {
      "get": {
        "tags": [
          "data"
        ],
        "summary": "Download Tick Data",
        "description": "Download raw, tick-level history as signed Apache Parquet URLs. Returns a list of Parquet **parts** (each with its row/byte counts and ID/time coverage range) plus the dataset schema. Feed the signed URLs into your own DuckDB, Polars, pandas, or Spark.\n\n**Releasing soon** \u2014 this dataset is in a gated private preview and is not yet reachable with a standard API key.\n\nFinalized data only: raw ticks are compacted daily at 06:00 UTC, so requests for today/future (or any day without a manifest) return `404 not_final`. Pick the day(s) with exactly one of `date`, `start_date`+`end_date`, or `start_time`+`end_time` (epoch ms). Signed URLs expire after ~1 hour.",
        "operationId": "get_ticks_v2_data_ticks_get",
        "parameters": [
          {
            "name": "venue",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "polymarket",
                "kalshi",
                "opinion"
              ],
              "description": "Dataset key.",
              "title": "Venue"
            },
            "description": "Dataset key: `polymarket` (CLOB price changes), `kalshi`, or `opinion` (orderbook deltas)."
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Single UTC day, YYYY-MM-DD.",
              "title": "Date"
            },
            "description": "Single UTC day, YYYY-MM-DD."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Range start, YYYY-MM-DD (pair with end_date).",
              "title": "Start Date"
            },
            "description": "Range start, YYYY-MM-DD (pair with end_date)."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Range end, YYYY-MM-DD (inclusive).",
              "title": "End Date"
            },
            "description": "Range end, YYYY-MM-DD (inclusive)."
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Window start, epoch ms UTC. Selects/derives days and prunes parts by ts range.",
              "title": "Start Time"
            },
            "description": "Window start, epoch ms UTC. Selects/derives days and prunes parts by ts range."
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Window end, epoch ms UTC (inclusive).",
              "title": "End Time"
            },
            "description": "Window end, epoch ms UTC (inclusive)."
          },
          {
            "name": "market_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Prune to the part(s) covering this market/ticker.",
              "title": "Market Id"
            },
            "description": "Prune to the part(s) covering this market/ticker."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TicksResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad or missing parameters (invalid venue, range, or params).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "`not_final` (day not compacted yet) or `not_found` (no data for venue/date/market).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v2/data/ticks/query": {
      "get": {
        "tags": [
          "data"
        ],
        "summary": "Query Tick Data",
        "description": "Run a server-side DuckDB query over the pruned Parquet parts and return JSON rows \u2014 for targeted pulls (one market, a bounded window) where you want rows instead of files. No storage URL is exposed to the caller; column/row/time limits are enforced server-side.\n\n**Releasing soon** \u2014 this dataset is in a gated private preview and is not yet reachable with a standard API key.\n\n`market_id`, `start_time`, and `end_time` are all required (Parquet is sorted by ID, so a market plus a bounded window keeps each query cheap). Default `limit` 10000, hard-capped at 100000.",
        "operationId": "query_ticks_v2_data_ticks_query_get",
        "parameters": [
          {
            "name": "venue",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "polymarket",
                "kalshi",
                "opinion"
              ],
              "description": "Dataset key.",
              "title": "Venue"
            },
            "description": "Dataset key: `polymarket` (CLOB price changes), `kalshi`, or `opinion` (orderbook deltas)."
          },
          {
            "name": "market_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Market / ticker to query.",
              "title": "Market Id"
            },
            "description": "Market / ticker to query."
          },
          {
            "name": "start_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Window start, epoch ms UTC. Filters rows with ts >= start_time.",
              "title": "Start Time"
            },
            "description": "Window start, epoch ms UTC. Filters rows with ts >= start_time."
          },
          {
            "name": "end_time",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "description": "Window end, epoch ms UTC (inclusive).",
              "title": "End Time"
            },
            "description": "Window end, epoch ms UTC (inclusive)."
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "UTC day override, YYYY-MM-DD (window still filters rows).",
              "title": "Date"
            },
            "description": "UTC day override, YYYY-MM-DD (window still filters rows)."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Range start override, YYYY-MM-DD.",
              "title": "Start Date"
            },
            "description": "Range start override, YYYY-MM-DD."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Range end override, YYYY-MM-DD (inclusive).",
              "title": "End Date"
            },
            "description": "Range end override, YYYY-MM-DD (inclusive)."
          },
          {
            "name": "columns",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated subset of columns to return.",
              "title": "Columns"
            },
            "description": "Comma-separated subset of columns to return."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Max rows (hard-capped at 100000).",
              "title": "Limit",
              "default": 10000,
              "maximum": 100000,
              "minimum": 1
            },
            "description": "Max rows (hard-capped at 100000)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TickQueryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad or missing parameters (invalid venue/columns, window too large).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "`not_final` (day not compacted yet) or `not_found` (no data for that market/date).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "`query_timeout` \u2014 query exceeded the time limit; narrow the window or columns.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "KalshiOrderbooksV2Response": {
        "properties": {
          "snapshots": {
            "items": {
              "$ref": "#/components/schemas/KalshiOrderbookSnapshotV2"
            },
            "type": "array",
            "title": "Snapshots"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "snapshots",
          "pagination"
        ],
        "title": "KalshiOrderbooksV2Response",
        "description": "Sub-cent Kalshi orderbooks endpoint response."
      },
      "KalshiOrderbookSnapshotV2": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker",
            "description": "Market ticker"
          },
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Snapshot timestamp in milliseconds"
          },
          "yes_bids": {
            "items": {
              "$ref": "#/components/schemas/KalshiOrderbookLevelV2"
            },
            "type": "array",
            "title": "Yes Bids",
            "description": "Yes bid levels, ordered by price descending"
          },
          "yes_asks": {
            "items": {
              "$ref": "#/components/schemas/KalshiOrderbookLevelV2"
            },
            "type": "array",
            "title": "Yes Asks",
            "description": "Yes ask levels, ordered by price ascending"
          },
          "best_bid": {
            "type": "string",
            "title": "Best Bid",
            "description": "Best bid price in decimal cents, fixed 2 decimals as a string (e.g. \"36.50\")"
          },
          "best_ask": {
            "type": "string",
            "title": "Best Ask",
            "description": "Best ask price in decimal cents, fixed 2 decimals as a string (e.g. \"37.00\")"
          },
          "bid_depth": {
            "type": "integer",
            "title": "Bid Depth",
            "description": "Total bid depth (number of contracts)"
          },
          "ask_depth": {
            "type": "integer",
            "title": "Ask Depth",
            "description": "Total ask depth (number of contracts)"
          },
          "sequence": {
            "type": "integer",
            "title": "Sequence",
            "description": "Sequence number for ordering within same timestamp"
          },
          "source": {
            "type": "string",
            "title": "Source",
            "description": "Origin of this snapshot within the capture pipeline: \"websocket\"/\"api\" (the primary spine) or \"live_early\" (trade-triggered early capture of brand-new markets)."
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "timestamp",
          "yes_bids",
          "yes_asks",
          "best_bid",
          "best_ask",
          "bid_depth",
          "ask_depth",
          "sequence",
          "source"
        ],
        "title": "KalshiOrderbookSnapshotV2",
        "description": "Single sub-cent Kalshi orderbook snapshot."
      },
      "KalshiOrderbookLevelV2": {
        "properties": {
          "price": {
            "type": "string",
            "title": "Price",
            "description": "Price in decimal cents as a string (e.g. \"36.50\")"
          },
          "size": {
            "type": "string",
            "title": "Size",
            "description": "Quantity at this price level as an exact string; may be fractional (e.g. \"196.52\")"
          }
        },
        "type": "object",
        "required": [
          "price",
          "size"
        ],
        "title": "KalshiOrderbookLevelV2",
        "description": "Single price level in a sub-cent Kalshi orderbook.\n\nUnlike the integer-cent endpoint, prices are decimal-cent strings\n(e.g. \"36.50\") to preserve sub-cent precision and exact scale."
      },
      "Activity": {
        "properties": {
          "side": {
            "$ref": "#/components/schemas/ActivitySide"
          },
          "market_slug": {
            "type": "string",
            "title": "Market Slug"
          },
          "market_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Id",
            "description": "Gamma market row id (numeric string). Populated for SPLIT/MERGE/REDEEM. Null for CONVERT \u2014 see `neg_risk_market_id` instead."
          },
          "neg_risk_market_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Neg Risk Market Id",
            "description": "NegRisk parent market identifier (32-byte hex). Matches Gamma's `Event.negRiskMarketID`. Populated only for CONVERT rows."
          },
          "condition_id": {
            "type": "string",
            "title": "Condition Id",
            "description": "CTF condition ID for SPLIT/MERGE/REDEEM (per-outcome). Empty string for CONVERT \u2014 conversions are market-level, so use `neg_risk_market_id`."
          },
          "index_set": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Index Set",
            "description": "NegRisk indexSet bitmask (decimal string) \u2014 which outcomes were involved. Populated only for CONVERT rows; null for other sides."
          },
          "shares": {
            "type": "integer",
            "title": "Shares",
            "description": "Raw number of shares from blockchain"
          },
          "shares_normalized": {
            "type": "number",
            "title": "Shares Normalized",
            "description": "Shares normalized (raw / 1000000)"
          },
          "amount_usd": {
            "type": "number",
            "title": "Amount Usd",
            "description": "USD value of the activity"
          },
          "price": {
            "type": "number",
            "title": "Price"
          },
          "tx_hash": {
            "type": "string",
            "title": "Tx Hash"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Unix timestamp in seconds"
          },
          "user": {
            "type": "string",
            "title": "User",
            "description": "User wallet address"
          }
        },
        "type": "object",
        "required": [
          "side",
          "market_slug",
          "condition_id",
          "shares",
          "shares_normalized",
          "amount_usd",
          "price",
          "tx_hash",
          "title",
          "timestamp",
          "user"
        ],
        "title": "Activity",
        "description": "Activity model."
      },
      "ActivityResponse": {
        "properties": {
          "activities": {
            "items": {
              "$ref": "#/components/schemas/Activity"
            },
            "type": "array",
            "title": "Activities"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "activities",
          "pagination"
        ],
        "title": "ActivityResponse",
        "description": "Activity endpoint response."
      },
      "ActivitySide": {
        "type": "string",
        "enum": [
          "MERGE",
          "SPLIT",
          "REDEEM",
          "CONVERT"
        ],
        "title": "ActivitySide",
        "description": "Activity side enum."
      },
      "ActivitySortBy": {
        "type": "string",
        "enum": [
          "timestamp",
          "type"
        ],
        "title": "ActivitySortBy",
        "description": "Sort options for activity."
      },
      "AllPositionsOrderBy": {
        "type": "string",
        "enum": [
          "block",
          "timestamp"
        ],
        "title": "AllPositionsOrderBy",
        "description": "Order by options for all-user positions streaming endpoint."
      },
      "AllPositionsResponse": {
        "properties": {
          "positions": {
            "items": {
              "$ref": "#/components/schemas/AllUsersPosition"
            },
            "type": "array",
            "title": "Positions",
            "description": "Position records"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "positions",
          "pagination"
        ],
        "title": "AllPositionsResponse",
        "description": "Response for all-user positions endpoint."
      },
      "AllTimeMetrics": {
        "properties": {
          "realized_pnl": {
            "type": "number",
            "title": "Realized Pnl",
            "description": "Realized profit/loss in USD (from closed positions)"
          },
          "total_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Pnl",
            "description": "Total PnL in USD (realized + unrealized - net fees)"
          },
          "volume": {
            "type": "number",
            "title": "Volume",
            "description": "Trading volume in USD"
          },
          "roi": {
            "type": "number",
            "title": "Roi",
            "description": "Return on investment (decimal, e.g., 0.5 = 50%)"
          },
          "trades": {
            "type": "integer",
            "title": "Trades",
            "description": "Number of trades"
          },
          "wins": {
            "type": "integer",
            "title": "Wins",
            "description": "Number of winning positions closed"
          },
          "losses": {
            "type": "integer",
            "title": "Losses",
            "description": "Number of losing positions closed"
          },
          "win_rate": {
            "type": "number",
            "title": "Win Rate",
            "description": "Win rate (decimal, e.g., 0.6 = 60%)"
          },
          "profit_factor": {
            "type": "number",
            "title": "Profit Factor",
            "description": "Profit factor (gross profit / gross loss)"
          },
          "positions_closed": {
            "type": "integer",
            "title": "Positions Closed",
            "description": "Number of positions closed"
          },
          "avg_buy_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Buy Price",
            "description": "Volume-weighted average buy price (YES-adjusted, 0-1)"
          },
          "avg_sell_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Sell Price",
            "description": "Volume-weighted average sell price (YES-adjusted, 0-1)"
          },
          "fees_paid": {
            "type": "number",
            "title": "Fees Paid",
            "description": "Taker fees paid in USD",
            "default": 0.0
          },
          "fees_refunded": {
            "type": "number",
            "title": "Fees Refunded",
            "description": "DEPRECATED: always 0. Refunds are already netted into fees_paid.",
            "default": 0.0
          },
          "avg_hold_time_seconds": {
            "type": "number",
            "title": "Avg Hold Time Seconds",
            "description": "Average hold time in seconds"
          },
          "wallet_age_days": {
            "type": "integer",
            "title": "Wallet Age Days",
            "description": "Days since first trade"
          },
          "total_positions": {
            "type": "integer",
            "title": "Total Positions",
            "description": "Total token positions ever opened (YES and NO counted separately)"
          },
          "active_positions": {
            "type": "integer",
            "title": "Active Positions",
            "description": "Number of currently open positions"
          },
          "max_win_streak": {
            "type": "integer",
            "title": "Max Win Streak",
            "description": "Maximum consecutive wins"
          },
          "max_loss_streak": {
            "type": "integer",
            "title": "Max Loss Streak",
            "description": "Maximum consecutive losses"
          },
          "best_position_realized_pnl": {
            "type": "number",
            "title": "Best Position Realized Pnl",
            "description": "Best single position realized PnL in USD"
          },
          "worst_position_realized_pnl": {
            "type": "number",
            "title": "Worst Position Realized Pnl",
            "description": "Worst single position realized PnL in USD"
          }
        },
        "type": "object",
        "required": [
          "realized_pnl",
          "volume",
          "roi",
          "trades",
          "wins",
          "losses",
          "win_rate",
          "profit_factor",
          "positions_closed",
          "avg_hold_time_seconds",
          "wallet_age_days",
          "total_positions",
          "active_positions",
          "max_win_streak",
          "max_loss_streak",
          "best_position_realized_pnl",
          "worst_position_realized_pnl"
        ],
        "title": "AllTimeMetrics",
        "description": "Extended metrics available only for all-time window."
      },
      "AllUsersPosition": {
        "properties": {
          "user": {
            "type": "string",
            "title": "User",
            "description": "Wallet address"
          },
          "market": {
            "$ref": "#/components/schemas/PositionMarketInfo"
          },
          "position": {
            "$ref": "#/components/schemas/PositionDetails"
          },
          "current": {
            "$ref": "#/components/schemas/PositionCurrentState"
          },
          "pnl": {
            "$ref": "#/components/schemas/PositionPnL"
          },
          "last_updated_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Updated At",
            "description": "Unix timestamp of last position update"
          },
          "last_updated_block": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Updated Block",
            "description": "Block number of last position update"
          }
        },
        "type": "object",
        "required": [
          "user",
          "market",
          "position",
          "current",
          "pnl"
        ],
        "title": "AllUsersPosition",
        "description": "Position with user info for all-users endpoint (same format as wallet/positions)."
      },
      "BinanceCandleData": {
        "properties": {
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Unix timestamp (seconds) at period start"
          },
          "open": {
            "type": "number",
            "title": "Open",
            "description": "Opening mid-price in USDT"
          },
          "high": {
            "type": "number",
            "title": "High",
            "description": "Highest mid-price in USDT"
          },
          "low": {
            "type": "number",
            "title": "Low",
            "description": "Lowest mid-price in USDT"
          },
          "close": {
            "type": "number",
            "title": "Close",
            "description": "Closing mid-price in USDT"
          },
          "tick_count": {
            "type": "integer",
            "title": "Tick Count",
            "description": "Number of book ticker updates in this candle"
          },
          "avg_spread": {
            "type": "number",
            "title": "Avg Spread",
            "description": "Average bid-ask spread over this candle"
          }
        },
        "type": "object",
        "required": [
          "timestamp",
          "open",
          "high",
          "low",
          "close",
          "tick_count",
          "avg_spread"
        ],
        "title": "BinanceCandleData",
        "description": "Single OHLCV candlestick derived from book ticker mid-prices.\n\nOpen/high/low/close reflect the mid-price (not trade price).\ntick_count indicates market activity density within the candle.",
        "examples": [
          {
            "avg_spread": 0.1,
            "close": 103275.3,
            "high": 103300.5,
            "low": 103200.0,
            "open": 103250.12,
            "tick_count": 15420,
            "timestamp": 1706745600
          }
        ]
      },
      "BinanceCandlesResponse": {
        "properties": {
          "symbol": {
            "type": "string",
            "title": "Symbol",
            "description": "Trading pair (e.g. BTCUSDT)"
          },
          "interval": {
            "type": "string",
            "title": "Interval",
            "description": "Candle interval (e.g. 15m, 1h)"
          },
          "candles": {
            "items": {
              "$ref": "#/components/schemas/BinanceCandleData"
            },
            "type": "array",
            "title": "Candles",
            "description": "Array of candles, ordered by timestamp ASC"
          }
        },
        "type": "object",
        "required": [
          "symbol",
          "interval",
          "candles"
        ],
        "title": "BinanceCandlesResponse",
        "description": "OHLCV candlestick response for a Binance trading pair.\n\nIntervals 1s and 1m are served from pre-aggregated materialized views.\nLarger intervals (5m, 15m, 1h, 4h, 1d) are aggregated on-the-fly from 1m data."
      },
      "BinanceInterval": {
        "type": "string",
        "enum": [
          "1s",
          "1m",
          "5m",
          "15m",
          "1h",
          "4h",
          "1d"
        ],
        "title": "BinanceInterval",
        "description": "Candlestick intervals aligned with crypto up/down market timeframes.\n\n- 1s, 1m: high-resolution data from pre-aggregated tables\n- 5m, 15m, 1h, 4h, 1d: aggregated on-the-fly from 1m candles"
      },
      "BinanceSymbol": {
        "type": "string",
        "enum": [
          "BTCUSDT",
          "ETHUSDT",
          "SOLUSDT",
          "XRPUSDT"
        ],
        "title": "BinanceSymbol",
        "description": "Supported Binance trading pairs for crypto up/down market backtesting."
      },
      "BinanceTickData": {
        "properties": {
          "timestamp": {
            "type": "string",
            "title": "Timestamp",
            "description": "ISO 8601 UTC timestamp with microsecond precision (e.g. 2026-01-31T12:00:00.123456Z)"
          },
          "bid_price": {
            "type": "number",
            "title": "Bid Price",
            "description": "Best bid price in USDT"
          },
          "ask_price": {
            "type": "number",
            "title": "Ask Price",
            "description": "Best ask price in USDT"
          },
          "mid_price": {
            "type": "number",
            "title": "Mid Price",
            "description": "Mid price: (bid + ask) / 2"
          },
          "spread": {
            "type": "number",
            "title": "Spread",
            "description": "Bid-ask spread: ask - bid"
          },
          "bid_qty": {
            "type": "number",
            "title": "Bid Qty",
            "description": "Quantity available at best bid"
          },
          "ask_qty": {
            "type": "number",
            "title": "Ask Qty",
            "description": "Quantity available at best ask"
          }
        },
        "type": "object",
        "required": [
          "timestamp",
          "bid_price",
          "ask_price",
          "mid_price",
          "spread",
          "bid_qty",
          "ask_qty"
        ],
        "title": "BinanceTickData",
        "description": "Single book ticker tick at microsecond granularity.\n\nSourced from Binance BookTicker stream \u2014 best bid/ask with quantities\nat the moment of each update. Typically 10-26 updates per second per symbol.",
        "examples": [
          {
            "ask_price": 103250.22,
            "ask_qty": 0.412,
            "bid_price": 103250.12,
            "bid_qty": 0.523,
            "mid_price": 103250.17,
            "spread": 0.1,
            "timestamp": "2026-01-31T12:00:00.123456Z"
          }
        ]
      },
      "BinanceTicksResponse": {
        "properties": {
          "symbol": {
            "type": "string",
            "title": "Symbol",
            "description": "Trading pair (e.g. BTCUSDT)"
          },
          "ticks": {
            "items": {
              "$ref": "#/components/schemas/BinanceTickData"
            },
            "type": "array",
            "title": "Ticks",
            "description": "Array of tick data points, ordered by timestamp ASC"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "symbol",
          "ticks",
          "pagination"
        ],
        "title": "BinanceTicksResponse",
        "description": "Paginated response of raw book ticker data.\n\nUse cursor-based pagination to iterate through large time windows.\nA 15-minute window typically contains ~63K ticks per symbol."
      },
      "BuilderFeeRateHistoryEntry": {
        "properties": {
          "taker_bps": {
            "type": "integer",
            "title": "Taker Bps",
            "description": "Taker-leg fee in basis points"
          },
          "maker_bps": {
            "type": "integer",
            "title": "Maker Bps",
            "description": "Maker-leg fee in basis points"
          },
          "valid_from": {
            "type": "integer",
            "title": "Valid From",
            "description": "Unix timestamp the rate took effect"
          },
          "valid_to": {
            "type": "integer",
            "title": "Valid To",
            "description": "Unix timestamp the rate stopped applying"
          }
        },
        "type": "object",
        "required": [
          "taker_bps",
          "maker_bps",
          "valid_from",
          "valid_to"
        ],
        "title": "BuilderFeeRateHistoryEntry",
        "description": "A single taker/maker fee validity window for one builder."
      },
      "BuilderLeaderboardEntry": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank",
            "description": "Position in leaderboard, 1-indexed"
          },
          "builder_code": {
            "type": "string",
            "title": "Builder Code",
            "description": "Builder code, bytes32 hex"
          },
          "volume_usd": {
            "type": "number",
            "title": "Volume Usd",
            "description": "Attributed trade notional in USD over the window"
          },
          "builder_fee_usd": {
            "type": "number",
            "title": "Builder Fee Usd",
            "description": "Builder fee revenue in USD over the window"
          },
          "platform_fee_usd": {
            "type": "number",
            "title": "Platform Fee Usd",
            "description": "Platform fee on attributed trades"
          },
          "trade_count": {
            "type": "integer",
            "title": "Trade Count",
            "description": "Number of V2 OrderFilled rows attributed to this builder"
          },
          "unique_traders": {
            "type": "integer",
            "title": "Unique Traders",
            "description": "Unique non-internal addresses that traded via this builder"
          },
          "unique_markets": {
            "type": "integer",
            "title": "Unique Markets",
            "description": "Unique condition_ids touched"
          },
          "current_taker_bps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Taker Bps",
            "description": "Current taker bps"
          },
          "current_maker_bps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Maker Bps",
            "description": "Current maker bps"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "builder_code",
          "volume_usd",
          "builder_fee_usd",
          "platform_fee_usd",
          "trade_count",
          "unique_traders",
          "unique_markets"
        ],
        "title": "BuilderLeaderboardEntry",
        "description": "One row in the builder leaderboard."
      },
      "BuilderLeaderboardResponse": {
        "properties": {
          "window": {
            "type": "string",
            "title": "Window",
            "description": "Time window for metrics"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/BuilderLeaderboardEntry"
            },
            "type": "array",
            "title": "Entries",
            "description": "Builder leaderboard rows"
          }
        },
        "type": "object",
        "required": [
          "window",
          "entries"
        ],
        "title": "BuilderLeaderboardResponse",
        "description": "Response for builder leaderboard endpoint."
      },
      "BuilderMarketEntry": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank"
          },
          "condition_id": {
            "type": "string",
            "title": "Condition Id"
          },
          "volume_usd": {
            "type": "number",
            "title": "Volume Usd"
          },
          "builder_fee_usd": {
            "type": "number",
            "title": "Builder Fee Usd"
          },
          "trade_count": {
            "type": "integer",
            "title": "Trade Count"
          },
          "unique_traders": {
            "type": "integer",
            "title": "Unique Traders"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "condition_id",
          "volume_usd",
          "builder_fee_usd",
          "trade_count",
          "unique_traders"
        ],
        "title": "BuilderMarketEntry",
        "description": "A market attributed to a builder."
      },
      "BuilderMarketsResponse": {
        "properties": {
          "builder_code": {
            "type": "string",
            "title": "Builder Code"
          },
          "window": {
            "type": "string",
            "title": "Window"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/BuilderMarketEntry"
            },
            "type": "array",
            "title": "Entries"
          }
        },
        "type": "object",
        "required": [
          "builder_code",
          "window",
          "entries"
        ],
        "title": "BuilderMarketsResponse",
        "description": "Response for builder top-markets endpoint."
      },
      "BuilderStats": {
        "properties": {
          "builder_code": {
            "type": "string",
            "title": "Builder Code",
            "description": "Builder code, bytes32 hex"
          },
          "window": {
            "type": "string",
            "title": "Window",
            "description": "Time window for the rolling metrics"
          },
          "volume_usd": {
            "type": "number",
            "title": "Volume Usd"
          },
          "builder_fee_usd": {
            "type": "number",
            "title": "Builder Fee Usd"
          },
          "platform_fee_usd": {
            "type": "number",
            "title": "Platform Fee Usd"
          },
          "trade_count": {
            "type": "integer",
            "title": "Trade Count"
          },
          "unique_traders": {
            "type": "integer",
            "title": "Unique Traders"
          },
          "unique_markets": {
            "type": "integer",
            "title": "Unique Markets"
          },
          "current_taker_bps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Taker Bps",
            "description": "Current taker bps"
          },
          "current_maker_bps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Maker Bps",
            "description": "Current maker bps"
          },
          "first_seen_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Seen At",
            "description": "Unix timestamp of earliest attributed fill"
          },
          "last_seen_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Seen At",
            "description": "Unix timestamp of latest attributed fill"
          },
          "fee_rate_history": {
            "items": {
              "$ref": "#/components/schemas/BuilderFeeRateHistoryEntry"
            },
            "type": "array",
            "title": "Fee Rate History"
          }
        },
        "type": "object",
        "required": [
          "builder_code",
          "window",
          "volume_usd",
          "builder_fee_usd",
          "platform_fee_usd",
          "trade_count",
          "unique_traders",
          "unique_markets"
        ],
        "title": "BuilderStats",
        "description": "Detailed stats for a single builder."
      },
      "BuilderTimeseriesPoint": {
        "properties": {
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Unix timestamp at bucket start"
          },
          "volume_usd": {
            "type": "number",
            "title": "Volume Usd"
          },
          "builder_fee_usd": {
            "type": "number",
            "title": "Builder Fee Usd"
          },
          "trade_count": {
            "type": "integer",
            "title": "Trade Count"
          }
        },
        "type": "object",
        "required": [
          "timestamp",
          "volume_usd",
          "builder_fee_usd",
          "trade_count"
        ],
        "title": "BuilderTimeseriesPoint",
        "description": "One bucket in a builder timeseries."
      },
      "BuilderTimeseriesResponse": {
        "properties": {
          "builder_code": {
            "type": "string",
            "title": "Builder Code"
          },
          "window": {
            "type": "string",
            "title": "Window"
          },
          "bucket": {
            "type": "string",
            "title": "Bucket",
            "description": "Bucket size: day or hour"
          },
          "points": {
            "items": {
              "$ref": "#/components/schemas/BuilderTimeseriesPoint"
            },
            "type": "array",
            "title": "Points"
          }
        },
        "type": "object",
        "required": [
          "builder_code",
          "window",
          "bucket",
          "points"
        ],
        "title": "BuilderTimeseriesResponse",
        "description": "Response for builder timeseries endpoint."
      },
      "CandlestickData": {
        "properties": {
          "end_period_ts": {
            "type": "integer",
            "title": "End Period Ts"
          },
          "price": {
            "$ref": "#/components/schemas/PriceData"
          },
          "volume": {
            "type": "number",
            "title": "Volume"
          },
          "trades_count": {
            "type": "integer",
            "title": "Trades Count"
          }
        },
        "type": "object",
        "required": [
          "end_period_ts",
          "price",
          "volume",
          "trades_count"
        ],
        "title": "CandlestickData",
        "description": "Individual candlestick data."
      },
      "CandlesticksResponse": {
        "properties": {
          "condition_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Condition Id",
            "description": "Market condition ID (set for condition-level candles)"
          },
          "token_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Id",
            "description": "Outcome token ID (set for token-level candles)"
          },
          "first_trade_ts": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Trade Ts",
            "description": "Unix timestamp of the first trade"
          },
          "last_trade_ts": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Trade Ts",
            "description": "Unix timestamp of the last trade"
          },
          "interval": {
            "type": "integer",
            "title": "Interval",
            "description": "Resolved candle interval in minutes (1, 5, 15, 60, or 1440). Reflects the auto-selected value when interval=0 is requested."
          },
          "interval_seconds": {
            "type": "integer",
            "title": "Interval Seconds",
            "description": "Resolved candle interval in seconds \u2014 the bucket width of each candlestick"
          },
          "candlesticks": {
            "items": {
              "$ref": "#/components/schemas/CandlestickData"
            },
            "type": "array",
            "title": "Candlesticks",
            "description": "Array of candlestick data points"
          }
        },
        "type": "object",
        "required": [
          "interval",
          "interval_seconds",
          "candlesticks"
        ],
        "title": "CandlesticksResponse",
        "description": "Candlesticks endpoint response."
      },
      "ClusterSiblingEntry": {
        "properties": {
          "address": {
            "type": "string",
            "title": "Address",
            "description": "Sibling wallet address"
          },
          "confidence": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 0.0,
            "title": "Confidence",
            "description": "Confidence score 0-100"
          },
          "min_hops": {
            "type": "integer",
            "title": "Min Hops",
            "description": "Shortest path from seed to sibling"
          },
          "evidence": {
            "type": "object",
            "title": "Evidence",
            "description": "Evidence object for the sibling relation"
          }
        },
        "type": "object",
        "required": [
          "address",
          "confidence",
          "min_hops",
          "evidence"
        ],
        "title": "ClusterSiblingEntry",
        "description": "One sibling wallet related to the seed via transfer-graph signals."
      },
      "CohortComparisonResponse": {
        "properties": {
          "window": {
            "$ref": "#/components/schemas/TimeWindow",
            "description": "Time window for metrics"
          },
          "cohorts": {
            "items": {
              "$ref": "#/components/schemas/CohortStats"
            },
            "type": "array",
            "title": "Cohorts",
            "description": "Performance stats per cohort"
          },
          "total_wallets": {
            "type": "integer",
            "title": "Total Wallets",
            "description": "Total wallets across all cohorts"
          }
        },
        "type": "object",
        "required": [
          "window",
          "cohorts",
          "total_wallets"
        ],
        "title": "CohortComparisonResponse",
        "description": "Response for cohort performance comparison."
      },
      "CohortStats": {
        "properties": {
          "cohort_name": {
            "type": "string",
            "title": "Cohort Name",
            "description": "Name of the cohort (e.g., trading style)"
          },
          "wallet_count": {
            "type": "integer",
            "title": "Wallet Count",
            "description": "Number of wallets in this cohort"
          },
          "total_volume": {
            "type": "number",
            "title": "Total Volume",
            "description": "Total volume from this cohort (USD)"
          },
          "total_realized_pnl": {
            "type": "number",
            "title": "Total Realized Pnl",
            "description": "Total realized PnL from this cohort (USD)"
          },
          "avg_realized_pnl": {
            "type": "number",
            "title": "Avg Realized Pnl",
            "description": "Average realized PnL per wallet (USD)"
          },
          "median_realized_pnl": {
            "type": "number",
            "title": "Median Realized Pnl",
            "description": "Median realized PnL (USD) - approximated"
          },
          "avg_roi": {
            "type": "number",
            "title": "Avg Roi",
            "description": "Average ROI"
          },
          "avg_win_rate": {
            "type": "number",
            "title": "Avg Win Rate",
            "description": "Average win rate"
          },
          "avg_profit_factor": {
            "type": "number",
            "title": "Avg Profit Factor",
            "description": "Average profit factor"
          },
          "avg_trades": {
            "type": "number",
            "title": "Avg Trades",
            "description": "Average number of trades"
          },
          "profitable_wallet_pct": {
            "type": "number",
            "title": "Profitable Wallet Pct",
            "description": "Percentage of wallets with positive PnL (0-1)"
          },
          "total_fees_paid": {
            "type": "number",
            "title": "Total Fees Paid",
            "description": "Total taker fees paid by this cohort (USD)",
            "default": 0.0
          },
          "total_fees_refunded": {
            "type": "number",
            "title": "Total Fees Refunded",
            "description": "DEPRECATED: always 0. Refunds are already netted into fees_paid.",
            "default": 0.0
          },
          "avg_fees_paid": {
            "type": "number",
            "title": "Avg Fees Paid",
            "description": "Average taker fees paid per wallet (USD)",
            "default": 0.0
          },
          "avg_fees_refunded": {
            "type": "number",
            "title": "Avg Fees Refunded",
            "description": "DEPRECATED: always 0. Refunds are already netted into fees_paid.",
            "default": 0.0
          }
        },
        "type": "object",
        "required": [
          "cohort_name",
          "wallet_count",
          "total_volume",
          "total_realized_pnl",
          "avg_realized_pnl",
          "median_realized_pnl",
          "avg_roi",
          "avg_win_rate",
          "avg_profit_factor",
          "avg_trades",
          "profitable_wallet_pct"
        ],
        "title": "CohortStats",
        "description": "Performance statistics for a cohort of wallets."
      },
      "CryptoAsset": {
        "type": "string",
        "enum": [
          "btc",
          "eth",
          "sol",
          "xrp",
          "hype",
          "doge",
          "bnb"
        ],
        "title": "CryptoAsset"
      },
      "CryptoTimeframe": {
        "type": "string",
        "enum": [
          "5m",
          "15m",
          "1h",
          "4h",
          "daily"
        ],
        "title": "CryptoTimeframe"
      },
      "CryptoUpDownMarket": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id"
          },
          "market_slug": {
            "type": "string",
            "title": "Market Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "asset": {
            "type": "string",
            "title": "Asset",
            "description": "Normalized asset code: btc, eth, sol, xrp"
          },
          "timeframe": {
            "type": "string",
            "title": "Timeframe",
            "description": "Normalized timeframe: 15m, 1h, 4h, daily"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "winning_side": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Winning Side",
            "description": "'Up', 'Down', or null if unresolved"
          },
          "up_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Up Price",
            "description": "Current Up outcome price (0-1)"
          },
          "down_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Down Price",
            "description": "Current Down outcome price (0-1)"
          },
          "up_token_id": {
            "type": "string",
            "title": "Up Token Id",
            "description": "Token ID for the Up outcome"
          },
          "down_token_id": {
            "type": "string",
            "title": "Down Token Id",
            "description": "Token ID for the Down outcome"
          },
          "start_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time",
            "description": "ISO 8601 timestamp"
          },
          "end_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Time",
            "description": "ISO 8601 timestamp"
          },
          "total_volume_usd": {
            "type": "number",
            "title": "Total Volume Usd",
            "default": 0.0
          },
          "liquidity_usd": {
            "type": "number",
            "title": "Liquidity Usd",
            "default": 0.0
          },
          "event_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Slug"
          },
          "image_url": {
            "type": "string",
            "title": "Image Url",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "market_slug",
          "title",
          "asset",
          "timeframe",
          "status",
          "up_token_id",
          "down_token_id"
        ],
        "title": "CryptoUpDownMarket",
        "description": "A crypto up/down market (e.g., 'Bitcoin Up or Down - 15m')."
      },
      "CryptoUpDownResponse": {
        "properties": {
          "markets": {
            "items": {
              "$ref": "#/components/schemas/CryptoUpDownMarket"
            },
            "type": "array",
            "title": "Markets"
          },
          "pagination": {
            "$ref": "#/components/schemas/OffsetPagination"
          }
        },
        "type": "object",
        "required": [
          "markets",
          "pagination"
        ],
        "title": "CryptoUpDownResponse",
        "description": "Response for crypto up/down markets list endpoint."
      },
      "CursorPagination": {
        "properties": {
          "limit": {
            "type": "integer",
            "title": "Limit",
            "description": "Requested limit"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Number of items in current response"
          },
          "pagination_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pagination Key",
            "description": "Base64-encoded cursor for next page"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "description": "Whether there are more items available"
          }
        },
        "type": "object",
        "required": [
          "limit",
          "count",
          "has_more"
        ],
        "title": "CursorPagination",
        "description": "Cursor-based pagination for endpoints that don't support offset."
      },
      "ErrorResponse": {
        "properties": {
          "error": {
            "type": "string",
            "title": "Error"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "title": "ErrorResponse",
        "description": "Standard error response."
      },
      "EventSortOption": {
        "type": "string",
        "enum": [
          "created",
          "created_asc",
          "start_date",
          "start_date_asc",
          "end_date",
          "end_date_desc",
          "title",
          "relevance",
          "volume_1d",
          "volume_7d",
          "volume_30d",
          "volume_all_time",
          "open_interest",
          "trades_1d",
          "trades_7d",
          "trades_30d"
        ],
        "title": "EventSortOption"
      },
      "EventStatusOption": {
        "type": "string",
        "enum": [
          "open",
          "closed"
        ],
        "title": "EventStatusOption"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HealthResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Service health status"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "HealthResponse",
        "description": "Health check endpoint response."
      },
      "KalshiEvent": {
        "properties": {
          "event_ticker": {
            "type": "string",
            "title": "Event Ticker"
          },
          "series_ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Series Ticker"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "default": ""
          },
          "subtitle": {
            "type": "string",
            "title": "Subtitle",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "event_ticker"
        ],
        "title": "KalshiEvent",
        "description": "Event info nested in Kalshi market."
      },
      "KalshiMarket": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker"
          },
          "event_ticker": {
            "type": "string",
            "title": "Event Ticker"
          },
          "market_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "yes_subtitle": {
            "type": "string",
            "title": "Yes Subtitle",
            "default": ""
          },
          "no_subtitle": {
            "type": "string",
            "title": "No Subtitle",
            "default": ""
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "result": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result"
          },
          "open_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Open Time",
            "description": "ISO 8601 timestamp"
          },
          "close_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Time",
            "description": "ISO 8601 timestamp"
          },
          "expected_expiration_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expected Expiration Time",
            "description": "ISO 8601 timestamp"
          },
          "settlement_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settlement Time",
            "description": "ISO 8601 timestamp"
          },
          "determination_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Determination Time",
            "description": "ISO 8601 timestamp"
          },
          "can_close_early": {
            "type": "boolean",
            "title": "Can Close Early",
            "default": false
          },
          "strike_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Strike Type"
          },
          "custom_strike": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Strike"
          },
          "floor_strike": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Used by strike_type greater/greater_or_equal/between",
            "title": "Floor Strike"
          },
          "cap_strike": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Used by strike_type less/less_or_equal/between",
            "title": "Cap Strike"
          },
          "rules_primary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Kalshi's plain-language settlement terms",
            "title": "Rules Primary"
          },
          "rules_secondary": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Kalshi's secondary terms (ties, postponements, ...)",
            "title": "Rules Secondary"
          },
          "series": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/KalshiSeries"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/KalshiOutcome"
            },
            "type": "array",
            "title": "Outcomes"
          },
          "last_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Price"
          },
          "volume": {
            "type": "integer",
            "title": "Volume",
            "default": 0
          },
          "open_interest": {
            "type": "integer",
            "title": "Open Interest",
            "default": 0
          },
          "dollar_volume": {
            "type": "integer",
            "title": "Dollar Volume",
            "default": 0
          },
          "dollar_open_interest": {
            "type": "integer",
            "title": "Dollar Open Interest",
            "default": 0
          },
          "event": {
            "$ref": "#/components/schemas/KalshiEvent"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At",
            "description": "ISO 8601 timestamp"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At",
            "description": "ISO 8601 timestamp"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "event_ticker",
          "title",
          "status",
          "outcomes",
          "event"
        ],
        "title": "KalshiMarket",
        "description": "Kalshi market in list response."
      },
      "KalshiMarketsResponse": {
        "properties": {
          "markets": {
            "items": {
              "$ref": "#/components/schemas/KalshiMarket"
            },
            "type": "array",
            "title": "Markets"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "markets",
          "pagination"
        ],
        "title": "KalshiMarketsResponse",
        "description": "Response for Kalshi markets list endpoint."
      },
      "KalshiOrderbookLevel": {
        "properties": {
          "price": {
            "type": "integer",
            "title": "Price",
            "description": "Price in cents (1-99)"
          },
          "size": {
            "type": "integer",
            "title": "Size",
            "description": "Number of contracts at this price level"
          }
        },
        "type": "object",
        "required": [
          "price",
          "size"
        ],
        "title": "KalshiOrderbookLevel",
        "description": "Single price level in Kalshi orderbook."
      },
      "KalshiOrderbookSnapshot": {
        "properties": {
          "ticker": {
            "type": "string",
            "title": "Ticker",
            "description": "Market ticker"
          },
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Snapshot timestamp in milliseconds"
          },
          "yes_bids": {
            "items": {
              "$ref": "#/components/schemas/KalshiOrderbookLevel"
            },
            "type": "array",
            "title": "Yes Bids",
            "description": "Yes bid levels, ordered by price descending"
          },
          "yes_asks": {
            "items": {
              "$ref": "#/components/schemas/KalshiOrderbookLevel"
            },
            "type": "array",
            "title": "Yes Asks",
            "description": "Yes ask levels, ordered by price ascending"
          },
          "best_bid": {
            "type": "integer",
            "title": "Best Bid",
            "description": "Best bid price in cents"
          },
          "best_ask": {
            "type": "integer",
            "title": "Best Ask",
            "description": "Best ask price in cents"
          },
          "bid_depth": {
            "type": "integer",
            "title": "Bid Depth",
            "description": "Total bid depth (number of contracts)"
          },
          "ask_depth": {
            "type": "integer",
            "title": "Ask Depth",
            "description": "Total ask depth (number of contracts)"
          },
          "sequence": {
            "type": "integer",
            "title": "Sequence",
            "description": "Sequence number for ordering within same timestamp"
          }
        },
        "type": "object",
        "required": [
          "ticker",
          "timestamp",
          "yes_bids",
          "yes_asks",
          "best_bid",
          "best_ask",
          "bid_depth",
          "ask_depth",
          "sequence"
        ],
        "title": "KalshiOrderbookSnapshot",
        "description": "Single Kalshi orderbook snapshot."
      },
      "KalshiOrderbooksResponse": {
        "properties": {
          "snapshots": {
            "items": {
              "$ref": "#/components/schemas/KalshiOrderbookSnapshot"
            },
            "type": "array",
            "title": "Snapshots"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "snapshots",
          "pagination"
        ],
        "title": "KalshiOrderbooksResponse",
        "description": "Kalshi orderbooks endpoint response."
      },
      "KalshiOutcome": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "predexon_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Predexon Id"
          },
          "bid": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bid"
          },
          "ask": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ask"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "KalshiOutcome",
        "description": "Outcome for a Kalshi market."
      },
      "KalshiTakerSide": {
        "type": "string",
        "enum": [
          "yes",
          "no"
        ],
        "title": "KalshiTakerSide",
        "description": "Kalshi taker side enum."
      },
      "KalshiTrade": {
        "properties": {
          "trade_id": {
            "type": "string",
            "title": "Trade Id",
            "description": "Unique trade identifier"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker",
            "description": "Market ticker"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Number of contracts traded"
          },
          "yes_price": {
            "type": "number",
            "title": "Yes Price",
            "description": "Yes price (0-1)"
          },
          "no_price": {
            "type": "number",
            "title": "No Price",
            "description": "No price (0-1)"
          },
          "taker_side": {
            "$ref": "#/components/schemas/KalshiTakerSide",
            "description": "Taker side: yes or no"
          },
          "created_time": {
            "type": "integer",
            "title": "Created Time",
            "description": "Unix timestamp in seconds"
          }
        },
        "type": "object",
        "required": [
          "trade_id",
          "ticker",
          "count",
          "yes_price",
          "no_price",
          "taker_side",
          "created_time"
        ],
        "title": "KalshiTrade",
        "description": "Kalshi trade model."
      },
      "KalshiTradesResponse": {
        "properties": {
          "trades": {
            "items": {
              "$ref": "#/components/schemas/KalshiTrade"
            },
            "type": "array",
            "title": "Trades"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "trades",
          "pagination"
        ],
        "title": "KalshiTradesResponse",
        "description": "Kalshi trades endpoint response."
      },
      "LeaderboardEntry": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank",
            "description": "Position in leaderboard (1-indexed)"
          },
          "user": {
            "type": "string",
            "title": "User",
            "description": "Wallet address"
          },
          "metrics": {
            "$ref": "#/components/schemas/WindowMetrics",
            "description": "Metrics for selected window"
          },
          "trading_styles": {
            "$ref": "#/components/schemas/TradingStyleFlags",
            "description": "Trading style flags"
          },
          "entry_edge": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entry Edge",
            "description": "Price edge (avg_sell - avg_buy), only for all_time"
          },
          "first_trade_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Trade At",
            "description": "Unix timestamp of first trade"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "user",
          "metrics",
          "trading_styles"
        ],
        "title": "LeaderboardEntry",
        "description": "Single entry in the leaderboard."
      },
      "LeaderboardResponse": {
        "properties": {
          "window": {
            "$ref": "#/components/schemas/TimeWindow",
            "description": "Time window for metrics"
          },
          "sort_by": {
            "$ref": "#/components/schemas/LeaderboardSortBy",
            "description": "Sort field used"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/LeaderboardEntry"
            },
            "type": "array",
            "title": "Entries",
            "description": "Leaderboard entries"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination",
            "description": "Pagination info"
          }
        },
        "type": "object",
        "required": [
          "window",
          "sort_by",
          "entries",
          "pagination"
        ],
        "title": "LeaderboardResponse",
        "description": "Response for global leaderboard endpoint."
      },
      "LeaderboardSortBy": {
        "type": "string",
        "enum": [
          "realized_pnl",
          "total_pnl",
          "volume",
          "roi",
          "profit_factor",
          "win_rate",
          "trades"
        ],
        "title": "LeaderboardSortBy",
        "description": "Sort options for leaderboard."
      },
      "LimitlessCollateral": {
        "properties": {
          "address": {
            "type": "string",
            "title": "Address",
            "default": ""
          },
          "symbol": {
            "type": "string",
            "title": "Symbol",
            "default": ""
          },
          "decimals": {
            "type": "integer",
            "title": "Decimals",
            "default": 6
          }
        },
        "type": "object",
        "title": "LimitlessCollateral",
        "description": "Collateral token info for a Limitless market."
      },
      "LimitlessMarket": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id"
          },
          "market_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Id"
          },
          "market_slug": {
            "type": "string",
            "title": "Market Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "trade_type": {
            "type": "string",
            "title": "Trade Type"
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/LimitlessOutcome"
            },
            "type": "array",
            "title": "Outcomes"
          },
          "total_volume_usd": {
            "type": "number",
            "title": "Total Volume Usd",
            "default": 0
          },
          "open_interest_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Open Interest Usd",
            "description": "Open interest in USD. Null for Limitless CLOB markets because Limitless currently exposes OI only for AMM markets."
          },
          "liquidity_usd": {
            "type": "number",
            "title": "Liquidity Usd",
            "default": 0
          },
          "image_url": {
            "type": "string",
            "title": "Image Url",
            "default": ""
          },
          "categories": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Categories",
            "default": []
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags",
            "default": []
          },
          "collateral": {
            "$ref": "#/components/schemas/LimitlessCollateral"
          },
          "market_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Address"
          },
          "exchange_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exchange Address"
          },
          "expired": {
            "type": "boolean",
            "title": "Expired",
            "default": false
          },
          "winning_outcome": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Winning Outcome"
          },
          "payout_numerators": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Payout Numerators",
            "default": []
          },
          "resolution_block": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution Block"
          },
          "resolution_tx": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution Tx"
          },
          "expiration_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expiration Time",
            "description": "ISO 8601 timestamp"
          },
          "created_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created Time",
            "description": "ISO 8601 timestamp"
          },
          "updated_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated Time",
            "description": "ISO 8601 timestamp"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "market_slug",
          "title",
          "status",
          "trade_type",
          "outcomes",
          "collateral"
        ],
        "title": "LimitlessMarket",
        "description": "Limitless market response model."
      },
      "LimitlessMarketsResponse": {
        "properties": {
          "markets": {
            "items": {
              "$ref": "#/components/schemas/LimitlessMarket"
            },
            "type": "array",
            "title": "Markets"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "markets",
          "pagination"
        ],
        "title": "LimitlessMarketsResponse",
        "description": "Response for Limitless markets list endpoint."
      },
      "LimitlessOrderbookLevel": {
        "properties": {
          "price": {
            "type": "number",
            "title": "Price",
            "description": "Price level (0-1 range)"
          },
          "size": {
            "type": "number",
            "title": "Size",
            "description": "Size at this price level"
          }
        },
        "type": "object",
        "required": [
          "price",
          "size"
        ],
        "title": "LimitlessOrderbookLevel",
        "description": "Single price level in Limitless orderbook."
      },
      "LimitlessOrderbookSnapshot": {
        "properties": {
          "market_slug": {
            "type": "string",
            "title": "Market Slug",
            "description": "Market slug identifier"
          },
          "token_id": {
            "type": "string",
            "title": "Token Id",
            "description": "YES token ID (metadata)"
          },
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Snapshot timestamp (Unix epoch MILLISECONDS)"
          },
          "bids": {
            "items": {
              "$ref": "#/components/schemas/LimitlessOrderbookLevel"
            },
            "type": "array",
            "title": "Bids",
            "description": "Bid levels (buying YES)"
          },
          "asks": {
            "items": {
              "$ref": "#/components/schemas/LimitlessOrderbookLevel"
            },
            "type": "array",
            "title": "Asks",
            "description": "Ask levels (selling YES)"
          },
          "midpoint": {
            "type": "number",
            "title": "Midpoint",
            "description": "Midpoint price"
          },
          "adjusted_midpoint": {
            "type": "number",
            "title": "Adjusted Midpoint",
            "description": "Adjusted midpoint price"
          }
        },
        "type": "object",
        "required": [
          "market_slug",
          "token_id",
          "timestamp",
          "bids",
          "asks",
          "midpoint",
          "adjusted_midpoint"
        ],
        "title": "LimitlessOrderbookSnapshot",
        "description": "Single Limitless orderbook snapshot (YES side only; invert for NO)."
      },
      "LimitlessOrderbooksResponse": {
        "properties": {
          "snapshots": {
            "items": {
              "$ref": "#/components/schemas/LimitlessOrderbookSnapshot"
            },
            "type": "array",
            "title": "Snapshots"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "snapshots",
          "pagination"
        ],
        "title": "LimitlessOrderbooksResponse",
        "description": "Limitless orderbooks endpoint response."
      },
      "LimitlessOutcome": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "token_id": {
            "type": "string",
            "title": "Token Id",
            "default": ""
          },
          "predexon_id": {
            "type": "string",
            "title": "Predexon Id",
            "default": ""
          },
          "price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "LimitlessOutcome",
        "description": "A single tradeable outcome for a Limitless market."
      },
      "MarketFilterLogic": {
        "type": "string",
        "enum": [
          "and",
          "or"
        ],
        "title": "MarketFilterLogic",
        "description": "Logic for combining market filters."
      },
      "MarketLeaderboardResponse": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id",
            "description": "Market condition ID"
          },
          "window": {
            "$ref": "#/components/schemas/TimeWindow",
            "description": "Time window for metrics"
          },
          "sort_by": {
            "$ref": "#/components/schemas/LeaderboardSortBy",
            "description": "Sort field used"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/LeaderboardEntry"
            },
            "type": "array",
            "title": "Entries",
            "description": "Leaderboard entries"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination",
            "description": "Pagination info"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "window",
          "sort_by",
          "entries",
          "pagination"
        ],
        "title": "MarketLeaderboardResponse",
        "description": "Response for per-market leaderboard endpoint."
      },
      "MarketOpenInterestTimeSeriesResponse": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id"
          },
          "market_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Id",
            "description": "Market ID"
          },
          "granularity": {
            "$ref": "#/components/schemas/PnLGranularity"
          },
          "start_time": {
            "type": "integer",
            "title": "Start Time"
          },
          "end_time": {
            "type": "integer",
            "title": "End Time"
          },
          "open_interest_over_time": {
            "items": {
              "$ref": "#/components/schemas/OpenInterestDataPoint"
            },
            "type": "array",
            "title": "Open Interest Over Time"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "granularity",
          "start_time",
          "end_time",
          "open_interest_over_time"
        ],
        "title": "MarketOpenInterestTimeSeriesResponse",
        "description": "Market open interest time series endpoint response."
      },
      "MarketPriceResponse": {
        "properties": {
          "price": {
            "type": "number",
            "title": "Price"
          },
          "at_time": {
            "type": "integer",
            "title": "At Time",
            "description": "Unix timestamp in seconds"
          }
        },
        "type": "object",
        "required": [
          "price",
          "at_time"
        ],
        "title": "MarketPriceResponse",
        "description": "Market price endpoint response."
      },
      "MarketRollingMetrics": {
        "properties": {
          "volume_1d": {
            "type": "number",
            "title": "Volume 1D",
            "description": "Volume in USD over last 24 hours",
            "default": 0.0
          },
          "volume_7d": {
            "type": "number",
            "title": "Volume 7D",
            "description": "Volume in USD over last 7 days",
            "default": 0.0
          },
          "volume_30d": {
            "type": "number",
            "title": "Volume 30D",
            "description": "Volume in USD over last 30 days",
            "default": 0.0
          },
          "buy_volume_1d": {
            "type": "number",
            "title": "Buy Volume 1D",
            "description": "Buy volume (USD) last 24h",
            "default": 0.0
          },
          "buy_volume_7d": {
            "type": "number",
            "title": "Buy Volume 7D",
            "description": "Buy volume (USD) last 7d",
            "default": 0.0
          },
          "buy_volume_30d": {
            "type": "number",
            "title": "Buy Volume 30D",
            "description": "Buy volume (USD) last 30d",
            "default": 0.0
          },
          "sell_volume_1d": {
            "type": "number",
            "title": "Sell Volume 1D",
            "description": "Sell volume (USD) last 24h",
            "default": 0.0
          },
          "sell_volume_7d": {
            "type": "number",
            "title": "Sell Volume 7D",
            "description": "Sell volume (USD) last 7d",
            "default": 0.0
          },
          "sell_volume_30d": {
            "type": "number",
            "title": "Sell Volume 30D",
            "description": "Sell volume (USD) last 30d",
            "default": 0.0
          },
          "trades_1d": {
            "type": "integer",
            "title": "Trades 1D",
            "description": "Trade count last 24h",
            "default": 0
          },
          "trades_7d": {
            "type": "integer",
            "title": "Trades 7D",
            "description": "Trade count last 7d",
            "default": 0
          },
          "trades_30d": {
            "type": "integer",
            "title": "Trades 30D",
            "description": "Trade count last 30d",
            "default": 0
          },
          "buys_1d": {
            "type": "integer",
            "title": "Buys 1D",
            "description": "Buy trades last 24h",
            "default": 0
          },
          "buys_7d": {
            "type": "integer",
            "title": "Buys 7D",
            "description": "Buy trades last 7d",
            "default": 0
          },
          "buys_30d": {
            "type": "integer",
            "title": "Buys 30D",
            "description": "Buy trades last 30d",
            "default": 0
          },
          "sells_1d": {
            "type": "integer",
            "title": "Sells 1D",
            "description": "Sell trades last 24h",
            "default": 0
          },
          "sells_7d": {
            "type": "integer",
            "title": "Sells 7D",
            "description": "Sell trades last 7d",
            "default": 0
          },
          "sells_30d": {
            "type": "integer",
            "title": "Sells 30D",
            "description": "Sell trades last 30d",
            "default": 0
          },
          "oi_change_1d": {
            "type": "number",
            "title": "Oi Change 1D",
            "description": "OI change over last 24h (USD)",
            "default": 0.0
          },
          "oi_change_7d": {
            "type": "number",
            "title": "Oi Change 7D",
            "description": "OI change over last 7d (USD)",
            "default": 0.0
          },
          "oi_change_30d": {
            "type": "number",
            "title": "Oi Change 30D",
            "description": "OI change over last 30d (USD)",
            "default": 0.0
          },
          "computed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Computed At",
            "description": "ISO 8601 timestamp when metrics were last computed"
          }
        },
        "type": "object",
        "title": "MarketRollingMetrics",
        "description": "Rolling window metrics from market_metrics_summary (hourly cron refresh)."
      },
      "MarketTypeOption": {
        "type": "string",
        "enum": [
          "binary",
          "categorical"
        ],
        "title": "MarketTypeOption"
      },
      "MarketVariantOption": {
        "type": "string",
        "enum": [
          "DEFAULT",
          "CRYPTO_UP_DOWN",
          "SPORTS_TEAM_MATCH",
          "SPORTS_MATCH",
          "TWEET_COUNT"
        ],
        "title": "MarketVariantOption"
      },
      "MarketVolumeTimeSeriesResponse": {
        "properties": {
          "token_id": {
            "type": "string",
            "title": "Token Id"
          },
          "granularity": {
            "$ref": "#/components/schemas/PnLGranularity"
          },
          "start_time": {
            "type": "integer",
            "title": "Start Time"
          },
          "end_time": {
            "type": "integer",
            "title": "End Time"
          },
          "volume_over_time": {
            "items": {
              "$ref": "#/components/schemas/VolumeDataPoint"
            },
            "type": "array",
            "title": "Volume Over Time"
          }
        },
        "type": "object",
        "required": [
          "token_id",
          "granularity",
          "start_time",
          "end_time",
          "volume_over_time"
        ],
        "title": "MarketVolumeTimeSeriesResponse",
        "description": "Market volume time series endpoint response."
      },
      "MatchType": {
        "type": "string",
        "enum": [
          "exact",
          "related",
          "all"
        ],
        "title": "MatchType",
        "description": "Match type filter for cross-platform market matching."
      },
      "OffsetPagination": {
        "properties": {
          "limit": {
            "type": "integer",
            "title": "Limit",
            "description": "Requested limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset",
            "description": "Current offset"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total number of matching items"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "description": "Whether there are more items available"
          }
        },
        "type": "object",
        "required": [
          "limit",
          "offset",
          "total",
          "has_more"
        ],
        "title": "OffsetPagination",
        "description": "Offset-based pagination for markets list endpoints."
      },
      "OpenInterestDataPoint": {
        "properties": {
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Unix timestamp in seconds"
          },
          "open_interest_usd": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Open Interest Usd",
            "description": "Total value of tokens circulating from split, merge, redeem, and conversion events (USD)"
          }
        },
        "type": "object",
        "required": [
          "timestamp"
        ],
        "title": "OpenInterestDataPoint",
        "description": "Individual open interest data point."
      },
      "OpinionCollection": {
        "properties": {
          "title": {
            "type": "string",
            "title": "Title"
          },
          "symbol": {
            "type": "string",
            "title": "Symbol"
          },
          "frequency": {
            "type": "string",
            "title": "Frequency"
          }
        },
        "type": "object",
        "required": [
          "title",
          "symbol",
          "frequency"
        ],
        "title": "OpinionCollection",
        "description": "Recurring market collection metadata."
      },
      "OpinionMarket": {
        "properties": {
          "market_id": {
            "type": "integer",
            "title": "Market Id"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/OpinionOutcome"
            },
            "type": "array",
            "title": "Outcomes"
          },
          "total_volume_usd": {
            "type": "number",
            "title": "Total Volume Usd",
            "default": 0
          },
          "volume_24h_usd": {
            "type": "number",
            "title": "Volume 24H Usd",
            "default": 0
          },
          "volume_7d_usd": {
            "type": "number",
            "title": "Volume 7D Usd",
            "default": 0
          },
          "condition_id": {
            "type": "string",
            "title": "Condition Id",
            "default": ""
          },
          "question_id": {
            "type": "string",
            "title": "Question Id",
            "default": ""
          },
          "result_token_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Result Token Id"
          },
          "event_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Id"
          },
          "event_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Slug"
          },
          "event_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Title"
          },
          "labels": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Labels",
            "default": []
          },
          "thumbnail_url": {
            "type": "string",
            "title": "Thumbnail Url",
            "default": ""
          },
          "chain_id": {
            "type": "string",
            "title": "Chain Id",
            "default": ""
          },
          "quote_token": {
            "type": "string",
            "title": "Quote Token",
            "default": ""
          },
          "collection": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OpinionCollection"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created Time",
            "description": "ISO 8601 timestamp"
          },
          "cutoff_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cutoff Time",
            "description": "ISO 8601 timestamp"
          },
          "resolved_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved Time",
            "description": "ISO 8601 timestamp"
          }
        },
        "type": "object",
        "required": [
          "market_id",
          "title",
          "slug",
          "status",
          "outcomes"
        ],
        "title": "OpinionMarket",
        "description": "Opinion market response model."
      },
      "OpinionMarketsResponse": {
        "properties": {
          "markets": {
            "items": {
              "$ref": "#/components/schemas/OpinionMarket"
            },
            "type": "array",
            "title": "Markets"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "markets",
          "pagination"
        ],
        "title": "OpinionMarketsResponse",
        "description": "Response for Opinion markets list endpoint."
      },
      "OpinionOrderbookLevel": {
        "properties": {
          "price": {
            "type": "number",
            "title": "Price",
            "description": "Price level (0-1 range)"
          },
          "size": {
            "type": "number",
            "title": "Size",
            "description": "Size at this price level"
          }
        },
        "type": "object",
        "required": [
          "price",
          "size"
        ],
        "title": "OpinionOrderbookLevel",
        "description": "Single price level in Opinion orderbook."
      },
      "OpinionOrderbookSnapshot": {
        "properties": {
          "market_id": {
            "type": "integer",
            "title": "Market Id",
            "description": "Market ID"
          },
          "token_id": {
            "type": "string",
            "title": "Token Id",
            "description": "YES token ID (metadata)"
          },
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Snapshot timestamp (Unix epoch MILLISECONDS)"
          },
          "bids": {
            "items": {
              "$ref": "#/components/schemas/OpinionOrderbookLevel"
            },
            "type": "array",
            "title": "Bids",
            "description": "Bid levels"
          },
          "asks": {
            "items": {
              "$ref": "#/components/schemas/OpinionOrderbookLevel"
            },
            "type": "array",
            "title": "Asks",
            "description": "Ask levels"
          },
          "best_bid": {
            "type": "number",
            "title": "Best Bid",
            "description": "Best bid price"
          },
          "best_ask": {
            "type": "number",
            "title": "Best Ask",
            "description": "Best ask price"
          },
          "bid_depth": {
            "type": "number",
            "title": "Bid Depth",
            "description": "Total bid depth"
          },
          "ask_depth": {
            "type": "number",
            "title": "Ask Depth",
            "description": "Total ask depth"
          }
        },
        "type": "object",
        "required": [
          "market_id",
          "token_id",
          "timestamp",
          "bids",
          "asks",
          "best_bid",
          "best_ask",
          "bid_depth",
          "ask_depth"
        ],
        "title": "OpinionOrderbookSnapshot",
        "description": "Single Opinion orderbook snapshot (YES side only; invert for NO)."
      },
      "OpinionOrderbooksResponse": {
        "properties": {
          "snapshots": {
            "items": {
              "$ref": "#/components/schemas/OpinionOrderbookSnapshot"
            },
            "type": "array",
            "title": "Snapshots"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "snapshots",
          "pagination"
        ],
        "title": "OpinionOrderbooksResponse",
        "description": "Opinion orderbooks endpoint response."
      },
      "OpinionOutcome": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "token_id": {
            "type": "string",
            "title": "Token Id",
            "default": ""
          },
          "predexon_id": {
            "type": "string",
            "title": "Predexon Id",
            "default": ""
          },
          "price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "OpinionOutcome",
        "description": "A single tradeable outcome for an Opinion market."
      },
      "OrderDirection": {
        "type": "string",
        "enum": [
          "asc",
          "desc"
        ],
        "title": "OrderDirection",
        "description": "Sort order direction enum."
      },
      "OrderSide": {
        "type": "string",
        "enum": [
          "BUY",
          "SELL"
        ],
        "title": "OrderSide",
        "description": "Order side enum."
      },
      "OrderbookLevel": {
        "properties": {
          "size": {
            "type": "number",
            "title": "Size",
            "description": "Size at this price level"
          },
          "price": {
            "type": "number",
            "title": "Price",
            "description": "Price level (0-1 range)"
          }
        },
        "type": "object",
        "required": [
          "size",
          "price"
        ],
        "title": "OrderbookLevel",
        "description": "Single price level in orderbook."
      },
      "OrderbookSnapshot": {
        "properties": {
          "asks": {
            "items": {
              "$ref": "#/components/schemas/OrderbookLevel"
            },
            "type": "array",
            "title": "Asks",
            "description": "Ask price levels, ordered by price"
          },
          "bids": {
            "items": {
              "$ref": "#/components/schemas/OrderbookLevel"
            },
            "type": "array",
            "title": "Bids",
            "description": "Bid price levels, ordered by price"
          },
          "hash": {
            "type": "string",
            "title": "Hash",
            "description": "Orderbook state hash"
          },
          "assetId": {
            "type": "string",
            "title": "Assetid",
            "description": "Asset/token ID"
          },
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Snapshot timestamp (Unix epoch MILLISECONDS)"
          },
          "tickSize": {
            "type": "string",
            "title": "Ticksize",
            "description": "Tick size for price levels"
          },
          "indexedAt": {
            "type": "integer",
            "title": "Indexedat",
            "description": "When snapshot was indexed (Unix epoch MILLISECONDS)"
          },
          "market": {
            "type": "string",
            "title": "Market",
            "description": "Market condition ID / address"
          }
        },
        "type": "object",
        "required": [
          "asks",
          "bids",
          "hash",
          "assetId",
          "timestamp",
          "tickSize",
          "indexedAt",
          "market"
        ],
        "title": "OrderbookSnapshot",
        "description": "Single orderbook snapshot.\n\nNote: This model uses MILLISECONDS for timestamps (not seconds) to match\nthe source data format from the orderbook indexer."
      },
      "OrderbooksResponse": {
        "properties": {
          "snapshots": {
            "items": {
              "$ref": "#/components/schemas/OrderbookSnapshot"
            },
            "type": "array",
            "title": "Snapshots"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "snapshots",
          "pagination"
        ],
        "title": "OrderbooksResponse",
        "description": "Orderbooks endpoint response."
      },
      "PairSortBy": {
        "type": "string",
        "enum": [
          "similarity",
          "expiration"
        ],
        "title": "PairSortBy",
        "description": "Sort options for matched pairs."
      },
      "PnLDataPoint": {
        "properties": {
          "timestamp": {
            "type": "integer",
            "title": "Timestamp"
          },
          "pnl_to_date": {
            "type": "number",
            "title": "Pnl To Date"
          }
        },
        "type": "object",
        "required": [
          "timestamp",
          "pnl_to_date"
        ],
        "title": "PnLDataPoint",
        "description": "Individual PnL data point."
      },
      "PnLGranularity": {
        "type": "string",
        "enum": [
          "day",
          "week",
          "month",
          "year",
          "all"
        ],
        "title": "PnLGranularity",
        "description": "PnL granularity enum."
      },
      "PolymarketEvent": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "ticker": {
            "type": "string",
            "title": "Ticker",
            "default": ""
          },
          "slug": {
            "type": "string",
            "title": "Slug",
            "default": ""
          },
          "title": {
            "type": "string",
            "title": "Title",
            "default": ""
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "category": {
            "type": "string",
            "title": "Category",
            "default": ""
          },
          "tags": {
            "items": {
              "type": "object"
            },
            "type": "array",
            "title": "Tags"
          },
          "series": {
            "items": {
              "type": "object"
            },
            "type": "array",
            "title": "Series"
          },
          "image_url": {
            "type": "string",
            "title": "Image Url",
            "default": ""
          },
          "icon_url": {
            "type": "string",
            "title": "Icon Url",
            "default": ""
          },
          "resolution_source": {
            "type": "string",
            "title": "Resolution Source",
            "default": ""
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date",
            "description": "ISO 8601 timestamp"
          },
          "end_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date",
            "description": "ISO 8601 timestamp"
          },
          "creation_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creation Date",
            "description": "ISO 8601 timestamp"
          },
          "closed_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Closed Time",
            "description": "ISO 8601 timestamp"
          },
          "neg_risk": {
            "type": "boolean",
            "title": "Neg Risk",
            "default": false
          },
          "neg_risk_market_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Neg Risk Market Id"
          },
          "enable_order_book": {
            "type": "boolean",
            "title": "Enable Order Book",
            "default": false
          },
          "status": {
            "type": "string",
            "title": "Status",
            "default": "open"
          },
          "market_count": {
            "type": "integer",
            "title": "Market Count",
            "default": 0
          },
          "total_volume_usd": {
            "type": "number",
            "title": "Total Volume Usd",
            "default": 0.0
          },
          "trades_all_time": {
            "type": "integer",
            "title": "Trades All Time",
            "default": 0
          },
          "liquidity_usd": {
            "type": "number",
            "title": "Liquidity Usd",
            "default": 0.0
          },
          "current_oi_usd": {
            "type": "number",
            "title": "Current Oi Usd",
            "default": 0.0
          },
          "rolling_metrics": {
            "anyOf": [
              {
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rolling Metrics"
          },
          "markets": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/PolymarketMarket"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Markets"
          }
        },
        "type": "object",
        "required": [
          "id"
        ],
        "title": "PolymarketEvent",
        "description": "Polymarket event in list response."
      },
      "PolymarketEventsResponse": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/PolymarketEvent"
            },
            "type": "array",
            "title": "Events"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "events",
          "pagination"
        ],
        "title": "PolymarketEventsResponse",
        "description": "Response for Polymarket events list endpoint."
      },
      "PolymarketMarket": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id"
          },
          "question_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Id"
          },
          "market_id": {
            "type": "string",
            "title": "Market Id"
          },
          "market_slug": {
            "type": "string",
            "title": "Market Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "winning_side": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Winning Side"
          },
          "start_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time",
            "description": "ISO 8601 timestamp"
          },
          "end_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Time",
            "description": "ISO 8601 timestamp"
          },
          "close_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Close Time",
            "description": "ISO 8601 timestamp"
          },
          "created_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created Time",
            "description": "ISO 8601 timestamp"
          },
          "image_url": {
            "type": "string",
            "title": "Image Url",
            "default": ""
          },
          "event_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Id"
          },
          "event_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Slug"
          },
          "event_title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Title"
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/PolymarketOutcome"
            },
            "type": "array",
            "title": "Outcomes"
          },
          "total_volume_usd": {
            "type": "number",
            "title": "Total Volume Usd",
            "default": 0.0
          },
          "liquidity_usd": {
            "type": "number",
            "title": "Liquidity Usd",
            "default": 0.0
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "is_neg_risk": {
            "type": "boolean",
            "title": "Is Neg Risk",
            "default": false
          },
          "rolling_metrics": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MarketRollingMetrics"
              },
              {
                "type": "null"
              }
            ],
            "description": "Rolling window metrics (1D/7D/30D) from hourly cron refresh"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "market_id",
          "market_slug",
          "title",
          "status",
          "outcomes"
        ],
        "title": "PolymarketMarket",
        "description": "Polymarket market in list response."
      },
      "PolymarketMarketsResponse": {
        "properties": {
          "markets": {
            "items": {
              "$ref": "#/components/schemas/PolymarketMarket"
            },
            "type": "array",
            "title": "Markets"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "markets",
          "pagination"
        ],
        "title": "PolymarketMarketsResponse",
        "description": "Response for Polymarket markets list endpoint."
      },
      "PolymarketOutcome": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "token_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Id"
          },
          "predexon_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Predexon Id"
          },
          "price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "PolymarketOutcome",
        "description": "Outcome for a Polymarket market."
      },
      "Position": {
        "properties": {
          "market": {
            "$ref": "#/components/schemas/PositionMarketInfo"
          },
          "position": {
            "$ref": "#/components/schemas/PositionDetails"
          },
          "current": {
            "$ref": "#/components/schemas/PositionCurrentState"
          },
          "pnl": {
            "$ref": "#/components/schemas/PositionPnL"
          }
        },
        "type": "object",
        "required": [
          "market",
          "position",
          "current",
          "pnl"
        ],
        "title": "Position",
        "description": "Individual position."
      },
      "PositionCurrentState": {
        "properties": {
          "price": {
            "type": "number",
            "title": "Price",
            "description": "Current market price (0-1)"
          },
          "value_usd": {
            "type": "number",
            "title": "Value Usd",
            "description": "Current position value in USD"
          }
        },
        "type": "object",
        "required": [
          "price",
          "value_usd"
        ],
        "title": "PositionCurrentState",
        "description": "Current market state for a position."
      },
      "PositionDetails": {
        "properties": {
          "shares": {
            "type": "number",
            "title": "Shares",
            "description": "Number of shares currently held (0 for closed positions)"
          },
          "total_shares_bought": {
            "type": "number",
            "title": "Total Shares Bought",
            "description": "DEPRECATED \u2014 approximate for positions fully closed and reopened at a different price. Use total_bought_usd for the exact lifetime buy total",
            "deprecated": true
          },
          "total_bought_usd": {
            "type": "number",
            "title": "Total Bought Usd",
            "description": "Total USD ever spent buying this position, lifetime cumulative (preserved even after redemption)",
            "default": 0.0
          },
          "avg_entry_price": {
            "type": "number",
            "title": "Avg Entry Price",
            "description": "Average entry price (0-1)"
          },
          "total_cost_usd": {
            "type": "number",
            "title": "Total Cost Usd",
            "description": "Total cost basis in USD"
          },
          "net_fees_usd": {
            "type": "number",
            "title": "Net Fees Usd",
            "description": "Net taker fees for this position (charged minus refunded, USD)",
            "default": 0.0
          }
        },
        "type": "object",
        "required": [
          "shares",
          "total_shares_bought",
          "avg_entry_price",
          "total_cost_usd"
        ],
        "title": "PositionDetails",
        "description": "Position size and cost basis."
      },
      "PositionMarketInfo": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id"
          },
          "market_slug": {
            "type": "string",
            "title": "Market Slug"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "side": {
            "$ref": "#/components/schemas/PositionSide"
          },
          "side_label": {
            "type": "string",
            "title": "Side Label",
            "description": "Human-readable outcome label (e.g., 'Trump wins' instead of 'Yes')"
          },
          "token_id": {
            "type": "string",
            "title": "Token Id"
          },
          "status": {
            "$ref": "#/components/schemas/PositionMarketStatus",
            "description": "Market status: open, resolved_win, or resolved_loss"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "market_slug",
          "title",
          "side",
          "side_label",
          "token_id",
          "status"
        ],
        "title": "PositionMarketInfo",
        "description": "Market info for a position."
      },
      "PositionMarketStatus": {
        "type": "string",
        "enum": [
          "open",
          "resolved_win",
          "resolved_loss"
        ],
        "title": "PositionMarketStatus",
        "description": "Market status for a position."
      },
      "PositionPnL": {
        "properties": {
          "unrealized_usd": {
            "type": "number",
            "title": "Unrealized Usd",
            "description": "Unrealized P&L in USD"
          },
          "unrealized_pct": {
            "type": "number",
            "title": "Unrealized Pct",
            "description": "Unrealized P&L as percentage"
          },
          "realized_usd": {
            "type": "number",
            "title": "Realized Usd",
            "description": "Realized P&L in USD"
          }
        },
        "type": "object",
        "required": [
          "unrealized_usd",
          "unrealized_pct",
          "realized_usd"
        ],
        "title": "PositionPnL",
        "description": "Profit and loss for a position."
      },
      "PositionSide": {
        "type": "string",
        "enum": [
          "YES",
          "NO"
        ],
        "title": "PositionSide",
        "description": "Position side (YES/NO)."
      },
      "PositionSortBy": {
        "type": "string",
        "enum": [
          "value",
          "unrealized_pnl",
          "realized_pnl",
          "cost",
          "avg_price",
          "current_price",
          "entry_date"
        ],
        "title": "PositionSortBy",
        "description": "Sort options for positions."
      },
      "PositionsSummary": {
        "properties": {
          "total_positions": {
            "type": "integer",
            "title": "Total Positions"
          },
          "total_value_usd": {
            "type": "number",
            "title": "Total Value Usd"
          },
          "total_cost_usd": {
            "type": "number",
            "title": "Total Cost Usd"
          },
          "total_unrealized_pnl_usd": {
            "type": "number",
            "title": "Total Unrealized Pnl Usd"
          },
          "total_realized_pnl_usd": {
            "type": "number",
            "title": "Total Realized Pnl Usd"
          },
          "win_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Win Rate"
          },
          "winning_positions": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Winning Positions"
          },
          "losing_positions": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Losing Positions"
          },
          "fees_paid": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fees Paid",
            "description": "Total taker fees paid (USD)"
          },
          "fees_refunded": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fees Refunded",
            "description": "DEPRECATED: always 0. Refunds are already netted into fees_paid."
          },
          "net_fees": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Net Fees",
            "description": "Net fees paid (same as fees_paid, which is already net of refunds)"
          }
        },
        "type": "object",
        "required": [
          "total_positions",
          "total_value_usd",
          "total_cost_usd",
          "total_unrealized_pnl_usd",
          "total_realized_pnl_usd"
        ],
        "title": "PositionsSummary",
        "description": "Summary of all positions."
      },
      "PredictFunOrderbookLevel": {
        "properties": {
          "price": {
            "type": "number",
            "title": "Price",
            "description": "Price level (0-1 range)"
          },
          "size": {
            "type": "number",
            "title": "Size",
            "description": "Size at this price level"
          }
        },
        "type": "object",
        "required": [
          "price",
          "size"
        ],
        "title": "PredictFunOrderbookLevel",
        "description": "Single price level in PredictFun orderbook."
      },
      "PredictFunOrderbookSnapshot": {
        "properties": {
          "market_id": {
            "type": "integer",
            "title": "Market Id",
            "description": "Market ID"
          },
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Snapshot timestamp (Unix epoch MILLISECONDS)"
          },
          "bids": {
            "items": {
              "$ref": "#/components/schemas/PredictFunOrderbookLevel"
            },
            "type": "array",
            "title": "Bids",
            "description": "Bid levels"
          },
          "asks": {
            "items": {
              "$ref": "#/components/schemas/PredictFunOrderbookLevel"
            },
            "type": "array",
            "title": "Asks",
            "description": "Ask levels"
          },
          "best_bid": {
            "type": "number",
            "title": "Best Bid",
            "description": "Best bid price"
          },
          "best_ask": {
            "type": "number",
            "title": "Best Ask",
            "description": "Best ask price"
          },
          "bid_depth": {
            "type": "number",
            "title": "Bid Depth",
            "description": "Total bid depth"
          },
          "ask_depth": {
            "type": "number",
            "title": "Ask Depth",
            "description": "Total ask depth"
          }
        },
        "type": "object",
        "required": [
          "market_id",
          "timestamp",
          "bids",
          "asks",
          "best_bid",
          "best_ask",
          "bid_depth",
          "ask_depth"
        ],
        "title": "PredictFunOrderbookSnapshot",
        "description": "Single PredictFun orderbook snapshot."
      },
      "PredictFunOrderbooksResponse": {
        "properties": {
          "snapshots": {
            "items": {
              "$ref": "#/components/schemas/PredictFunOrderbookSnapshot"
            },
            "type": "array",
            "title": "Snapshots"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "snapshots",
          "pagination"
        ],
        "title": "PredictFunOrderbooksResponse",
        "description": "PredictFun orderbooks endpoint response."
      },
      "PredictMarket": {
        "properties": {
          "market_id": {
            "type": "integer",
            "title": "Market Id"
          },
          "condition_id": {
            "type": "string",
            "title": "Condition Id",
            "default": ""
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "default": ""
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "market_variant": {
            "type": "string",
            "title": "Market Variant",
            "default": ""
          },
          "outcomes": {
            "items": {
              "$ref": "#/components/schemas/PredictOutcome"
            },
            "type": "array",
            "title": "Outcomes"
          },
          "best_bid": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Best Bid"
          },
          "best_ask": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Best Ask"
          },
          "bid_depth": {
            "type": "number",
            "title": "Bid Depth",
            "default": 0
          },
          "ask_depth": {
            "type": "number",
            "title": "Ask Depth",
            "default": 0
          },
          "is_yield_bearing": {
            "type": "boolean",
            "title": "Is Yield Bearing",
            "default": false
          },
          "is_neg_risk": {
            "type": "boolean",
            "title": "Is Neg Risk",
            "default": false
          },
          "event_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Slug"
          },
          "image_url": {
            "type": "string",
            "title": "Image Url",
            "default": ""
          },
          "winning_outcome": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Winning Outcome"
          },
          "payout_numerators": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Payout Numerators",
            "default": []
          },
          "resolution_block": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution Block"
          },
          "resolution_tx": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolution Tx"
          },
          "created_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created Time",
            "description": "ISO 8601 timestamp"
          },
          "updated_time": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated Time",
            "description": "ISO 8601 timestamp"
          }
        },
        "type": "object",
        "required": [
          "market_id",
          "title",
          "status",
          "outcomes"
        ],
        "title": "PredictMarket",
        "description": "Predict.fun market response model."
      },
      "PredictMarketsResponse": {
        "properties": {
          "markets": {
            "items": {
              "$ref": "#/components/schemas/PredictMarket"
            },
            "type": "array",
            "title": "Markets"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "markets",
          "pagination"
        ],
        "title": "PredictMarketsResponse",
        "description": "Response for Predict.fun markets list endpoint."
      },
      "PredictOutcome": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label"
          },
          "token_id": {
            "type": "string",
            "title": "Token Id",
            "default": ""
          },
          "predexon_id": {
            "type": "string",
            "title": "Predexon Id",
            "default": ""
          },
          "best_bid": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Best Bid"
          },
          "best_ask": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Best Ask"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "PredictOutcome",
        "description": "A single tradeable outcome for a Predict.fun market."
      },
      "PriceData": {
        "properties": {
          "open": {
            "type": "number",
            "title": "Open"
          },
          "high": {
            "type": "number",
            "title": "High"
          },
          "low": {
            "type": "number",
            "title": "Low"
          },
          "close": {
            "type": "number",
            "title": "Close"
          },
          "open_dollars": {
            "type": "string",
            "title": "Open Dollars"
          },
          "high_dollars": {
            "type": "string",
            "title": "High Dollars"
          },
          "low_dollars": {
            "type": "string",
            "title": "Low Dollars"
          },
          "close_dollars": {
            "type": "string",
            "title": "Close Dollars"
          },
          "mean": {
            "type": "number",
            "title": "Mean"
          },
          "mean_dollars": {
            "type": "string",
            "title": "Mean Dollars"
          },
          "previous": {
            "type": "number",
            "title": "Previous"
          },
          "previous_dollars": {
            "type": "string",
            "title": "Previous Dollars"
          }
        },
        "type": "object",
        "required": [
          "open",
          "high",
          "low",
          "close",
          "open_dollars",
          "high_dollars",
          "low_dollars",
          "close_dollars",
          "mean",
          "mean_dollars",
          "previous",
          "previous_dollars"
        ],
        "title": "PriceData",
        "description": "Price data within candlestick."
      },
      "RecurrenceOption": {
        "type": "string",
        "enum": [
          "daily",
          "weekly",
          "monthly"
        ],
        "title": "RecurrenceOption"
      },
      "RootResponse": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "API name"
          },
          "version": {
            "type": "string",
            "title": "Version",
            "description": "API version"
          },
          "endpoints": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Endpoints",
            "description": "Map of endpoint names to paths"
          }
        },
        "type": "object",
        "required": [
          "name",
          "version",
          "endpoints"
        ],
        "title": "RootResponse",
        "description": "Root endpoint response with API info."
      },
      "SimilarWalletEntry": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank",
            "description": "Similarity rank (1 = most similar)"
          },
          "user": {
            "type": "string",
            "title": "User",
            "description": "Wallet address"
          },
          "markets_overlap": {
            "type": "integer",
            "title": "Markets Overlap",
            "description": "Number of markets traded by both wallets"
          },
          "overlap_pct": {
            "type": "number",
            "title": "Overlap Pct",
            "description": "Percentage of target's markets also traded by this wallet (0-1)"
          },
          "total_markets": {
            "type": "integer",
            "title": "Total Markets",
            "description": "Total markets this wallet has traded"
          },
          "metrics": {
            "$ref": "#/components/schemas/WindowMetrics",
            "description": "This wallet's global metrics"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "user",
          "markets_overlap",
          "overlap_pct",
          "total_markets",
          "metrics"
        ],
        "title": "SimilarWalletEntry",
        "description": "A wallet similar to the target wallet."
      },
      "SmartActivityMarket": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id",
            "description": "Market condition ID"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "Market title"
          },
          "market_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Slug",
            "description": "Market slug for URL construction"
          },
          "smart_wallet_count": {
            "type": "integer",
            "title": "Smart Wallet Count",
            "description": "Number of smart wallets that traded this market"
          },
          "smart_volume": {
            "type": "number",
            "title": "Smart Volume",
            "description": "Total volume from smart wallets (USD)"
          },
          "smart_realized_pnl": {
            "type": "number",
            "title": "Smart Realized Pnl",
            "description": "Total realized PnL from smart wallets (USD)"
          },
          "smart_total_pnl": {
            "type": "number",
            "title": "Smart Total Pnl",
            "description": "Total net total PnL from smart wallets (USD)"
          },
          "avg_smart_roi": {
            "type": "number",
            "title": "Avg Smart Roi",
            "description": "Average ROI of smart wallets in this market"
          },
          "avg_smart_win_rate": {
            "type": "number",
            "title": "Avg Smart Win Rate",
            "description": "Average win rate of smart wallets in this market"
          },
          "net_buyers_pct": {
            "type": "number",
            "title": "Net Buyers Pct",
            "description": "Percentage of smart wallets that are net buyers (0-1)"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "smart_wallet_count",
          "smart_volume",
          "smart_realized_pnl",
          "smart_total_pnl",
          "avg_smart_roi",
          "avg_smart_win_rate",
          "net_buyers_pct"
        ],
        "title": "SmartActivityMarket",
        "description": "Market with smart wallet activity stats."
      },
      "SmartActivityResponse": {
        "properties": {
          "smart_wallet_criteria": {
            "type": "object",
            "title": "Smart Wallet Criteria",
            "description": "Criteria used to define smart wallets"
          },
          "window": {
            "$ref": "#/components/schemas/TimeWindow",
            "description": "Time window for metrics"
          },
          "markets": {
            "items": {
              "$ref": "#/components/schemas/SmartActivityMarket"
            },
            "type": "array",
            "title": "Markets",
            "description": "Markets with smart wallet activity"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination",
            "description": "Pagination info"
          }
        },
        "type": "object",
        "required": [
          "smart_wallet_criteria",
          "window",
          "markets",
          "pagination"
        ],
        "title": "SmartActivityResponse",
        "description": "Response for market discovery endpoint."
      },
      "SmartActivitySortBy": {
        "type": "string",
        "enum": [
          "smart_volume",
          "smart_wallet_count",
          "smart_realized_pnl",
          "smart_total_pnl",
          "avg_smart_roi"
        ],
        "title": "SmartActivitySortBy",
        "description": "Sort options for smart activity markets."
      },
      "SmartMoneyPositioning": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id",
            "description": "Market condition ID"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "Market title"
          },
          "market_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Slug",
            "description": "Market slug for URL construction"
          },
          "smart_wallet_count": {
            "type": "integer",
            "title": "Smart Wallet Count",
            "description": "Number of smart wallets in this market"
          },
          "net_buyers": {
            "type": "integer",
            "title": "Net Buyers",
            "description": "Smart wallets that are net buyers (buy_volume > sell_volume)"
          },
          "net_sellers": {
            "type": "integer",
            "title": "Net Sellers",
            "description": "Smart wallets that are net sellers"
          },
          "neutral": {
            "type": "integer",
            "title": "Neutral",
            "description": "Smart wallets with balanced buy/sell"
          },
          "net_buyers_pct": {
            "type": "number",
            "title": "Net Buyers Pct",
            "description": "Percentage of smart wallets that are net buyers (0-1)"
          },
          "total_smart_volume": {
            "type": "number",
            "title": "Total Smart Volume",
            "description": "Total volume from smart wallets (USD)"
          },
          "total_smart_buy_volume": {
            "type": "number",
            "title": "Total Smart Buy Volume",
            "description": "Total buy volume from smart wallets (USD)"
          },
          "total_smart_sell_volume": {
            "type": "number",
            "title": "Total Smart Sell Volume",
            "description": "Total sell volume from smart wallets (USD)"
          },
          "avg_smart_buy_price": {
            "type": "number",
            "title": "Avg Smart Buy Price",
            "description": "Volume-weighted average buy price of smart wallets (0-1)"
          },
          "avg_smart_sell_price": {
            "type": "number",
            "title": "Avg Smart Sell Price",
            "description": "Volume-weighted average sell price of smart wallets (0-1)"
          },
          "total_smart_realized_pnl": {
            "type": "number",
            "title": "Total Smart Realized Pnl",
            "description": "Total realized PnL from smart wallets (USD)"
          },
          "total_smart_total_pnl": {
            "type": "number",
            "title": "Total Smart Total Pnl",
            "description": "Total net total PnL from smart wallets (USD)"
          },
          "avg_smart_roi": {
            "type": "number",
            "title": "Avg Smart Roi",
            "description": "Average ROI of smart wallets"
          },
          "avg_smart_win_rate": {
            "type": "number",
            "title": "Avg Smart Win Rate",
            "description": "Average win rate of smart wallets"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "smart_wallet_count",
          "net_buyers",
          "net_sellers",
          "neutral",
          "net_buyers_pct",
          "total_smart_volume",
          "total_smart_buy_volume",
          "total_smart_sell_volume",
          "avg_smart_buy_price",
          "avg_smart_sell_price",
          "total_smart_realized_pnl",
          "total_smart_total_pnl",
          "avg_smart_roi",
          "avg_smart_win_rate"
        ],
        "title": "SmartMoneyPositioning",
        "description": "Aggregate smart money positioning for a market."
      },
      "SmartMoneyResponse": {
        "properties": {
          "smart_wallet_criteria": {
            "type": "object",
            "title": "Smart Wallet Criteria",
            "description": "Criteria used to define smart wallets"
          },
          "window": {
            "$ref": "#/components/schemas/TimeWindow",
            "description": "Time window for metrics"
          },
          "positioning": {
            "$ref": "#/components/schemas/SmartMoneyPositioning",
            "description": "Smart money positioning data"
          }
        },
        "type": "object",
        "required": [
          "smart_wallet_criteria",
          "window",
          "positioning"
        ],
        "title": "SmartMoneyResponse",
        "description": "Response for smart money positioning endpoint."
      },
      "SortOrder": {
        "type": "string",
        "enum": [
          "asc",
          "desc"
        ],
        "title": "SortOrder"
      },
      "StatusFilter": {
        "type": "string",
        "enum": [
          "open",
          "closed"
        ],
        "title": "StatusFilter"
      },
      "StatusOption": {
        "type": "string",
        "enum": [
          "open",
          "closed"
        ],
        "title": "StatusOption"
      },
      "TagSort": {
        "type": "string",
        "enum": [
          "volume_7d",
          "volume_1d",
          "volume_30d",
          "volume_all_time",
          "open_interest",
          "markets"
        ],
        "title": "TagSort"
      },
      "TimeWindow": {
        "type": "string",
        "enum": [
          "1d",
          "7d",
          "30d",
          "all_time"
        ],
        "title": "TimeWindow",
        "description": "Time window for rolling metrics."
      },
      "TopHolderEntry": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank",
            "description": "Position in list (1-indexed)"
          },
          "user": {
            "type": "string",
            "title": "User",
            "description": "Wallet address"
          },
          "token_id": {
            "type": "string",
            "title": "Token Id",
            "description": "Token ID for this position"
          },
          "position_shares": {
            "type": "number",
            "title": "Position Shares",
            "description": "Total shares held (normalized)"
          },
          "position_value_usd": {
            "type": "number",
            "title": "Position Value Usd",
            "description": "Estimated position value in USD"
          },
          "side": {
            "type": "string",
            "title": "Side",
            "description": "Position side (Yes/No or custom label)"
          },
          "outcome_index": {
            "type": "integer",
            "title": "Outcome Index",
            "description": "Outcome index: 0 for Yes/first outcome, 1 for No/second outcome"
          },
          "avg_price": {
            "type": "number",
            "title": "Avg Price",
            "description": "Average entry price (0-1)"
          },
          "realized_pnl": {
            "type": "number",
            "title": "Realized Pnl",
            "description": "Realized PnL in USD"
          },
          "unrealized_pnl": {
            "type": "number",
            "title": "Unrealized Pnl",
            "description": "Unrealized PnL in USD"
          },
          "total_pnl": {
            "type": "number",
            "title": "Total Pnl",
            "description": "Total PnL in USD (realized + unrealized)"
          },
          "trade_count": {
            "type": "integer",
            "title": "Trade Count",
            "description": "Number of trades"
          },
          "first_trade_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Trade At",
            "description": "Unix timestamp of first trade"
          },
          "last_trade_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Trade At",
            "description": "Unix timestamp of last trade"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "user",
          "token_id",
          "position_shares",
          "position_value_usd",
          "side",
          "outcome_index",
          "avg_price",
          "realized_pnl",
          "unrealized_pnl",
          "total_pnl",
          "trade_count"
        ],
        "title": "TopHolderEntry",
        "description": "Single entry in the top holders list."
      },
      "TopHoldersResponse": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id",
            "description": "Market condition ID"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "Market title"
          },
          "market_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Slug",
            "description": "Market slug"
          },
          "side": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Side",
            "description": "Position side filter applied ('yes', 'no', or null for all)"
          },
          "total_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Count",
            "description": "Total number of holders matching filters (only if include_count=true)"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/TopHolderEntry"
            },
            "type": "array",
            "title": "Entries",
            "description": "Top holder entries"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination",
            "description": "Pagination info"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "entries",
          "pagination"
        ],
        "title": "TopHoldersResponse",
        "description": "Response for market top holders endpoint."
      },
      "Trade": {
        "properties": {
          "token_id": {
            "type": "string",
            "title": "Token Id"
          },
          "side": {
            "$ref": "#/components/schemas/OrderSide"
          },
          "market_slug": {
            "type": "string",
            "title": "Market Slug"
          },
          "condition_id": {
            "type": "string",
            "title": "Condition Id"
          },
          "shares": {
            "type": "integer",
            "title": "Shares",
            "description": "Shares (raw blockchain units)"
          },
          "shares_normalized": {
            "type": "number",
            "title": "Shares Normalized",
            "description": "Shares normalized (raw / 1000000)"
          },
          "price": {
            "type": "number",
            "title": "Price",
            "description": "Trade price (0-1 range)"
          },
          "amount_usd": {
            "type": "number",
            "title": "Amount Usd",
            "description": "Trade value in USD"
          },
          "tx_hash": {
            "type": "string",
            "title": "Tx Hash"
          },
          "title": {
            "type": "string",
            "title": "Title"
          },
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Unix timestamp in seconds"
          },
          "order_hash": {
            "type": "string",
            "title": "Order Hash",
            "description": "Order hash (same order can have multiple fills)"
          },
          "user": {
            "type": "string",
            "title": "User",
            "description": "Maker address"
          },
          "taker": {
            "type": "string",
            "title": "Taker",
            "description": "Taker address (counterparty)"
          },
          "is_yes_side": {
            "type": "boolean",
            "title": "Is Yes Side",
            "description": "True if trade is for YES token, False for NO token"
          },
          "outcome_label": {
            "type": "string",
            "title": "Outcome Label",
            "description": "Human-readable outcome label (e.g., 'Yes', 'No', 'Trump', 'Harris')",
            "default": ""
          },
          "fee_usd": {
            "type": "number",
            "title": "Fee Usd",
            "description": "Trading fee in USD",
            "default": 0.0
          },
          "exchange_version": {
            "type": "integer",
            "title": "Exchange Version",
            "description": "Exchange contract version: 1 = V1 (CTF/NegRiskCTF), 2 = V2",
            "default": 1
          },
          "builder": {
            "type": "string",
            "title": "Builder",
            "description": "V2 builder attribution tag (bytes32 hex). Empty for V1 fills or V2 fills with no builder.",
            "default": ""
          },
          "metadata": {
            "type": "string",
            "title": "Metadata",
            "description": "V2 opaque metadata tag (bytes32 hex). Empty for V1 fills or V2 fills with no metadata.",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "token_id",
          "side",
          "market_slug",
          "condition_id",
          "shares",
          "shares_normalized",
          "price",
          "amount_usd",
          "tx_hash",
          "title",
          "timestamp",
          "order_hash",
          "user",
          "taker",
          "is_yes_side"
        ],
        "title": "Trade",
        "description": "Trade model for Polymarket trades."
      },
      "TradeTypeOption": {
        "type": "string",
        "enum": [
          "amm",
          "clob"
        ],
        "title": "TradeTypeOption"
      },
      "TradesResponse": {
        "properties": {
          "trades": {
            "items": {
              "$ref": "#/components/schemas/Trade"
            },
            "type": "array",
            "title": "Trades"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "trades",
          "pagination"
        ],
        "title": "TradesResponse",
        "description": "Trades endpoint response."
      },
      "TradingStyleFlags": {
        "properties": {
          "is_whale": {
            "type": "boolean",
            "title": "Is Whale",
            "description": "Large position trader (avg trade > $1000)"
          },
          "is_market_maker": {
            "type": "boolean",
            "title": "Is Market Maker",
            "description": "Balanced buy/sell + frequent trading"
          },
          "is_active_trader": {
            "type": "boolean",
            "title": "Is Active Trader",
            "description": "High trade frequency (>4 trades/position)"
          },
          "is_buy_and_hold": {
            "type": "boolean",
            "title": "Is Buy And Hold",
            "description": "Long holding periods (<=2 trades/position)"
          },
          "is_degen": {
            "type": "boolean",
            "title": "Is Degen",
            "description": "High-risk pattern (win rate < 35%, 50+ closes)"
          },
          "is_high_conviction": {
            "type": "boolean",
            "title": "Is High Conviction",
            "description": "Buys at high YES prices (>=0.80)"
          },
          "is_contrarian": {
            "type": "boolean",
            "title": "Is Contrarian",
            "description": "Takes unpopular sides (<=0.25)"
          },
          "is_value_hunter": {
            "type": "boolean",
            "title": "Is Value Hunter",
            "description": "Enters at uncertain odds (0.35-0.55)"
          },
          "primary_style": {
            "type": "string",
            "title": "Primary Style",
            "description": "Primary trading style classification"
          }
        },
        "type": "object",
        "required": [
          "is_whale",
          "is_market_maker",
          "is_active_trader",
          "is_buy_and_hold",
          "is_degen",
          "is_high_conviction",
          "is_contrarian",
          "is_value_hunter",
          "primary_style"
        ],
        "title": "TradingStyleFlags",
        "description": "Multi-label trading style classification."
      },
      "UmaEvent": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "source_contract": {
            "type": "string",
            "title": "Source Contract"
          },
          "block_number": {
            "type": "integer",
            "title": "Block Number"
          },
          "block_timestamp": {
            "type": "integer",
            "title": "Block Timestamp"
          },
          "log_index": {
            "type": "integer",
            "title": "Log Index"
          },
          "tx_hash": {
            "type": "string",
            "title": "Tx Hash"
          },
          "question_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Question Id"
          },
          "game_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Game Id"
          },
          "sports_market_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sports Market Id"
          },
          "condition_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Condition Id"
          },
          "requester": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requester"
          },
          "proposer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proposer"
          },
          "disputer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disputer"
          },
          "proposed_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Proposed Price"
          },
          "settled_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Settled Price"
          },
          "payout": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payout"
          },
          "expiration_time": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expiration Time"
          },
          "payouts": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Payouts"
          },
          "home_score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Home Score"
          },
          "away_score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Away Score"
          },
          "bond_amount": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bond Amount"
          },
          "liveness_amount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Liveness Amount"
          },
          "ancillary_data": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ancillary Data"
          }
        },
        "type": "object",
        "required": [
          "id",
          "event_type",
          "source_contract",
          "block_number",
          "block_timestamp",
          "log_index",
          "tx_hash"
        ],
        "title": "UmaEvent",
        "description": "Single UMA event row from uma_event_by_market."
      },
      "UmaMarketDetailResponse": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id"
          },
          "question": {
            "$ref": "#/components/schemas/UmaQuestionStatus"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/UmaEvent"
            },
            "type": "array",
            "title": "Events"
          },
          "events_pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "question",
          "events_pagination"
        ],
        "title": "UmaMarketDetailResponse",
        "description": "Single-market response: current status + event history."
      },
      "UmaMarketsListItem": {
        "properties": {
          "question": {
            "$ref": "#/components/schemas/UmaQuestionStatus"
          }
        },
        "type": "object",
        "required": [
          "question"
        ],
        "title": "UmaMarketsListItem"
      },
      "UmaMarketsListResponse": {
        "properties": {
          "state": {
            "type": "string",
            "title": "State"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/UmaMarketsListItem"
            },
            "type": "array",
            "title": "Items"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "state",
          "items",
          "pagination"
        ],
        "title": "UmaMarketsListResponse"
      },
      "UmaQuestionState": {
        "type": "string",
        "enum": [
          "pending",
          "proposed",
          "disputed",
          "reset",
          "resolved"
        ],
        "title": "UmaQuestionState"
      },
      "UmaQuestionStatus": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Question ID (bytes32 hex)"
          },
          "adapter": {
            "type": "string",
            "title": "Adapter",
            "description": "Source adapter contract address"
          },
          "condition_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Condition Id"
          },
          "market_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Id",
            "description": "Polymarket market ID (decimal string)"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "state": {
            "$ref": "#/components/schemas/UmaQuestionState"
          },
          "is_paused": {
            "type": "boolean",
            "title": "Is Paused",
            "default": false
          },
          "is_flagged": {
            "type": "boolean",
            "title": "Is Flagged",
            "default": false
          },
          "resolved_price": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved Price",
            "description": "UMA payout numerator (1e18-scaled, string)"
          },
          "resolved_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resolved At"
          },
          "paused_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Paused At"
          },
          "flagged_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Flagged At"
          },
          "last_event_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Event At"
          },
          "last_tx_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Tx Hash"
          },
          "reset_count": {
            "type": "integer",
            "title": "Reset Count",
            "default": 0
          },
          "reward": {
            "type": "string",
            "title": "Reward",
            "description": "Proposer reward (1e18-scaled, string)"
          },
          "proposal_bond": {
            "type": "string",
            "title": "Proposal Bond",
            "description": "Proposal bond (1e18-scaled, string)"
          },
          "reward_token": {
            "type": "string",
            "title": "Reward Token"
          },
          "request_timestamp": {
            "type": "integer",
            "title": "Request Timestamp"
          },
          "creator": {
            "type": "string",
            "title": "Creator"
          },
          "created_block": {
            "type": "integer",
            "title": "Created Block"
          },
          "created_tx_hash": {
            "type": "string",
            "title": "Created Tx Hash"
          }
        },
        "type": "object",
        "required": [
          "id",
          "adapter",
          "state",
          "reward",
          "proposal_bond",
          "reward_token",
          "request_timestamp",
          "creator",
          "created_block",
          "created_tx_hash"
        ],
        "title": "UmaQuestionStatus",
        "description": "UMA question status (regular non-sports markets)."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VolumeChartDataPoint": {
        "properties": {
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Unix timestamp in seconds (start of period)"
          },
          "total_volume": {
            "type": "number",
            "title": "Total Volume",
            "description": "Total USD volume in this period"
          },
          "yes_volume": {
            "type": "number",
            "title": "Yes Volume",
            "description": "YES-side USD volume in this period"
          },
          "no_volume": {
            "type": "number",
            "title": "No Volume",
            "description": "NO-side USD volume in this period"
          },
          "trades_count": {
            "type": "integer",
            "title": "Trades Count",
            "description": "Number of trades in this period"
          }
        },
        "type": "object",
        "required": [
          "timestamp",
          "total_volume",
          "yes_volume",
          "no_volume",
          "trades_count"
        ],
        "title": "VolumeChartDataPoint",
        "description": "Individual volume chart data point."
      },
      "VolumeChartGranularity": {
        "type": "string",
        "enum": [
          "hour",
          "day",
          "week"
        ],
        "title": "VolumeChartGranularity",
        "description": "Granularity for volume chart endpoint."
      },
      "VolumeChartResponse": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id",
            "description": "Market condition ID"
          },
          "granularity": {
            "$ref": "#/components/schemas/VolumeChartGranularity",
            "description": "Time granularity"
          },
          "start_time": {
            "type": "integer",
            "title": "Start Time",
            "description": "Unix timestamp of first data point"
          },
          "end_time": {
            "type": "integer",
            "title": "End Time",
            "description": "Unix timestamp of last data point"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/VolumeChartDataPoint"
            },
            "type": "array",
            "title": "Data",
            "description": "Volume data points"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "granularity",
          "start_time",
          "end_time",
          "data"
        ],
        "title": "VolumeChartResponse",
        "description": "Volume chart endpoint response."
      },
      "VolumeDataPoint": {
        "properties": {
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Unix timestamp in seconds"
          },
          "volume": {
            "type": "number",
            "title": "Volume",
            "description": "Cumulative volume up to this point"
          },
          "buy_volume": {
            "type": "number",
            "title": "Buy Volume",
            "description": "Cumulative buy volume up to this point"
          },
          "sell_volume": {
            "type": "number",
            "title": "Sell Volume",
            "description": "Cumulative sell volume up to this point"
          }
        },
        "type": "object",
        "required": [
          "timestamp",
          "volume",
          "buy_volume",
          "sell_volume"
        ],
        "title": "VolumeDataPoint",
        "description": "Individual volume data point."
      },
      "WalletBuilderFeeBreakdownEntry": {
        "properties": {
          "builder_code": {
            "type": "string",
            "title": "Builder Code",
            "description": "Builder code, bytes32 hex"
          },
          "builder_fee_usd": {
            "type": "number",
            "title": "Builder Fee Usd",
            "description": "Builder fees this wallet paid to this builder"
          },
          "volume_usd": {
            "type": "number",
            "title": "Volume Usd",
            "description": "Wallet's attributed trade notional via this builder"
          },
          "trade_count": {
            "type": "integer",
            "title": "Trade Count",
            "description": "Number of attributed fill legs"
          },
          "taker_fill_count": {
            "type": "integer",
            "title": "Taker Fill Count",
            "description": "Fill legs where wallet was the taker"
          },
          "maker_fill_count": {
            "type": "integer",
            "title": "Maker Fill Count",
            "description": "Fill legs where wallet was the maker"
          },
          "current_taker_bps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Taker Bps",
            "description": "Current taker bps for this builder"
          },
          "current_maker_bps": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Maker Bps",
            "description": "Current maker bps for this builder"
          }
        },
        "type": "object",
        "required": [
          "builder_code",
          "builder_fee_usd",
          "volume_usd",
          "trade_count",
          "taker_fill_count",
          "maker_fill_count"
        ],
        "title": "WalletBuilderFeeBreakdownEntry",
        "description": "Per-builder breakdown of fees a single wallet paid."
      },
      "WalletBuilderFeesResponse": {
        "properties": {
          "wallet_address": {
            "type": "string",
            "title": "Wallet Address",
            "description": "Wallet address (lowercased)"
          },
          "window": {
            "type": "string",
            "title": "Window",
            "description": "Time window: 24h, 7d, 30d, all, or 'custom' when start_time/end_time supplied"
          },
          "start_time": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time",
            "description": "Echo of start_time query param (Unix seconds), if provided"
          },
          "end_time": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Time",
            "description": "Echo of end_time query param (Unix seconds), if provided"
          },
          "builder_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Builder Code",
            "description": "Echo of builder_code filter, if provided"
          },
          "total_builder_fee_usd": {
            "type": "number",
            "title": "Total Builder Fee Usd",
            "description": "Total builder fees this wallet paid across all (filtered) builders"
          },
          "total_volume_usd": {
            "type": "number",
            "title": "Total Volume Usd",
            "description": "Wallet's total attributed V2 trade notional"
          },
          "total_trade_count": {
            "type": "integer",
            "title": "Total Trade Count",
            "description": "Total attributed fill legs"
          },
          "builder_count": {
            "type": "integer",
            "title": "Builder Count",
            "description": "Distinct builders this wallet traded via (within filter)"
          },
          "breakdown": {
            "items": {
              "$ref": "#/components/schemas/WalletBuilderFeeBreakdownEntry"
            },
            "type": "array",
            "title": "Breakdown",
            "description": "Per-builder breakdown, ranked by builder_fee_usd desc"
          }
        },
        "type": "object",
        "required": [
          "wallet_address",
          "window",
          "total_builder_fee_usd",
          "total_volume_usd",
          "total_trade_count",
          "builder_count"
        ],
        "title": "WalletBuilderFeesResponse",
        "description": "Builder fees a wallet has paid, with optional per-builder breakdown."
      },
      "WalletClusterResponse": {
        "properties": {
          "seed": {
            "type": "string",
            "title": "Seed",
            "description": "Seed wallet address"
          },
          "siblings": {
            "items": {
              "$ref": "#/components/schemas/ClusterSiblingEntry"
            },
            "type": "array",
            "title": "Siblings",
            "description": "Top sibling wallets by confidence"
          },
          "computed_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Computed At",
            "description": "Unix timestamp when this cluster was last computed"
          }
        },
        "type": "object",
        "required": [
          "seed",
          "siblings"
        ],
        "title": "WalletClusterResponse",
        "description": "Connected wallets for a seed wallet."
      },
      "WalletFilterEntry": {
        "properties": {
          "rank": {
            "type": "integer",
            "title": "Rank",
            "description": "Position in results (1-indexed)"
          },
          "user": {
            "type": "string",
            "title": "User",
            "description": "Wallet address"
          },
          "metrics": {
            "$ref": "#/components/schemas/WindowMetrics",
            "description": "Combined metrics across specified markets (aggregated from per-market data)"
          },
          "entry_edge": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entry Edge",
            "description": "Combined price edge across specified markets (avg_sell - avg_buy)"
          },
          "markets_matched": {
            "type": "integer",
            "title": "Markets Matched",
            "description": "Number of specified markets this wallet traded"
          }
        },
        "type": "object",
        "required": [
          "rank",
          "user",
          "metrics",
          "markets_matched"
        ],
        "title": "WalletFilterEntry",
        "description": "Single entry in wallet filter results."
      },
      "WalletFilterResponse": {
        "properties": {
          "markets": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Markets",
            "description": "Market condition IDs used in filter"
          },
          "market_logic": {
            "$ref": "#/components/schemas/MarketFilterLogic",
            "description": "Logic used: AND or OR"
          },
          "window": {
            "$ref": "#/components/schemas/TimeWindow",
            "description": "Time window for metrics"
          },
          "sort_by": {
            "$ref": "#/components/schemas/LeaderboardSortBy",
            "description": "Sort field used"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/WalletFilterEntry"
            },
            "type": "array",
            "title": "Entries",
            "description": "Matching wallets"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination",
            "description": "Pagination info"
          }
        },
        "type": "object",
        "required": [
          "markets",
          "market_logic",
          "window",
          "sort_by",
          "entries",
          "pagination"
        ],
        "title": "WalletFilterResponse",
        "description": "Response for wallet filter by markets endpoint."
      },
      "WalletIdentitiesRequest": {
        "properties": {
          "addresses": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 200,
            "title": "Addresses",
            "description": "Wallet addresses to look up (max 200)"
          }
        },
        "type": "object",
        "required": [
          "addresses"
        ],
        "title": "WalletIdentitiesRequest",
        "description": "Bulk identity lookup request."
      },
      "WalletIdentitiesResponse": {
        "properties": {
          "profiles": {
            "additionalProperties": {
              "$ref": "#/components/schemas/WalletIdentity"
            },
            "type": "object",
            "title": "Profiles",
            "description": "Map of requested address (lowercase) -> profile. Missing addresses are omitted."
          }
        },
        "type": "object",
        "required": [
          "profiles"
        ],
        "title": "WalletIdentitiesResponse",
        "description": "Bulk identity lookup response."
      },
      "WalletIdentity": {
        "properties": {
          "address": {
            "type": "string",
            "title": "Address",
            "description": "Wallet address (proxy / safe address)"
          },
          "signer": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Signer",
            "description": "Underlying EOA / signer address"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type",
            "description": "Wallet type (proxy, safe, eoa, etc.)"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name",
            "description": "User-set display name from Gamma profile"
          },
          "pseudonym": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pseudonym",
            "description": "Auto-generated pseudonym"
          },
          "bio": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bio",
            "description": "User bio"
          },
          "profile_image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Image",
            "description": "Profile picture URL"
          },
          "x_username": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "X Username",
            "description": "Linked X (Twitter) username"
          },
          "verified_badge": {
            "type": "boolean",
            "title": "Verified Badge",
            "description": "Verified badge on Polymarket",
            "default": false
          },
          "is_creator": {
            "type": "boolean",
            "title": "Is Creator",
            "description": "Polymarket market creator",
            "default": false
          },
          "is_mod": {
            "type": "boolean",
            "title": "Is Mod",
            "description": "Polymarket moderator",
            "default": false
          },
          "usdc_balance": {
            "type": "number",
            "title": "Usdc Balance",
            "description": "On-chain USDC balance (USD)",
            "default": 0.0
          },
          "last_transfer_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Transfer At",
            "description": "Unix ts of last USDC transfer"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At",
            "description": "Unix ts the wallet was first observed"
          },
          "profile_fetched_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Profile Fetched At",
            "description": "Unix ts profile was last refreshed from Gamma"
          }
        },
        "type": "object",
        "required": [
          "address"
        ],
        "title": "WalletIdentity",
        "description": "Identity + profile metadata for a Polymarket wallet."
      },
      "WalletIdentityResponse": {
        "properties": {
          "address": {
            "type": "string",
            "title": "Address",
            "description": "Requested wallet address (lowercased)"
          },
          "found": {
            "type": "boolean",
            "title": "Found",
            "description": "Whether a wallet record was found"
          },
          "profile": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WalletIdentity"
              },
              {
                "type": "null"
              }
            ],
            "description": "Profile data if found"
          }
        },
        "type": "object",
        "required": [
          "address",
          "found"
        ],
        "title": "WalletIdentityResponse",
        "description": "Response for the single-wallet identity endpoint."
      },
      "WalletMarketEntry": {
        "properties": {
          "condition_id": {
            "type": "string",
            "title": "Condition Id",
            "description": "Market condition ID"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title",
            "description": "Market title (resolved from market_state)"
          },
          "market_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Slug",
            "description": "Market slug for URL construction"
          },
          "metrics": {
            "$ref": "#/components/schemas/WindowMetrics",
            "description": "Metrics for selected window"
          },
          "entry_edge": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entry Edge",
            "description": "Price edge for this market"
          },
          "first_trade_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Trade At",
            "description": "First trade timestamp in this market"
          },
          "last_trade_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Trade At",
            "description": "Last trade timestamp in this market"
          }
        },
        "type": "object",
        "required": [
          "condition_id",
          "metrics"
        ],
        "title": "WalletMarketEntry",
        "description": "Per-market metrics for a wallet."
      },
      "WalletMarketsResponse": {
        "properties": {
          "user": {
            "type": "string",
            "title": "User",
            "description": "Wallet address"
          },
          "window": {
            "$ref": "#/components/schemas/TimeWindow",
            "description": "Time window for metrics"
          },
          "markets": {
            "items": {
              "$ref": "#/components/schemas/WalletMarketEntry"
            },
            "type": "array",
            "title": "Markets",
            "description": "Per-market metrics"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination",
            "description": "Pagination info"
          }
        },
        "type": "object",
        "required": [
          "user",
          "window",
          "markets",
          "pagination"
        ],
        "title": "WalletMarketsResponse",
        "description": "Response for wallet's per-market breakdown."
      },
      "WalletMetrics": {
        "properties": {
          "one_day": {
            "$ref": "#/components/schemas/WindowMetrics",
            "description": "1-day rolling metrics"
          },
          "seven_day": {
            "$ref": "#/components/schemas/WindowMetrics",
            "description": "7-day rolling metrics"
          },
          "thirty_day": {
            "$ref": "#/components/schemas/WindowMetrics",
            "description": "30-day rolling metrics"
          },
          "all_time": {
            "$ref": "#/components/schemas/AllTimeMetrics",
            "description": "All-time metrics"
          }
        },
        "type": "object",
        "required": [
          "one_day",
          "seven_day",
          "thirty_day",
          "all_time"
        ],
        "title": "WalletMetrics",
        "description": "All metrics for a wallet across all time windows."
      },
      "WalletPnLResponse": {
        "properties": {
          "granularity": {
            "$ref": "#/components/schemas/PnLGranularity"
          },
          "start_time": {
            "type": "integer",
            "title": "Start Time"
          },
          "end_time": {
            "type": "integer",
            "title": "End Time"
          },
          "wallet_address": {
            "type": "string",
            "title": "Wallet Address"
          },
          "realized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Realized Pnl",
            "description": "Current total realized PnL (USD)"
          },
          "unrealized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrealized Pnl",
            "description": "Current unrealized PnL (USD), computed live from positions"
          },
          "fees_paid": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fees Paid",
            "description": "Total taker fees paid (USD)"
          },
          "fees_refunded": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fees Refunded",
            "description": "DEPRECATED: always 0. Refunds are already netted into fees_paid."
          },
          "total_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Pnl",
            "description": "realized + unrealized - fees_paid (USD)"
          },
          "pnl_over_time": {
            "items": {
              "$ref": "#/components/schemas/PnLDataPoint"
            },
            "type": "array",
            "title": "Pnl Over Time"
          }
        },
        "type": "object",
        "required": [
          "granularity",
          "start_time",
          "end_time",
          "wallet_address",
          "pnl_over_time"
        ],
        "title": "WalletPnLResponse",
        "description": "Wallet PnL endpoint response."
      },
      "WalletPositionsResponse": {
        "properties": {
          "wallet_address": {
            "type": "string",
            "title": "Wallet Address"
          },
          "positions": {
            "items": {
              "$ref": "#/components/schemas/Position"
            },
            "type": "array",
            "title": "Positions"
          },
          "summary": {
            "$ref": "#/components/schemas/PositionsSummary"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination"
          }
        },
        "type": "object",
        "required": [
          "wallet_address",
          "positions",
          "summary",
          "pagination"
        ],
        "title": "WalletPositionsResponse",
        "description": "Wallet positions endpoint response."
      },
      "WalletProfileResponse": {
        "properties": {
          "user": {
            "type": "string",
            "title": "User",
            "description": "Wallet address"
          },
          "metrics": {
            "$ref": "#/components/schemas/WalletMetrics",
            "description": "Metrics across all windows"
          },
          "trading_styles": {
            "$ref": "#/components/schemas/TradingStyleFlags",
            "description": "Trading style classifications"
          },
          "entry_edge": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entry Edge",
            "description": "Price edge (avg_sell - avg_buy)"
          },
          "unrealized_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unrealized Pnl",
            "description": "Total unrealized PnL in USD"
          },
          "total_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Pnl",
            "description": "Total PnL (realized + unrealized - net fees)"
          },
          "first_trade_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Trade At",
            "description": "Unix timestamp of first trade"
          },
          "last_trade_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Trade At",
            "description": "Unix timestamp of last trade"
          },
          "computed_at": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Computed At",
            "description": "Unix timestamp when metrics were computed"
          }
        },
        "type": "object",
        "required": [
          "user",
          "metrics",
          "trading_styles"
        ],
        "title": "WalletProfileResponse",
        "description": "Full wallet profile response."
      },
      "WalletSimilarityResponse": {
        "properties": {
          "target_wallet": {
            "type": "string",
            "title": "Target Wallet",
            "description": "The wallet we're finding similar wallets for"
          },
          "target_market_count": {
            "type": "integer",
            "title": "Target Market Count",
            "description": "Number of markets the target wallet has traded"
          },
          "window": {
            "$ref": "#/components/schemas/TimeWindow",
            "description": "Time window for metrics"
          },
          "similar_wallets": {
            "items": {
              "$ref": "#/components/schemas/SimilarWalletEntry"
            },
            "type": "array",
            "title": "Similar Wallets",
            "description": "Wallets with similar market portfolios"
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPagination",
            "description": "Pagination info"
          }
        },
        "type": "object",
        "required": [
          "target_wallet",
          "target_market_count",
          "window",
          "similar_wallets",
          "pagination"
        ],
        "title": "WalletSimilarityResponse",
        "description": "Response for wallet similarity endpoint."
      },
      "WalletVolumeChartDataPoint": {
        "properties": {
          "timestamp": {
            "type": "integer",
            "title": "Timestamp",
            "description": "Unix timestamp in seconds (start of period)"
          },
          "total_volume": {
            "type": "number",
            "title": "Total Volume",
            "description": "Total USD volume in this period"
          },
          "buy_volume": {
            "type": "number",
            "title": "Buy Volume",
            "description": "BUY-side USD volume in this period"
          },
          "sell_volume": {
            "type": "number",
            "title": "Sell Volume",
            "description": "SELL-side USD volume in this period"
          },
          "trades_count": {
            "type": "integer",
            "title": "Trades Count",
            "description": "Number of trades in this period"
          }
        },
        "type": "object",
        "required": [
          "timestamp",
          "total_volume",
          "buy_volume",
          "sell_volume",
          "trades_count"
        ],
        "title": "WalletVolumeChartDataPoint",
        "description": "Individual wallet volume chart data point."
      },
      "WalletVolumeChartResponse": {
        "properties": {
          "wallet_address": {
            "type": "string",
            "title": "Wallet Address",
            "description": "Wallet address"
          },
          "granularity": {
            "$ref": "#/components/schemas/VolumeChartGranularity",
            "description": "Time granularity"
          },
          "start_time": {
            "type": "integer",
            "title": "Start Time",
            "description": "Unix timestamp of first data point"
          },
          "end_time": {
            "type": "integer",
            "title": "End Time",
            "description": "Unix timestamp of last data point"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/WalletVolumeChartDataPoint"
            },
            "type": "array",
            "title": "Data",
            "description": "Volume data points"
          }
        },
        "type": "object",
        "required": [
          "wallet_address",
          "granularity",
          "start_time",
          "end_time",
          "data"
        ],
        "title": "WalletVolumeChartResponse",
        "description": "Wallet volume chart endpoint response."
      },
      "WindowMetrics": {
        "properties": {
          "realized_pnl": {
            "type": "number",
            "title": "Realized Pnl",
            "description": "Realized profit/loss in USD (from closed positions)"
          },
          "total_pnl": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total Pnl",
            "description": "Total PnL in USD (realized + unrealized - net fees)"
          },
          "volume": {
            "type": "number",
            "title": "Volume",
            "description": "Trading volume in USD"
          },
          "roi": {
            "type": "number",
            "title": "Roi",
            "description": "Return on investment (decimal, e.g., 0.5 = 50%)"
          },
          "trades": {
            "type": "integer",
            "title": "Trades",
            "description": "Number of trades"
          },
          "wins": {
            "type": "integer",
            "title": "Wins",
            "description": "Number of winning positions closed"
          },
          "losses": {
            "type": "integer",
            "title": "Losses",
            "description": "Number of losing positions closed"
          },
          "win_rate": {
            "type": "number",
            "title": "Win Rate",
            "description": "Win rate (decimal, e.g., 0.6 = 60%)"
          },
          "profit_factor": {
            "type": "number",
            "title": "Profit Factor",
            "description": "Profit factor (gross profit / gross loss)"
          },
          "positions_closed": {
            "type": "integer",
            "title": "Positions Closed",
            "description": "Number of positions closed"
          },
          "avg_buy_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Buy Price",
            "description": "Volume-weighted average buy price (0-1)"
          },
          "avg_sell_price": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avg Sell Price",
            "description": "Volume-weighted average sell price (0-1)"
          },
          "fees_paid": {
            "type": "number",
            "title": "Fees Paid",
            "description": "Taker fees paid in USD",
            "default": 0.0
          },
          "fees_refunded": {
            "type": "number",
            "title": "Fees Refunded",
            "description": "DEPRECATED: always 0. Refunds are already netted into fees_paid.",
            "default": 0.0
          }
        },
        "type": "object",
        "required": [
          "realized_pnl",
          "volume",
          "roi",
          "trades",
          "wins",
          "losses",
          "win_rate",
          "profit_factor",
          "positions_closed"
        ],
        "title": "WindowMetrics",
        "description": "Metrics for a specific time window."
      },
      "app__api__v1__kalshi__markets_list__SortOption": {
        "type": "string",
        "enum": [
          "volume",
          "open_interest",
          "price_desc",
          "price_asc",
          "close_time"
        ],
        "title": "SortOption"
      },
      "app__api__v1__limitless__markets_list__SortOption": {
        "type": "string",
        "enum": [
          "volume",
          "open_interest",
          "liquidity",
          "price_desc",
          "price_asc",
          "expiration",
          "created",
          "created_asc"
        ],
        "title": "SortOption"
      },
      "app__api__v1__opinion__markets_list__SortOption": {
        "type": "string",
        "enum": [
          "volume",
          "volume_24h",
          "volume_7d",
          "created",
          "created_asc",
          "expiration"
        ],
        "title": "SortOption"
      },
      "app__api__v1__polymarket__markets_list__SortOption": {
        "type": "string",
        "enum": [
          "volume",
          "open_interest",
          "price_desc",
          "price_asc",
          "expiration",
          "expiration_asc",
          "created",
          "created_asc",
          "relevance",
          "volume_1d",
          "volume_7d",
          "volume_30d",
          "trades_1d",
          "trades_7d",
          "trades_30d",
          "oi_change_1d",
          "oi_change_7d",
          "oi_change_30d"
        ],
        "title": "SortOption"
      },
      "app__api__v1__predictfun__markets_list__SortOption": {
        "type": "string",
        "enum": [
          "created",
          "created_asc",
          "price_desc",
          "price_asc",
          "bid_depth"
        ],
        "title": "SortOption"
      },
      "TickSchemaField": {
        "type": "object",
        "title": "TickSchemaField",
        "description": "One column in a tick dataset's Parquet schema.",
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "type": {
            "type": "string",
            "title": "Type"
          }
        },
        "required": [
          "name",
          "type"
        ]
      },
      "TickPart": {
        "type": "object",
        "title": "TickPart",
        "description": "A single Parquet part with a signed download URL and its coverage range.",
        "properties": {
          "url": {
            "type": "string",
            "title": "Url",
            "description": "Short-lived signed GET URL for one Parquet file."
          },
          "rows": {
            "type": "integer",
            "title": "Rows"
          },
          "bytes": {
            "type": "integer",
            "title": "Bytes"
          },
          "id_min": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id Min",
            "description": "Lowest ID-column value in the part."
          },
          "id_max": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Id Max"
          },
          "ts_min": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ts Min",
            "description": "Earliest timestamp (epoch ms) in the part."
          },
          "ts_max": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ts Max"
          },
          "expires_at": {
            "type": "string",
            "title": "Expires At",
            "description": "When the signed URL stops working (~1 hour out)."
          }
        },
        "required": [
          "url",
          "rows",
          "bytes",
          "expires_at"
        ]
      },
      "TicksResponse": {
        "type": "object",
        "title": "TicksResponse",
        "description": "Signed-URL download response for a venue/date (or date range).",
        "properties": {
          "venue": {
            "type": "string",
            "title": "Venue"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "end_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "start_time": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time"
          },
          "end_time": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Time"
          },
          "market_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Id"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "default": "final"
          },
          "format": {
            "type": "string",
            "title": "Format",
            "default": "parquet"
          },
          "compression": {
            "type": "string",
            "title": "Compression",
            "default": "zstd"
          },
          "schema": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TickSchemaField"
            },
            "title": "Schema",
            "description": "Column names and types in the Parquet files."
          },
          "sort_order": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "title": "Sort Order",
            "description": "Columns the files are globally sorted by."
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TickPart"
            },
            "title": "Parts"
          },
          "total_rows": {
            "type": "integer",
            "title": "Total Rows"
          },
          "total_bytes": {
            "type": "integer",
            "title": "Total Bytes"
          }
        },
        "required": [
          "venue",
          "status",
          "format",
          "compression",
          "schema",
          "sort_order",
          "parts",
          "total_rows",
          "total_bytes"
        ]
      },
      "TickQueryResponse": {
        "type": "object",
        "title": "TickQueryResponse",
        "description": "Server-side DuckDB query result (rows as JSON).",
        "properties": {
          "venue": {
            "type": "string",
            "title": "Venue"
          },
          "date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Date"
          },
          "start_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Date"
          },
          "end_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Date"
          },
          "start_time": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Time"
          },
          "end_time": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Time"
          },
          "market_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Market Id"
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "title": "Columns"
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "title": "Rows"
          },
          "row_count": {
            "type": "integer",
            "title": "Row Count"
          },
          "truncated": {
            "type": "boolean",
            "title": "Truncated",
            "default": false
          }
        },
        "required": [
          "venue",
          "columns",
          "rows",
          "row_count",
          "truncated"
        ]
      },
      "KalshiSettlementSource": {
        "description": "Where Kalshi takes the outcome from (series-level).",
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Name"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Url"
          }
        },
        "title": "KalshiSettlementSource",
        "type": "object"
      },
      "KalshiSeries": {
        "description": "Series-level contract metadata from Kalshi GET /series.",
        "properties": {
          "ticker": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Ticker"
          },
          "settlement_sources": {
            "items": {
              "$ref": "#/components/schemas/KalshiSettlementSource"
            },
            "title": "Settlement Sources",
            "type": "array"
          },
          "contract_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Original regulatory filing of the contract",
            "title": "Contract Url"
          },
          "contract_terms_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "description": "Current contract terms",
            "title": "Contract Terms Url"
          }
        },
        "title": "KalshiSeries",
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.predexon.com"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ]
}