{
  "asyncapi": "3.0.0",
  "info": {
    "title": "Hypercall WebSocket API",
    "version": "0.0.1",
    "description": "Real-time data streaming for options trading.\n\n## Connection\n\nConnect to `wss://HOST/ws` with optional query parameters:\n- `wallet`: Your wallet address (required for authenticated channels)\n\n## Available Channels\n\n| Channel | Auth Required | Description |\n|---------|---------------|-------------|\n| `orderbook` | No | L2 orderbook updates for all symbols |\n| `options_chain` | No | Incremental options chain updates |\n| `trades` | No | Public trade feed |\n| `market_updates` | No | Market listing changes (created/deleted/expired) |\n| `candles:<UNDERLYING>:<RESOLUTION>` | No | Realtime underlying candle updates |\n| `index_prices` | No | Batch index/spot price updates for all underlyings |\n| `order_updates` | Yes | Your order status changes |\n| `fills` | Yes | Your trade fills |\n| `portfolio` | Yes | Your position and balance updates |\n| `liquidation` | Yes | Your liquidation state changes |\n| `competition` | Yes | Your competition rank and final stats |\n| `competition_engagement` | Yes | Your rank jumps, gap-to-next, and final standing updates |\n\nOrderbook channel sizes (`bids`/`asks`) are human-readable contract quantities.\n\n## Authentication\n\nAuthenticated channels require the `wallet` query parameter and filter messages to only show data for that wallet. No signature is required for WebSocket connections.\n\n## Message Format\n\nAll messages are JSON with a `type` field indicating the message type."
  },
  "servers": {
    "production": {
      "host": "testnet-api.hypercall.xyz",
      "protocol": "wss",
      "pathname": "/ws",
      "description": "Testnet"
    }
  },
  "channels": {
    "websocket": {
      "address": "/ws",
      "parameters": {
        "wallet": {
          "description": "Wallet address for authenticated channels (optional)",
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "components": {
    "messages": {
      "CandleUpdate": {
        "name": "CandleUpdate",
        "title": "CandleUpdate",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "Subscribe": {
        "name": "Subscribe",
        "title": "Subscribe",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "PositionExpired": {
        "name": "PositionExpired",
        "title": "PositionExpired",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "CompetitionGapUpdate": {
        "name": "CompetitionGapUpdate",
        "title": "CompetitionGapUpdate",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "Fill": {
        "name": "Fill",
        "title": "Fill",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "IndexPriceUpdate": {
        "name": "IndexPriceUpdate",
        "title": "IndexPriceUpdate",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "Unsubscribed": {
        "name": "Unsubscribed",
        "title": "Unsubscribed",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "Error": {
        "name": "Error",
        "title": "Error",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "CompetitionUpdate": {
        "name": "CompetitionUpdate",
        "title": "CompetitionUpdate",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "Trade": {
        "name": "Trade",
        "title": "Trade",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "CompetitionFinalStats": {
        "name": "CompetitionFinalStats",
        "title": "CompetitionFinalStats",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "Unsubscribe": {
        "name": "Unsubscribe",
        "title": "Unsubscribe",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "MarketUpdate": {
        "name": "MarketUpdate",
        "title": "MarketUpdate",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "CompetitionRankChange": {
        "name": "CompetitionRankChange",
        "title": "CompetitionRankChange",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "CompetitionPnlSummary": {
        "name": "CompetitionPnlSummary",
        "title": "CompetitionPnlSummary",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "OrderbookUpdate": {
        "name": "OrderbookUpdate",
        "title": "OrderbookUpdate",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "Authenticate": {
        "name": "Authenticate",
        "title": "Authenticate",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "OptionsChainUpdate": {
        "name": "OptionsChainUpdate",
        "title": "OptionsChainUpdate",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "CompetitionFinalStanding": {
        "name": "CompetitionFinalStanding",
        "title": "CompetitionFinalStanding",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "PortfolioUpdate": {
        "name": "PortfolioUpdate",
        "title": "PortfolioUpdate",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "OrderUpdate": {
        "name": "OrderUpdate",
        "title": "OrderUpdate",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "LiquidationStateChange": {
        "name": "LiquidationStateChange",
        "title": "LiquidationStateChange",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "Authenticated": {
        "name": "Authenticated",
        "title": "Authenticated",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      },
      "Subscribed": {
        "name": "Subscribed",
        "title": "Subscribed",
        "contentType": "application/json",
        "payload": {
          "description": "WebSocket message types for client-server communication.\n\nAll messages are tagged with a `type` field for JSON serialization.",
          "title": "WsMessage",
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Subscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscribe to a data channel"
            },
            {
              "type": "object",
              "properties": {
                "expiry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbols": {
                  "type": [
                    "array",
                    "null"
                  ],
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "type": "string",
                  "const": "Unsubscribe"
                },
                "option_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscribe from a data channel"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "OrderUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Order status update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsOrderbookUpdate"
            },
            {
              "$ref": "#/$defs/WsFillUpdate"
            },
            {
              "$ref": "#/$defs/WsTradeUpdate"
            },
            {
              "$ref": "#/$defs/WsCandleUpdate"
            },
            {
              "$ref": "#/$defs/WsMarketUpdate"
            },
            {
              "$ref": "#/$defs/WsOptionsChainUpdate"
            },
            {
              "$ref": "#/$defs/WsIndexPriceUpdate"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "PortfolioUpdate"
                }
              },
              "required": [
                "type"
              ],
              "description": "Portfolio update (authenticated)"
            },
            {
              "$ref": "#/$defs/WsPositionExpired"
            },
            {
              "$ref": "#/$defs/WsLiquidationStateChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionPnlSummary"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStats"
            },
            {
              "$ref": "#/$defs/WsCompetitionRankChange"
            },
            {
              "$ref": "#/$defs/WsCompetitionGapUpdate"
            },
            {
              "$ref": "#/$defs/WsCompetitionFinalStanding"
            },
            {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Authenticate"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Identify the connection with a wallet address (replaces query-param ?wallet=)."
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Authenticated"
                },
                "wallet": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "wallet"
              ],
              "description": "Server confirms wallet identification"
            },
            {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "const": "Error"
                }
              },
              "required": [
                "type",
                "message"
              ],
              "description": "Error message from server"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Subscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Subscription confirmed"
            },
            {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "Unsubscribed"
                },
                "channel": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "channel"
              ],
              "description": "Unsubscription confirmed"
            }
          ],
          "$defs": {
            "CandleResolution": {
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "4h",
                "1d"
              ],
              "type": "string"
            },
            "IndexPriceEntry": {
              "description": "Single underlying index price entry.",
              "properties": {
                "price": {
                  "description": "Current spot/index price from oracle",
                  "type": "string"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                }
              },
              "required": [
                "underlying",
                "price"
              ],
              "type": "object"
            },
            "OptionsChainGreeksAbs": {
              "properties": {
                "delta": {
                  "format": "double",
                  "type": "number"
                },
                "gamma": {
                  "format": "double",
                  "type": "number"
                },
                "theta": {
                  "format": "double",
                  "type": "number"
                },
                "vega": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta",
                "gamma",
                "theta",
                "vega"
              ],
              "type": "object"
            },
            "OptionsChainGreeksCash": {
              "properties": {
                "delta_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "gamma_1pct_usd": {
                  "format": "double",
                  "type": "number"
                },
                "theta_1d_usd": {
                  "format": "double",
                  "type": "number"
                },
                "vega_1vol_usd": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "delta_1pct_usd",
                "gamma_1pct_usd",
                "theta_1d_usd",
                "vega_1vol_usd"
              ],
              "type": "object"
            },
            "OptionsChainLeg": {
              "properties": {
                "ask_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "ask_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_iv": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_price_usd": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_contracts": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "bid_size_usd_notional": {
                  "format": "double",
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "greeks_abs": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksAbs"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "greeks_cash": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainGreeksCash"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "option_token_address": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "type": "string"
                }
              },
              "required": [
                "symbol"
              ],
              "type": "object"
            },
            "OptionsChainStrikeRow": {
              "properties": {
                "call": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "put": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/OptionsChainLeg"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "strike": {
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "strike"
              ],
              "type": "object"
            },
            "WsCandleUpdate": {
              "description": "Underlying candle update message",
              "properties": {
                "close": {
                  "description": "Close price",
                  "format": "double",
                  "type": "number"
                },
                "end_time_ms": {
                  "description": "Candle end timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "high": {
                  "description": "High price",
                  "format": "double",
                  "type": "number"
                },
                "low": {
                  "description": "Low price",
                  "format": "double",
                  "type": "number"
                },
                "open": {
                  "description": "Open price",
                  "format": "double",
                  "type": "number"
                },
                "resolution": {
                  "$ref": "#/$defs/CandleResolution",
                  "description": "Candle interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`)"
                },
                "start_time_ms": {
                  "description": "Candle start timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "underlying": {
                  "description": "Underlying asset (e.g., \"BTC\", \"ETH\")",
                  "type": "string"
                },
                "volume": {
                  "description": "Traded volume",
                  "format": "double",
                  "type": "number"
                }
              },
              "required": [
                "underlying",
                "resolution",
                "start_time_ms",
                "end_time_ms",
                "open",
                "high",
                "low",
                "close",
                "volume"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStanding": {
              "description": "Competition final standing notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "type": "string"
                },
                "medal": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "type": "string"
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "type": "string"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionFinalStats": {
              "description": "Final competition stats for a wallet (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Final efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Final PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Final rank",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Final traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionGapUpdate": {
              "description": "Competition gap update notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "gap_metric_value": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "next_rank": {
                  "format": "int64",
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionPnlStanding": {
              "description": "Competition standing included in wallet summary updates.",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "competition_name": {
                  "description": "Competition name",
                  "type": "string"
                },
                "competition_state": {
                  "description": "Competition state (`pre`, `active`, `post`)",
                  "type": "string"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "medal": {
                  "description": "Medal code (1,2,3) for top-3 wallets",
                  "format": "uint8",
                  "maximum": 255,
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet, when ranked",
                  "format": "uint",
                  "minimum": 0,
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                }
              },
              "required": [
                "competition_id",
                "competition_name",
                "competition_state",
                "pnl",
                "volume",
                "efficiency"
              ],
              "type": "object"
            },
            "WsCompetitionPnlSummary": {
              "description": "Competition PnL summary for a wallet on the authenticated competition channel.",
              "properties": {
                "active_competition": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/WsCompetitionPnlStanding"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Active competition summary, when one exists"
                },
                "lifetime_realized_pnl": {
                  "description": "Lifetime realized PnL",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "lifetime_realized_pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionRankChange": {
              "description": "Competition rank change notification for a wallet.",
              "properties": {
                "competition_id": {
                  "format": "int64",
                  "type": "integer"
                },
                "delta_places": {
                  "format": "int64",
                  "type": "integer"
                },
                "from_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "pnl": {
                  "type": "string"
                },
                "timestamp": {
                  "format": "int64",
                  "type": "integer"
                },
                "to_rank": {
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "from_rank",
                "to_rank",
                "delta_places",
                "pnl",
                "timestamp"
              ],
              "type": "object"
            },
            "WsCompetitionUpdate": {
              "description": "Competition leaderboard update (authenticated channel).",
              "properties": {
                "competition_id": {
                  "description": "Competition identifier",
                  "format": "int64",
                  "type": "integer"
                },
                "efficiency": {
                  "description": "Current efficiency (pnl / volume)",
                  "type": "string"
                },
                "pnl": {
                  "description": "Current PnL",
                  "type": "string"
                },
                "rank": {
                  "description": "Current rank for this wallet",
                  "format": "int64",
                  "type": "integer"
                },
                "timestamp": {
                  "description": "Event timestamp (ms)",
                  "format": "int64",
                  "type": "integer"
                },
                "volume": {
                  "description": "Current traded volume",
                  "type": "string"
                },
                "wallet_address": {
                  "description": "Wallet address for this update",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "competition_id",
                "rank",
                "pnl",
                "volume",
                "efficiency",
                "timestamp"
              ],
              "type": "object"
            },
            "WsFillUpdate": {
              "description": "Fill notification message (authenticated channel)",
              "properties": {
                "builder_code_address": {
                  "description": "Builder code wallet address for fee sharing (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "builder_code_fee": {
                  "description": "Fee paid to builder code (if any)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fee": {
                  "description": "Trading fee charged",
                  "type": "string"
                },
                "fill_id": {
                  "description": "Fill ID",
                  "format": "int64",
                  "type": "integer"
                },
                "is_taker": {
                  "description": "Whether this fill was as taker",
                  "type": "boolean"
                },
                "order_id": {
                  "description": "Order ID",
                  "format": "int64",
                  "type": "integer"
                },
                "price": {
                  "description": "Fill price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Trade side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Size in contracts (human-readable units)",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "trade_id": {
                  "description": "Unique trade ID",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that received the fill (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "order_id",
                "fill_id",
                "symbol",
                "side",
                "price",
                "size",
                "timestamp",
                "wallet_address",
                "fee",
                "trade_id",
                "is_taker"
              ],
              "type": "object"
            },
            "WsIndexPriceUpdate": {
              "description": "Batch index price update for all underlyings.",
              "properties": {
                "prices": {
                  "description": "Per-underlying index prices",
                  "items": {
                    "$ref": "#/$defs/IndexPriceEntry"
                  },
                  "type": "array"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "prices",
                "timestamp"
              ],
              "type": "object"
            },
            "WsLiquidationStateChange": {
              "description": "Liquidation state change notification (authenticated channel)",
              "properties": {
                "auction_id": {
                  "description": "Auction ID (if liquidation auction is active)",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "equity": {
                  "description": "Current equity",
                  "type": "string"
                },
                "mm_required": {
                  "description": "Maintenance margin required",
                  "type": "string"
                },
                "new_state": {
                  "description": "New liquidation state (e.g., \"Normal\", \"Warning\", \"Liquidating\")",
                  "type": "string"
                },
                "previous_state": {
                  "description": "Previous liquidation state",
                  "type": "string"
                },
                "shortfall": {
                  "description": "MM shortfall (if any, 0 if no shortfall)",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address affected by the state change",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "previous_state",
                "new_state",
                "equity",
                "mm_required",
                "shortfall",
                "timestamp"
              ],
              "type": "object"
            },
            "WsMarketUpdate": {
              "description": "Market listing change notification",
              "oneOf": [
                {
                  "description": "New option market created",
                  "properties": {
                    "action": {
                      "const": "Created",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Creation timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset (e.g., \"BTC\")",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market deleted",
                  "properties": {
                    "action": {
                      "const": "Deleted",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Deletion timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "description": "Market expired and settled",
                  "properties": {
                    "action": {
                      "const": "Expired",
                      "type": "string"
                    },
                    "expiry": {
                      "description": "Expiry timestamp (Unix seconds)",
                      "format": "uint32",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "is_call": {
                      "description": "True for call, false for put",
                      "type": "boolean"
                    },
                    "strike": {
                      "description": "Strike price",
                      "type": "string"
                    },
                    "symbol": {
                      "description": "Option symbol",
                      "type": "string"
                    },
                    "timestamp": {
                      "description": "Settlement timestamp (Unix milliseconds)",
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "underlying": {
                      "description": "Underlying asset",
                      "type": "string"
                    }
                  },
                  "required": [
                    "action",
                    "symbol",
                    "strike",
                    "is_call",
                    "underlying",
                    "expiry",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOptionsChainUpdate": {
              "description": "Incremental options chain update.",
              "oneOf": [
                {
                  "properties": {
                    "action": {
                      "const": "Upsert",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "row": {
                      "$ref": "#/$defs/OptionsChainStrikeRow"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "row",
                    "timestamp"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "action": {
                      "const": "Remove",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "expiry": {
                      "format": "uint64",
                      "minimum": 0,
                      "type": "integer"
                    },
                    "option_type": {
                      "type": "string"
                    },
                    "strike": {
                      "format": "double",
                      "type": "number"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "timestamp": {
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "action",
                    "currency",
                    "expiry",
                    "strike",
                    "option_type",
                    "symbol",
                    "timestamp"
                  ],
                  "type": "object"
                }
              ]
            },
            "WsOrderbookUpdate": {
              "description": "L2 orderbook update message",
              "properties": {
                "asks": {
                  "description": "Ask levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "bids": {
                  "description": "Bid levels as (price, size) tuples, where size is in human-readable contracts.",
                  "items": {
                    "maxItems": 2,
                    "minItems": 2,
                    "prefixItems": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "array"
                  },
                  "type": "array"
                },
                "option_token_address": {
                  "description": "Option token address for this symbol, when known",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "symbol": {
                  "description": "Option symbol (e.g., \"BTC-20260131-100000-C\")",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "bids",
                "asks",
                "timestamp"
              ],
              "type": "object"
            },
            "WsPositionExpired": {
              "description": "Position expiry notification (authenticated channel)",
              "properties": {
                "cost_basis": {
                  "description": "Position cost basis at settlement.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "net_pnl": {
                  "description": "Net settlement PnL (excluding fees).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "position_size": {
                  "description": "Position size that was settled",
                  "type": "string"
                },
                "settlement_entry_price": {
                  "description": "User per-contract entry price at settlement time.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "settlement_price": {
                  "description": "Settlement price used",
                  "type": "string"
                },
                "settlement_value": {
                  "description": "Settlement value credited/debited",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol that expired",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                },
                "wallet_address": {
                  "description": "Wallet address that held the position (hex string)",
                  "type": "string"
                }
              },
              "required": [
                "wallet_address",
                "symbol",
                "position_size",
                "settlement_price",
                "settlement_value",
                "timestamp"
              ],
              "type": "object"
            },
            "WsTradeUpdate": {
              "description": "Public trade event message",
              "properties": {
                "price": {
                  "description": "Trade price in USD",
                  "type": "string"
                },
                "side": {
                  "description": "Aggressor side (\"buy\" or \"sell\")",
                  "type": "string"
                },
                "size": {
                  "description": "Trade size in contracts",
                  "type": "string"
                },
                "symbol": {
                  "description": "Option symbol",
                  "type": "string"
                },
                "timestamp": {
                  "description": "Unix timestamp in milliseconds",
                  "format": "int64",
                  "type": "integer"
                }
              },
              "required": [
                "symbol",
                "price",
                "size",
                "side",
                "timestamp"
              ],
              "type": "object"
            }
          },
          "$schema": "https://json-schema.org/draft/2020-12/schema"
        }
      }
    }
  }
}
