{
  "asyncapi": "3.0.0",
  "info": {
    "title": "Polymarket Perps WebSocket API",
    "version": "1.0.0",
    "description": "WebSocket API for real-time trading operations and market data.",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "defaultContentType": "application/json",
  "servers": {
    "production": {
      "host": "ws.perpetuals.polymarket.com",
      "protocol": "wss",
      "description": "Production WebSocket server"
    }
  },
  "channels": {
    "ping": {
      "address": "/v1/ws",
      "title": "Ping",
      "summary": "Ping/pong heartbeat",
      "description": "Connections are automatically closed after 60 seconds of inactivity. Send a ping message periodically to keep the connection alive.",
      "messages": {
        "Request": {
          "name": "PingRequest",
          "title": "Ping",
          "summary": "Client sends ping to test connection and keep alive",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "op": {
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "ping"
                    ]
                  }
                }
              }
            },
            "required": [
              "req",
              "op"
            ]
          },
          "examples": [
            {
              "name": "Request Example",
              "payload": {
                "req": "post",
                "op": {
                  "type": "ping"
                }
              }
            }
          ]
        },
        "Response": {
          "name": "PongResponse",
          "title": "Pong",
          "summary": "Server responds with pong including connection info",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "type": "object",
                "required": [
                  "status",
                  "ts",
                  "sq"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "ok",
                      "err"
                    ],
                    "description": "Result status"
                  },
                  "ts": {
                    "type": "integer",
                    "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                    "example": 1767225600000
                  },
                  "sq": {
                    "type": "integer",
                    "description": "Sequence number",
                    "example": 1234567890
                  }
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "Response Example",
              "payload": {
                "data": {
                  "status": "ok",
                  "ts": 1767225600000,
                  "sq": 1234567890
                }
              }
            }
          ]
        }
      }
    },
    "placeOrders": {
      "address": "/v1/ws",
      "title": "Create Orders",
      "summary": "Create new orders.",
      "description": "Create new orders.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n\n<Badge color=\"gray\" size=\"md\">Action Weight: **1 / order**</Badge>\n",
      "messages": {
        "Request": {
          "name": "PlaceOrdersRequest",
          "title": "Create Orders Request",
          "summary": "Client submits a signed order placement request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "op": {
                "type": "object",
                "required": [
                  "type",
                  "args"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "createOrders"
                    ]
                  },
                  "args": {
                    "description": "Array of orders to create",
                    "type": "object",
                    "required": [
                      "iid",
                      "buy",
                      "qty"
                    ],
                    "properties": {
                      "iid": {
                        "type": "integer",
                        "description": "Instrument ID",
                        "example": 1
                      },
                      "buy": {
                        "type": "boolean",
                        "description": "Is buy",
                        "example": true
                      },
                      "p": {
                        "type": "string",
                        "description": "Price",
                        "example": "100.00"
                      },
                      "qty": {
                        "type": "string",
                        "description": "Quantity in no. of contracts",
                        "example": "10.00"
                      },
                      "tif": {
                        "type": "string",
                        "description": "Time in force",
                        "enum": [
                          "gtc",
                          "ioc",
                          "fok"
                        ]
                      },
                      "po": {
                        "type": "boolean",
                        "description": "Post only",
                        "default": false,
                        "example": false
                      },
                      "ro": {
                        "type": "boolean",
                        "description": "Reduce only",
                        "example": false,
                        "default": false
                      },
                      "c": {
                        "type": "string",
                        "description": "Client order ID",
                        "minLength": 32,
                        "maxLength": 32,
                        "pattern": "^[0-9a-f]{32}$",
                        "example": "550e8400e29b41d4a716446655440000"
                      },
                      "tr": {
                        "type": "object",
                        "description": "Optional trigger attached to this order.",
                        "properties": {
                          "market": {
                            "type": "boolean",
                            "description": "Whether the trigger executes as a market order"
                          },
                          "trp": {
                            "type": "string",
                            "description": "Trigger price",
                            "example": "110.00"
                          },
                          "tpsl": {
                            "type": "string",
                            "description": "Trigger type",
                            "enum": [
                              "tp",
                              "sl"
                            ]
                          }
                        }
                      }
                    }
                  },
                  "grp": {
                    "type": "string",
                    "description": "TPSL grouping",
                    "enum": [
                      "order",
                      "position"
                    ]
                  }
                }
              },
              "sig": {
                "type": "string",
                "description": "Signature in hex format",
                "example": "0x1234567890..."
              },
              "salt": {
                "type": "integer",
                "description": "Salt",
                "example": 1234567890
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "exp": {
                "type": "integer",
                "description": "Command expiry timestamp in Unix milliseconds. If provided, it must be in the future and within the gateway's default command timeout. It can shorten request validity but cannot extend it. This is not an order auto-cancel time.",
                "example": 1767225600000
              }
            },
            "required": [
              "req",
              "op",
              "sig",
              "salt",
              "ts"
            ]
          },
          "examples": [
            {
              "name": "Request Example",
              "payload": {
                "req": "post",
                "op": {
                  "type": "createOrders",
                  "args": [
                    {
                      "iid": 1,
                      "buy": true,
                      "p": "100.00",
                      "qty": "10.00",
                      "tif": "gtc",
                      "po": false,
                      "ro": false,
                      "c": "550e8400e29b41d4a716446655440000",
                      "tr": {
                        "trp": "110.00",
                        "tpsl": "tp"
                      }
                    }
                  ],
                  "grp": "order"
                },
                "sig": "0x1234567890...",
                "salt": 1234567890,
                "ts": 1767225600000,
                "exp": 1767225600000
              }
            }
          ]
        },
        "Response": {
          "name": "PlaceOrdersResponse",
          "title": "Create Orders Response",
          "summary": "Server responds with order ACK for each submitted order",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "type": "object",
                "description": "Array of order results",
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "status",
                      "oid"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "ok"
                        ]
                      },
                      "oid": {
                        "type": "integer",
                        "description": "Order ID",
                        "example": 1234567890
                      },
                      "coid": {
                        "type": "string",
                        "description": "Client order ID",
                        "minLength": 32,
                        "maxLength": 32,
                        "pattern": "^[0-9a-f]{32}$",
                        "example": "550e8400e29b41d4a716446655440000"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "status",
                      "error"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "err"
                        ]
                      },
                      "error": {
                        "type": "string",
                        "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                        "example": "insufficient_margin"
                      },
                      "oid": {
                        "type": "integer",
                        "description": "Order ID",
                        "example": 1234567890
                      },
                      "coid": {
                        "type": "string",
                        "description": "Client order ID",
                        "minLength": 32,
                        "maxLength": 32,
                        "pattern": "^[0-9a-f]{32}$",
                        "example": "550e8400e29b41d4a716446655440000"
                      }
                    }
                  }
                ]
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "Order accepted",
              "payload": {
                "id": 1,
                "data": [
                  {
                    "status": "ok",
                    "oid": 1234567890
                  }
                ]
              }
            }
          ]
        }
      }
    },
    "cancelOrders": {
      "address": "/v1/ws",
      "title": "Cancel Orders",
      "summary": "Cancel orders.",
      "description": "Cancel orders.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n\n<Badge color=\"gray\" size=\"md\">Action Weight: **0**</Badge>\n",
      "messages": {
        "Request": {
          "name": "CancelOrdersRequest",
          "title": "Cancel Orders Request",
          "summary": "Client submits a signed order cancellation request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "op": {
                "type": "object",
                "required": [
                  "type",
                  "args"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "cancelOrders"
                    ]
                  },
                  "args": {
                    "type": "array",
                    "description": "Array of order IDs to cancel. Cancelling an order that has attached\ntake-profit / stop-loss children (see `CreateOrder.tr`) cascades to\nthose children — they are cancelled with reason `ParentCancelled`.\n",
                    "items": {
                      "type": "integer",
                      "description": "Order ID",
                      "example": 1234567890
                    }
                  }
                }
              },
              "sig": {
                "type": "string",
                "description": "Signature in hex format",
                "example": "0x1234567890..."
              },
              "salt": {
                "type": "integer",
                "description": "Salt",
                "example": 1234567890
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "exp": {
                "type": "integer",
                "description": "Command expiry timestamp in Unix milliseconds. If provided, it must be in the future and within the gateway's default command timeout. It can shorten request validity but cannot extend it. This is not an order auto-cancel time.",
                "example": 1767225600000
              }
            },
            "required": [
              "req",
              "op",
              "sig",
              "salt",
              "ts"
            ]
          },
          "examples": [
            {
              "name": "Request Example",
              "payload": {
                "req": "post",
                "op": {
                  "type": "cancelOrders",
                  "args": [
                    1234567890
                  ]
                },
                "sig": "0x1234567890...",
                "salt": 1234567890,
                "ts": 1767225600000,
                "exp": 1767225600000
              }
            }
          ]
        },
        "Response": {
          "name": "CancelOrdersResponse",
          "title": "Cancel Orders Response",
          "summary": "Server responds with cancel result for each order",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "type": "array",
                "description": "Array of cancel results",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "oid"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        },
                        "oid": {
                          "type": "integer",
                          "description": "Order ID",
                          "example": 1234567890
                        },
                        "coid": {
                          "type": "string",
                          "description": "Client order ID",
                          "minLength": 32,
                          "maxLength": 32,
                          "pattern": "^[0-9a-f]{32}$",
                          "example": "550e8400e29b41d4a716446655440000"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "oid": {
                          "type": "integer",
                          "description": "Order ID",
                          "example": 1234567890
                        },
                        "coid": {
                          "type": "string",
                          "description": "Client order ID",
                          "minLength": 32,
                          "maxLength": 32,
                          "pattern": "^[0-9a-f]{32}$",
                          "example": "550e8400e29b41d4a716446655440000"
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "Both canceled",
              "payload": {
                "id": 3,
                "data": [
                  {
                    "status": "ok",
                    "oid": 1234567890
                  },
                  {
                    "status": "ok",
                    "oid": 1234567891
                  }
                ]
              }
            }
          ]
        }
      }
    },
    "cancelOrdersCOID": {
      "address": "/v1/ws",
      "title": "Cancel Orders COID",
      "summary": "Cancel orders by client order ID.",
      "description": "Cancel orders by client order ID.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n\n<Badge color=\"gray\" size=\"md\">Action Weight: **0**</Badge>\n",
      "messages": {
        "Request": {
          "name": "CancelOrdersCoidRequest",
          "title": "Cancel Orders COID Request",
          "summary": "Client submits a signed cancel-by-client-order-id request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "op": {
                "type": "object",
                "required": [
                  "type",
                  "args"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "cancelOrdersCOID"
                    ]
                  },
                  "args": {
                    "type": "array",
                    "description": "Array of client order IDs to cancel. Cancelling an order that has\nattached take-profit / stop-loss children (see `CreateOrder.tr`)\ncascades to those children — they are cancelled with reason\n`ParentCancelled`.\n",
                    "items": {
                      "type": "string",
                      "description": "Client order ID",
                      "minLength": 32,
                      "maxLength": 32,
                      "pattern": "^[0-9a-f]{32}$",
                      "example": "550e8400e29b41d4a716446655440000"
                    }
                  }
                }
              },
              "sig": {
                "type": "string",
                "description": "Signature in hex format",
                "example": "0x1234567890..."
              },
              "salt": {
                "type": "integer",
                "description": "Salt",
                "example": 1234567890
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "exp": {
                "type": "integer",
                "description": "Command expiry timestamp in Unix milliseconds. If provided, it must be in the future and within the gateway's default command timeout. It can shorten request validity but cannot extend it. This is not an order auto-cancel time.",
                "example": 1767225600000
              }
            },
            "required": [
              "req",
              "op",
              "sig",
              "salt",
              "ts"
            ]
          },
          "examples": [
            {
              "name": "Request Example",
              "payload": {
                "req": "post",
                "op": {
                  "type": "cancelOrdersCOID",
                  "args": [
                    "550e8400e29b41d4a716446655440000"
                  ]
                },
                "sig": "0x1234567890...",
                "salt": 1234567890,
                "ts": 1767225600000,
                "exp": 1767225600000
              }
            }
          ]
        },
        "Response": {
          "name": "CancelOrdersCoidResponse",
          "title": "Cancel Orders COID Response",
          "summary": "Server responds with cancel result for each client order ID",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "type": "array",
                "description": "Array of cancel results",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "oid"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        },
                        "oid": {
                          "type": "integer",
                          "description": "Order ID",
                          "example": 1234567890
                        },
                        "coid": {
                          "type": "string",
                          "description": "Client order ID",
                          "minLength": 32,
                          "maxLength": 32,
                          "pattern": "^[0-9a-f]{32}$",
                          "example": "550e8400e29b41d4a716446655440000"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "oid": {
                          "type": "integer",
                          "description": "Order ID",
                          "example": 1234567890
                        },
                        "coid": {
                          "type": "string",
                          "description": "Client order ID",
                          "minLength": 32,
                          "maxLength": 32,
                          "pattern": "^[0-9a-f]{32}$",
                          "example": "550e8400e29b41d4a716446655440000"
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "Both canceled",
              "payload": {
                "id": 3,
                "data": [
                  {
                    "status": "ok",
                    "oid": 1234567890,
                    "coid": "550e8400e29b41d4a716446655440000"
                  },
                  {
                    "status": "ok",
                    "oid": 1234567891,
                    "coid": "550e8400e29b41d4a716446655440001"
                  }
                ]
              }
            }
          ]
        }
      }
    },
    "autoCancel": {
      "address": "/v1/ws",
      "title": "Auto-Cancel",
      "summary": "Set or clear auto-cancel dead-man-switch.",
      "description": "Arm or clear the per-account auto-cancel schedule.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n\n<Badge color=\"gray\" size=\"md\">Action Weight: **10**</Badge>\n",
      "messages": {
        "Request": {
          "name": "AutoCancelRequest",
          "title": "Auto-Cancel Request",
          "summary": "Client submits a signed auto-cancel request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "op": {
                "type": "object",
                "required": [
                  "type",
                  "args"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "autoCancel"
                    ]
                  },
                  "args": {
                    "type": "object",
                    "required": [
                      "time"
                    ],
                    "properties": {
                      "time": {
                        "type": "integer",
                        "description": "Timestamp in milliseconds",
                        "example": 1767225600000
                      }
                    }
                  }
                }
              },
              "sig": {
                "type": "string",
                "description": "Signature in hex format",
                "example": "0x1234567890..."
              },
              "salt": {
                "type": "integer",
                "description": "Salt",
                "example": 1234567890
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              }
            },
            "required": [
              "req",
              "op",
              "sig",
              "salt",
              "ts"
            ]
          },
          "examples": [
            {
              "name": "Request Example",
              "payload": {
                "req": "post",
                "op": {
                  "type": "autoCancel",
                  "args": {
                    "time": 1767225600000
                  }
                },
                "sig": "0x1234567890...",
                "salt": 1234567890,
                "ts": 1767225600000
              }
            }
          ]
        },
        "Response": {
          "name": "AutoCancelResponse",
          "title": "Auto-Cancel Response",
          "summary": "Server responds with auto-cancel result",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "status"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "ok"
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "status",
                      "error"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "err"
                        ]
                      },
                      "error": {
                        "type": "string",
                        "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                        "example": "insufficient_margin"
                      }
                    }
                  }
                ]
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "Armed",
              "payload": {
                "id": 5,
                "data": {
                  "status": "ok"
                }
              }
            }
          ]
        }
      }
    },
    "updateLeverage": {
      "address": "/v1/ws",
      "title": "Update Leverage",
      "summary": "Update leverage for an instrument.",
      "description": "Set leverage and margin type for an instrument.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n\n<Badge color=\"gray\" size=\"md\">Action Weight: **1**</Badge>\n",
      "messages": {
        "Request": {
          "name": "UpdateLeverageRequest",
          "title": "Update Leverage Request",
          "summary": "Client submits a signed leverage update request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "op": {
                "type": "object",
                "required": [
                  "type",
                  "args"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "updateLeverage"
                    ]
                  },
                  "args": {
                    "type": "object",
                    "required": [
                      "iid",
                      "lev",
                      "cross"
                    ],
                    "properties": {
                      "iid": {
                        "type": "integer",
                        "description": "Instrument ID",
                        "example": 1
                      },
                      "lev": {
                        "type": "integer",
                        "description": "Leverage",
                        "example": 10
                      },
                      "cross": {
                        "type": "boolean",
                        "description": "Whether to use cross margin mode"
                      }
                    }
                  }
                }
              },
              "sig": {
                "type": "string",
                "description": "Signature in hex format",
                "example": "0x1234567890..."
              },
              "salt": {
                "type": "integer",
                "description": "Salt",
                "example": 1234567890
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              }
            },
            "required": [
              "req",
              "op",
              "sig",
              "salt",
              "ts"
            ]
          },
          "examples": [
            {
              "name": "Request Example",
              "payload": {
                "req": "post",
                "op": {
                  "type": "updateLeverage",
                  "args": {
                    "iid": 1,
                    "lev": 10
                  }
                },
                "sig": "0x1234567890...",
                "salt": 1234567890,
                "ts": 1767225600000
              }
            }
          ]
        },
        "Response": {
          "name": "UpdateLeverageResponse",
          "title": "Update Leverage Response",
          "summary": "Server responds with leverage update result",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "status"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "ok"
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "status",
                      "error"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "err"
                        ]
                      },
                      "error": {
                        "type": "string",
                        "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                        "example": "insufficient_margin"
                      }
                    }
                  }
                ]
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "Updated",
              "payload": {
                "id": 6,
                "data": {
                  "status": "ok"
                }
              }
            }
          ]
        }
      }
    },
    "auth": {
      "address": "/v1/ws",
      "title": "Auth",
      "summary": "Authentication to access private channels.",
      "messages": {
        "Request": {
          "name": "AuthRequest",
          "title": "Auth",
          "summary": "Authenticate this WebSocket connection for private channels",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "op": {
                "type": "object",
                "required": [
                  "type",
                  "args"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "auth"
                    ]
                  },
                  "args": {
                    "type": "object",
                    "required": [
                      "proxy",
                      "secret"
                    ],
                    "properties": {
                      "proxy": {
                        "type": "string",
                        "description": "Proxy address in hex format",
                        "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
                      },
                      "secret": {
                        "type": "string",
                        "description": "API secret",
                        "example": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
                      }
                    }
                  }
                }
              }
            },
            "required": [
              "req",
              "op"
            ]
          },
          "examples": [
            {
              "name": "Request Example",
              "payload": {
                "req": "post",
                "op": {
                  "type": "auth",
                  "args": {
                    "proxy": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
                    "secret": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
                  }
                }
              }
            }
          ]
        },
        "Response": {
          "name": "AuthResponse",
          "title": "Auth Response",
          "summary": "Authentication result",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "status"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "ok"
                        ]
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "status",
                      "error"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "err"
                        ]
                      },
                      "error": {
                        "type": "string",
                        "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                        "example": "insufficient_margin"
                      }
                    }
                  }
                ]
              }
            },
            "required": [
              "data"
            ]
          }
        }
      }
    },
    "trades": {
      "address": "/v1/ws",
      "title": "Trades",
      "summary": "Real-time trade stream.",
      "messages": {
        "SubscribeRequest": {
          "name": "TradesSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to public trade updates for an instrument",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Trades subscription in format \"trades::{iid}\" (e.g., \"trades::1\")",
                "items": {
                  "type": "string",
                  "pattern": "^trades::\\d+$"
                },
                "example": [
                  "trades::1"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "trades::1"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "TradesSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to trades subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "TradesUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from public trade updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Trades subscription in format \"trades::{iid}\" (e.g., \"trades::1\")",
                "items": {
                  "type": "string",
                  "pattern": "^trades::\\d+$"
                },
                "example": [
                  "trades::1"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "trades::1"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "TradesUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to trades unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "TradesUpdate",
          "title": "Update",
          "summary": "Real-time trade updates for subscribed instruments",
          "contentType": "application/json",
          "payload": {
            "title": "Trades Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "description": "Array of trade objects",
                "title": "TradeResponse",
                "properties": {
                  "tid": {
                    "type": "integer",
                    "description": "Trade ID",
                    "example": 1
                  },
                  "iid": {
                    "type": "integer",
                    "description": "Instrument ID",
                    "example": 1
                  },
                  "side": {
                    "type": "string",
                    "description": "Side",
                    "enum": [
                      "long",
                      "short"
                    ]
                  },
                  "p": {
                    "type": "string",
                    "description": "Price",
                    "example": "100.00"
                  },
                  "qty": {
                    "type": "string",
                    "description": "Quantity in no. of contracts",
                    "example": "10.00"
                  },
                  "ts": {
                    "type": "integer",
                    "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                    "example": 1767225600000
                  },
                  "hash": {
                    "type": "string",
                    "description": "On-chain transaction hash, \"0x\" if not yet mined",
                    "default": "0x",
                    "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
                  }
                },
                "required": [
                  "tid",
                  "iid",
                  "side",
                  "p",
                  "qty",
                  "ts",
                  "hash"
                ]
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "trades::1",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": [
                  {
                    "tid": 1,
                    "iid": 1,
                    "side": "long",
                    "p": "100.00",
                    "qty": "10.00",
                    "ts": 1767225600000,
                    "hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
                  }
                ]
              }
            }
          ]
        }
      }
    },
    "bbo": {
      "address": "/v1/ws",
      "title": "BBO",
      "summary": "Best bid and offer real-time updates.",
      "messages": {
        "SubscribeRequest": {
          "name": "BBOSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to BBO updates for a specific instrument",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "BBO subscription per instrument: `bbo::{iid}` (e.g. `bbo::1`).\n",
                "items": {
                  "type": "string",
                  "pattern": "^bbo::\\d+$"
                },
                "example": [
                  "bbo::1"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "bbo::1"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "BBOSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to BBO subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "BBOUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from BBO updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "BBO subscription per instrument: `bbo::{iid}` (e.g. `bbo::1`).\n",
                "items": {
                  "type": "string",
                  "pattern": "^bbo::\\d+$"
                },
                "example": [
                  "bbo::1"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "bbo::1"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "BBOUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to BBO unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "BBOUpdate",
          "title": "Update",
          "summary": "Real-time BBO updates for subscribed instruments",
          "contentType": "application/json",
          "payload": {
            "title": "BBO Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "description": "BBO object",
                "title": "BBO Data",
                "properties": {
                  "iid": {
                    "type": "integer",
                    "description": "Instrument ID",
                    "example": 1
                  },
                  "bp": {
                    "type": "string",
                    "description": "Best bid price",
                    "example": "99.50"
                  },
                  "bq": {
                    "type": "string",
                    "description": "Best bid quantity",
                    "example": "10.00"
                  },
                  "ap": {
                    "type": "string",
                    "description": "Best ask price",
                    "example": "100.50"
                  },
                  "aq": {
                    "type": "string",
                    "description": "Best ask quantity",
                    "example": "10.00"
                  }
                },
                "required": [
                  "iid",
                  "bp",
                  "bq",
                  "ap",
                  "aq"
                ]
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "bbo::1",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": {
                  "iid": 1,
                  "bp": "99.50",
                  "bq": "10.00",
                  "ap": "100.50",
                  "aq": "10.00"
                }
              }
            }
          ]
        }
      }
    },
    "book": {
      "address": "/v1/ws",
      "title": "Book",
      "summary": "Order book snapshot updates. Pushed every 100ms.",
      "messages": {
        "SubscribeRequest": {
          "name": "BookSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to order book updates for an instrument",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Book subscription in format \"book::{iid}\" (e.g., \"book::1\")",
                "items": {
                  "type": "string",
                  "pattern": "^book::\\d+$"
                },
                "example": [
                  "book::1"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "book::1"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "BookSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to book subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "BookUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from order book updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Book subscription in format \"book::{iid}\" (e.g., \"book::1\")",
                "items": {
                  "type": "string",
                  "pattern": "^book::\\d+$"
                },
                "example": [
                  "book::1"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "book::1"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "BookUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to book unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "BookUpdate",
          "title": "Update",
          "summary": "Real-time order book updates for subscribed instruments",
          "contentType": "application/json",
          "payload": {
            "title": "Book Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "required": [
                  "b",
                  "a"
                ],
                "properties": {
                  "b": {
                    "type": "array",
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 2,
                      "description": "- `\"100.00\"` - Price\n- `\"10.00\"` - Quantity\n",
                      "example": [
                        "100.00",
                        "10.00"
                      ]
                    },
                    "description": "Bid levels"
                  },
                  "a": {
                    "type": "array",
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 2,
                      "description": "- `\"100.00\"` - Price\n- `\"10.00\"` - Quantity\n",
                      "example": [
                        "100.00",
                        "10.00"
                      ]
                    },
                    "description": "Ask levels"
                  }
                }
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "book::1",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": {
                  "b": [
                    [
                      "100.00",
                      "10.00"
                    ]
                  ],
                  "a": [
                    [
                      "100.00",
                      "10.00"
                    ]
                  ]
                }
              }
            }
          ]
        }
      }
    },
    "klines": {
      "address": "/v1/ws",
      "title": "Klines",
      "summary": "Real-time kline updates.",
      "messages": {
        "SubscribeRequest": {
          "name": "KlinesSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to kline updates for an instrument and interval",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Klines subscription in format \"klines::{iid}::{interval}\" (e.g., \"klines::1::1m\")",
                "items": {
                  "type": "string",
                  "pattern": "^klines::\\d+::(1m|5m|15m|30m|1h|4h|6h|12h|1d|1w)$"
                },
                "example": [
                  "klines::1::1m"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "klines::1::1m"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "KlinesSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to klines subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "KlinesUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from kline updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Klines subscription in format \"klines::{iid}::{interval}\" (e.g., \"klines::1::1m\")",
                "items": {
                  "type": "string",
                  "pattern": "^klines::\\d+::(1m|5m|15m|30m|1h|4h|6h|12h|1d|1w)$"
                },
                "example": [
                  "klines::1::1m"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "klines::1::1m"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "KlinesUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to klines unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "KlineUpdate",
          "title": "Update",
          "summary": "Real-time kline updates for subscribed instruments",
          "contentType": "application/json",
          "payload": {
            "title": "Kline Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "array",
                "description": "Array of kline arrays",
                "items": {
                  "type": "array",
                  "description": "- `1767225600000` - Open time\n- `\"100.00\"` - Open price\n- `\"105.00\"` - High price\n- `\"99.00\"` - Low price\n- `\"102.00\"` - Close price\n- `\"500.00\"` - Volume (base unit)\n- `42` - Number of trades\n",
                  "example": [
                    1767225600000,
                    "100.00",
                    "105.00",
                    "99.00",
                    "102.00",
                    "500.00",
                    42
                  ]
                }
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "klines::1::1m",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": [
                  [
                    1767225600000,
                    "100.00",
                    "105.00",
                    "99.00",
                    "102.00",
                    "500.00",
                    42
                  ]
                ]
              }
            }
          ]
        }
      }
    },
    "tickers": {
      "address": "/v1/ws",
      "title": "Tickers",
      "summary": "Ticker updates. Pushed every 100ms.",
      "messages": {
        "SubscribeRequest": {
          "name": "TickersSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to ticker updates for all instruments or a specific one",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Ticker subscription: `tickers::all` for every active instrument,\nor `tickers::{iid}` (e.g. `tickers::1`) for a specific one.\n",
                "items": {
                  "type": "string",
                  "pattern": "^tickers::(\\d+|all)$"
                },
                "example": [
                  "tickers::all"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "tickers::all"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "TickersSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to tickers subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "TickersUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from ticker updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Ticker subscription: `tickers::all` for every active instrument,\nor `tickers::{iid}` (e.g. `tickers::1`) for a specific one.\n",
                "items": {
                  "type": "string",
                  "pattern": "^tickers::(\\d+|all)$"
                },
                "example": [
                  "tickers::all"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "tickers::all"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "TickersUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to tickers unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "TickerUpdate",
          "title": "Update",
          "summary": "Real-time ticker updates for subscribed instruments",
          "contentType": "application/json",
          "payload": {
            "title": "Ticker Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "description": "Array of ticker objects",
                "properties": {
                  "iid": {
                    "type": "integer",
                    "description": "Instrument ID",
                    "example": 1
                  },
                  "idx": {
                    "type": "string",
                    "description": "Index price",
                    "example": "100.00"
                  },
                  "mark": {
                    "type": "string",
                    "description": "Mark price",
                    "example": "100.00"
                  },
                  "last": {
                    "type": "string",
                    "description": "Last traded price",
                    "example": "100.00"
                  },
                  "mid": {
                    "type": "string",
                    "description": "Mid price",
                    "example": "100.00"
                  },
                  "oi": {
                    "type": "string",
                    "description": "Open interest in number of contracts",
                    "example": "10.00"
                  },
                  "fr": {
                    "type": "string",
                    "description": "Funding rate",
                    "example": "0.0001"
                  },
                  "nxf": {
                    "type": "integer",
                    "description": "Next funding timestamp in milliseconds",
                    "example": 1767225600000
                  }
                },
                "required": [
                  "iid",
                  "idx",
                  "mark",
                  "last",
                  "mid",
                  "oi",
                  "fr",
                  "nxf"
                ]
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "tickers::all",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": [
                  {
                    "iid": 1,
                    "idx": "100.00",
                    "mark": "100.00",
                    "last": "100.00",
                    "mid": "100.00",
                    "oi": "10.00",
                    "fr": "0.0001",
                    "nxf": 1767225600000
                  }
                ]
              }
            }
          ]
        }
      }
    },
    "statistics": {
      "address": "/v1/ws",
      "title": "Statistics",
      "summary": "24-hour statistics updates. Pushed every 1 second.",
      "messages": {
        "SubscribeRequest": {
          "name": "StatisticsSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to 24-hour statistics updates for all instruments or a specific one",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Statistics subscription: `statistics::all` for every active instrument,\nor `statistics::{iid}` (e.g. `statistics::1`) for a specific one.\n",
                "items": {
                  "type": "string",
                  "pattern": "^statistics::(\\d+|all)$"
                },
                "example": [
                  "statistics::all"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "statistics::all"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "StatisticsSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to statistics subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "StatisticsUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from statistics updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Statistics subscription: `statistics::all` for every active instrument,\nor `statistics::{iid}` (e.g. `statistics::1`) for a specific one.\n",
                "items": {
                  "type": "string",
                  "pattern": "^statistics::(\\d+|all)$"
                },
                "example": [
                  "statistics::all"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "statistics::all"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "StatisticsUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to statistics unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "StatisticsUpdate",
          "title": "Update",
          "summary": "24-hour statistics for subscribed instruments",
          "contentType": "application/json",
          "payload": {
            "title": "Statistics Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "description": "Array of statistics objects",
                "properties": {
                  "iid": {
                    "type": "integer",
                    "description": "Instrument ID",
                    "example": 1
                  },
                  "vol": {
                    "type": "string",
                    "description": "24-hour trading volume in contracts",
                    "example": "1000.00"
                  },
                  "open": {
                    "type": "string",
                    "description": "Opening price from 24 hours ago",
                    "example": "100.50"
                  },
                  "klines": {
                    "type": "array",
                    "items": {
                      "type": "array",
                      "description": "- `1767225600000` - Open time\n- `\"100.00\"` - Open price\n- `\"105.00\"` - High price\n- `\"99.00\"` - Low price\n- `\"102.00\"` - Close price\n- `\"500.00\"` - Volume (base unit)\n- `42` - Number of trades\n",
                      "example": [
                        1767225600000,
                        "100.00",
                        "105.00",
                        "99.00",
                        "102.00",
                        "500.00",
                        42
                      ]
                    },
                    "description": "Last 24-hour kline data"
                  }
                },
                "required": [
                  "iid",
                  "vol",
                  "open",
                  "klines"
                ]
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "statistics::all",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": [
                  {
                    "iid": 1,
                    "vol": "1000.00",
                    "open": "100.50",
                    "klines": [
                      [
                        1767225600000,
                        "100.00",
                        "105.00",
                        "99.00",
                        "102.00",
                        "500.00",
                        42
                      ]
                    ]
                  }
                ]
              }
            }
          ]
        }
      }
    },
    "fills": {
      "address": "/v1/ws",
      "title": "Fills",
      "summary": "Real-time fill updates. Requires authentication, see [Auth](/ws/auth).",
      "messages": {
        "SubscribeRequest": {
          "name": "FillsSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to private fill updates (requires prior auth)",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Fills private channel: \"fills\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "fills"
                  ]
                },
                "example": [
                  "fills"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "fills"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "FillsSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to fills subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "FillsUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from private fill updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Fills private channel: \"fills\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "fills"
                  ]
                },
                "example": [
                  "fills"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "fills"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "FillsUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to fills unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "FillsUpdate",
          "title": "Update",
          "summary": "Real-time fill updates for authenticated users",
          "contentType": "application/json",
          "payload": {
            "title": "Fills Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "description": "Array of fill objects",
                "properties": {
                  "tid": {
                    "type": "integer",
                    "description": "Trade ID",
                    "example": 1
                  },
                  "oid": {
                    "type": "integer",
                    "description": "Order ID",
                    "example": 1234567890
                  },
                  "iid": {
                    "type": "integer",
                    "description": "Instrument ID",
                    "example": 1
                  },
                  "side": {
                    "type": "string",
                    "description": "Side",
                    "enum": [
                      "long",
                      "short"
                    ]
                  },
                  "p": {
                    "type": "string",
                    "description": "Price",
                    "example": "100.00"
                  },
                  "qty": {
                    "type": "string",
                    "description": "Quantity in no. of contracts",
                    "example": "10.00"
                  },
                  "taker": {
                    "type": "boolean",
                    "description": "Whether this side was the taker"
                  },
                  "fee": {
                    "type": "string",
                    "description": "Fee amount for this trade side",
                    "example": "1.25"
                  },
                  "fea": {
                    "type": "string",
                    "description": "Fee asset name",
                    "example": "USDC"
                  },
                  "psz": {
                    "type": "string",
                    "description": "Position size before the fill",
                    "example": "26.86"
                  },
                  "pep": {
                    "type": "string",
                    "description": "Position entry price before the fill",
                    "example": "100.00"
                  },
                  "pnl": {
                    "type": "string",
                    "description": "PnL in USD",
                    "example": "100.00"
                  },
                  "liq": {
                    "type": "boolean",
                    "description": "Whether the fill was a liquidation"
                  },
                  "ts": {
                    "type": "integer",
                    "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                    "example": 1767225600000
                  },
                  "coid": {
                    "type": "string",
                    "description": "Client order ID",
                    "minLength": 32,
                    "maxLength": 32,
                    "pattern": "^[0-9a-f]{32}$",
                    "example": "550e8400e29b41d4a716446655440000"
                  }
                },
                "required": [
                  "tid",
                  "oid",
                  "iid",
                  "side",
                  "p",
                  "qty",
                  "taker",
                  "fee",
                  "fea",
                  "psz",
                  "pep",
                  "pnl",
                  "ts",
                  "liq"
                ]
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "fills",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": [
                  {
                    "tid": 1,
                    "oid": 1234567890,
                    "iid": 1,
                    "side": "long",
                    "p": "100.00",
                    "qty": "10.00",
                    "fee": "1.25",
                    "fea": "USDC",
                    "psz": "26.86",
                    "pep": "100.00",
                    "pnl": "100.00",
                    "ts": 1767225600000,
                    "coid": "550e8400e29b41d4a716446655440000"
                  }
                ]
              }
            }
          ]
        }
      }
    },
    "orders": {
      "address": "/v1/ws",
      "title": "Orders",
      "summary": "Real-time order updates. Requires authentication, see [Auth](/ws/auth).",
      "messages": {
        "SubscribeRequest": {
          "name": "OrdersSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to private order updates (requires prior auth)",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Orders private channel: \"orders\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "orders"
                  ]
                },
                "example": [
                  "orders"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "orders"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "OrdersSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to orders subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "OrdersUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from private order updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Orders private channel: \"orders\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "orders"
                  ]
                },
                "example": [
                  "orders"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "orders"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "OrdersUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to orders unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "OrdersUpdate",
          "title": "Update",
          "summary": "Real-time order updates for authenticated users",
          "contentType": "application/json",
          "payload": {
            "title": "Orders Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "description": "Order object",
                "properties": {
                  "oid": {
                    "type": "integer",
                    "description": "Order ID",
                    "example": 1234567890
                  },
                  "iid": {
                    "type": "integer",
                    "description": "Instrument ID",
                    "example": 1
                  },
                  "buy": {
                    "type": "boolean",
                    "description": "Is buy",
                    "example": true
                  },
                  "p": {
                    "type": "string",
                    "description": "Price",
                    "example": "100.00"
                  },
                  "qty": {
                    "type": "string",
                    "description": "Quantity in no. of contracts",
                    "example": "10.00"
                  },
                  "tif": {
                    "type": "string",
                    "description": "Time in force",
                    "enum": [
                      "gtc",
                      "ioc",
                      "fok"
                    ]
                  },
                  "po": {
                    "type": "boolean",
                    "description": "Post only",
                    "default": false,
                    "example": false
                  },
                  "ro": {
                    "type": "boolean",
                    "description": "Reduce only",
                    "example": false,
                    "default": false
                  },
                  "rest": {
                    "type": "string",
                    "description": "Resting quantity",
                    "example": "9.00"
                  },
                  "fill": {
                    "type": "string",
                    "description": "Filled quantity",
                    "example": "1.00"
                  },
                  "cts": {
                    "type": "integer",
                    "description": "Create timestamp in milliseconds",
                    "example": 1767225600000
                  },
                  "uts": {
                    "type": "integer",
                    "description": "Update timestamp in milliseconds",
                    "example": 1767225600000
                  },
                  "status": {
                    "type": "string",
                    "description": "Order status",
                    "example": "open"
                  },
                  "coid": {
                    "type": "string",
                    "description": "Client order ID",
                    "minLength": 32,
                    "maxLength": 32,
                    "pattern": "^[0-9a-f]{32}$",
                    "example": "550e8400e29b41d4a716446655440000"
                  }
                },
                "required": [
                  "oid",
                  "iid",
                  "buy",
                  "p",
                  "qty",
                  "tif",
                  "po",
                  "ro",
                  "status",
                  "rest",
                  "fill",
                  "cts",
                  "uts"
                ]
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "orders",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": {
                  "oid": 1234567890,
                  "iid": 1,
                  "buy": true,
                  "p": "100.00",
                  "qty": "10.00",
                  "tif": "gtc",
                  "po": false,
                  "ro": false,
                  "rest": "9.00",
                  "fill": "1.00",
                  "cts": 1767225600000,
                  "uts": 1767225600000,
                  "status": "open",
                  "coid": "550e8400e29b41d4a716446655440000"
                }
              }
            }
          ]
        }
      }
    },
    "funding": {
      "address": "/v1/ws",
      "title": "Funding",
      "summary": "Real-time funding payment updates. Requires authentication, see [Auth](/ws/auth).",
      "messages": {
        "SubscribeRequest": {
          "name": "FundingSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to private funding payment updates (requires prior auth)",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Funding private channel: \"funding\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "funding"
                  ]
                },
                "example": [
                  "funding"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "funding"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "FundingSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to funding subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "FundingUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from private funding updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Funding private channel: \"funding\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "funding"
                  ]
                },
                "example": [
                  "funding"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "funding"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "FundingUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to funding unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "FundingUpdate",
          "title": "Update",
          "summary": "Real-time funding payment updates for authenticated users",
          "contentType": "application/json",
          "payload": {
            "title": "Funding Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "description": "Array of funding objects",
                "properties": {
                  "iid": {
                    "type": "integer",
                    "description": "Instrument ID",
                    "example": 1
                  },
                  "sz": {
                    "type": "string",
                    "description": "Signed position size in no. of contracts (positive = long, negative = short)",
                    "example": "10.00"
                  },
                  "fr": {
                    "type": "string",
                    "description": "Funding rate",
                    "example": "0.0001"
                  },
                  "fund": {
                    "type": "string",
                    "description": "Funding paid in USD",
                    "example": "1.00"
                  },
                  "fua": {
                    "type": "string",
                    "description": "Funding asset name",
                    "example": "USDC"
                  },
                  "ts": {
                    "type": "integer",
                    "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                    "example": 1767225600000
                  }
                },
                "required": [
                  "iid",
                  "sz",
                  "fr",
                  "fund",
                  "fua",
                  "ts"
                ]
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "funding",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": [
                  {
                    "iid": 1,
                    "sz": "10.00",
                    "fr": "0.0001",
                    "fund": "1.00",
                    "fua": "USDC",
                    "ts": 1767225600000
                  }
                ]
              }
            }
          ]
        }
      }
    },
    "balances": {
      "address": "/v1/ws",
      "title": "Balances",
      "summary": "Real-time balance updates. Pushed every 5 seconds. Requires authentication, see [Auth](/ws/auth).",
      "messages": {
        "SubscribeRequest": {
          "name": "BalancesSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to private balance updates (requires prior auth)",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Balances private channel: \"balances\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "balances"
                  ]
                },
                "example": [
                  "balances"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "balances"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "BalancesSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to balances subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "BalancesUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from private balance updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Balances private channel: \"balances\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "balances"
                  ]
                },
                "example": [
                  "balances"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "balances"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "BalancesUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to balances unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "BalancesUpdate",
          "title": "Update",
          "summary": "Balance updates pushed every 5 seconds",
          "contentType": "application/json",
          "payload": {
            "title": "Balances Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "description": "Balance object",
                "properties": {
                  "asset": {
                    "type": "string",
                    "description": "Asset name",
                    "example": "USDC"
                  },
                  "balance": {
                    "type": "string",
                    "description": "Total balance",
                    "example": "10000.00"
                  },
                  "value": {
                    "type": "string",
                    "description": "USD value",
                    "example": "10000.00"
                  }
                },
                "required": [
                  "asset",
                  "balance",
                  "value"
                ]
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "balances",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": {
                  "asset": "USDC",
                  "balance": "10000.00",
                  "value": "10000.00"
                }
              }
            }
          ]
        }
      }
    },
    "portfolio": {
      "address": "/v1/ws",
      "title": "Portfolio",
      "summary": "Real-time portfolio updates. Pushed every 5 seconds. Requires authentication, see [Auth](/ws/auth).",
      "messages": {
        "SubscribeRequest": {
          "name": "PortfolioSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to private portfolio updates (requires prior auth)",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Portfolio private channel: \"portfolio\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "portfolio"
                  ]
                },
                "example": [
                  "portfolio"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "portfolio"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "PortfolioSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to portfolio subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "PortfolioUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from private portfolio updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Portfolio private channel: \"portfolio\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "portfolio"
                  ]
                },
                "example": [
                  "portfolio"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "portfolio"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "PortfolioUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to portfolio unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "PortfolioUpdate",
          "title": "Update",
          "summary": "Portfolio updates pushed every 5 seconds",
          "contentType": "application/json",
          "payload": {
            "title": "Portfolio Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "required": [
                  "positions",
                  "margin",
                  "withdrawable",
                  "in_liquidation",
                  "timestamp"
                ],
                "properties": {
                  "positions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "instrument_id",
                        "symbol",
                        "size",
                        "entry_price",
                        "leverage",
                        "cross",
                        "initial_margin",
                        "maintenance_margin",
                        "position_value",
                        "liquidation_price",
                        "unrealized_pnl",
                        "return_on_equity",
                        "cumulative_funding"
                      ],
                      "properties": {
                        "instrument_id": {
                          "type": "integer",
                          "description": "Instrument ID"
                        },
                        "symbol": {
                          "type": "string",
                          "description": "Instrument symbol",
                          "example": "NVDA-USDC"
                        },
                        "size": {
                          "type": "string",
                          "description": "Signed position size in no. of contracts (positive = long, negative = short)",
                          "example": "10.00"
                        },
                        "entry_price": {
                          "type": "string",
                          "description": "Average entry price",
                          "example": "2986.30"
                        },
                        "leverage": {
                          "type": "integer",
                          "description": "Leverage",
                          "example": 10
                        },
                        "cross": {
                          "type": "boolean",
                          "description": "Whether to use cross margin mode"
                        },
                        "initial_margin": {
                          "type": "string",
                          "description": "Initial margin in USD",
                          "example": "10.00"
                        },
                        "maintenance_margin": {
                          "type": "string",
                          "description": "Maintenance margin amount",
                          "example": "100.00"
                        },
                        "position_value": {
                          "type": "string",
                          "description": "Notional position value in USD",
                          "example": "100.03"
                        },
                        "liquidation_price": {
                          "type": "string",
                          "description": "Liquidation price",
                          "example": "2866.27"
                        },
                        "unrealized_pnl": {
                          "type": "string",
                          "description": "Unrealized PnL in USD",
                          "example": "-0.01"
                        },
                        "return_on_equity": {
                          "type": "string",
                          "description": "Return on equity as a decimal",
                          "example": "-0.0027"
                        },
                        "cumulative_funding": {
                          "type": "string",
                          "description": "Cumulative funding paid/received in USD",
                          "example": "514.09"
                        }
                      }
                    }
                  },
                  "margin": {
                    "type": "object",
                    "required": [
                      "total_account_value",
                      "total_initial_margin",
                      "total_maintenance_margin",
                      "total_position_value"
                    ],
                    "properties": {
                      "total_account_value": {
                        "type": "string",
                        "description": "Total account value in USD (equity + unrealized PnL)",
                        "example": "13109.48"
                      },
                      "total_initial_margin": {
                        "type": "string",
                        "description": "Total initial margin in use across all positions",
                        "example": "4.97"
                      },
                      "total_maintenance_margin": {
                        "type": "string",
                        "description": "Total maintenance margin across all positions",
                        "example": "2.49"
                      },
                      "total_position_value": {
                        "type": "string",
                        "description": "Total notional position value in USD",
                        "example": "100.03"
                      }
                    }
                  },
                  "withdrawable": {
                    "type": "string",
                    "description": "Withdrawable balance in USD",
                    "example": "13104.51"
                  },
                  "in_liquidation": {
                    "type": "boolean",
                    "description": "Whether the account is currently under liquidation"
                  },
                  "timestamp": {
                    "type": "integer",
                    "description": "Update timestamp in milliseconds",
                    "example": 1767225600000
                  }
                }
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "portfolio",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": {
                  "positions": [
                    {
                      "symbol": "NVDA-USDC",
                      "size": "10.00",
                      "entry_price": "2986.30",
                      "leverage": 10,
                      "initial_margin": "10.00",
                      "maintenance_margin": "100.00",
                      "position_value": "100.03",
                      "liquidation_price": "2866.27",
                      "unrealized_pnl": "-0.01",
                      "return_on_equity": "-0.0027",
                      "cumulative_funding": "514.09"
                    }
                  ],
                  "margin": {
                    "total_account_value": "13109.48",
                    "total_initial_margin": "4.97",
                    "total_maintenance_margin": "2.49",
                    "total_position_value": "100.03"
                  },
                  "withdrawable": "13104.51",
                  "timestamp": 1767225600000
                }
              }
            }
          ]
        }
      }
    },
    "deposits": {
      "address": "/v1/ws",
      "title": "Deposits",
      "summary": "Real-time deposit status updates. Requires authentication, see [Auth](/ws/auth).",
      "messages": {
        "SubscribeRequest": {
          "name": "DepositsSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to private deposit updates (requires prior auth)",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Deposits private channel: \"deposits\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "deposits"
                  ]
                },
                "example": [
                  "deposits"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "deposits"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "DepositsSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to deposits subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "DepositsUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from private deposit updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Deposits private channel: \"deposits\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "deposits"
                  ]
                },
                "example": [
                  "deposits"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "deposits"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "DepositsUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to deposits unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "DepositsUpdate",
          "title": "Update",
          "summary": "Deposit status updates for authenticated users",
          "contentType": "application/json",
          "payload": {
            "title": "Deposits Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "description": "Array of deposit objects",
                "properties": {
                  "hash": {
                    "type": "string",
                    "description": "On-chain transaction hash, \"0x\" if not yet mined",
                    "default": "0x",
                    "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
                  },
                  "asset": {
                    "type": "string",
                    "description": "Asset name",
                    "example": "USDC"
                  },
                  "amount": {
                    "type": "string",
                    "description": "Raw token amount including decimals. For withdrawals this matches the uint256 amount in the EIP-712 signature (e.g. \"100000000\" for 100 USDC with 6 decimals).",
                    "example": "100000000"
                  },
                  "status": {
                    "type": "string",
                    "description": "Deposit status",
                    "enum": [
                      "pending",
                      "confirmed",
                      "removed"
                    ]
                  }
                },
                "required": [
                  "hash",
                  "asset",
                  "amount",
                  "status"
                ]
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "deposits",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": [
                  {
                    "hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
                    "asset": "USDC",
                    "amount": "100000000",
                    "status": "pending"
                  }
                ]
              }
            }
          ]
        }
      }
    },
    "withdrawals": {
      "address": "/v1/ws",
      "title": "Withdrawals",
      "summary": "Real-time withdrawal status updates. Requires authentication, see [Auth](/ws/auth).",
      "messages": {
        "SubscribeRequest": {
          "name": "WithdrawalsSubscribeRequest",
          "title": "Subscribe",
          "summary": "Subscribe to private withdrawal updates (requires prior auth)",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Withdrawals private channel: \"withdrawals\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "withdrawals"
                  ]
                },
                "example": [
                  "withdrawals"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "SubscribeRequest Example",
              "payload": {
                "req": "sub",
                "chs": [
                  "withdrawals"
                ]
              }
            }
          ]
        },
        "SubscribeResponse": {
          "name": "WithdrawalsSubscribeResponse",
          "title": "Subscribe Response",
          "summary": "Response to withdrawals subscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "SubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "UnsubscribeRequest": {
          "name": "WithdrawalsUnsubscribeRequest",
          "title": "Unsubscribe",
          "summary": "Unsubscribe from private withdrawal updates",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Request",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "req": {
                "type": "string",
                "description": "Request type",
                "enum": [
                  "post",
                  "sub",
                  "unsub"
                ]
              },
              "chs": {
                "type": "array",
                "description": "Withdrawals private channel: \"withdrawals\"",
                "items": {
                  "type": "string",
                  "enum": [
                    "withdrawals"
                  ]
                },
                "example": [
                  "withdrawals"
                ]
              }
            },
            "required": [
              "req",
              "chs"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeRequest Example",
              "payload": {
                "req": "unsub",
                "chs": [
                  "withdrawals"
                ]
              }
            }
          ]
        },
        "UnsubscribeResponse": {
          "name": "WithdrawalsUnsubscribeResponse",
          "title": "Unsubscribe Response",
          "summary": "Response to withdrawals unsubscribe request",
          "contentType": "application/json",
          "payload": {
            "type": "object",
            "title": "Base Response",
            "properties": {
              "id": {
                "type": "integer",
                "description": "Correlation ID for request-response matching"
              },
              "data": {
                "title": "Subscribe Response",
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "status",
                        "error"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "err"
                          ]
                        },
                        "error": {
                          "type": "string",
                          "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
                          "example": "insufficient_margin"
                        }
                      }
                    }
                  ]
                }
              }
            },
            "required": [
              "data"
            ]
          },
          "examples": [
            {
              "name": "UnsubscribeResponse Example",
              "payload": {
                "data": []
              }
            }
          ]
        },
        "Update": {
          "name": "WithdrawalsUpdate",
          "title": "Update",
          "summary": "Withdrawal status updates for authenticated users",
          "contentType": "application/json",
          "payload": {
            "title": "Withdrawals Update",
            "type": "object",
            "properties": {
              "ch": {
                "type": "string",
                "description": "Channel name for push data. Parameterized channels include the instrument ID (e.g. \"trades::1\", \"book::1\", \"klines::1::1m\", \"tickers::all\"). Private channels use plain names (e.g. \"fills\", \"orders\").",
                "example": "trades::1"
              },
              "ts": {
                "type": "integer",
                "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
                "example": 1767225600000
              },
              "sq": {
                "type": "integer",
                "description": "Sequence number",
                "example": 1234567890
              },
              "data": {
                "type": "object",
                "description": "Array of withdrawal objects",
                "properties": {
                  "withdraw_id": {
                    "type": "integer",
                    "description": "Withdraw ID"
                  },
                  "asset": {
                    "type": "string",
                    "description": "Asset name",
                    "example": "USDC"
                  },
                  "amount": {
                    "type": "string",
                    "description": "Raw token amount including decimals. For withdrawals this matches the uint256 amount in the EIP-712 signature (e.g. \"100000000\" for 100 USDC with 6 decimals).",
                    "example": "100000000"
                  },
                  "fee": {
                    "type": "string",
                    "description": "Withdrawal transaction fee in decimalized asset units",
                    "example": "5.00"
                  },
                  "to": {
                    "type": "string",
                    "description": "Destination address in hex format",
                    "example": "0x1234567890abcdef1234567890abcdef12345678"
                  },
                  "status": {
                    "type": "string",
                    "description": "Withdrawal status",
                    "enum": [
                      "pending",
                      "confirmed",
                      "removed",
                      "failed"
                    ]
                  },
                  "hash": {
                    "type": "string",
                    "description": "On-chain transaction hash, \"0x\" if not yet mined",
                    "default": "0x",
                    "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
                  }
                },
                "required": [
                  "withdraw_id",
                  "asset",
                  "amount",
                  "fee",
                  "to",
                  "status",
                  "hash"
                ]
              }
            },
            "required": [
              "ch",
              "ts",
              "sq",
              "data"
            ]
          },
          "examples": [
            {
              "name": "Update Example",
              "payload": {
                "ch": "withdrawals",
                "ts": 1767225600000,
                "sq": 1234567890,
                "data": [
                  {
                    "asset": "USDC",
                    "amount": "100000000",
                    "fee": "5.00",
                    "to": "0x1234567890abcdef1234567890abcdef12345678",
                    "status": "pending",
                    "hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
                  }
                ]
              }
            }
          ]
        }
      }
    }
  },
  "operations": {
    "PingSend": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/ping"
      },
      "summary": "Send ping",
      "messages": [
        {
          "$ref": "#/channels/ping/messages/Request"
        }
      ]
    },
    "PingReceive": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/ping"
      },
      "summary": "Pong response",
      "messages": [
        {
          "$ref": "#/channels/ping/messages/Response"
        }
      ]
    },
    "PlaceOrdersSend": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/placeOrders"
      },
      "summary": "Submit new orders",
      "messages": [
        {
          "$ref": "#/channels/placeOrders/messages/Request"
        }
      ]
    },
    "PlaceOrdersReceive": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/placeOrders"
      },
      "summary": "Order ACK response",
      "messages": [
        {
          "$ref": "#/channels/placeOrders/messages/Response"
        }
      ]
    },
    "CancelOrdersSend": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/cancelOrders"
      },
      "summary": "Cancel orders",
      "messages": [
        {
          "$ref": "#/channels/cancelOrders/messages/Request"
        }
      ]
    },
    "CancelOrdersReceive": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/cancelOrders"
      },
      "summary": "Cancel response",
      "messages": [
        {
          "$ref": "#/channels/cancelOrders/messages/Response"
        }
      ]
    },
    "CancelOrdersCOIDSend": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/cancelOrdersCOID"
      },
      "summary": "Cancel orders by client order ID",
      "messages": [
        {
          "$ref": "#/channels/cancelOrdersCOID/messages/Request"
        }
      ]
    },
    "CancelOrdersCOIDReceive": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/cancelOrdersCOID"
      },
      "summary": "Cancel by client order ID response",
      "messages": [
        {
          "$ref": "#/channels/cancelOrdersCOID/messages/Response"
        }
      ]
    },
    "AutoCancelSend": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/autoCancel"
      },
      "summary": "Set or clear auto-cancel",
      "messages": [
        {
          "$ref": "#/channels/autoCancel/messages/Request"
        }
      ]
    },
    "AutoCancelReceive": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/autoCancel"
      },
      "summary": "Auto-cancel response",
      "messages": [
        {
          "$ref": "#/channels/autoCancel/messages/Response"
        }
      ]
    },
    "UpdateLeverageSend": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/updateLeverage"
      },
      "summary": "Update leverage",
      "messages": [
        {
          "$ref": "#/channels/updateLeverage/messages/Request"
        }
      ]
    },
    "UpdateLeverageReceive": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/updateLeverage"
      },
      "summary": "Update leverage response",
      "messages": [
        {
          "$ref": "#/channels/updateLeverage/messages/Response"
        }
      ]
    },
    "TradesSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/trades"
      },
      "summary": "Subscribe to trades",
      "messages": [
        {
          "$ref": "#/channels/trades/messages/SubscribeRequest"
        }
      ]
    },
    "TradesSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/trades"
      },
      "summary": "Trades subscribe response",
      "messages": [
        {
          "$ref": "#/channels/trades/messages/SubscribeResponse"
        }
      ]
    },
    "TradesUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/trades"
      },
      "summary": "Unsubscribe from trades",
      "messages": [
        {
          "$ref": "#/channels/trades/messages/UnsubscribeRequest"
        }
      ]
    },
    "TradesUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/trades"
      },
      "summary": "Trades unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/trades/messages/UnsubscribeResponse"
        }
      ]
    },
    "TradesUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/trades"
      },
      "summary": "Receive trade updates",
      "messages": [
        {
          "$ref": "#/channels/trades/messages/Update"
        }
      ]
    },
    "BBOSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/bbo"
      },
      "summary": "Subscribe to BBO",
      "messages": [
        {
          "$ref": "#/channels/bbo/messages/SubscribeRequest"
        }
      ]
    },
    "BBOSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/bbo"
      },
      "summary": "BBO subscribe response",
      "messages": [
        {
          "$ref": "#/channels/bbo/messages/SubscribeResponse"
        }
      ]
    },
    "BBOUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/bbo"
      },
      "summary": "Unsubscribe from BBO",
      "messages": [
        {
          "$ref": "#/channels/bbo/messages/UnsubscribeRequest"
        }
      ]
    },
    "BBOUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/bbo"
      },
      "summary": "BBO unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/bbo/messages/UnsubscribeResponse"
        }
      ]
    },
    "BBOUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/bbo"
      },
      "summary": "Receive BBO updates",
      "messages": [
        {
          "$ref": "#/channels/bbo/messages/Update"
        }
      ]
    },
    "BookSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/book"
      },
      "summary": "Subscribe to book",
      "messages": [
        {
          "$ref": "#/channels/book/messages/SubscribeRequest"
        }
      ]
    },
    "BookSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/book"
      },
      "summary": "Book subscribe response",
      "messages": [
        {
          "$ref": "#/channels/book/messages/SubscribeResponse"
        }
      ]
    },
    "BookUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/book"
      },
      "summary": "Unsubscribe from book",
      "messages": [
        {
          "$ref": "#/channels/book/messages/UnsubscribeRequest"
        }
      ]
    },
    "BookUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/book"
      },
      "summary": "Book unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/book/messages/UnsubscribeResponse"
        }
      ]
    },
    "BookUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/book"
      },
      "summary": "Receive book updates",
      "messages": [
        {
          "$ref": "#/channels/book/messages/Update"
        }
      ]
    },
    "KlinesSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/klines"
      },
      "summary": "Subscribe to klines",
      "messages": [
        {
          "$ref": "#/channels/klines/messages/SubscribeRequest"
        }
      ]
    },
    "KlinesSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/klines"
      },
      "summary": "Klines subscribe response",
      "messages": [
        {
          "$ref": "#/channels/klines/messages/SubscribeResponse"
        }
      ]
    },
    "KlinesUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/klines"
      },
      "summary": "Unsubscribe from klines",
      "messages": [
        {
          "$ref": "#/channels/klines/messages/UnsubscribeRequest"
        }
      ]
    },
    "KlinesUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/klines"
      },
      "summary": "Klines unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/klines/messages/UnsubscribeResponse"
        }
      ]
    },
    "KlinesUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/klines"
      },
      "summary": "Receive kline updates",
      "messages": [
        {
          "$ref": "#/channels/klines/messages/Update"
        }
      ]
    },
    "TickersSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/tickers"
      },
      "summary": "Subscribe to tickers",
      "messages": [
        {
          "$ref": "#/channels/tickers/messages/SubscribeRequest"
        }
      ]
    },
    "TickersSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/tickers"
      },
      "summary": "Tickers subscribe response",
      "messages": [
        {
          "$ref": "#/channels/tickers/messages/SubscribeResponse"
        }
      ]
    },
    "TickersUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/tickers"
      },
      "summary": "Unsubscribe from tickers",
      "messages": [
        {
          "$ref": "#/channels/tickers/messages/UnsubscribeRequest"
        }
      ]
    },
    "TickersUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/tickers"
      },
      "summary": "Tickers unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/tickers/messages/UnsubscribeResponse"
        }
      ]
    },
    "TickersUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/tickers"
      },
      "summary": "Receive ticker updates",
      "messages": [
        {
          "$ref": "#/channels/tickers/messages/Update"
        }
      ]
    },
    "StatisticsSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/statistics"
      },
      "summary": "Subscribe to statistics",
      "messages": [
        {
          "$ref": "#/channels/statistics/messages/SubscribeRequest"
        }
      ]
    },
    "StatisticsSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/statistics"
      },
      "summary": "Statistics subscribe response",
      "messages": [
        {
          "$ref": "#/channels/statistics/messages/SubscribeResponse"
        }
      ]
    },
    "StatisticsUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/statistics"
      },
      "summary": "Unsubscribe from statistics",
      "messages": [
        {
          "$ref": "#/channels/statistics/messages/UnsubscribeRequest"
        }
      ]
    },
    "StatisticsUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/statistics"
      },
      "summary": "Statistics unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/statistics/messages/UnsubscribeResponse"
        }
      ]
    },
    "StatisticsUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/statistics"
      },
      "summary": "Receive statistics updates",
      "messages": [
        {
          "$ref": "#/channels/statistics/messages/Update"
        }
      ]
    },
    "AuthSend": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/auth"
      },
      "summary": "Authenticate connection",
      "messages": [
        {
          "$ref": "#/channels/auth/messages/Request"
        }
      ]
    },
    "AuthReceive": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/auth"
      },
      "summary": "Auth response",
      "messages": [
        {
          "$ref": "#/channels/auth/messages/Response"
        }
      ]
    },
    "FillsSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/fills"
      },
      "summary": "Subscribe to fills",
      "messages": [
        {
          "$ref": "#/channels/fills/messages/SubscribeRequest"
        }
      ]
    },
    "FillsSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/fills"
      },
      "summary": "Fills subscribe response",
      "messages": [
        {
          "$ref": "#/channels/fills/messages/SubscribeResponse"
        }
      ]
    },
    "FillsUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/fills"
      },
      "summary": "Unsubscribe from fills",
      "messages": [
        {
          "$ref": "#/channels/fills/messages/UnsubscribeRequest"
        }
      ]
    },
    "FillsUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/fills"
      },
      "summary": "Fills unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/fills/messages/UnsubscribeResponse"
        }
      ]
    },
    "FillsUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/fills"
      },
      "summary": "Receive fill updates",
      "messages": [
        {
          "$ref": "#/channels/fills/messages/Update"
        }
      ]
    },
    "OrdersSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/orders"
      },
      "summary": "Subscribe to orders",
      "messages": [
        {
          "$ref": "#/channels/orders/messages/SubscribeRequest"
        }
      ]
    },
    "OrdersSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/orders"
      },
      "summary": "Orders subscribe response",
      "messages": [
        {
          "$ref": "#/channels/orders/messages/SubscribeResponse"
        }
      ]
    },
    "OrdersUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/orders"
      },
      "summary": "Unsubscribe from orders",
      "messages": [
        {
          "$ref": "#/channels/orders/messages/UnsubscribeRequest"
        }
      ]
    },
    "OrdersUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/orders"
      },
      "summary": "Orders unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/orders/messages/UnsubscribeResponse"
        }
      ]
    },
    "OrdersUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/orders"
      },
      "summary": "Receive order updates",
      "messages": [
        {
          "$ref": "#/channels/orders/messages/Update"
        }
      ]
    },
    "FundingSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/funding"
      },
      "summary": "Subscribe to funding",
      "messages": [
        {
          "$ref": "#/channels/funding/messages/SubscribeRequest"
        }
      ]
    },
    "FundingSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/funding"
      },
      "summary": "Funding subscribe response",
      "messages": [
        {
          "$ref": "#/channels/funding/messages/SubscribeResponse"
        }
      ]
    },
    "FundingUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/funding"
      },
      "summary": "Unsubscribe from funding",
      "messages": [
        {
          "$ref": "#/channels/funding/messages/UnsubscribeRequest"
        }
      ]
    },
    "FundingUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/funding"
      },
      "summary": "Funding unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/funding/messages/UnsubscribeResponse"
        }
      ]
    },
    "FundingUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/funding"
      },
      "summary": "Receive funding updates",
      "messages": [
        {
          "$ref": "#/channels/funding/messages/Update"
        }
      ]
    },
    "BalancesSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/balances"
      },
      "summary": "Subscribe to balances",
      "messages": [
        {
          "$ref": "#/channels/balances/messages/SubscribeRequest"
        }
      ]
    },
    "BalancesSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/balances"
      },
      "summary": "Balances subscribe response",
      "messages": [
        {
          "$ref": "#/channels/balances/messages/SubscribeResponse"
        }
      ]
    },
    "BalancesUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/balances"
      },
      "summary": "Unsubscribe from balances",
      "messages": [
        {
          "$ref": "#/channels/balances/messages/UnsubscribeRequest"
        }
      ]
    },
    "BalancesUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/balances"
      },
      "summary": "Balances unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/balances/messages/UnsubscribeResponse"
        }
      ]
    },
    "BalancesUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/balances"
      },
      "summary": "Receive balance updates",
      "messages": [
        {
          "$ref": "#/channels/balances/messages/Update"
        }
      ]
    },
    "PortfolioSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/portfolio"
      },
      "summary": "Subscribe to portfolio",
      "messages": [
        {
          "$ref": "#/channels/portfolio/messages/SubscribeRequest"
        }
      ]
    },
    "PortfolioSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/portfolio"
      },
      "summary": "Portfolio subscribe response",
      "messages": [
        {
          "$ref": "#/channels/portfolio/messages/SubscribeResponse"
        }
      ]
    },
    "PortfolioUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/portfolio"
      },
      "summary": "Unsubscribe from portfolio",
      "messages": [
        {
          "$ref": "#/channels/portfolio/messages/UnsubscribeRequest"
        }
      ]
    },
    "PortfolioUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/portfolio"
      },
      "summary": "Portfolio unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/portfolio/messages/UnsubscribeResponse"
        }
      ]
    },
    "PortfolioUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/portfolio"
      },
      "summary": "Receive portfolio updates",
      "messages": [
        {
          "$ref": "#/channels/portfolio/messages/Update"
        }
      ]
    },
    "DepositsSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/deposits"
      },
      "summary": "Subscribe to deposits",
      "messages": [
        {
          "$ref": "#/channels/deposits/messages/SubscribeRequest"
        }
      ]
    },
    "DepositsSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/deposits"
      },
      "summary": "Deposits subscribe response",
      "messages": [
        {
          "$ref": "#/channels/deposits/messages/SubscribeResponse"
        }
      ]
    },
    "DepositsUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/deposits"
      },
      "summary": "Unsubscribe from deposits",
      "messages": [
        {
          "$ref": "#/channels/deposits/messages/UnsubscribeRequest"
        }
      ]
    },
    "DepositsUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/deposits"
      },
      "summary": "Deposits unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/deposits/messages/UnsubscribeResponse"
        }
      ]
    },
    "DepositsUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/deposits"
      },
      "summary": "Receive deposit updates",
      "messages": [
        {
          "$ref": "#/channels/deposits/messages/Update"
        }
      ]
    },
    "WithdrawalsSubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/withdrawals"
      },
      "summary": "Subscribe to withdrawals",
      "messages": [
        {
          "$ref": "#/channels/withdrawals/messages/SubscribeRequest"
        }
      ]
    },
    "WithdrawalsSubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/withdrawals"
      },
      "summary": "Withdrawals subscribe response",
      "messages": [
        {
          "$ref": "#/channels/withdrawals/messages/SubscribeResponse"
        }
      ]
    },
    "WithdrawalsUnsubscribe": {
      "action": "receive",
      "channel": {
        "$ref": "#/channels/withdrawals"
      },
      "summary": "Unsubscribe from withdrawals",
      "messages": [
        {
          "$ref": "#/channels/withdrawals/messages/UnsubscribeRequest"
        }
      ]
    },
    "WithdrawalsUnsubscribeResponse": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/withdrawals"
      },
      "summary": "Withdrawals unsubscribe response",
      "messages": [
        {
          "$ref": "#/channels/withdrawals/messages/UnsubscribeResponse"
        }
      ]
    },
    "WithdrawalsUpdate": {
      "action": "send",
      "channel": {
        "$ref": "#/channels/withdrawals"
      },
      "summary": "Receive withdrawal updates",
      "messages": [
        {
          "$ref": "#/channels/withdrawals/messages/Update"
        }
      ]
    }
  }
}