{
  "openapi": "3.1.0",
  "info": {
    "title": "Trade8 REST API",
    "version": "1.0.0",
    "description": "Perpetual markets, order execution, accounts, risk, and custody. All example IDs, prices, rates, and capacity figures are illustrative. Signing and recovery rules: https://trade8.xyz/docs/authentication/",
    "contact": {
      "name": "Trade8 Support",
      "email": "support@trade8.xyz"
    }
  },
  "x-reference-only": true,
  "servers": [
    {
      "url": "https://api.trade8.xyz",
      "description": "REST API"
    }
  ],
  "externalDocs": {
    "url": "https://trade8.xyz/docs/",
    "description": "Guides and WebSocket reference"
  },
  "tags": [
    {
      "name": "Market Data"
    },
    {
      "name": "Accounts and Keys"
    },
    {
      "name": "Orders and Execution"
    },
    {
      "name": "Positions and Risk"
    },
    {
      "name": "Custody and Settlement"
    },
    {
      "name": "Funding and Transfers"
    }
  ],
  "paths": {
    "/v1/time": {
      "get": {
        "operationId": "getTime",
        "tags": [
          "Market Data"
        ],
        "summary": "Read Server Time",
        "description": "Compare UTC time with your signed client. Keep the host clock synchronized with NTP.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "market:read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "server_time": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Server UTC time."
                    },
                    "unix_seconds": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "Unix time in whole seconds."
                    }
                  },
                  "required": [
                    "server_time",
                    "unix_seconds"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "server_time": "2026-08-31T12:00:00.000Z",
                  "unix_seconds": 1788177600
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/markets": {
      "get": {
        "operationId": "listMarkets",
        "tags": [
          "Market Data"
        ],
        "summary": "List Perpetual Markets",
        "description": "List perpetual markets with their native exchange contracts. Filter by instrument, exchange, or settlement asset. No API key is required.\n\nEach instrument appears once. Its contracts contain the supported exchange mappings, settlement units, and available price and size rules.",
        "security": [],
        "parameters": [
          {
            "name": "instrument",
            "in": "query",
            "required": false,
            "description": "Normalized perpetual family.",
            "schema": {
              "type": "string",
              "description": "Normalized perpetual family."
            },
            "example": "BTC-PERP"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "binance"
          },
          {
            "name": "settlement_asset",
            "in": "query",
            "required": false,
            "description": "Filter contracts by settlement asset.",
            "schema": {
              "type": "string",
              "description": "Filter contracts by settlement asset."
            },
            "example": "USDT"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 10; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 10
            },
            "example": 10
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "description": "UTC source-metadata refresh time in HTTP-date format.",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "description": "Public market and exchange responses may be cached for 300 seconds.",
                "schema": {
                  "type": "string",
                  "example": "public, max-age=300"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketCatalog"
                },
                "example": {
                  "markets": [
                    {
                      "instrument": "BTC-PERP",
                      "contract_type": "perpetual",
                      "base_asset": "BTC",
                      "contracts": [
                        {
                          "venue": "apex",
                          "venue_instrument": "BTC-USDT",
                          "settlement_asset": "USDT",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USDT",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.001",
                          "minimum_quantity": "0.0010",
                          "maximum_quantity": "50",
                          "max_leverage": "100"
                        },
                        {
                          "venue": "aster",
                          "venue_instrument": "BTCU",
                          "settlement_asset": "U",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "U",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.10"
                          },
                          "quantity_step": "0.001",
                          "minimum_quantity": "0.001",
                          "maximum_quantity": "1000",
                          "minimum_notional": "5"
                        },
                        {
                          "venue": "aster",
                          "venue_instrument": "BTCUSD1",
                          "settlement_asset": "USD1",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USD1",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.10"
                          },
                          "quantity_step": "0.001",
                          "minimum_quantity": "0.001",
                          "maximum_quantity": "1000",
                          "minimum_notional": "5"
                        },
                        {
                          "venue": "aster",
                          "venue_instrument": "BTCUSDT",
                          "settlement_asset": "USDT",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USDT",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.001",
                          "minimum_quantity": "0.001",
                          "maximum_quantity": "1000",
                          "minimum_notional": "5"
                        },
                        {
                          "venue": "binance",
                          "venue_instrument": "BTCU",
                          "settlement_asset": "U",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "U",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.10"
                          },
                          "quantity_step": "0.0001",
                          "minimum_quantity": "0.0001",
                          "maximum_quantity": "800",
                          "minimum_notional": "5"
                        },
                        {
                          "venue": "binance",
                          "venue_instrument": "BTCUSD_PERP",
                          "settlement_asset": "BTC",
                          "payoff_type": "inverse",
                          "quantity_unit": "contract",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "1",
                          "minimum_quantity": "1",
                          "maximum_quantity": "1000000",
                          "contract_size": "100",
                          "contract_size_unit": "USD"
                        },
                        {
                          "venue": "binance",
                          "venue_instrument": "BTCUSD1",
                          "settlement_asset": "USD1",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USD1",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.10"
                          },
                          "quantity_step": "0.0001",
                          "minimum_quantity": "0.0001",
                          "maximum_quantity": "800",
                          "minimum_notional": "50"
                        },
                        {
                          "venue": "binance",
                          "venue_instrument": "BTCUSDC",
                          "settlement_asset": "USDC",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USDC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.001",
                          "minimum_quantity": "0.001",
                          "maximum_quantity": "800",
                          "minimum_notional": "50"
                        },
                        {
                          "venue": "binance",
                          "venue_instrument": "BTCUSDT",
                          "settlement_asset": "USDT",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USDT",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.10"
                          },
                          "quantity_step": "0.001",
                          "minimum_quantity": "0.001",
                          "maximum_quantity": "1000",
                          "minimum_notional": "50"
                        },
                        {
                          "venue": "bitget",
                          "venue_instrument": "BTCPERP",
                          "settlement_asset": "USDC",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USDC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.0001",
                          "minimum_quantity": "0.0001",
                          "maximum_quantity": "100",
                          "minimum_notional": "5",
                          "max_leverage": "125"
                        },
                        {
                          "venue": "bitget",
                          "venue_instrument": "BTCUSDT",
                          "settlement_asset": "USDT",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USDT",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.0001",
                          "minimum_quantity": "0.0001",
                          "maximum_quantity": "1200",
                          "minimum_notional": "5",
                          "max_leverage": "150"
                        },
                        {
                          "venue": "bybit",
                          "venue_instrument": "BTCPERP",
                          "settlement_asset": "USDC",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USDC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.10"
                          },
                          "quantity_step": "0.001",
                          "minimum_quantity": "0.001",
                          "maximum_quantity": "1000.000",
                          "minimum_notional": "5",
                          "max_leverage": "125.00"
                        },
                        {
                          "venue": "bybit",
                          "venue_instrument": "BTCUSD",
                          "settlement_asset": "BTC",
                          "payoff_type": "inverse",
                          "quantity_unit": "USD",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.10"
                          },
                          "quantity_step": "1",
                          "minimum_quantity": "1",
                          "maximum_quantity": "25000000",
                          "minimum_notional": "5",
                          "max_leverage": "100.00"
                        },
                        {
                          "venue": "bybit",
                          "venue_instrument": "BTCUSDT",
                          "settlement_asset": "USDT",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USDT",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.10"
                          },
                          "quantity_step": "0.001",
                          "minimum_quantity": "0.001",
                          "maximum_quantity": "1500.000",
                          "minimum_notional": "5",
                          "max_leverage": "150.00"
                        },
                        {
                          "venue": "deribit",
                          "venue_instrument": "BTC_USDC-PERPETUAL",
                          "settlement_asset": "USDC",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USDC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.0001",
                          "minimum_quantity": "0.0001",
                          "max_leverage": "50"
                        },
                        {
                          "venue": "deribit",
                          "venue_instrument": "BTC-PERPETUAL",
                          "settlement_asset": "BTC",
                          "payoff_type": "inverse",
                          "quantity_unit": "USD",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.5"
                          },
                          "quantity_step": "10",
                          "minimum_quantity": "10",
                          "max_leverage": "50"
                        },
                        {
                          "venue": "dydx",
                          "venue_instrument": "BTC-USD",
                          "settlement_asset": "USDC",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "1"
                          },
                          "quantity_step": "0.0001"
                        },
                        {
                          "venue": "edgex",
                          "venue_instrument": "BTCUSD",
                          "settlement_asset": "USDT",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.001",
                          "minimum_quantity": "0.003",
                          "maximum_quantity": "22",
                          "max_leverage": "100"
                        },
                        {
                          "venue": "extended",
                          "venue_instrument": "BTC-USD",
                          "settlement_asset": "USDC",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "1"
                          },
                          "quantity_step": "0.00001",
                          "minimum_quantity": "0.0001",
                          "max_leverage": "50.00"
                        },
                        {
                          "venue": "gate",
                          "venue_instrument": "BTC_USD",
                          "settlement_asset": "BTC",
                          "payoff_type": "inverse",
                          "quantity_unit": "contract",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "1",
                          "minimum_quantity": "1",
                          "maximum_quantity": "530000",
                          "max_leverage": "100"
                        },
                        {
                          "venue": "gate",
                          "venue_instrument": "BTC_USDT",
                          "settlement_asset": "USDT",
                          "payoff_type": "linear",
                          "quantity_unit": "contract",
                          "price_unit": "USDT",
                          "contract_size": "0.0001",
                          "contract_size_unit": "BTC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "1",
                          "minimum_quantity": "1",
                          "maximum_quantity": "12000000",
                          "max_leverage": "200"
                        },
                        {
                          "venue": "gmx",
                          "venue_instrument": "0x3ce7BCDB37Bf587d1C17B930Fa0A7000A0648D12",
                          "network": "avalanche",
                          "settlement_assets": [
                            "BTC"
                          ],
                          "quantity_unit": "USD",
                          "price_unit": "USD"
                        },
                        {
                          "venue": "gmx",
                          "venue_instrument": "0x47c031236e19d024b42f8AE6780E44A573170703",
                          "network": "arbitrum",
                          "settlement_assets": [
                            "WBTC.b",
                            "USDC"
                          ],
                          "quantity_unit": "USD",
                          "price_unit": "USD"
                        },
                        {
                          "venue": "gmx",
                          "venue_instrument": "0x7C11F78Ce78768518D743E81Fdfa2F860C6b9A77",
                          "network": "arbitrum",
                          "settlement_assets": [
                            "WBTC.b"
                          ],
                          "quantity_unit": "USD",
                          "price_unit": "USD"
                        },
                        {
                          "venue": "gmx",
                          "venue_instrument": "0xd62068697bCc92AF253225676D618B0C9f17C663",
                          "network": "arbitrum",
                          "settlement_assets": [
                            "tBTC"
                          ],
                          "quantity_unit": "USD",
                          "price_unit": "USD"
                        },
                        {
                          "venue": "gmx",
                          "venue_instrument": "0xFb02132333A79C8B5Bd0b64E3AbccA5f7fAf2937",
                          "network": "avalanche",
                          "settlement_assets": [
                            "BTC",
                            "USDC"
                          ],
                          "quantity_unit": "USD",
                          "price_unit": "USD"
                        },
                        {
                          "venue": "grvt",
                          "venue_instrument": "BTC_USDT_Perp",
                          "settlement_asset": "USDT",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USDT",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "minimum_quantity": "0.001",
                          "minimum_notional": "100.0"
                        },
                        {
                          "venue": "hyperliquid",
                          "venue_instrument": "BTC",
                          "settlement_asset": "USDC",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "significant_figures",
                            "max_significant_figures": 5,
                            "max_decimal_places": 1,
                            "integer_prices_allowed": true
                          },
                          "quantity_step": "0.00001",
                          "max_leverage": "40"
                        },
                        {
                          "venue": "kraken",
                          "venue_instrument": "PF_XBTUSD",
                          "settlement_asset": "USD",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "1"
                          },
                          "quantity_step": "0.0001"
                        },
                        {
                          "venue": "kucoin",
                          "venue_instrument": "XBTUSDCM",
                          "settlement_asset": "USDC",
                          "payoff_type": "linear",
                          "quantity_unit": "contract",
                          "price_unit": "USDC",
                          "contract_size": "0.0001",
                          "contract_size_unit": "BTC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "1",
                          "maximum_quantity": "1000000"
                        },
                        {
                          "venue": "kucoin",
                          "venue_instrument": "XBTUSDM",
                          "settlement_asset": "BTC",
                          "payoff_type": "inverse",
                          "quantity_unit": "contract",
                          "price_unit": "USD",
                          "contract_size": "1",
                          "contract_size_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "1",
                          "maximum_quantity": "1000000"
                        },
                        {
                          "venue": "kucoin",
                          "venue_instrument": "XBTUSDTM",
                          "settlement_asset": "USDT",
                          "payoff_type": "linear",
                          "quantity_unit": "contract",
                          "price_unit": "USDT",
                          "contract_size": "0.001",
                          "contract_size_unit": "BTC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "1",
                          "maximum_quantity": "1000000"
                        },
                        {
                          "venue": "lighter",
                          "venue_instrument": "BTC",
                          "settlement_asset": "USDC",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.00001",
                          "minimum_quantity": "0.00010",
                          "minimum_notional": "10.000000"
                        },
                        {
                          "venue": "mexc",
                          "venue_instrument": "BTC_USD",
                          "settlement_asset": "BTC",
                          "quantity_unit": "contract",
                          "price_unit": "USD",
                          "contract_size": "100",
                          "contract_size_unit": "BTC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "1",
                          "minimum_quantity": "1",
                          "maximum_quantity": "2800",
                          "max_leverage": "125"
                        },
                        {
                          "venue": "mexc",
                          "venue_instrument": "BTC_USD1",
                          "settlement_asset": "USD1",
                          "quantity_unit": "contract",
                          "price_unit": "USD1",
                          "contract_size": "0.0001",
                          "contract_size_unit": "BTC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "1",
                          "minimum_quantity": "1",
                          "maximum_quantity": "350000",
                          "max_leverage": "100"
                        },
                        {
                          "venue": "mexc",
                          "venue_instrument": "BTC_USDC",
                          "settlement_asset": "USDC",
                          "quantity_unit": "contract",
                          "price_unit": "USDC",
                          "contract_size": "0.0001",
                          "contract_size_unit": "BTC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "1",
                          "minimum_quantity": "1",
                          "maximum_quantity": "1500000",
                          "max_leverage": "200"
                        },
                        {
                          "venue": "mexc",
                          "venue_instrument": "BTC_USDT",
                          "settlement_asset": "USDT",
                          "quantity_unit": "contract",
                          "price_unit": "USDT",
                          "contract_size": "0.0001",
                          "contract_size_unit": "BTC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "1",
                          "minimum_quantity": "1",
                          "maximum_quantity": "2500000",
                          "max_leverage": "500"
                        },
                        {
                          "venue": "okx",
                          "venue_instrument": "BTC-USD-SWAP",
                          "settlement_asset": "BTC",
                          "payoff_type": "inverse",
                          "quantity_unit": "contract",
                          "price_unit": "USD",
                          "contract_size": "100",
                          "contract_size_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.1",
                          "minimum_quantity": "0.1",
                          "maximum_quantity": "100000000",
                          "max_leverage": "100"
                        },
                        {
                          "venue": "okx",
                          "venue_instrument": "BTC-USDT-SWAP",
                          "settlement_asset": "USDT",
                          "payoff_type": "linear",
                          "quantity_unit": "contract",
                          "price_unit": "USDT",
                          "contract_size": "0.01",
                          "contract_size_unit": "BTC",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.01",
                          "minimum_quantity": "0.01",
                          "maximum_quantity": "100000000",
                          "max_leverage": "100"
                        },
                        {
                          "venue": "paradex",
                          "venue_instrument": "BTC-USD-PERP",
                          "settlement_asset": "USDC",
                          "payoff_type": "linear",
                          "quantity_unit": "BTC",
                          "price_unit": "USD",
                          "price_rule": {
                            "type": "fixed_tick",
                            "tick_size": "0.1"
                          },
                          "quantity_step": "0.00001",
                          "maximum_quantity": "100",
                          "minimum_notional": "10"
                        }
                      ]
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/markets/{instrument}": {
      "get": {
        "operationId": "getMarket",
        "tags": [
          "Market Data"
        ],
        "summary": "Read Contract Specifications",
        "description": "Read an instrument’s exchange symbols, settlement assets, price rules, and quantity increments. Public access; unknown instruments return HTTP 404.",
        "security": [],
        "parameters": [
          {
            "name": "instrument",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "BTC-PERP"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "description": "UTC source-metadata refresh time in HTTP-date format.",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "description": "Public market and exchange responses may be cached for 300 seconds.",
                "schema": {
                  "type": "string",
                  "example": "public, max-age=300"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketDetail"
                },
                "example": {
                  "instrument": "BTC-PERP",
                  "contract_type": "perpetual",
                  "base_asset": "BTC",
                  "contracts": [
                    {
                      "venue": "apex",
                      "venue_instrument": "BTC-USDT",
                      "settlement_asset": "USDT",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USDT",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.001",
                      "minimum_quantity": "0.0010",
                      "maximum_quantity": "50",
                      "max_leverage": "100"
                    },
                    {
                      "venue": "aster",
                      "venue_instrument": "BTCU",
                      "settlement_asset": "U",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "U",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.10"
                      },
                      "quantity_step": "0.001",
                      "minimum_quantity": "0.001",
                      "maximum_quantity": "1000",
                      "minimum_notional": "5"
                    },
                    {
                      "venue": "aster",
                      "venue_instrument": "BTCUSD1",
                      "settlement_asset": "USD1",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USD1",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.10"
                      },
                      "quantity_step": "0.001",
                      "minimum_quantity": "0.001",
                      "maximum_quantity": "1000",
                      "minimum_notional": "5"
                    },
                    {
                      "venue": "aster",
                      "venue_instrument": "BTCUSDT",
                      "settlement_asset": "USDT",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USDT",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.001",
                      "minimum_quantity": "0.001",
                      "maximum_quantity": "1000",
                      "minimum_notional": "5"
                    },
                    {
                      "venue": "binance",
                      "venue_instrument": "BTCU",
                      "settlement_asset": "U",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "U",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.10"
                      },
                      "quantity_step": "0.0001",
                      "minimum_quantity": "0.0001",
                      "maximum_quantity": "800",
                      "minimum_notional": "5"
                    },
                    {
                      "venue": "binance",
                      "venue_instrument": "BTCUSD_PERP",
                      "settlement_asset": "BTC",
                      "payoff_type": "inverse",
                      "quantity_unit": "contract",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "1",
                      "minimum_quantity": "1",
                      "maximum_quantity": "1000000",
                      "contract_size": "100",
                      "contract_size_unit": "USD"
                    },
                    {
                      "venue": "binance",
                      "venue_instrument": "BTCUSD1",
                      "settlement_asset": "USD1",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USD1",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.10"
                      },
                      "quantity_step": "0.0001",
                      "minimum_quantity": "0.0001",
                      "maximum_quantity": "800",
                      "minimum_notional": "50"
                    },
                    {
                      "venue": "binance",
                      "venue_instrument": "BTCUSDC",
                      "settlement_asset": "USDC",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USDC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.001",
                      "minimum_quantity": "0.001",
                      "maximum_quantity": "800",
                      "minimum_notional": "50"
                    },
                    {
                      "venue": "binance",
                      "venue_instrument": "BTCUSDT",
                      "settlement_asset": "USDT",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USDT",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.10"
                      },
                      "quantity_step": "0.001",
                      "minimum_quantity": "0.001",
                      "maximum_quantity": "1000",
                      "minimum_notional": "50"
                    },
                    {
                      "venue": "bitget",
                      "venue_instrument": "BTCPERP",
                      "settlement_asset": "USDC",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USDC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.0001",
                      "minimum_quantity": "0.0001",
                      "maximum_quantity": "100",
                      "minimum_notional": "5",
                      "max_leverage": "125"
                    },
                    {
                      "venue": "bitget",
                      "venue_instrument": "BTCUSDT",
                      "settlement_asset": "USDT",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USDT",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.0001",
                      "minimum_quantity": "0.0001",
                      "maximum_quantity": "1200",
                      "minimum_notional": "5",
                      "max_leverage": "150"
                    },
                    {
                      "venue": "bybit",
                      "venue_instrument": "BTCPERP",
                      "settlement_asset": "USDC",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USDC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.10"
                      },
                      "quantity_step": "0.001",
                      "minimum_quantity": "0.001",
                      "maximum_quantity": "1000.000",
                      "minimum_notional": "5",
                      "max_leverage": "125.00"
                    },
                    {
                      "venue": "bybit",
                      "venue_instrument": "BTCUSD",
                      "settlement_asset": "BTC",
                      "payoff_type": "inverse",
                      "quantity_unit": "USD",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.10"
                      },
                      "quantity_step": "1",
                      "minimum_quantity": "1",
                      "maximum_quantity": "25000000",
                      "minimum_notional": "5",
                      "max_leverage": "100.00"
                    },
                    {
                      "venue": "bybit",
                      "venue_instrument": "BTCUSDT",
                      "settlement_asset": "USDT",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USDT",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.10"
                      },
                      "quantity_step": "0.001",
                      "minimum_quantity": "0.001",
                      "maximum_quantity": "1500.000",
                      "minimum_notional": "5",
                      "max_leverage": "150.00"
                    },
                    {
                      "venue": "deribit",
                      "venue_instrument": "BTC_USDC-PERPETUAL",
                      "settlement_asset": "USDC",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USDC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.0001",
                      "minimum_quantity": "0.0001",
                      "max_leverage": "50"
                    },
                    {
                      "venue": "deribit",
                      "venue_instrument": "BTC-PERPETUAL",
                      "settlement_asset": "BTC",
                      "payoff_type": "inverse",
                      "quantity_unit": "USD",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.5"
                      },
                      "quantity_step": "10",
                      "minimum_quantity": "10",
                      "max_leverage": "50"
                    },
                    {
                      "venue": "dydx",
                      "venue_instrument": "BTC-USD",
                      "settlement_asset": "USDC",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "1"
                      },
                      "quantity_step": "0.0001"
                    },
                    {
                      "venue": "edgex",
                      "venue_instrument": "BTCUSD",
                      "settlement_asset": "USDT",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.001",
                      "minimum_quantity": "0.003",
                      "maximum_quantity": "22",
                      "max_leverage": "100"
                    },
                    {
                      "venue": "extended",
                      "venue_instrument": "BTC-USD",
                      "settlement_asset": "USDC",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "1"
                      },
                      "quantity_step": "0.00001",
                      "minimum_quantity": "0.0001",
                      "max_leverage": "50.00"
                    },
                    {
                      "venue": "gate",
                      "venue_instrument": "BTC_USD",
                      "settlement_asset": "BTC",
                      "payoff_type": "inverse",
                      "quantity_unit": "contract",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "1",
                      "minimum_quantity": "1",
                      "maximum_quantity": "530000",
                      "max_leverage": "100"
                    },
                    {
                      "venue": "gate",
                      "venue_instrument": "BTC_USDT",
                      "settlement_asset": "USDT",
                      "payoff_type": "linear",
                      "quantity_unit": "contract",
                      "price_unit": "USDT",
                      "contract_size": "0.0001",
                      "contract_size_unit": "BTC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "1",
                      "minimum_quantity": "1",
                      "maximum_quantity": "12000000",
                      "max_leverage": "200"
                    },
                    {
                      "venue": "gmx",
                      "venue_instrument": "0x3ce7BCDB37Bf587d1C17B930Fa0A7000A0648D12",
                      "network": "avalanche",
                      "settlement_assets": [
                        "BTC"
                      ],
                      "quantity_unit": "USD",
                      "price_unit": "USD"
                    },
                    {
                      "venue": "gmx",
                      "venue_instrument": "0x47c031236e19d024b42f8AE6780E44A573170703",
                      "network": "arbitrum",
                      "settlement_assets": [
                        "WBTC.b",
                        "USDC"
                      ],
                      "quantity_unit": "USD",
                      "price_unit": "USD"
                    },
                    {
                      "venue": "gmx",
                      "venue_instrument": "0x7C11F78Ce78768518D743E81Fdfa2F860C6b9A77",
                      "network": "arbitrum",
                      "settlement_assets": [
                        "WBTC.b"
                      ],
                      "quantity_unit": "USD",
                      "price_unit": "USD"
                    },
                    {
                      "venue": "gmx",
                      "venue_instrument": "0xd62068697bCc92AF253225676D618B0C9f17C663",
                      "network": "arbitrum",
                      "settlement_assets": [
                        "tBTC"
                      ],
                      "quantity_unit": "USD",
                      "price_unit": "USD"
                    },
                    {
                      "venue": "gmx",
                      "venue_instrument": "0xFb02132333A79C8B5Bd0b64E3AbccA5f7fAf2937",
                      "network": "avalanche",
                      "settlement_assets": [
                        "BTC",
                        "USDC"
                      ],
                      "quantity_unit": "USD",
                      "price_unit": "USD"
                    },
                    {
                      "venue": "grvt",
                      "venue_instrument": "BTC_USDT_Perp",
                      "settlement_asset": "USDT",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USDT",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "minimum_quantity": "0.001",
                      "minimum_notional": "100.0"
                    },
                    {
                      "venue": "hyperliquid",
                      "venue_instrument": "BTC",
                      "settlement_asset": "USDC",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "significant_figures",
                        "max_significant_figures": 5,
                        "max_decimal_places": 1,
                        "integer_prices_allowed": true
                      },
                      "quantity_step": "0.00001",
                      "max_leverage": "40"
                    },
                    {
                      "venue": "kraken",
                      "venue_instrument": "PF_XBTUSD",
                      "settlement_asset": "USD",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "1"
                      },
                      "quantity_step": "0.0001"
                    },
                    {
                      "venue": "kucoin",
                      "venue_instrument": "XBTUSDCM",
                      "settlement_asset": "USDC",
                      "payoff_type": "linear",
                      "quantity_unit": "contract",
                      "price_unit": "USDC",
                      "contract_size": "0.0001",
                      "contract_size_unit": "BTC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "1",
                      "maximum_quantity": "1000000"
                    },
                    {
                      "venue": "kucoin",
                      "venue_instrument": "XBTUSDM",
                      "settlement_asset": "BTC",
                      "payoff_type": "inverse",
                      "quantity_unit": "contract",
                      "price_unit": "USD",
                      "contract_size": "1",
                      "contract_size_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "1",
                      "maximum_quantity": "1000000"
                    },
                    {
                      "venue": "kucoin",
                      "venue_instrument": "XBTUSDTM",
                      "settlement_asset": "USDT",
                      "payoff_type": "linear",
                      "quantity_unit": "contract",
                      "price_unit": "USDT",
                      "contract_size": "0.001",
                      "contract_size_unit": "BTC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "1",
                      "maximum_quantity": "1000000"
                    },
                    {
                      "venue": "lighter",
                      "venue_instrument": "BTC",
                      "settlement_asset": "USDC",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.00001",
                      "minimum_quantity": "0.00010",
                      "minimum_notional": "10.000000"
                    },
                    {
                      "venue": "mexc",
                      "venue_instrument": "BTC_USD",
                      "settlement_asset": "BTC",
                      "quantity_unit": "contract",
                      "price_unit": "USD",
                      "contract_size": "100",
                      "contract_size_unit": "BTC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "1",
                      "minimum_quantity": "1",
                      "maximum_quantity": "2800",
                      "max_leverage": "125"
                    },
                    {
                      "venue": "mexc",
                      "venue_instrument": "BTC_USD1",
                      "settlement_asset": "USD1",
                      "quantity_unit": "contract",
                      "price_unit": "USD1",
                      "contract_size": "0.0001",
                      "contract_size_unit": "BTC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "1",
                      "minimum_quantity": "1",
                      "maximum_quantity": "350000",
                      "max_leverage": "100"
                    },
                    {
                      "venue": "mexc",
                      "venue_instrument": "BTC_USDC",
                      "settlement_asset": "USDC",
                      "quantity_unit": "contract",
                      "price_unit": "USDC",
                      "contract_size": "0.0001",
                      "contract_size_unit": "BTC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "1",
                      "minimum_quantity": "1",
                      "maximum_quantity": "1500000",
                      "max_leverage": "200"
                    },
                    {
                      "venue": "mexc",
                      "venue_instrument": "BTC_USDT",
                      "settlement_asset": "USDT",
                      "quantity_unit": "contract",
                      "price_unit": "USDT",
                      "contract_size": "0.0001",
                      "contract_size_unit": "BTC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "1",
                      "minimum_quantity": "1",
                      "maximum_quantity": "2500000",
                      "max_leverage": "500"
                    },
                    {
                      "venue": "okx",
                      "venue_instrument": "BTC-USD-SWAP",
                      "settlement_asset": "BTC",
                      "payoff_type": "inverse",
                      "quantity_unit": "contract",
                      "price_unit": "USD",
                      "contract_size": "100",
                      "contract_size_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.1",
                      "minimum_quantity": "0.1",
                      "maximum_quantity": "100000000",
                      "max_leverage": "100"
                    },
                    {
                      "venue": "okx",
                      "venue_instrument": "BTC-USDT-SWAP",
                      "settlement_asset": "USDT",
                      "payoff_type": "linear",
                      "quantity_unit": "contract",
                      "price_unit": "USDT",
                      "contract_size": "0.01",
                      "contract_size_unit": "BTC",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.01",
                      "minimum_quantity": "0.01",
                      "maximum_quantity": "100000000",
                      "max_leverage": "100"
                    },
                    {
                      "venue": "paradex",
                      "venue_instrument": "BTC-USD-PERP",
                      "settlement_asset": "USDC",
                      "payoff_type": "linear",
                      "quantity_unit": "BTC",
                      "price_unit": "USD",
                      "price_rule": {
                        "type": "fixed_tick",
                        "tick_size": "0.1"
                      },
                      "quantity_step": "0.00001",
                      "maximum_quantity": "100",
                      "minimum_notional": "10"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/markets/{instrument}/orderbook": {
      "get": {
        "operationId": "getOrderBook",
        "tags": [
          "Market Data"
        ],
        "summary": "Read an Order Book",
        "description": "Read one exchange book. The example uses Hyperliquid BTC settled in USDC. Subscribe to orderbook for sequenced updates.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "market:read",
        "parameters": [
          {
            "name": "instrument",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "BTC-PERP"
          },
          {
            "name": "venue",
            "in": "query",
            "required": true,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "hyperliquid"
          },
          {
            "name": "settlement_asset",
            "in": "query",
            "required": true,
            "description": "Filter contracts by settlement asset.",
            "schema": {
              "type": "string",
              "description": "Filter contracts by settlement asset."
            },
            "example": "USDC"
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "description": "Number of levels per side: 10, 20, or 50. Default 20.",
            "schema": {
              "type": "integer",
              "enum": [
                10,
                20,
                50
              ],
              "default": 20
            },
            "example": 20
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderBook"
                },
                "example": {
                  "instrument": "BTC-PERP",
                  "venue": "hyperliquid",
                  "settlement_asset": "USDC",
                  "book_sequence": 1042,
                  "bids": [
                    {
                      "price": "76999",
                      "quantity": "1.25000"
                    }
                  ],
                  "asks": [
                    {
                      "price": "77001",
                      "quantity": "0.90000"
                    }
                  ],
                  "updated_at": "2026-08-31T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/markets/{instrument}/ticker": {
      "get": {
        "operationId": "getTicker",
        "tags": [
          "Market Data"
        ],
        "summary": "Read Prices",
        "description": "Read bid, ask, last, mark, and index prices for a specific exchange contract.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "market:read",
        "parameters": [
          {
            "name": "instrument",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "BTC-PERP"
          },
          {
            "name": "venue",
            "in": "query",
            "required": true,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "hyperliquid"
          },
          {
            "name": "settlement_asset",
            "in": "query",
            "required": true,
            "description": "Filter contracts by settlement asset.",
            "schema": {
              "type": "string",
              "description": "Filter contracts by settlement asset."
            },
            "example": "USDC"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ticker"
                },
                "example": {
                  "instrument": "BTC-PERP",
                  "venue": "hyperliquid",
                  "settlement_asset": "USDC",
                  "bid": "76999",
                  "ask": "77001",
                  "last": "77000",
                  "mark_price": "77000",
                  "index_price": "76998",
                  "updated_at": "2026-08-31T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/markets/{instrument}/trades": {
      "get": {
        "operationId": "listTrades",
        "tags": [
          "Market Data"
        ],
        "summary": "Read Market Trades",
        "description": "Read public executions in ascending executed_at order. Pair venue with trade_id when deduplicating.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "market:read",
        "parameters": [
          {
            "name": "instrument",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "BTC-PERP"
          },
          {
            "name": "venue",
            "in": "query",
            "required": true,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "hyperliquid"
          },
          {
            "name": "settlement_asset",
            "in": "query",
            "required": true,
            "description": "Filter contracts by settlement asset.",
            "schema": {
              "type": "string",
              "description": "Filter contracts by settlement asset."
            },
            "example": "USDC"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "description": "Inclusive UTC start; default 24 hours before end_time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Start time."
            },
            "example": "2026-08-31T12:00:00.000Z"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "description": "Exclusive UTC end; default request time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "End time."
            },
            "example": "2026-09-01T12:00:00.000Z"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "trades": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Trade"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "trades",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "trades": [
                    {
                      "trade_id": "trade_example_01",
                      "instrument": "BTC-PERP",
                      "venue": "hyperliquid",
                      "settlement_asset": "USDC",
                      "side": "buy",
                      "price": "77001",
                      "quantity": "0.01000",
                      "executed_at": "2026-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/venues": {
      "get": {
        "operationId": "listVenues",
        "tags": [
          "Market Data"
        ],
        "summary": "List Exchanges",
        "description": "List all centralized and decentralized exchanges shown in the Trade8 integration directory, with their IDs and official websites.",
        "security": [],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Exchange category.",
            "schema": {
              "type": "string",
              "enum": [
                "centralized",
                "decentralized"
              ],
              "description": "Exchange category."
            },
            "example": "centralized"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "Last-Modified": {
                "description": "UTC source-metadata refresh time in HTTP-date format.",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "description": "Public market and exchange responses may be cached for 300 seconds.",
                "schema": {
                  "type": "string",
                  "example": "public, max-age=300"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VenueCatalog"
                },
                "example": {
                  "venues": [
                    {
                      "id": "apex",
                      "name": "ApeX Protocol",
                      "type": "decentralized",
                      "website": "https://www.apex.exchange/"
                    },
                    {
                      "id": "aster",
                      "name": "Aster",
                      "type": "decentralized",
                      "website": "https://www.asterdex.com/"
                    },
                    {
                      "id": "binance",
                      "name": "Binance",
                      "type": "centralized",
                      "website": "https://www.binance.com/"
                    },
                    {
                      "id": "bitget",
                      "name": "Bitget",
                      "type": "centralized",
                      "website": "https://www.bitget.com/"
                    },
                    {
                      "id": "bybit",
                      "name": "Bybit",
                      "type": "centralized",
                      "website": "https://www.bybit.com/"
                    },
                    {
                      "id": "deribit",
                      "name": "Deribit",
                      "type": "centralized",
                      "website": "https://www.deribit.com/"
                    },
                    {
                      "id": "dydx",
                      "name": "dYdX",
                      "type": "decentralized",
                      "website": "https://www.dydx.xyz/"
                    },
                    {
                      "id": "edgex",
                      "name": "edgeX",
                      "type": "decentralized",
                      "website": "https://www.edgex.exchange/"
                    },
                    {
                      "id": "extended",
                      "name": "Extended",
                      "type": "decentralized",
                      "website": "https://extended.exchange/"
                    },
                    {
                      "id": "gate",
                      "name": "Gate",
                      "type": "centralized",
                      "website": "https://www.gate.com/"
                    },
                    {
                      "id": "gmx",
                      "name": "GMX",
                      "type": "decentralized",
                      "website": "https://gmx.io/"
                    },
                    {
                      "id": "grvt",
                      "name": "GRVT",
                      "type": "decentralized",
                      "website": "https://grvt.io/"
                    },
                    {
                      "id": "hyperliquid",
                      "name": "Hyperliquid",
                      "type": "decentralized",
                      "website": "https://hyperliquid.xyz/"
                    },
                    {
                      "id": "kraken",
                      "name": "Kraken",
                      "type": "centralized",
                      "website": "https://www.kraken.com/"
                    },
                    {
                      "id": "kucoin",
                      "name": "KuCoin",
                      "type": "centralized",
                      "website": "https://www.kucoin.com/"
                    },
                    {
                      "id": "lighter",
                      "name": "Lighter",
                      "type": "decentralized",
                      "website": "https://lighter.xyz/"
                    },
                    {
                      "id": "mexc",
                      "name": "MEXC",
                      "type": "centralized",
                      "website": "https://www.mexc.com/"
                    },
                    {
                      "id": "okx",
                      "name": "OKX",
                      "type": "centralized",
                      "website": "https://www.okx.com/"
                    },
                    {
                      "id": "paradex",
                      "name": "Paradex",
                      "type": "decentralized",
                      "website": "https://www.paradex.trade/"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/funding": {
      "get": {
        "operationId": "getFunding",
        "tags": [
          "Market Data"
        ],
        "summary": "Read Funding Rates",
        "description": "Compare rates with their settlement interval. The Binance example is an eight-hour indicative rate; other exchanges can use different intervals.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "market:read",
        "parameters": [
          {
            "name": "instrument",
            "in": "query",
            "required": true,
            "description": "Normalized perpetual family.",
            "schema": {
              "type": "string",
              "description": "Normalized perpetual family."
            },
            "example": "BTC-PERP"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "binance"
          },
          {
            "name": "settlement_asset",
            "in": "query",
            "required": false,
            "description": "Filter contracts by settlement asset.",
            "schema": {
              "type": "string",
              "description": "Filter contracts by settlement asset."
            },
            "example": "USDT"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "funding": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Funding"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "funding",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "funding": [
                    {
                      "instrument": "BTC-PERP",
                      "venue": "binance",
                      "settlement_asset": "USDT",
                      "rate": "0.0001",
                      "interval_hours": "8",
                      "next_funding_at": "2026-08-31T16:00:00.000Z",
                      "type": "indicative"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/accounts": {
      "get": {
        "operationId": "listAccounts",
        "tags": [
          "Accounts and Keys"
        ],
        "summary": "List Trading Accounts",
        "description": "Read main accounts and subaccounts available to this key, including enabled exchanges.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accounts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Account"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "accounts",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "accounts": [
                    {
                      "account_id": "acct_example_main",
                      "name": "Main Trading",
                      "type": "main",
                      "status": "active",
                      "reporting_asset": "USDT",
                      "enabled_venues": [
                        "binance",
                        "okx",
                        "bybit",
                        "hyperliquid",
                        "dydx"
                      ],
                      "created_at": "2026-08-31T12:00:00.000Z"
                    },
                    {
                      "account_id": "acct_example_mm",
                      "name": "Market Making",
                      "type": "subaccount",
                      "status": "active",
                      "reporting_asset": "USDT",
                      "enabled_venues": [
                        "binance",
                        "okx",
                        "bybit",
                        "hyperliquid",
                        "dydx"
                      ],
                      "created_at": "2026-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/account/balances": {
      "get": {
        "operationId": "getBalances",
        "tags": [
          "Accounts and Keys"
        ],
        "summary": "Read Account Balances",
        "description": "Read each asset separately. Custody balances and collateral allocations appear in the Custody and Settlement endpoints.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "balances": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Balance"
                      },
                      "description": "Ledger balances by asset."
                    }
                  },
                  "required": [
                    "balances"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "balances": [
                    {
                      "account_id": "acct_example_main",
                      "asset": "USDT",
                      "total": "10000.00",
                      "available": "7500.00",
                      "committed": "2500.00",
                      "updated_at": "2026-08-31T12:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/account/fees": {
      "get": {
        "operationId": "getFees",
        "tags": [
          "Accounts and Keys"
        ],
        "summary": "Read Account Trading Fees",
        "description": "Read account-specific maker, taker, and Trade8 charges by contract. Example rates illustrate the response structure.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "instrument",
            "in": "query",
            "required": false,
            "description": "Normalized perpetual family.",
            "schema": {
              "type": "string",
              "description": "Normalized perpetual family."
            },
            "example": "BTC-PERP"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "binance"
          },
          {
            "name": "settlement_asset",
            "in": "query",
            "required": false,
            "description": "Filter contracts by settlement asset.",
            "schema": {
              "type": "string",
              "description": "Filter contracts by settlement asset."
            },
            "example": "USDT"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fees": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Fee"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "fees",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "fees": [
                    {
                      "venue": "binance",
                      "instrument": "BTC-PERP",
                      "settlement_asset": "USDT",
                      "maker_rate": "0.0001",
                      "taker_rate": "0.0003",
                      "trade8_rate": "0.0000",
                      "effective_at": "2026-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/account/limits": {
      "get": {
        "operationId": "getLimits",
        "tags": [
          "Accounts and Keys"
        ],
        "summary": "Read Account Limits",
        "description": "Read REST, order, and WebSocket budgets. Capacity depends on the account configuration; these numbers are examples.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Limits"
                },
                "example": {
                  "account_id": "acct_example_main",
                  "rest_requests_per_second": 100,
                  "order_requests_per_second": 50,
                  "websocket_connections": 5,
                  "subscriptions_per_connection": 100,
                  "batch_order_limit": 20,
                  "effective_at": "2026-08-31T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/api-keys": {
      "get": {
        "operationId": "listApiKeys",
        "tags": [
          "Accounts and Keys"
        ],
        "summary": "Inspect API-Key Permissions",
        "description": "Read key metadata, account grants, IP restrictions, and expiry. Secret material is supplied only during key provisioning.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "keys:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "keys",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "keys": [
                    {
                      "key_id": "t8_example_read",
                      "label": "Reconciliation",
                      "scopes": [
                        "accounts:read",
                        "orders:read",
                        "custody:read"
                      ],
                      "account_ids": [
                        "acct_example_main"
                      ],
                      "ip_allowlist": [
                        "192.0.2.10/32"
                      ],
                      "status": "active",
                      "expires_at": "2027-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/orders": {
      "post": {
        "operationId": "createOrder",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Create an Order",
        "description": "Submit a parent order with exchange and settlement constraints. The example posts a BTC limit order across Binance and Bybit.\n\nLimit variants require limit_price. Conditional orders require trigger_price, trigger_source, and trigger_venue. See Order Lifecycle for trigger direction and linked exit workflows.\n\nThe allowed and excluded lists must be disjoint. Each child contract must match settlement_asset. Direct routing requires exactly one allowed exchange.\n\nThe same account/client_order_id identifies one order for the lifetime of the account. Duplicate submissions with a new idempotency key return CLIENT_ORDER_ID_CONFLICT; look up the existing order.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "schema": {
              "type": "string",
              "description": "Idempotency key.",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "request-example-0001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequest"
              },
              "example": {
                "account_id": "acct_example_main",
                "client_order_id": "strategy-a-0001",
                "instrument": "BTC-PERP",
                "settlement_asset": "USDT",
                "side": "buy",
                "type": "limit",
                "quantity": "0.100",
                "limit_price": "77000.00",
                "time_in_force": "GTC",
                "post_only": true,
                "reduce_only": false,
                "routing": "auto",
                "venue_policy": {
                  "allowed": [
                    "binance",
                    "bybit"
                  ]
                },
                "self_trade_prevention": "cancel_newest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Request accepted. Follow the resource state for completion.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                },
                "example": {
                  "order_id": "ord_example_01",
                  "account_id": "acct_example_main",
                  "client_order_id": "strategy-a-0001",
                  "instrument": "BTC-PERP",
                  "settlement_asset": "USDT",
                  "side": "buy",
                  "type": "limit",
                  "status": "accepted",
                  "requested_quantity": "0.100",
                  "filled_quantity": "0.000",
                  "remaining_quantity": "0.100",
                  "cancelled_quantity": "0.000",
                  "average_fill_price": null,
                  "revision": 1,
                  "created_at": "2026-08-31T12:00:00.000Z",
                  "updated_at": "2026-08-31T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      },
      "get": {
        "operationId": "listOrders",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "List Orders",
        "description": "Read parent orders in ascending created_at order. Open-order queries include all open orders unless time filters are explicit. Use status=open for pending, accepted, trigger_pending, and partially_filled orders.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "instrument",
            "in": "query",
            "required": false,
            "description": "Normalized perpetual family.",
            "schema": {
              "type": "string",
              "description": "Normalized perpetual family."
            },
            "example": "BTC-PERP"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Open, terminal, or any. Default open.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "terminal",
                "any"
              ],
              "description": "Order filter."
            },
            "example": "open"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "description": "Inclusive UTC start; default 24 hours before end_time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Start time."
            },
            "example": "2026-08-31T12:00:00.000Z"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "description": "Exclusive UTC end; default request time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "End time."
            },
            "example": "2026-09-01T12:00:00.000Z"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "orders": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "orders",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "orders": [
                    {
                      "order_id": "ord_example_01",
                      "account_id": "acct_example_main",
                      "client_order_id": "strategy-a-0001",
                      "instrument": "BTC-PERP",
                      "settlement_asset": "USDT",
                      "side": "buy",
                      "type": "limit",
                      "status": "partially_filled",
                      "requested_quantity": "0.100",
                      "filled_quantity": "0.060",
                      "remaining_quantity": "0.040",
                      "cancelled_quantity": "0.000",
                      "average_fill_price": "77000.00",
                      "revision": 2,
                      "created_at": "2026-08-31T12:00:00.000Z",
                      "updated_at": "2026-08-31T12:00:00.250Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/orders/{order_id}": {
      "get": {
        "operationId": "getOrder",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Read an Order",
        "description": "Reconcile lifecycle state and cumulative quantities. Compare revision before applying an older REST result over a streamed update.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:read",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "ord_example_01"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                },
                "example": {
                  "order_id": "ord_example_01",
                  "account_id": "acct_example_main",
                  "client_order_id": "strategy-a-0001",
                  "instrument": "BTC-PERP",
                  "settlement_asset": "USDT",
                  "side": "buy",
                  "type": "limit",
                  "status": "partially_filled",
                  "requested_quantity": "0.100",
                  "filled_quantity": "0.060",
                  "remaining_quantity": "0.040",
                  "cancelled_quantity": "0.000",
                  "average_fill_price": "77000.00",
                  "revision": 2,
                  "created_at": "2026-08-31T12:00:00.000Z",
                  "updated_at": "2026-08-31T12:00:00.250Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      },
      "delete": {
        "operationId": "cancelOrder",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Cancel an Order",
        "description": "Request cancellation of the open remainder across its child orders. Track the final quantities through the orders channel or order lookup.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:write",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "ord_example_01"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "schema": {
              "type": "string",
              "description": "Idempotency key.",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "request-example-0001"
          }
        ],
        "responses": {
          "202": {
            "description": "Request accepted. Follow the resource state for completion.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Cancellation"
                },
                "example": {
                  "order_id": "ord_example_01",
                  "cancellation_status": "pending",
                  "requested_at": "2026-08-31T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      },
      "patch": {
        "operationId": "amendOrder",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Amend a Limit Order",
        "description": "Change price or total requested quantity on an ordinary open limit order. expected_revision protects against a concurrent fill or amendment.\n\nSupply quantity, limit_price, or both. A change can reset exchange queue priority. A terminal order returns ORDER_NOT_AMENDABLE.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:write",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "ord_example_01"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "schema": {
              "type": "string",
              "description": "Idempotency key.",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "request-example-0001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "Authorized account."
                  },
                  "expected_revision": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Last observed revision."
                  },
                  "quantity": {
                    "type": "string",
                    "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                    "description": "New total size, including fills. Must be at least the filled quantity."
                  },
                  "limit_price": {
                    "type": "string",
                    "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                    "description": "New limit price."
                  }
                },
                "required": [
                  "account_id",
                  "expected_revision"
                ],
                "additionalProperties": false,
                "anyOf": [
                  {
                    "required": [
                      "quantity"
                    ]
                  },
                  {
                    "required": [
                      "limit_price"
                    ]
                  }
                ]
              },
              "example": {
                "account_id": "acct_example_main",
                "expected_revision": 2,
                "quantity": "0.120",
                "limit_price": "76990.00"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Request accepted. Follow the resource state for completion.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "order_id": {
                      "type": "string",
                      "description": "Parent order."
                    },
                    "amendment_id": {
                      "type": "string",
                      "description": "Amendment request ID."
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending"
                      ],
                      "description": "Reconcile the order revision for completion."
                    }
                  },
                  "required": [
                    "order_id",
                    "amendment_id",
                    "status"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "order_id": "ord_example_01",
                  "amendment_id": "amend_example_01",
                  "status": "pending"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/orders/by-client-id/{client_order_id}": {
      "get": {
        "operationId": "getOrderByClientId",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Find an Order by Client ID",
        "description": "Find the existing order after a timeout or lost acknowledgement using the identifier you saved before submission.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:read",
        "parameters": [
          {
            "name": "client_order_id",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "strategy-a-0001"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                },
                "example": {
                  "order_id": "ord_example_01",
                  "account_id": "acct_example_main",
                  "client_order_id": "strategy-a-0001",
                  "instrument": "BTC-PERP",
                  "settlement_asset": "USDT",
                  "side": "buy",
                  "type": "limit",
                  "status": "partially_filled",
                  "requested_quantity": "0.100",
                  "filled_quantity": "0.060",
                  "remaining_quantity": "0.040",
                  "cancelled_quantity": "0.000",
                  "average_fill_price": "77000.00",
                  "revision": 2,
                  "created_at": "2026-08-31T12:00:00.000Z",
                  "updated_at": "2026-08-31T12:00:00.250Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/orders/{order_id}/fills": {
      "get": {
        "operationId": "listOrderFills",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Read Order Fills",
        "description": "Inspect each execution, including Binance or other exchange identifiers, liquidity role, fee asset, and charge. The example fee is 0.060 × 77,000 × 0.0001 = 0.462 USDT.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:read",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "ord_example_01"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fills": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Fill"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "fills",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "fills": [
                    {
                      "fill_id": "fill_example_01",
                      "order_id": "ord_example_01",
                      "account_id": "acct_example_main",
                      "instrument": "BTC-PERP",
                      "venue": "binance",
                      "venue_order_id": "bn_example_01",
                      "settlement_asset": "USDT",
                      "quantity": "0.060",
                      "price": "77000.00",
                      "fee": "0.462",
                      "fee_asset": "USDT",
                      "liquidity": "maker",
                      "executed_at": "2026-08-31T12:00:00.250Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/fills": {
      "get": {
        "operationId": "listFills",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Read Account Fills",
        "description": "Recover executions across all orders in ascending executed_at order. Deduplicate on fill_id.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "instrument",
            "in": "query",
            "required": false,
            "description": "Normalized perpetual family.",
            "schema": {
              "type": "string",
              "description": "Normalized perpetual family."
            },
            "example": "BTC-PERP"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "binance"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "description": "Inclusive UTC start; default 24 hours before end_time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Start time."
            },
            "example": "2026-08-31T12:00:00.000Z"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "description": "Exclusive UTC end; default request time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "End time."
            },
            "example": "2026-09-01T12:00:00.000Z"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fills": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Fill"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "fills",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "fills": [
                    {
                      "fill_id": "fill_example_01",
                      "order_id": "ord_example_01",
                      "account_id": "acct_example_main",
                      "instrument": "BTC-PERP",
                      "venue": "binance",
                      "venue_order_id": "bn_example_01",
                      "settlement_asset": "USDT",
                      "quantity": "0.060",
                      "price": "77000.00",
                      "fee": "0.462",
                      "fee_asset": "USDT",
                      "liquidity": "maker",
                      "executed_at": "2026-08-31T12:00:00.250Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/orders/{order_id}/children": {
      "get": {
        "operationId": "listChildOrders",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Inspect Exchange Routing",
        "description": "Follow the Binance and Bybit child orders behind one parent. Each child carries its native exchange order ID.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:read",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "ord_example_01"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "children": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChildOrder"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "children",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "children": [
                    {
                      "child_order_id": "child_example_01",
                      "order_id": "ord_example_01",
                      "venue": "binance",
                      "venue_order_id": "bn_example_01",
                      "quantity": "0.060",
                      "filled_quantity": "0.060",
                      "status": "filled",
                      "updated_at": "2026-08-31T12:00:00.250Z"
                    },
                    {
                      "child_order_id": "child_example_02",
                      "order_id": "ord_example_01",
                      "venue": "bybit",
                      "venue_order_id": "bb_example_01",
                      "quantity": "0.040",
                      "filled_quantity": "0.000",
                      "status": "accepted",
                      "updated_at": "2026-08-31T12:00:00.250Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/orders/batch": {
      "post": {
        "operationId": "createOrderBatch",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Submit an Order Batch",
        "description": "Submit independently evaluated orders for one account. Every item has its own client_order_id. Read each result even when the HTTP response succeeds.\n\nMaximum 20 orders, subject to a lower account batch_order_limit. The batch consumes one order-budget unit per item. Retry only unresolved or corrected items with their original client IDs.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "schema": {
              "type": "string",
              "description": "Idempotency key.",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "request-example-0001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "Account shared by all items."
                  },
                  "orders": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/OrderRequest"
                    },
                    "description": "Items must use the same account_id as the envelope.",
                    "minItems": 1,
                    "maxItems": 20
                  }
                },
                "required": [
                  "account_id",
                  "orders"
                ],
                "additionalProperties": false
              },
              "example": {
                "account_id": "acct_example_main",
                "orders": [
                  {
                    "account_id": "acct_example_main",
                    "client_order_id": "strategy-a-0001",
                    "instrument": "BTC-PERP",
                    "settlement_asset": "USDT",
                    "side": "buy",
                    "type": "limit",
                    "quantity": "0.100",
                    "limit_price": "77000.00",
                    "time_in_force": "GTC",
                    "post_only": true,
                    "reduce_only": false,
                    "routing": "auto",
                    "venue_policy": {
                      "allowed": [
                        "binance",
                        "bybit"
                      ]
                    },
                    "self_trade_prevention": "cancel_newest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Request accepted. Follow the resource state for completion.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "client_order_id": {
                                "type": "string",
                                "description": "Client ID."
                              },
                              "accepted": {
                                "const": true
                              },
                              "order": {
                                "$ref": "#/components/schemas/Order"
                              }
                            },
                            "required": [
                              "client_order_id",
                              "accepted",
                              "order"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "client_order_id": {
                                "type": "string",
                                "description": "Client ID."
                              },
                              "accepted": {
                                "const": false
                              },
                              "error": {
                                "$ref": "#/components/schemas/Error"
                              }
                            },
                            "required": [
                              "client_order_id",
                              "accepted",
                              "error"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "description": "One result per input item, in input order."
                    }
                  },
                  "required": [
                    "results"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "results": [
                    {
                      "client_order_id": "strategy-a-0001",
                      "accepted": true,
                      "order": {
                        "order_id": "ord_example_01",
                        "account_id": "acct_example_main",
                        "client_order_id": "strategy-a-0001",
                        "instrument": "BTC-PERP",
                        "settlement_asset": "USDT",
                        "side": "buy",
                        "type": "limit",
                        "status": "accepted",
                        "requested_quantity": "0.100",
                        "filled_quantity": "0.000",
                        "remaining_quantity": "0.100",
                        "cancelled_quantity": "0.000",
                        "average_fill_price": null,
                        "revision": 1,
                        "created_at": "2026-08-31T12:00:00.000Z",
                        "updated_at": "2026-08-31T12:00:00.000Z"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/orders/cancel-all": {
      "post": {
        "operationId": "cancelAllOrders",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Cancel Open Orders",
        "description": "Request cancellation for the account, optionally narrowed to an instrument. A returned order_id lets you track every cancellation.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "schema": {
              "type": "string",
              "description": "Idempotency key.",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "request-example-0001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "Account to cancel."
                  },
                  "instrument": {
                    "type": "string",
                    "description": "Optional instrument filter."
                  }
                },
                "required": [
                  "account_id"
                ],
                "additionalProperties": false
              },
              "example": {
                "account_id": "acct_example_main",
                "instrument": "BTC-PERP"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Request accepted. Follow the resource state for completion.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "cancellations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Cancellation"
                      },
                      "description": "Cancellation requests for matching open orders."
                    }
                  },
                  "required": [
                    "cancellations"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "cancellations": [
                    {
                      "order_id": "ord_example_01",
                      "cancellation_status": "pending",
                      "requested_at": "2026-08-31T12:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/account/dead-man-switch": {
      "put": {
        "operationId": "setDeadManSwitch",
        "tags": [
          "Orders and Execution"
        ],
        "summary": "Set the Dead-Man Switch",
        "description": "Arm or refresh an account-wide timer. Expiry requests cancellation of all open orders in that account. Use a dedicated subaccount for each independent strategy.\n\nRefresh with a new Idempotency-Key before half the timeout elapses. A replay of the same key returns the previous result and leaves its original expiry unchanged. Exchange outages can delay cancellation acknowledgements.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "orders:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "schema": {
              "type": "string",
              "description": "Idempotency key.",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "request-example-0001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "Account whose orders are protected."
                  },
                  "timeout_seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "0 disables the timer; otherwise 10–120 seconds.",
                    "enum": [
                      0,
                      10,
                      20,
                      30,
                      60,
                      90,
                      120
                    ]
                  }
                },
                "required": [
                  "account_id",
                  "timeout_seconds"
                ],
                "additionalProperties": false
              },
              "example": {
                "account_id": "acct_example_mm",
                "timeout_seconds": 60
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "account_id": {
                      "type": "string",
                      "description": "Protected account."
                    },
                    "armed": {
                      "type": "boolean",
                      "description": "Whether the timer is active."
                    },
                    "expires_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time",
                      "description": "Expiry time; null when disabled."
                    }
                  },
                  "required": [
                    "account_id",
                    "armed",
                    "expires_at"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "account_id": "acct_example_mm",
                  "armed": true,
                  "expires_at": "2026-08-31T12:01:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/positions": {
      "get": {
        "operationId": "listPositions",
        "tags": [
          "Positions and Risk"
        ],
        "summary": "Read Open Positions",
        "description": "Read exposure, margin mode, leverage, P&L, and liquidation estimates separately for each exchange contract.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "instrument",
            "in": "query",
            "required": false,
            "description": "Normalized perpetual family.",
            "schema": {
              "type": "string",
              "description": "Normalized perpetual family."
            },
            "example": "BTC-PERP"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "binance"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "positions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Position"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "positions",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "positions": [
                    {
                      "position_id": "pos_example_01",
                      "account_id": "acct_example_main",
                      "instrument": "BTC-PERP",
                      "venue": "binance",
                      "settlement_asset": "USDT",
                      "side": "long",
                      "quantity": "0.060",
                      "entry_price": "77000.00",
                      "mark_price": "77100.00",
                      "unrealized_pnl": "6.00",
                      "liquidation_price": "64000.00",
                      "leverage": "5",
                      "margin_mode": "isolated",
                      "updated_at": "2026-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/account/margin-settings": {
      "get": {
        "operationId": "getMarginSettings",
        "tags": [
          "Positions and Risk"
        ],
        "summary": "Read Margin Settings",
        "description": "Inspect cross or isolated margin and configured leverage by exchange and instrument.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "instrument",
            "in": "query",
            "required": false,
            "description": "Normalized perpetual family.",
            "schema": {
              "type": "string",
              "description": "Normalized perpetual family."
            },
            "example": "BTC-PERP"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "binance"
          },
          {
            "name": "settlement_asset",
            "in": "query",
            "required": false,
            "description": "Filter contracts by settlement asset.",
            "schema": {
              "type": "string",
              "description": "Filter contracts by settlement asset."
            },
            "example": "USDT"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "settings": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MarginSetting"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "settings",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "settings": [
                    {
                      "account_id": "acct_example_main",
                      "instrument": "BTC-PERP",
                      "venue": "binance",
                      "settlement_asset": "USDT",
                      "margin_mode": "isolated",
                      "leverage": "5",
                      "updated_at": "2026-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      },
      "put": {
        "operationId": "setMarginSettings",
        "tags": [
          "Positions and Risk"
        ],
        "summary": "Set Leverage and Margin Mode",
        "description": "Set leverage and cross or isolated margin for one exchange contract. Read the returned setting before submitting orders that depend on it.\n\nExchange rules can require open orders and positions to be closed before switching margin mode. An incompatible change returns MARGIN_MODE_CONFLICT.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "accounts:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "schema": {
              "type": "string",
              "description": "Idempotency key.",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "request-example-0001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "Authorized account."
                  },
                  "instrument": {
                    "type": "string",
                    "description": "Normalized family."
                  },
                  "venue": {
                    "type": "string",
                    "description": "Exchange ID."
                  },
                  "settlement_asset": {
                    "type": "string",
                    "description": "Contract settlement asset."
                  },
                  "margin_mode": {
                    "type": "string",
                    "enum": [
                      "cross",
                      "isolated"
                    ],
                    "description": "Margin mode."
                  },
                  "leverage": {
                    "type": "string",
                    "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                    "description": "Leverage multiplier."
                  }
                },
                "required": [
                  "account_id",
                  "instrument",
                  "venue",
                  "settlement_asset",
                  "margin_mode",
                  "leverage"
                ],
                "additionalProperties": false
              },
              "example": {
                "account_id": "acct_example_main",
                "instrument": "BTC-PERP",
                "venue": "binance",
                "settlement_asset": "USDT",
                "margin_mode": "isolated",
                "leverage": "5"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarginSetting"
                },
                "example": {
                  "account_id": "acct_example_main",
                  "instrument": "BTC-PERP",
                  "venue": "binance",
                  "settlement_asset": "USDT",
                  "margin_mode": "isolated",
                  "leverage": "5",
                  "updated_at": "2026-08-31T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/account/risk": {
      "get": {
        "operationId": "getRisk",
        "tags": [
          "Positions and Risk"
        ],
        "summary": "Read Margin and Risk",
        "description": "Read exchange-level equity, margin requirements, and available capacity. Compare assets within their own settlement denomination.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "accounts:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "binance"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "risk": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Risk"
                      },
                      "description": "Risk by exchange and settlement asset."
                    }
                  },
                  "required": [
                    "risk"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "risk": [
                    {
                      "account_id": "acct_example_main",
                      "venue": "binance",
                      "settlement_asset": "USDT",
                      "equity": "2506.00",
                      "initial_margin": "925.20",
                      "maintenance_margin": "23.13",
                      "available_margin": "1580.80",
                      "margin_ratio": "0.009230",
                      "state": "normal",
                      "updated_at": "2026-08-31T12:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/custodians": {
      "get": {
        "operationId": "listCustodians",
        "tags": [
          "Custody and Settlement"
        ],
        "summary": "List Custody Integrations",
        "description": "Read custody providers such as Ceffu, Copper, Coinbase Custody, BitGo, Komainu, and Zodia Custody. Linked custody accounts supply the eligible exchange routes.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "custody:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "custodians": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Custodian"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "custodians",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "custodians": [
                    {
                      "id": "ceffu",
                      "name": "Ceffu",
                      "services": [
                        "custody",
                        "off_exchange_collateral"
                      ]
                    },
                    {
                      "id": "copper",
                      "name": "Copper",
                      "services": [
                        "custody",
                        "off_exchange_collateral"
                      ]
                    },
                    {
                      "id": "coinbase",
                      "name": "Coinbase Custody",
                      "services": [
                        "custody"
                      ]
                    },
                    {
                      "id": "bitgo",
                      "name": "BitGo",
                      "services": [
                        "custody"
                      ]
                    },
                    {
                      "id": "komainu",
                      "name": "Komainu",
                      "services": [
                        "custody"
                      ]
                    },
                    {
                      "id": "zodia",
                      "name": "Zodia Custody",
                      "services": [
                        "custody"
                      ]
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/custody/accounts": {
      "get": {
        "operationId": "listCustodyAccounts",
        "tags": [
          "Custody and Settlement"
        ],
        "summary": "Read Custody Accounts",
        "description": "Read linked balances and eligible allocation destinations. This example includes a Ceffu account for Binance and a Copper account for OKX and Bybit.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "custody:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "custody_accounts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CustodyAccount"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "custody_accounts",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "custody_accounts": [
                    {
                      "custody_account_id": "cust_example_ceffu",
                      "account_id": "acct_example_main",
                      "custodian": "ceffu",
                      "asset": "USDT",
                      "balance": "10000.00",
                      "allocated": "2500.00",
                      "available": "7500.00",
                      "eligible_venues": [
                        "binance"
                      ],
                      "updated_at": "2026-08-31T12:00:00.000Z"
                    },
                    {
                      "custody_account_id": "cust_example_copper",
                      "account_id": "acct_example_main",
                      "custodian": "copper",
                      "asset": "USDT",
                      "balance": "10000.00",
                      "allocated": "2500.00",
                      "available": "7500.00",
                      "eligible_venues": [
                        "okx",
                        "bybit"
                      ],
                      "updated_at": "2026-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/collateral/allocations": {
      "get": {
        "operationId": "listAllocations",
        "tags": [
          "Custody and Settlement"
        ],
        "summary": "Read Collateral Allocations",
        "description": "Track custody collateral committed to each exchange and its acknowledgement state.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "custody:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "binance"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "allocations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Allocation"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "allocations",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "allocations": [
                    {
                      "allocation_id": "alloc_example_01",
                      "account_id": "acct_example_main",
                      "client_allocation_id": "collateral-0001",
                      "custody_account_id": "cust_example_ceffu",
                      "custodian": "ceffu",
                      "venue": "binance",
                      "asset": "USDT",
                      "amount": "2500.00",
                      "status": "active",
                      "updated_at": "2026-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      },
      "post": {
        "operationId": "createAllocation",
        "tags": [
          "Custody and Settlement"
        ],
        "summary": "Allocate Off-Exchange Collateral",
        "description": "Request an allocation from a linked custody account to an eligible exchange. The example allocates Ceffu-held USDT to Binance.\n\nWait for active before counting the allocation as usable exchange collateral. The client_allocation_id is unique within the account and is retained for reconciliation.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "custody:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "schema": {
              "type": "string",
              "description": "Idempotency key.",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "request-example-0001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "Authorized account."
                  },
                  "client_allocation_id": {
                    "type": "string",
                    "description": "Unique client allocation ID."
                  },
                  "custody_account_id": {
                    "type": "string",
                    "description": "Linked source custody account."
                  },
                  "venue": {
                    "type": "string",
                    "description": "Exchange in eligible_venues."
                  },
                  "asset": {
                    "type": "string",
                    "description": "Collateral asset."
                  },
                  "amount": {
                    "type": "string",
                    "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                    "description": "Amount in asset units."
                  }
                },
                "required": [
                  "account_id",
                  "client_allocation_id",
                  "custody_account_id",
                  "venue",
                  "asset",
                  "amount"
                ],
                "additionalProperties": false
              },
              "example": {
                "account_id": "acct_example_main",
                "client_allocation_id": "collateral-0001",
                "custody_account_id": "cust_example_ceffu",
                "venue": "binance",
                "asset": "USDT",
                "amount": "2500.00"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Request accepted. Follow the resource state for completion.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Allocation"
                },
                "example": {
                  "allocation_id": "alloc_example_01",
                  "account_id": "acct_example_main",
                  "client_allocation_id": "collateral-0001",
                  "custody_account_id": "cust_example_ceffu",
                  "custodian": "ceffu",
                  "venue": "binance",
                  "asset": "USDT",
                  "amount": "2500.00",
                  "status": "pending",
                  "updated_at": "2026-08-31T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/collateral/allocations/{allocation_id}": {
      "get": {
        "operationId": "getAllocation",
        "tags": [
          "Custody and Settlement"
        ],
        "summary": "Read an Allocation",
        "description": "Follow a collateral request until the exchange acknowledgement makes it active or the request is rejected.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "custody:read",
        "parameters": [
          {
            "name": "allocation_id",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "alloc_example_01"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Allocation"
                },
                "example": {
                  "allocation_id": "alloc_example_01",
                  "account_id": "acct_example_main",
                  "client_allocation_id": "collateral-0001",
                  "custody_account_id": "cust_example_ceffu",
                  "custodian": "ceffu",
                  "venue": "binance",
                  "asset": "USDT",
                  "amount": "2500.00",
                  "status": "active",
                  "updated_at": "2026-08-31T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/settlements": {
      "get": {
        "operationId": "listSettlements",
        "tags": [
          "Custody and Settlement"
        ],
        "summary": "Read Settlement Records",
        "description": "Reconcile custody and exchange settlement cycles. The Copper/OKX example credits 125.50 USDT to custody.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "custody:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "venue",
            "in": "query",
            "required": false,
            "description": "Exchange identifier.",
            "schema": {
              "type": "string",
              "description": "Exchange identifier."
            },
            "example": "binance"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "description": "Inclusive UTC start; default 24 hours before end_time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Start time."
            },
            "example": "2026-08-31T12:00:00.000Z"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "description": "Exclusive UTC end; default request time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "End time."
            },
            "example": "2026-09-01T12:00:00.000Z"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "settlements": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Settlement"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "settlements",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "settlements": [
                    {
                      "settlement_id": "settle_example_01",
                      "account_id": "acct_example_main",
                      "custodian": "copper",
                      "venue": "okx",
                      "asset": "USDT",
                      "amount": "125.50",
                      "status": "completed",
                      "cycle_start": "2026-08-31T08:00:00.000Z",
                      "cycle_end": "2026-08-31T12:00:00.000Z",
                      "updated_at": "2026-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/deposits": {
      "get": {
        "operationId": "listDeposits",
        "tags": [
          "Funding and Transfers"
        ],
        "summary": "Track Deposits",
        "description": "Follow Bitcoin or stablecoin deposits through confirmations, review, and ledger credit. The example shows a USDC deposit on Ethereum.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "transfers:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "description": "Inclusive UTC start; default 24 hours before end_time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Start time."
            },
            "example": "2026-08-31T12:00:00.000Z"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "description": "Exclusive UTC end; default request time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "End time."
            },
            "example": "2026-09-01T12:00:00.000Z"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deposits": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Deposit"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "deposits",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "deposits": [
                    {
                      "deposit_id": "dep_example_01",
                      "account_id": "acct_example_main",
                      "asset": "USDC",
                      "network": "ethereum",
                      "amount": "5000.00",
                      "confirmations": 12,
                      "required_confirmations": 12,
                      "status": "credited",
                      "updated_at": "2026-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/transfers": {
      "post": {
        "operationId": "createTransfer",
        "tags": [
          "Funding and Transfers"
        ],
        "summary": "Transfer Between Subaccounts",
        "description": "Move available ledger balance between accounts controlled by the same organization. The key needs access to both accounts.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "transfers:write",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Unique 1–64 character key per account, method, and path. Retained for 24 hours. Reuse with the exact same request when recovering an unknown outcome.",
            "schema": {
              "type": "string",
              "description": "Idempotency key.",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "example": "request-example-0001"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_transfer_id": {
                    "type": "string",
                    "description": "Unique identifier within the source account."
                  },
                  "from_account_id": {
                    "type": "string",
                    "description": "Source account; also scopes the idempotency key."
                  },
                  "to_account_id": {
                    "type": "string",
                    "description": "Destination account in the same organization."
                  },
                  "asset": {
                    "type": "string",
                    "description": "Asset to move."
                  },
                  "amount": {
                    "type": "string",
                    "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                    "description": "Amount in asset units."
                  }
                },
                "required": [
                  "client_transfer_id",
                  "from_account_id",
                  "to_account_id",
                  "asset",
                  "amount"
                ],
                "additionalProperties": false
              },
              "example": {
                "client_transfer_id": "rebalance-0001",
                "from_account_id": "acct_example_main",
                "to_account_id": "acct_example_mm",
                "asset": "USDC",
                "amount": "500.00"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Request accepted. Follow the resource state for completion.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transfer"
                },
                "example": {
                  "transfer_id": "transfer_example_01",
                  "client_transfer_id": "rebalance-0001",
                  "from_account_id": "acct_example_main",
                  "to_account_id": "acct_example_mm",
                  "asset": "USDC",
                  "amount": "500.00",
                  "status": "pending",
                  "created_at": "2026-08-31T12:00:00.000Z",
                  "updated_at": "2026-08-31T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      },
      "get": {
        "operationId": "listTransfers",
        "tags": [
          "Funding and Transfers"
        ],
        "summary": "List Transfers",
        "description": "Read internal transfers involving an account in ascending created_at order. Use client_transfer_id to reconcile a timed-out submission.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "transfers:read",
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          },
          {
            "name": "client_transfer_id",
            "in": "query",
            "required": false,
            "description": "Exact client transfer ID.",
            "schema": {
              "type": "string",
              "description": "Exact client transfer ID."
            },
            "example": "rebalance-0001"
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "description": "Inclusive UTC start; default 24 hours before end_time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Start time."
            },
            "example": "2026-08-31T12:00:00.000Z"
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "description": "Exclusive UTC end; default request time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "End time."
            },
            "example": "2026-09-01T12:00:00.000Z"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, default 50; maximum 200.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Results per page.",
              "maximum": 200,
              "default": 50
            },
            "example": 50
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque next_cursor from the preceding response.",
            "schema": {
              "type": "string",
              "description": "Opaque next_cursor from the preceding response."
            },
            "example": "cursor_example_next"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transfers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Transfer"
                      },
                      "description": "Results on this page."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  },
                  "required": [
                    "transfers",
                    "pagination"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "transfers": [
                    {
                      "transfer_id": "transfer_example_01",
                      "client_transfer_id": "rebalance-0001",
                      "from_account_id": "acct_example_main",
                      "to_account_id": "acct_example_mm",
                      "asset": "USDC",
                      "amount": "500.00",
                      "status": "pending",
                      "created_at": "2026-08-31T12:00:00.000Z",
                      "updated_at": "2026-08-31T12:00:00.000Z"
                    }
                  ],
                  "pagination": {
                    "next_cursor": null,
                    "has_more": false
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    },
    "/v1/transfers/{transfer_id}": {
      "get": {
        "operationId": "getTransfer",
        "tags": [
          "Funding and Transfers"
        ],
        "summary": "Read a Transfer",
        "description": "Track an internal transfer until the destination ledger is credited or the request is rejected.",
        "security": [
          {
            "ApiKey": [],
            "Timestamp": [],
            "Signature": []
          }
        ],
        "x-required-scope": "transfers:read",
        "parameters": [
          {
            "name": "transfer_id",
            "in": "path",
            "required": true,
            "description": "Identifier of the resource to read or change.",
            "schema": {
              "type": "string",
              "description": "Identifier of the resource to read or change."
            },
            "example": "transfer_example_01"
          },
          {
            "name": "account_id",
            "in": "query",
            "required": true,
            "description": "Authorized trading account.",
            "schema": {
              "type": "string",
              "description": "Authorized trading account."
            },
            "example": "acct_example_main"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response.",
            "headers": {
              "X-Request-ID": {
                "description": "Support correlation identifier.",
                "schema": {
                  "type": "string"
                }
              },
              "X-RateLimit-Limit": {
                "description": "Request budget for this account bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Requests remaining in this bucket.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "description": "Unix time in whole seconds when the bucket resets.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transfer"
                },
                "example": {
                  "transfer_id": "transfer_example_01",
                  "client_transfer_id": "rebalance-0001",
                  "from_account_id": "acct_example_main",
                  "to_account_id": "acct_example_mm",
                  "asset": "USDC",
                  "amount": "500.00",
                  "status": "pending",
                  "created_at": "2026-08-31T12:00:00.000Z",
                  "updated_at": "2026-08-31T12:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400"
          },
          "401": {
            "$ref": "#/components/responses/Error401"
          },
          "403": {
            "$ref": "#/components/responses/Error403"
          },
          "404": {
            "$ref": "#/components/responses/Error404"
          },
          "409": {
            "$ref": "#/components/responses/Error409"
          },
          "422": {
            "$ref": "#/components/responses/Error422"
          },
          "429": {
            "$ref": "#/components/responses/Error429"
          },
          "500": {
            "$ref": "#/components/responses/Error500"
          },
          "503": {
            "$ref": "#/components/responses/Error503"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Trade8-API-Key",
        "description": "Public key ID. All three authentication headers are required together."
      },
      "Timestamp": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Trade8-Timestamp",
        "description": "UTC Unix seconds within 30 seconds of server time."
      },
      "Signature": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Trade8-Signature",
        "description": "Base64 HMAC-SHA256 over timestamp + LF + uppercase method + LF + encoded path and query + LF + Idempotency-Key (empty for GET) + LF + exact UTF-8 body (empty when absent). Decode the base64 API secret before signing."
      }
    },
    "schemas": {
      "Pagination": {
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Opaque cursor for the next page; null at the end."
          },
          "has_more": {
            "type": "boolean",
            "description": "True when another page is available."
          }
        },
        "required": [
          "next_cursor",
          "has_more"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "description": "Support correlation identifier; also returned in X-Request-ID."
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable machine-readable error code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable explanation."
              },
              "retryable": {
                "type": "boolean",
                "description": "Whether the operation may be retried after the documented recovery steps."
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string",
                      "description": "JSON field or query parameter."
                    },
                    "reason": {
                      "type": "string",
                      "description": "Validation or policy reason."
                    }
                  },
                  "required": [
                    "field",
                    "reason"
                  ],
                  "additionalProperties": false
                },
                "description": "Field-level details; empty for errors without a specific field."
              }
            },
            "required": [
              "code",
              "message",
              "retryable",
              "details"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "request_id",
          "error"
        ],
        "additionalProperties": false
      },
      "VenueStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "name": {
            "type": "string",
            "description": "Exchange display name."
          },
          "type": {
            "type": "string",
            "enum": [
              "centralized",
              "decentralized"
            ],
            "description": "Exchange category."
          },
          "status": {
            "type": "string",
            "enum": [
              "operational",
              "degraded",
              "maintenance",
              "offline"
            ],
            "description": "Connection state in a streaming update."
          },
          "order_types": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Order type."
            },
            "description": "Enabled order types."
          },
          "margin_modes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "cross",
                "isolated"
              ],
              "description": "Margin mode."
            },
            "description": "Available margin modes."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "status",
          "order_types",
          "margin_modes",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Venue": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "name": {
            "type": "string",
            "description": "Exchange display name."
          },
          "type": {
            "type": "string",
            "enum": [
              "centralized",
              "decentralized"
            ],
            "description": "Exchange category."
          },
          "website": {
            "type": "string",
            "description": "Official exchange website.",
            "format": "uri"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "website"
        ],
        "additionalProperties": false
      },
      "PriceRule": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "fixed_tick"
              },
              "tick_size": {
                "type": "string",
                "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
                "description": "Price increment in price_unit."
              }
            },
            "required": [
              "type",
              "tick_size"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "significant_figures"
              },
              "max_significant_figures": {
                "type": "integer",
                "minimum": 1,
                "description": "Maximum significant figures for non-integer prices."
              },
              "max_decimal_places": {
                "type": "integer",
                "minimum": 0,
                "description": "Maximum decimal places."
              },
              "integer_prices_allowed": {
                "type": "boolean",
                "description": "Integer prices may exceed the significant-figure limit."
              }
            },
            "required": [
              "type",
              "max_significant_figures",
              "max_decimal_places",
              "integer_prices_allowed"
            ],
            "additionalProperties": false
          }
        ]
      },
      "VenueContract": {
        "type": "object",
        "properties": {
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "venue_instrument": {
            "type": "string",
            "description": "Native exchange symbol, such as BTCUSDT or BTC."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "settlement_assets": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Asset symbol, such as BTC, USDT, or USDC."
            },
            "description": "Settlement tokens for a pool with side-dependent collateral."
          },
          "network": {
            "type": "string",
            "description": "Blockchain network for an onchain pool."
          },
          "payoff_type": {
            "type": "string",
            "enum": [
              "linear",
              "inverse"
            ],
            "description": "Contract payoff where specified by the exchange."
          },
          "contract_size": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Value represented by one native contract."
          },
          "contract_size_unit": {
            "type": "string",
            "description": "Unit of contract_size; multiply native contract quantity by contract_size to express face value."
          },
          "quantity_unit": {
            "type": "string",
            "description": "Native size unit: base asset, USD, or contract. Read contract_size for lot-based contracts."
          },
          "price_unit": {
            "type": "string",
            "description": "Price quote unit."
          },
          "price_rule": {
            "$ref": "#/components/schemas/PriceRule",
            "description": "Fixed increment or significant-figure pricing rule."
          },
          "quantity_step": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Size increment in quantity_unit."
          },
          "minimum_quantity": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Exchange LOT_SIZE minimum for limit orders."
          },
          "maximum_quantity": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Exchange LOT_SIZE maximum for limit orders; market-order limits may differ."
          },
          "minimum_notional": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Minimum order value in price_unit."
          },
          "max_leverage": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Published exchange ceiling at snapshot time; account risk tiers can lower it."
          }
        },
        "required": [
          "venue",
          "venue_instrument",
          "quantity_unit",
          "price_unit"
        ],
        "additionalProperties": false
      },
      "Market": {
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "contract_type": {
            "type": "string",
            "enum": [
              "perpetual"
            ],
            "description": "Perpetual futures instrument family; payoff details belong to each exchange contract."
          },
          "base_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "contracts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VenueContract"
            },
            "description": "Native contract mappings, grouped under one perpetual instrument."
          }
        },
        "required": [
          "instrument",
          "contract_type",
          "base_asset",
          "contracts"
        ],
        "additionalProperties": false
      },
      "PriceLevel": {
        "type": "object",
        "properties": {
          "price": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Price in the contract quote asset."
          },
          "quantity": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Absolute resting quantity in the contract base unit. Zero removes a level in a delta."
          }
        },
        "required": [
          "price",
          "quantity"
        ],
        "additionalProperties": false
      },
      "OrderBook": {
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "book_sequence": {
            "type": "integer",
            "minimum": 0,
            "description": "Monotonic sequence for this exchange/instrument book."
          },
          "bids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceLevel"
            },
            "description": "Bids, highest price first."
          },
          "asks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceLevel"
            },
            "description": "Asks, lowest price first."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "instrument",
          "venue",
          "settlement_asset",
          "book_sequence",
          "bids",
          "asks",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Ticker": {
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "bid": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Best bid price."
          },
          "ask": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Best ask price."
          },
          "last": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Last traded price."
          },
          "mark_price": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Exchange mark price used for risk calculations."
          },
          "index_price": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Exchange index price."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "instrument",
          "venue",
          "settlement_asset",
          "bid",
          "ask",
          "last",
          "mark_price",
          "index_price",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Trade": {
        "type": "object",
        "properties": {
          "trade_id": {
            "type": "string",
            "description": "Exchange trade identifier; deduplicate with venue."
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Aggressor side."
          },
          "price": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Execution price in the contract quote asset."
          },
          "quantity": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Base quantity executed."
          },
          "executed_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "trade_id",
          "instrument",
          "venue",
          "settlement_asset",
          "side",
          "price",
          "quantity",
          "executed_at"
        ],
        "additionalProperties": false
      },
      "Funding": {
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "rate": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Decimal funding rate for the stated interval: 0.0001 = 0.01%."
          },
          "interval_hours": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Hours covered by this rate."
          },
          "next_funding_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          },
          "type": {
            "type": "string",
            "enum": [
              "indicative",
              "final"
            ],
            "description": "Indicative rates can change before settlement."
          }
        },
        "required": [
          "instrument",
          "venue",
          "settlement_asset",
          "rate",
          "interval_hours",
          "next_funding_at",
          "type"
        ],
        "additionalProperties": false
      },
      "Account": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "name": {
            "type": "string",
            "description": "Account display name."
          },
          "type": {
            "type": "string",
            "enum": [
              "main",
              "subaccount"
            ],
            "description": "Account hierarchy role."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "read_only",
              "suspended"
            ],
            "description": "Account access state."
          },
          "reporting_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "enabled_venues": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
            },
            "description": "Exchanges enabled for this account."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "account_id",
          "name",
          "type",
          "status",
          "reporting_asset",
          "enabled_venues",
          "created_at"
        ],
        "additionalProperties": false
      },
      "Balance": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "total": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Ledger balance in this asset, excluding unrealized P&L."
          },
          "available": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Uncommitted ledger balance."
          },
          "committed": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Amount allocated or reserved. available + committed = total."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "account_id",
          "asset",
          "total",
          "available",
          "committed",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Fee": {
        "type": "object",
        "properties": {
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "maker_rate": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Decimal maker fee rate. Negative values indicate rebates."
          },
          "taker_rate": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Decimal taker fee rate."
          },
          "trade8_rate": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Additional Trade8 trading charge as a decimal rate."
          },
          "effective_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "venue",
          "instrument",
          "settlement_asset",
          "maker_rate",
          "taker_rate",
          "trade8_rate",
          "effective_at"
        ],
        "additionalProperties": false
      },
      "Limits": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "rest_requests_per_second": {
            "type": "integer",
            "minimum": 1,
            "description": "Account REST request budget."
          },
          "order_requests_per_second": {
            "type": "integer",
            "minimum": 1,
            "description": "Shared budget for order mutations."
          },
          "websocket_connections": {
            "type": "integer",
            "minimum": 1,
            "description": "Concurrent authenticated connection limit."
          },
          "subscriptions_per_connection": {
            "type": "integer",
            "minimum": 1,
            "description": "Channel subscriptions allowed on each connection."
          },
          "batch_order_limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Maximum orders in one batch."
          },
          "effective_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "account_id",
          "rest_requests_per_second",
          "order_requests_per_second",
          "websocket_connections",
          "subscriptions_per_connection",
          "batch_order_limit",
          "effective_at"
        ],
        "additionalProperties": false
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "key_id": {
            "type": "string",
            "description": "Public key identifier; the secret is never returned by this endpoint."
          },
          "label": {
            "type": "string",
            "description": "Key display label."
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Permission scope."
            },
            "description": "Granted scopes."
          },
          "account_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Trading account identifier within the authorized account grant."
            },
            "description": "Accounts the key may access."
          },
          "ip_allowlist": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Allowed IPv4/IPv6 address or CIDR."
            },
            "description": "Permitted source IP ranges."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "revoked",
              "expired"
            ],
            "description": "Key status."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "key_id",
          "label",
          "scopes",
          "account_ids",
          "ip_allowlist",
          "status",
          "expires_at"
        ],
        "additionalProperties": false
      },
      "VenuePolicy": {
        "type": "object",
        "properties": {
          "allowed": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
            },
            "description": "Only these exchanges may receive child orders.",
            "minItems": 1
          },
          "excluded": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
            },
            "description": "Exchanges excluded from routing; must be disjoint from allowed."
          },
          "max_slippage_bps": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Maximum market-order slippage from the consolidated best price at acceptance, in basis points. Execution stops at this boundary."
          }
        },
        "required": [],
        "additionalProperties": false
      },
      "OrderRequest": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "client_order_id": {
            "type": "string",
            "description": "Unique client identifier within the account. Retain it for reconciliation.",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Trade direction."
          },
          "type": {
            "type": "string",
            "enum": [
              "market",
              "limit",
              "stop_market",
              "stop_limit",
              "take_profit_market",
              "take_profit_limit"
            ],
            "description": "Order type."
          },
          "quantity": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Order size in the market base unit."
          },
          "limit_price": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Required for limit, stop_limit, and take_profit_limit."
          },
          "trigger_price": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Required for stop and take-profit orders."
          },
          "trigger_source": {
            "type": "string",
            "enum": [
              "mark",
              "last",
              "index"
            ],
            "description": "Price used by a conditional order."
          },
          "trigger_venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "time_in_force": {
            "type": "string",
            "enum": [
              "GTC",
              "IOC",
              "FOK"
            ],
            "description": "Limit orders: GTC, IOC, or FOK. Market orders: IOC. Default GTC for limit variants and IOC for market variants."
          },
          "post_only": {
            "type": "boolean",
            "description": "Default false. Supported on ordinary GTC limit orders; crossing orders are rejected."
          },
          "reduce_only": {
            "type": "boolean",
            "description": "Default false. Restricts fills to reducing the current exchange position."
          },
          "routing": {
            "type": "string",
            "enum": [
              "auto",
              "direct"
            ],
            "description": "Auto chooses eligible exchanges; direct requires exactly one allowed exchange."
          },
          "venue_policy": {
            "$ref": "#/components/schemas/VenuePolicy"
          },
          "self_trade_prevention": {
            "type": "string",
            "enum": [
              "cancel_newest",
              "cancel_oldest",
              "cancel_both"
            ],
            "description": "Action when orders from the same account would match. Default cancel_newest."
          }
        },
        "required": [
          "account_id",
          "client_order_id",
          "instrument",
          "settlement_asset",
          "side",
          "type",
          "quantity",
          "routing"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "time_in_force": {
                  "const": "FOK"
                }
              },
              "required": [
                "time_in_force"
              ]
            },
            "then": {
              "properties": {
                "routing": {
                  "const": "direct"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "limit",
                    "stop_limit",
                    "take_profit_limit"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "required": [
                "limit_price"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "stop_market",
                    "stop_limit",
                    "take_profit_market",
                    "take_profit_limit"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "required": [
                "trigger_price",
                "trigger_source",
                "trigger_venue"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "market",
                    "stop_market",
                    "take_profit_market"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "time_in_force": {
                  "const": "IOC"
                },
                "post_only": {
                  "const": false
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "post_only": {
                  "const": true
                }
              },
              "required": [
                "post_only"
              ]
            },
            "then": {
              "properties": {
                "type": {
                  "const": "limit"
                },
                "time_in_force": {
                  "const": "GTC"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "routing": {
                  "const": "direct"
                }
              },
              "required": [
                "routing"
              ]
            },
            "then": {
              "required": [
                "venue_policy"
              ],
              "properties": {
                "venue_policy": {
                  "required": [
                    "allowed"
                  ],
                  "properties": {
                    "allowed": {
                      "minItems": 1,
                      "maxItems": 1
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "Order": {
        "type": "object",
        "properties": {
          "order_id": {
            "type": "string",
            "description": "Trade8 parent order identifier."
          },
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "client_order_id": {
            "type": "string",
            "description": "Unique client identifier within the account. Retain it for reconciliation.",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ],
            "description": "Direction."
          },
          "type": {
            "type": "string",
            "description": "Order type."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "trigger_pending",
              "partially_filled",
              "filled",
              "cancelled",
              "rejected",
              "expired"
            ],
            "description": "Current order lifecycle state."
          },
          "requested_quantity": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Total requested base quantity."
          },
          "filled_quantity": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Cumulative executed base quantity."
          },
          "remaining_quantity": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Quantity still open or awaiting execution. Zero after a terminal state."
          },
          "cancelled_quantity": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Quantity cancelled, rejected, or expired without a fill."
          },
          "average_fill_price": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Quantity-weighted price of actual fills; null before the first fill."
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "Monotonic order revision. Use for optimistic concurrency and event reconciliation."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "order_id",
          "account_id",
          "client_order_id",
          "instrument",
          "settlement_asset",
          "side",
          "type",
          "status",
          "requested_quantity",
          "filled_quantity",
          "remaining_quantity",
          "cancelled_quantity",
          "average_fill_price",
          "revision",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Fill": {
        "type": "object",
        "properties": {
          "fill_id": {
            "type": "string",
            "description": "Unique Trade8 fill identifier."
          },
          "order_id": {
            "type": "string",
            "description": "Parent order identifier."
          },
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "venue_order_id": {
            "type": "string",
            "description": "Native exchange order identifier."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "quantity": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Executed base quantity."
          },
          "price": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Execution price in the quote asset."
          },
          "fee": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Trading charge for this fill; negative indicates a rebate."
          },
          "fee_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "liquidity": {
            "type": "string",
            "enum": [
              "maker",
              "taker"
            ],
            "description": "Liquidity role at execution."
          },
          "executed_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "fill_id",
          "order_id",
          "account_id",
          "instrument",
          "venue",
          "venue_order_id",
          "settlement_asset",
          "quantity",
          "price",
          "fee",
          "fee_asset",
          "liquidity",
          "executed_at"
        ],
        "additionalProperties": false
      },
      "ChildOrder": {
        "type": "object",
        "properties": {
          "child_order_id": {
            "type": "string",
            "description": "Trade8 child identifier."
          },
          "order_id": {
            "type": "string",
            "description": "Parent identifier."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "venue_order_id": {
            "type": "string",
            "description": "Exchange order identifier."
          },
          "quantity": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Base quantity routed to this exchange."
          },
          "filled_quantity": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Cumulative executed base quantity."
          },
          "status": {
            "type": "string",
            "description": "Child lifecycle state."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "child_order_id",
          "order_id",
          "venue",
          "venue_order_id",
          "quantity",
          "filled_quantity",
          "status",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Cancellation": {
        "type": "object",
        "properties": {
          "order_id": {
            "type": "string",
            "description": "Parent identifier."
          },
          "cancellation_status": {
            "type": "string",
            "enum": [
              "pending",
              "completed"
            ],
            "description": "Follow the order stream or order lookup for the final quantities."
          },
          "requested_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "order_id",
          "cancellation_status",
          "requested_at"
        ],
        "additionalProperties": false
      },
      "Position": {
        "type": "object",
        "properties": {
          "position_id": {
            "type": "string",
            "description": "Position identifier."
          },
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ],
            "description": "Position direction."
          },
          "quantity": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Absolute base quantity; zero marks a closed position update."
          },
          "entry_price": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Quantity-weighted entry price."
          },
          "mark_price": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Current exchange mark price."
          },
          "unrealized_pnl": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Unrealized P&L in the settlement asset."
          },
          "liquidation_price": {
            "type": [
              "string",
              "null"
            ],
            "description": "Estimated exchange liquidation price, or null when unavailable."
          },
          "leverage": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Configured leverage multiplier."
          },
          "margin_mode": {
            "type": "string",
            "enum": [
              "cross",
              "isolated"
            ],
            "description": "Exchange margin mode."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "position_id",
          "account_id",
          "instrument",
          "venue",
          "settlement_asset",
          "side",
          "quantity",
          "entry_price",
          "mark_price",
          "unrealized_pnl",
          "liquidation_price",
          "leverage",
          "margin_mode",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "MarginSetting": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "margin_mode": {
            "type": "string",
            "enum": [
              "cross",
              "isolated"
            ],
            "description": "Cross shares eligible collateral within this exchange account; isolated reserves it for the position."
          },
          "leverage": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Requested leverage multiplier; validated against exchange and account risk tiers."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "account_id",
          "instrument",
          "venue",
          "settlement_asset",
          "margin_mode",
          "leverage",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Risk": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "settlement_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "equity": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Equity in settlement_asset, including unrealized P&L."
          },
          "initial_margin": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Initial margin requirement."
          },
          "maintenance_margin": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Maintenance margin requirement."
          },
          "available_margin": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Margin available for new positions after reservations."
          },
          "margin_ratio": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Maintenance margin / equity. Rising values indicate less headroom."
          },
          "state": {
            "type": "string",
            "enum": [
              "normal",
              "warning",
              "reduce_only",
              "liquidating"
            ],
            "description": "Exchange risk state."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "account_id",
          "venue",
          "settlement_asset",
          "equity",
          "initial_margin",
          "maintenance_margin",
          "available_margin",
          "margin_ratio",
          "state",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Custodian": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Custodian identifier from the integration catalog."
          },
          "name": {
            "type": "string",
            "description": "Custodian display name."
          },
          "services": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "custody",
                "off_exchange_collateral"
              ],
              "description": "Supported service."
            },
            "description": "Services enabled for this integration."
          }
        },
        "required": [
          "id",
          "name",
          "services"
        ],
        "additionalProperties": false
      },
      "CustodyAccount": {
        "type": "object",
        "properties": {
          "custody_account_id": {
            "type": "string",
            "description": "Linked custody account identifier."
          },
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "custodian": {
            "type": "string",
            "description": "Custodian identifier, such as ceffu, copper, bitgo, or coinbase."
          },
          "asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "balance": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Custody ledger balance in this asset."
          },
          "allocated": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Amount committed to exchange collateral."
          },
          "available": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Unallocated custody balance."
          },
          "eligible_venues": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
            },
            "description": "Exchanges enabled for off-exchange allocation from this custody account."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "custody_account_id",
          "account_id",
          "custodian",
          "asset",
          "balance",
          "allocated",
          "available",
          "eligible_venues",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Allocation": {
        "type": "object",
        "properties": {
          "allocation_id": {
            "type": "string",
            "description": "Collateral allocation identifier."
          },
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "client_allocation_id": {
            "type": "string",
            "description": "Unique client identifier within the account. Retain it for reconciliation.",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "custody_account_id": {
            "type": "string",
            "description": "Source custody account."
          },
          "custodian": {
            "type": "string",
            "description": "Custodian identifier."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "amount": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Amount in asset units."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "releasing",
              "released",
              "rejected"
            ],
            "description": "Active means the exchange has acknowledged usable collateral."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "allocation_id",
          "account_id",
          "client_allocation_id",
          "custody_account_id",
          "custodian",
          "venue",
          "asset",
          "amount",
          "status",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Settlement": {
        "type": "object",
        "properties": {
          "settlement_id": {
            "type": "string",
            "description": "Settlement record identifier."
          },
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "custodian": {
            "type": "string",
            "description": "Custodian identifier."
          },
          "venue": {
            "type": "string",
            "description": "Exchange identifier from GET /v1/venues, such as binance, okx, bybit, hyperliquid, or dydx."
          },
          "asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "amount": {
            "type": "string",
            "pattern": "^-?(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Positive credits the custody account; negative debits it."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed"
            ],
            "description": "Settlement processing state."
          },
          "cycle_start": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          },
          "cycle_end": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "settlement_id",
          "account_id",
          "custodian",
          "venue",
          "asset",
          "amount",
          "status",
          "cycle_start",
          "cycle_end",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Deposit": {
        "type": "object",
        "properties": {
          "deposit_id": {
            "type": "string",
            "description": "Deposit identifier."
          },
          "account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "network": {
            "type": "string",
            "description": "Blockchain network identifier, such as ethereum or bitcoin."
          },
          "amount": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Received amount in asset units."
          },
          "confirmations": {
            "type": "integer",
            "minimum": 0,
            "description": "Observed confirmations."
          },
          "required_confirmations": {
            "type": "integer",
            "minimum": 1,
            "description": "Confirmation threshold for this deposit."
          },
          "status": {
            "type": "string",
            "enum": [
              "detected",
              "confirming",
              "review",
              "credited",
              "rejected"
            ],
            "description": "Credited means the amount is included in the ledger balance."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "deposit_id",
          "account_id",
          "asset",
          "network",
          "amount",
          "confirmations",
          "required_confirmations",
          "status",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "Transfer": {
        "type": "object",
        "properties": {
          "transfer_id": {
            "type": "string",
            "description": "Internal transfer identifier."
          },
          "client_transfer_id": {
            "type": "string",
            "description": "Unique client identifier within the account. Retain it for reconciliation.",
            "pattern": "^[A-Za-z0-9_-]{1,64}$"
          },
          "from_account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "to_account_id": {
            "type": "string",
            "description": "Trading account identifier within the authorized account grant."
          },
          "asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "amount": {
            "type": "string",
            "pattern": "^(?=.*[1-9])(0|[1-9][0-9]*)(\\.[0-9]+)?$",
            "description": "Transfer amount in asset units."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "completed",
              "rejected"
            ],
            "description": "Internal transfer processing state."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "UTC timestamp in RFC 3339 format."
          }
        },
        "required": [
          "transfer_id",
          "client_transfer_id",
          "from_account_id",
          "to_account_id",
          "asset",
          "amount",
          "status",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "MarketDetail": {
        "type": "object",
        "properties": {
          "instrument": {
            "type": "string",
            "description": "Normalized perpetual family, for example BTC-PERP. Select a settlement asset and exchange to identify a contract."
          },
          "contract_type": {
            "type": "string",
            "enum": [
              "perpetual"
            ],
            "description": "Perpetual futures instrument family; payoff details belong to each exchange contract."
          },
          "base_asset": {
            "type": "string",
            "description": "Asset symbol, such as BTC, USDT, or USDC."
          },
          "contracts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VenueContract"
            },
            "description": "Native contract mappings, grouped under one perpetual instrument."
          }
        },
        "required": [
          "instrument",
          "contract_type",
          "base_asset",
          "contracts"
        ],
        "additionalProperties": false
      },
      "MarketCatalog": {
        "type": "object",
        "properties": {
          "markets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Market"
            },
            "description": "Instruments on this page."
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "required": [
          "markets",
          "pagination"
        ],
        "additionalProperties": false
      },
      "VenueCatalog": {
        "type": "object",
        "properties": {
          "venues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Venue"
            },
            "description": "Exchanges on this page."
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "required": [
          "venues",
          "pagination"
        ],
        "additionalProperties": false
      }
    },
    "responses": {
      "Error400": {
        "description": "Invalid request syntax",
        "headers": {
          "X-Request-ID": {
            "description": "Support correlation identifier.",
            "schema": {
              "type": "string"
            }
          },
          "X-RateLimit-Limit": {
            "description": "Request budget for this account bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Requests remaining in this bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Reset": {
            "description": "Unix time in whole seconds when the bucket resets.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error401": {
        "description": "Authentication failed",
        "headers": {
          "X-Request-ID": {
            "description": "Support correlation identifier.",
            "schema": {
              "type": "string"
            }
          },
          "X-RateLimit-Limit": {
            "description": "Request budget for this account bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Requests remaining in this bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Reset": {
            "description": "Unix time in whole seconds when the bucket resets.",
            "schema": {
              "type": "integer"
            }
          },
          "WWW-Authenticate": {
            "description": "Authentication scheme for REST requests.",
            "schema": {
              "type": "string",
              "example": "Trade8-HMAC realm=\"Trade8 API\""
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "request_id": "req_example_01",
              "error": {
                "code": "AUTHENTICATION_REQUIRED",
                "message": "Authentication is required. Send X-Trade8-API-Key, X-Trade8-Timestamp, and X-Trade8-Signature.",
                "retryable": false,
                "details": []
              }
            }
          }
        }
      },
      "Error403": {
        "description": "Account or scope denied",
        "headers": {
          "X-Request-ID": {
            "description": "Support correlation identifier.",
            "schema": {
              "type": "string"
            }
          },
          "X-RateLimit-Limit": {
            "description": "Request budget for this account bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Requests remaining in this bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Reset": {
            "description": "Unix time in whole seconds when the bucket resets.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error404": {
        "description": "Resource not found",
        "headers": {
          "X-Request-ID": {
            "description": "Support correlation identifier.",
            "schema": {
              "type": "string"
            }
          },
          "X-RateLimit-Limit": {
            "description": "Request budget for this account bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Requests remaining in this bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Reset": {
            "description": "Unix time in whole seconds when the bucket resets.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error409": {
        "description": "State or idempotency conflict",
        "headers": {
          "X-Request-ID": {
            "description": "Support correlation identifier.",
            "schema": {
              "type": "string"
            }
          },
          "X-RateLimit-Limit": {
            "description": "Request budget for this account bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Requests remaining in this bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Reset": {
            "description": "Unix time in whole seconds when the bucket resets.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error422": {
        "description": "Trading or collateral rule rejected",
        "headers": {
          "X-Request-ID": {
            "description": "Support correlation identifier.",
            "schema": {
              "type": "string"
            }
          },
          "X-RateLimit-Limit": {
            "description": "Request budget for this account bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Requests remaining in this bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Reset": {
            "description": "Unix time in whole seconds when the bucket resets.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "request_id": "req_example_01",
              "error": {
                "code": "INVALID_ORDER",
                "message": "Quantity must match the exchange size increment.",
                "retryable": false,
                "details": [
                  {
                    "field": "quantity",
                    "reason": "Use a multiple of 0.001 BTC for this route."
                  }
                ]
              }
            }
          }
        }
      },
      "Error429": {
        "description": "Rate limit reached",
        "headers": {
          "X-Request-ID": {
            "description": "Support correlation identifier.",
            "schema": {
              "type": "string"
            }
          },
          "X-RateLimit-Limit": {
            "description": "Request budget for this account bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Requests remaining in this bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Reset": {
            "description": "Unix time in whole seconds when the bucket resets.",
            "schema": {
              "type": "integer"
            }
          },
          "Retry-After": {
            "description": "Delay in seconds before another attempt.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error500": {
        "description": "Internal error; reconcile mutations before retrying",
        "headers": {
          "X-Request-ID": {
            "description": "Support correlation identifier.",
            "schema": {
              "type": "string"
            }
          },
          "X-RateLimit-Limit": {
            "description": "Request budget for this account bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Requests remaining in this bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Reset": {
            "description": "Unix time in whole seconds when the bucket resets.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Error503": {
        "description": "Temporarily unavailable; reconcile mutations before retrying",
        "headers": {
          "X-Request-ID": {
            "description": "Support correlation identifier.",
            "schema": {
              "type": "string"
            }
          },
          "X-RateLimit-Limit": {
            "description": "Request budget for this account bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "description": "Requests remaining in this bucket.",
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Reset": {
            "description": "Unix time in whole seconds when the bucket resets.",
            "schema": {
              "type": "integer"
            }
          },
          "Retry-After": {
            "description": "Delay in seconds before another attempt.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
