{
  "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| `indicative_market_data` | No | Aggregated indicative quotes from quote providers |\n| `rfq` | Yes | RFQ quotes and status 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"
    }
  },
  "components": {
    "messages": {
      "CompetitionPnlSummary": {
        "name": "CompetitionPnlSummary",
        "title": "CompetitionPnlSummary",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "Authenticate": {
        "name": "Authenticate",
        "title": "Authenticate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "CompetitionFinalStanding": {
        "name": "CompetitionFinalStanding",
        "title": "CompetitionFinalStanding",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "Authenticated": {
        "name": "Authenticated",
        "title": "Authenticated",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "OrderbookUpdate": {
        "name": "OrderbookUpdate",
        "title": "OrderbookUpdate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "RfqAcceptResult": {
        "name": "RfqAcceptResult",
        "title": "RfqAcceptResult",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "Unsubscribe": {
        "name": "Unsubscribe",
        "title": "Unsubscribe",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "OrderUpdate": {
        "name": "OrderUpdate",
        "title": "OrderUpdate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "Unsubscribed": {
        "name": "Unsubscribed",
        "title": "Unsubscribed",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "CompetitionRankChange": {
        "name": "CompetitionRankChange",
        "title": "CompetitionRankChange",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "RfqQuotes": {
        "name": "RfqQuotes",
        "title": "RfqQuotes",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "LiquidationStateChange": {
        "name": "LiquidationStateChange",
        "title": "LiquidationStateChange",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "OptionsChainUpdate": {
        "name": "OptionsChainUpdate",
        "title": "OptionsChainUpdate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "CompetitionUpdate": {
        "name": "CompetitionUpdate",
        "title": "CompetitionUpdate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "Subscribe": {
        "name": "Subscribe",
        "title": "Subscribe",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "CompetitionGapUpdate": {
        "name": "CompetitionGapUpdate",
        "title": "CompetitionGapUpdate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "Fill": {
        "name": "Fill",
        "title": "Fill",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "Trade": {
        "name": "Trade",
        "title": "Trade",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "PortfolioUpdate": {
        "name": "PortfolioUpdate",
        "title": "PortfolioUpdate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "IndicativeMarketData": {
        "name": "IndicativeMarketData",
        "title": "IndicativeMarketData",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "SubmitRfq": {
        "name": "SubmitRfq",
        "title": "SubmitRfq",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "AcceptRfqQuote": {
        "name": "AcceptRfqQuote",
        "title": "AcceptRfqQuote",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "Other": {
        "name": "Other",
        "title": "Other",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "CompetitionFinalStats": {
        "name": "CompetitionFinalStats",
        "title": "CompetitionFinalStats",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "Error": {
        "name": "Error",
        "title": "Error",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "IndexPriceUpdate": {
        "name": "IndexPriceUpdate",
        "title": "IndexPriceUpdate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "CandleUpdate": {
        "name": "CandleUpdate",
        "title": "CandleUpdate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "PlaceOrder": {
        "name": "PlaceOrder",
        "title": "PlaceOrder",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "PositionExpired": {
        "name": "PositionExpired",
        "title": "PositionExpired",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "RfqStatusUpdate": {
        "name": "RfqStatusUpdate",
        "title": "RfqStatusUpdate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "SubmitAutoExecuteRfq": {
        "name": "SubmitAutoExecuteRfq",
        "title": "SubmitAutoExecuteRfq",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "OrderResult": {
        "name": "OrderResult",
        "title": "OrderResult",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "Subscribed": {
        "name": "Subscribed",
        "title": "Subscribed",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      },
      "MarketUpdate": {
        "name": "MarketUpdate",
        "title": "MarketUpdate",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WsMessage"
        }
      }
    },
    "schemas": {
      "WsMessage": {
        "title": "WsMessage",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "channel": {
                "type": "string"
              },
              "symbols": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "expiry": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "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"
                ]
              },
              "type": {
                "type": "string",
                "const": "Unsubscribe"
              },
              "option_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "symbols": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string"
                }
              },
              "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": "#/components/schemas/WsMessage/$defs/WsOrderbookUpdate"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsFillUpdate"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsTradeUpdate"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsCandleUpdate"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsMarketUpdate"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsOptionsChainUpdate"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsIndexPriceUpdate"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "PortfolioUpdate"
              }
            },
            "required": [
              "type"
            ],
            "description": "Portfolio update (authenticated)"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsPositionExpired"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsLiquidationStateChange"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsCompetitionUpdate"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsCompetitionPnlSummary"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsCompetitionFinalStats"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsCompetitionRankChange"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsCompetitionGapUpdate"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$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": {
              "channel": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "const": "Subscribed"
              }
            },
            "required": [
              "type",
              "channel"
            ],
            "description": "Subscription confirmed"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "Unsubscribed"
              },
              "channel": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "channel"
            ],
            "description": "Unsubscription confirmed"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsIndicativeMarketData"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsRfqQuotes"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsRfqStatusUpdate"
          },
          {
            "type": "object",
            "properties": {
              "wallet_address": {
                "type": "string"
              },
              "legs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/WsMessage/$defs/WsRfqLegRequest"
                }
              },
              "signature": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "const": "SubmitRfq"
              },
              "nonce": {
                "type": "integer",
                "format": "uint64",
                "minimum": 0
              },
              "rfq_id": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "rfq_id",
              "legs",
              "wallet_address",
              "nonce",
              "signature"
            ],
            "description": "Submit an RFQ request via WebSocket (authenticated)"
          },
          {
            "type": "object",
            "properties": {
              "nonce": {
                "type": "integer",
                "minimum": 0,
                "format": "uint64"
              },
              "signature": {
                "type": "string"
              },
              "wallet_address": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "const": "SubmitAutoExecuteRfq"
              },
              "rfq_id": {
                "type": "string"
              },
              "legs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/WsMessage/$defs/WsRfqLegRequest"
                }
              },
              "limit_price": {
                "type": "string",
                "description": "Directional premium limit as a decimal string. Buy RFQs use this\nas a max debit. Sell RFQs use it as a min credit."
              }
            },
            "required": [
              "type",
              "rfq_id",
              "legs",
              "wallet_address",
              "limit_price",
              "nonce",
              "signature"
            ],
            "description": "Submit an RFQ with auto-execute via WebSocket (authenticated).\nThe taker pre-authorizes execution with a directional `limit_price`."
          },
          {
            "type": "object",
            "properties": {
              "signature": {
                "type": "string"
              },
              "rfq_id": {
                "type": "string"
              },
              "wallet_address": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "const": "AcceptRfqQuote"
              },
              "quote_id": {
                "type": "string"
              },
              "nonce": {
                "type": "integer",
                "format": "uint64",
                "minimum": 0
              }
            },
            "required": [
              "type",
              "rfq_id",
              "quote_id",
              "wallet_address",
              "nonce",
              "signature"
            ],
            "description": "Accept an RFQ quote via WebSocket (authenticated)"
          },
          {
            "type": "object",
            "properties": {
              "fill_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "RfqAcceptResult"
              },
              "quote_id": {
                "type": "string"
              },
              "rfq_id": {
                "type": "string"
              },
              "status": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "rfq_id",
              "quote_id",
              "status"
            ],
            "description": "RFQ accept result pushed back to the client"
          },
          {
            "type": "object",
            "properties": {
              "nonce": {
                "type": "integer",
                "format": "uint64",
                "minimum": 0
              },
              "mmp_enabled": {
                "type": [
                  "boolean",
                  "null"
                ],
                "default": null
              },
              "signature": {
                "type": "string"
              },
              "builder_code_address": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "type": {
                "type": "string",
                "const": "PlaceOrder"
              },
              "route": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Optional route during the deprecation window.\nOmitted route keeps the legacy WebSocket orderbook path for now. It will not be\nrequired before July 4, 2026, but may become required later."
              },
              "client_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "side": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "wallet": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "tif": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "size": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "wallet",
              "symbol",
              "side",
              "size",
              "price",
              "nonce",
              "signature"
            ],
            "description": "Place an order via WebSocket (authenticated)"
          },
          {
            "$ref": "#/components/schemas/WsMessage/$defs/WsOrderResult"
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "Other"
              }
            },
            "required": [
              "type"
            ]
          }
        ],
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "$defs": {
          "WsOrderbookUpdate": {
            "type": "object",
            "properties": {
              "symbol": {
                "type": "string"
              },
              "option_token_address": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "bids": {
                "type": "array",
                "items": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "minItems": 2,
                  "maxItems": 2
                }
              },
              "asks": {
                "type": "array",
                "items": {
                  "type": "array",
                  "prefixItems": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "minItems": 2,
                  "maxItems": 2
                }
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "symbol",
              "bids",
              "asks",
              "timestamp"
            ]
          },
          "WsFillUpdate": {
            "type": "object",
            "properties": {
              "order_id": {
                "type": "integer",
                "format": "int64"
              },
              "fill_id": {
                "type": "integer",
                "format": "int64"
              },
              "symbol": {
                "type": "string"
              },
              "side": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "size": {
                "type": "string"
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              },
              "wallet_address": {
                "type": "string"
              },
              "fee": {
                "type": "string"
              },
              "trade_id": {
                "type": "integer",
                "format": "int64"
              },
              "is_taker": {
                "type": "boolean"
              },
              "builder_code_address": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "builder_code_fee": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "instrument_type": {
                "type": "string",
                "default": "option"
              }
            },
            "required": [
              "order_id",
              "fill_id",
              "symbol",
              "side",
              "price",
              "size",
              "timestamp",
              "wallet_address",
              "fee",
              "trade_id",
              "is_taker"
            ]
          },
          "WsTradeUpdate": {
            "type": "object",
            "properties": {
              "symbol": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "size": {
                "type": "string"
              },
              "side": {
                "type": "string"
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "symbol",
              "price",
              "size",
              "side",
              "timestamp"
            ]
          },
          "CandleResolution": {
            "type": "string",
            "enum": [
              "1m",
              "5m",
              "15m",
              "1h",
              "4h",
              "1d"
            ]
          },
          "WsCandleUpdate": {
            "type": "object",
            "properties": {
              "underlying": {
                "type": "string"
              },
              "resolution": {
                "$ref": "#/components/schemas/WsMessage/$defs/CandleResolution"
              },
              "start_time_ms": {
                "type": "integer",
                "format": "int64"
              },
              "end_time_ms": {
                "type": "integer",
                "format": "int64"
              },
              "open": {
                "type": "number",
                "format": "double"
              },
              "high": {
                "type": "number",
                "format": "double"
              },
              "low": {
                "type": "number",
                "format": "double"
              },
              "close": {
                "type": "number",
                "format": "double"
              },
              "volume": {
                "type": "number",
                "format": "double"
              }
            },
            "required": [
              "underlying",
              "resolution",
              "start_time_ms",
              "end_time_ms",
              "open",
              "high",
              "low",
              "close",
              "volume"
            ]
          },
          "WsMarketUpdate": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string"
                  },
                  "strike": {
                    "type": "string"
                  },
                  "is_call": {
                    "type": "boolean"
                  },
                  "underlying": {
                    "type": "string"
                  },
                  "expiry": {
                    "type": "integer",
                    "format": "uint32",
                    "minimum": 0
                  },
                  "timestamp": {
                    "type": "integer",
                    "format": "uint64",
                    "minimum": 0
                  },
                  "action": {
                    "type": "string",
                    "const": "Created"
                  }
                },
                "required": [
                  "action",
                  "symbol",
                  "strike",
                  "is_call",
                  "underlying",
                  "expiry",
                  "timestamp"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string"
                  },
                  "timestamp": {
                    "type": "integer",
                    "format": "uint64",
                    "minimum": 0
                  },
                  "action": {
                    "type": "string",
                    "const": "Deleted"
                  }
                },
                "required": [
                  "action",
                  "symbol",
                  "timestamp"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "symbol": {
                    "type": "string"
                  },
                  "strike": {
                    "type": "string"
                  },
                  "is_call": {
                    "type": "boolean"
                  },
                  "underlying": {
                    "type": "string"
                  },
                  "expiry": {
                    "type": "integer",
                    "format": "uint32",
                    "minimum": 0
                  },
                  "timestamp": {
                    "type": "integer",
                    "format": "uint64",
                    "minimum": 0
                  },
                  "action": {
                    "type": "string",
                    "const": "Expired"
                  }
                },
                "required": [
                  "action",
                  "symbol",
                  "strike",
                  "is_call",
                  "underlying",
                  "expiry",
                  "timestamp"
                ]
              }
            ]
          },
          "OptionsChainStrikeRow": {
            "description": "A single strike row in the options chain, pairing call and put legs.",
            "type": "object",
            "properties": {
              "strike": {
                "description": "Strike price in USD.",
                "type": "number",
                "format": "double"
              },
              "call": {
                "description": "Call leg at this strike, if listed.",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WsMessage/$defs/OptionsChainLeg"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "put": {
                "description": "Put leg at this strike, if listed.",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WsMessage/$defs/OptionsChainLeg"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "strike"
            ]
          },
          "OptionsChainLeg": {
            "description": "A single call or put leg in the options chain, including top-of-book quotes and Greeks.",
            "type": "object",
            "properties": {
              "symbol": {
                "description": "Instrument symbol (e.g. `\"BTC-20260101-100000-C\"`).",
                "type": "string"
              },
              "option_token_address": {
                "description": "On-chain option token address, if deployed (checksummed Ethereum address).",
                "type": [
                  "string",
                  "null"
                ]
              },
              "bid_price_usd": {
                "description": "Best bid price in USD.",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "bid_iv": {
                "description": "Implied volatility at the best bid.",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "bid_size_contracts": {
                "description": "Size at the best bid in contracts.",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "bid_size_usd_notional": {
                "description": "Notional value of the best bid in USD.",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "ask_price_usd": {
                "description": "Best ask price in USD.",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "ask_iv": {
                "description": "Implied volatility at the best ask.",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "ask_size_contracts": {
                "description": "Size at the best ask in contracts.",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "ask_size_usd_notional": {
                "description": "Notional value of the best ask in USD.",
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "greeks_abs": {
                "description": "Per-contract (absolute) Greeks.",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WsMessage/$defs/OptionsChainGreeksAbs"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "greeks_cash": {
                "description": "Cash-denominated Greeks.",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WsMessage/$defs/OptionsChainGreeksCash"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "symbol"
            ]
          },
          "OptionsChainGreeksAbs": {
            "description": "Absolute (per-contract) option Greeks.",
            "type": "object",
            "properties": {
              "delta": {
                "description": "Delta: rate of change of option price with respect to underlying price.",
                "type": "number",
                "format": "double"
              },
              "gamma": {
                "description": "Gamma: rate of change of delta with respect to underlying price.",
                "type": "number",
                "format": "double"
              },
              "theta": {
                "description": "Theta: time decay per day.",
                "type": "number",
                "format": "double"
              },
              "vega": {
                "description": "Vega: sensitivity to 1-point change in implied volatility.",
                "type": "number",
                "format": "double"
              }
            },
            "required": [
              "delta",
              "gamma",
              "theta",
              "vega"
            ]
          },
          "OptionsChainGreeksCash": {
            "description": "Cash-denominated option Greeks (dollar impact per unit move).",
            "type": "object",
            "properties": {
              "delta_1pct_usd": {
                "description": "Dollar PnL for a 1% move in the underlying.",
                "type": "number",
                "format": "double"
              },
              "gamma_1pct_usd": {
                "description": "Dollar gamma impact for a 1% move in the underlying.",
                "type": "number",
                "format": "double"
              },
              "theta_1d_usd": {
                "description": "Dollar theta decay over one day.",
                "type": "number",
                "format": "double"
              },
              "vega_1vol_usd": {
                "description": "Dollar vega for a 1-vol-point move.",
                "type": "number",
                "format": "double"
              }
            },
            "required": [
              "delta_1pct_usd",
              "gamma_1pct_usd",
              "theta_1d_usd",
              "vega_1vol_usd"
            ]
          },
          "WsOptionsChainUpdate": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string"
                  },
                  "expiry": {
                    "type": "integer",
                    "format": "uint64",
                    "minimum": 0
                  },
                  "row": {
                    "$ref": "#/components/schemas/WsMessage/$defs/OptionsChainStrikeRow"
                  },
                  "timestamp": {
                    "type": "integer",
                    "format": "int64"
                  },
                  "action": {
                    "type": "string",
                    "const": "Upsert"
                  }
                },
                "required": [
                  "action",
                  "currency",
                  "expiry",
                  "row",
                  "timestamp"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "currency": {
                    "type": "string"
                  },
                  "expiry": {
                    "type": "integer",
                    "format": "uint64",
                    "minimum": 0
                  },
                  "strike": {
                    "type": "number",
                    "format": "double"
                  },
                  "option_type": {
                    "type": "string"
                  },
                  "symbol": {
                    "type": "string"
                  },
                  "timestamp": {
                    "type": "integer",
                    "format": "int64"
                  },
                  "action": {
                    "type": "string",
                    "const": "Remove"
                  }
                },
                "required": [
                  "action",
                  "currency",
                  "expiry",
                  "strike",
                  "option_type",
                  "symbol",
                  "timestamp"
                ]
              }
            ]
          },
          "IndexPriceEntry": {
            "type": "object",
            "properties": {
              "underlying": {
                "type": "string"
              },
              "price": {
                "type": "string"
              }
            },
            "required": [
              "underlying",
              "price"
            ]
          },
          "WsIndexPriceUpdate": {
            "type": "object",
            "properties": {
              "prices": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/WsMessage/$defs/IndexPriceEntry"
                }
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "prices",
              "timestamp"
            ]
          },
          "WsPositionExpired": {
            "type": "object",
            "properties": {
              "wallet_address": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "position_size": {
                "type": "string"
              },
              "settlement_price": {
                "type": "string"
              },
              "settlement_value": {
                "type": "string"
              },
              "settlement_entry_price": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "cost_basis": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "net_pnl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "wallet_address",
              "symbol",
              "position_size",
              "settlement_price",
              "settlement_value",
              "timestamp"
            ]
          },
          "WsPartialLiquidationState": {
            "type": "object",
            "properties": {
              "entered_at": {
                "type": "integer",
                "format": "int64"
              },
              "target_equity": {
                "type": "string"
              },
              "mm_shortfall": {
                "type": "string"
              },
              "escalation_deadline": {
                "type": "integer",
                "format": "int64"
              },
              "last_reprice_at": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64"
              },
              "active_order_request_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "active_order_client_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "bonus_bps": {
                "type": "integer",
                "format": "int32"
              },
              "pending_full_auction_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "pending_full_request_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "pending_full_tx_hash": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "pending_full_margin_needed": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "entered_at",
              "target_equity",
              "mm_shortfall",
              "escalation_deadline",
              "active_order_request_ids",
              "active_order_client_ids",
              "bonus_bps"
            ]
          },
          "WsFullLiquidationState": {
            "type": "object",
            "properties": {
              "auction_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "request_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "tx_hash": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "started_at": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64"
              },
              "chain_start_time": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64"
              },
              "margin_needed": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "stop_request_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "stop_tx_hash": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "liquidated_at": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64"
              },
              "winner": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "bonus": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "resolution_tx_hash": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "WsLiquidationStateChange": {
            "type": "object",
            "properties": {
              "wallet_address": {
                "type": "string"
              },
              "previous_state": {
                "type": "string"
              },
              "new_state": {
                "type": "string"
              },
              "liquidation_mode": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "margin_mode": {
                "type": "string"
              },
              "equity": {
                "type": "string"
              },
              "mm_required": {
                "type": "string"
              },
              "maintenance_margin": {
                "type": "string"
              },
              "shortfall": {
                "type": "string"
              },
              "partial_liquidation": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WsMessage/$defs/WsPartialLiquidationState"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "full_liquidation": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WsMessage/$defs/WsFullLiquidationState"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "wallet_address",
              "previous_state",
              "new_state",
              "margin_mode",
              "equity",
              "mm_required",
              "maintenance_margin",
              "shortfall",
              "timestamp"
            ]
          },
          "WsCompetitionUpdate": {
            "type": "object",
            "properties": {
              "wallet_address": {
                "type": "string"
              },
              "competition_id": {
                "type": "integer",
                "format": "int64"
              },
              "rank": {
                "type": "integer",
                "format": "int64"
              },
              "pnl": {
                "type": "string"
              },
              "volume": {
                "type": "string"
              },
              "efficiency": {
                "type": "string"
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "wallet_address",
              "competition_id",
              "rank",
              "pnl",
              "volume",
              "efficiency",
              "timestamp"
            ]
          },
          "WsCompetitionPnlStanding": {
            "type": "object",
            "properties": {
              "competition_id": {
                "type": "integer",
                "format": "int64"
              },
              "competition_name": {
                "type": "string"
              },
              "competition_state": {
                "type": "string"
              },
              "rank": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "uint",
                "minimum": 0
              },
              "pnl": {
                "type": "string"
              },
              "volume": {
                "type": "string"
              },
              "efficiency": {
                "type": "string"
              },
              "medal": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "uint8",
                "minimum": 0,
                "maximum": 255
              }
            },
            "required": [
              "competition_id",
              "competition_name",
              "competition_state",
              "pnl",
              "volume",
              "efficiency"
            ]
          },
          "WsCompetitionPnlSummary": {
            "type": "object",
            "properties": {
              "wallet_address": {
                "type": "string"
              },
              "lifetime_realized_pnl": {
                "type": "string"
              },
              "active_competition": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WsMessage/$defs/WsCompetitionPnlStanding"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "wallet_address",
              "lifetime_realized_pnl",
              "timestamp"
            ]
          },
          "WsCompetitionFinalStats": {
            "type": "object",
            "properties": {
              "wallet_address": {
                "type": "string"
              },
              "competition_id": {
                "type": "integer",
                "format": "int64"
              },
              "rank": {
                "type": "integer",
                "format": "int64"
              },
              "pnl": {
                "type": "string"
              },
              "volume": {
                "type": "string"
              },
              "efficiency": {
                "type": "string"
              },
              "medal": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64"
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "wallet_address",
              "competition_id",
              "rank",
              "pnl",
              "volume",
              "efficiency",
              "timestamp"
            ]
          },
          "WsCompetitionRankChange": {
            "type": "object",
            "properties": {
              "wallet_address": {
                "type": "string"
              },
              "competition_id": {
                "type": "integer",
                "format": "int64"
              },
              "from_rank": {
                "type": "integer",
                "format": "int64"
              },
              "to_rank": {
                "type": "integer",
                "format": "int64"
              },
              "delta_places": {
                "type": "integer",
                "format": "int64"
              },
              "pnl": {
                "type": "string"
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "wallet_address",
              "competition_id",
              "from_rank",
              "to_rank",
              "delta_places",
              "pnl",
              "timestamp"
            ]
          },
          "WsCompetitionGapUpdate": {
            "type": "object",
            "properties": {
              "wallet_address": {
                "type": "string"
              },
              "competition_id": {
                "type": "integer",
                "format": "int64"
              },
              "rank": {
                "type": "integer",
                "format": "int64"
              },
              "next_rank": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64"
              },
              "gap_metric_value": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "wallet_address",
              "competition_id",
              "rank",
              "timestamp"
            ]
          },
          "WsCompetitionFinalStanding": {
            "type": "object",
            "properties": {
              "wallet_address": {
                "type": "string"
              },
              "competition_id": {
                "type": "integer",
                "format": "int64"
              },
              "rank": {
                "type": "integer",
                "format": "int64"
              },
              "pnl": {
                "type": "string"
              },
              "volume": {
                "type": "string"
              },
              "efficiency": {
                "type": "string"
              },
              "medal": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "int64"
              },
              "timestamp": {
                "type": "integer",
                "format": "int64"
              }
            },
            "required": [
              "wallet_address",
              "competition_id",
              "rank",
              "pnl",
              "volume",
              "efficiency",
              "timestamp"
            ]
          },
          "RfqProviderIndicativeQuote": {
            "type": "object",
            "properties": {
              "wallet": {
                "type": "string"
              },
              "bid_price": {
                "type": "string"
              },
              "ask_price": {
                "type": "string"
              },
              "max_bid_size": {
                "type": "string"
              },
              "max_ask_size": {
                "type": "string"
              },
              "updated_at": {
                "type": "integer",
                "format": "uint64",
                "minimum": 0
              }
            },
            "required": [
              "wallet",
              "bid_price",
              "ask_price",
              "max_bid_size",
              "max_ask_size",
              "updated_at"
            ]
          },
          "WsIndicativeMarketData": {
            "type": "object",
            "properties": {
              "instrument": {
                "type": "string"
              },
              "best_bid": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "bid_iv": {
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "ask_iv": {
                "type": [
                  "number",
                  "null"
                ],
                "format": "double"
              },
              "best_ask": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "indicative_bid_size": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "indicative_ask_size": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "num_providers": {
                "type": "integer",
                "format": "uint32",
                "minimum": 0
              },
              "rfq_provider_quotes": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "$ref": "#/components/schemas/WsMessage/$defs/RfqProviderIndicativeQuote"
                }
              },
              "timestamp": {
                "type": "integer",
                "format": "uint64",
                "minimum": 0
              }
            },
            "required": [
              "instrument",
              "num_providers",
              "timestamp"
            ]
          },
          "WsRfqQuoteEntry": {
            "type": "object",
            "properties": {
              "quote_id": {
                "type": "string"
              },
              "net_premium": {
                "type": "string"
              },
              "expires_at": {
                "type": "integer",
                "format": "uint64",
                "minimum": 0
              }
            },
            "required": [
              "quote_id",
              "net_premium",
              "expires_at"
            ]
          },
          "WsRfqQuotes": {
            "type": "object",
            "properties": {
              "rfq_id": {
                "type": "string"
              },
              "quotes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/WsMessage/$defs/WsRfqQuoteEntry"
                }
              },
              "status": {
                "type": "string"
              },
              "taker_wallet": {
                "type": "string"
              }
            },
            "required": [
              "rfq_id",
              "quotes",
              "status",
              "taker_wallet"
            ]
          },
          "WsRfqStatusUpdate": {
            "type": "object",
            "properties": {
              "rfq_id": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "taker_wallet": {
                "type": "string"
              }
            },
            "required": [
              "rfq_id",
              "status",
              "taker_wallet"
            ]
          },
          "WsRfqLegRequest": {
            "type": "object",
            "properties": {
              "instrument": {
                "type": "string"
              },
              "side": {
                "type": "string"
              },
              "size": {
                "type": "string"
              }
            },
            "required": [
              "instrument",
              "side",
              "size"
            ]
          },
          "WsOrderResult": {
            "type": "object",
            "properties": {
              "order_id": {
                "type": [
                  "integer",
                  "null"
                ],
                "format": "uint64",
                "minimum": 0
              },
              "status": {
                "type": "string"
              },
              "symbol": {
                "type": "string"
              },
              "side": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "size": {
                "type": "string"
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "status",
              "symbol",
              "side",
              "price",
              "size"
            ]
          }
        }
      }
    }
  }
}
