{
  "openapi": "3.0.3",
  "info": {
    "title": "Polymarket Perps HTTP API",
    "version": "1.0.0",
    "description": "HTTP API for Polymarket perpetual trading system.",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "https://api.perpetuals.polymarket.com",
      "description": "Production Perps HTTP API"
    }
  ],
  "paths": {
    "/v1/info/ping": {
      "get": {
        "operationId": "getPing",
        "summary": "Test Connection",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Test connection to the server.\n",
        "responses": {
          "200": {
            "description": "Successful ping response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/time": {
      "get": {
        "operationId": "getTime",
        "summary": "Get Server Time",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Get server time.\n",
        "responses": {
          "200": {
            "description": "Successful time response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Time"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/exchange": {
      "get": {
        "operationId": "getExchange",
        "summary": "Get Exchange Info",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get exchange information.\n",
        "responses": {
          "200": {
            "description": "Successful exchange information response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Exchange"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/assets": {
      "get": {
        "operationId": "getAssets",
        "summary": "Get Collateral Assets",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get a list of collateral assets.\n",
        "responses": {
          "200": {
            "description": "Assets response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Asset"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/instruments": {
      "get": {
        "operationId": "getInstruments",
        "summary": "Get Instruments",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get all instruments.",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "maximum": 4294967295,
              "description": "Instrument ID"
            }
          },
          {
            "name": "instrument_type",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/instrument_type"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/category"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Instruments response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Instrument"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/tickers": {
      "get": {
        "operationId": "getTickers",
        "summary": "Get Tickers",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get all instrument tickers with live market data.",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/instrument_id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tickers response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Ticker"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/statistics": {
      "get": {
        "operationId": "getStatistics",
        "summary": "Get Statistics",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get last 24-hour statistics for all instruments.",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/instrument_id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Statistics response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Statistic"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/klines": {
      "get": {
        "operationId": "getKlines",
        "summary": "Get Klines",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **5**</Badge>"
        },
        "description": "Get klines for an instrument.\nIf no end time is provided, the current time will be used.\nMaximum of 1000 entries returned per request.\n",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "maximum": 4294967295,
              "description": "Instrument ID"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/interval"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Klines response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KlinesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/mark-history": {
      "get": {
        "operationId": "getMarkHistory",
        "summary": "Get Mark Price History",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **5**</Badge>\n<br/>\n<Badge color=\"gray\" size=\"md\">Cached for 2s. A request served from cache costs **1**</Badge>\n"
        },
        "description": "Get mark price history for an instrument, bucketed by interval.\nIf no end time is provided, the current time will be used.\nMaximum of 1000 entries returned per request.\nOnly buckets with at least one mark update are included.\nFor intervals of a minute or coarser, a bucket cut mid-way by `end_timestamp`\nmay be omitted, or may reflect the window's last mark at one-minute fidelity.\n",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "maximum": 4294967295,
              "description": "Instrument ID"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/interval"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mark price history response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarkHistoryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/bbo": {
      "get": {
        "operationId": "getBBO",
        "summary": "Get BBO",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get best bid and offer for all instruments.",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/instrument_id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "BBO response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BBO"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/book": {
      "get": {
        "operationId": "getBook",
        "summary": "Get Book",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight:</Badge>\n<br/>\n<Badge color=\"gray\" size=\"md\">Depth 10: **2**</Badge>\n<br/>\n<Badge color=\"gray\" size=\"md\">Depth 100: **5**</Badge>\n<br/>\n<Badge color=\"gray\" size=\"md\">Depth 500: **10**</Badge>\n<br/>\n<Badge color=\"gray\" size=\"md\">Depth 1000: **20**</Badge>\n"
        },
        "description": "Get book for an instrument.",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "maximum": 4294967295,
              "description": "Instrument ID"
            }
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/depth"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Book response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Book"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/index": {
      "get": {
        "operationId": "getIndex",
        "summary": "Get Index",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get index price and the list of constituents for an asset.",
        "parameters": [
          {
            "name": "asset",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/asset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Index constituents response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Index"
                },
                "examples": {
                  "index": {
                    "summary": "Index constituents",
                    "value": {
                      "asset": "NVDA",
                      "index_price": "160.00",
                      "constituents": [
                        {
                          "source": "chainlink",
                          "symbol": "NVDA/USD",
                          "weight": "1.0",
                          "price": "160.00"
                        }
                      ],
                      "ts": 1767225600000
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/trades": {
      "get": {
        "operationId": "getTrades",
        "summary": "Get Recent Trades",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "Get public trades for an instrument.\nMaximum of 100 entries returned per request.\n",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "maximum": 4294967295,
              "description": "Instrument ID"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trades response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Trades"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/portfolio": {
      "get": {
        "operationId": "getPublicPortfolio",
        "summary": "Get Public Portfolio",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **5**</Badge>"
        },
        "description": "Get public portfolio for an address including equity and open positions.\n",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/address"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public portfolio response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPortfolio"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/position-fills": {
      "get": {
        "operationId": "getPublicPositionFills",
        "summary": "Get Current Position Fills",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>\n<br/>\n<Badge color=\"gray\" size=\"md\">Cached 2s — a request served from cache costs **1**</Badge>"
        },
        "description": "Get every fill in a registered account's current open position cycle for\none instrument. A cycle begins when the position opens from flat or flips\ndirection. For a flip, every fill from the flipping engine event belongs\nto the new cycle so a fill is never split between cycles.\n\nReturns an empty page when the account has no open position for the\ninstrument. Maximum of 100 entries returned per request. Results are\nordered by time; use `sort` to choose newest-first (`desc`, default) or\noldest-first (`asc`). To page through more than 100 fills, pass the opaque\n`cursor` returned by the previous page and keep `sort` unchanged. Each page\nverifies that the cursor still describes the account's current position\ncycle. If that position changes while pagination is in progress, the\ncursor returns `400` and pagination must restart from the first page.\n\nCycle discovery for a position inherited from a gateway snapshot is\nlimited to 250,000 account-history rows. A cycle older than that bound\nreturns `413` rather than allowing a public request to run an unbounded\nClickHouse scan. Positions opened or flipped after gateway startup carry\ntheir cycle boundary directly and do not use this discovery scan.\n",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/address"
            }
          },
          {
            "name": "instrument_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "maximum": 4294967295,
              "description": "Instrument ID"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/fills_cursor"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current position fills response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountTrades"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "408": {
            "$ref": "#/components/responses/Error408Response"
          },
          "413": {
            "$ref": "#/components/responses/Error413Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/funding": {
      "get": {
        "operationId": "getFundingHistory",
        "summary": "Get Historical Funding",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "Get public funding rate history for an instrument.\nMaximum of 100 entries returned per request.\n",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "maximum": 4294967295,
              "description": "Instrument ID"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Funding rate history response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FundingHistory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/fees": {
      "get": {
        "operationId": "getInfoFees",
        "summary": "Get Fees",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get the fee tier schedule for each instrument type and category.",
        "responses": {
          "200": {
            "description": "Fee schedule response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeesInfo"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/limit-tiers": {
      "get": {
        "operationId": "getLimitTiers",
        "summary": "Get Limit Tiers",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get the list of account limit tiers. Action and open-order fields are enforced per account; legacy request-rate fields are not used for gateway request enforcement.",
        "responses": {
          "200": {
            "description": "Limit tiers response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LimitTier"
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/info/invite": {
      "get": {
        "operationId": "checkInviteCode",
        "summary": "Check Invite Code",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Check whether an invite code can be used. When `address` is provided, the\nresponse is invalid if that address already has an account.\n",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/code"
            }
          },
          {
            "name": "address",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/address"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Invite code validation response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteCheckResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/trade/orders": {
      "post": {
        "operationId": "createOrders",
        "summary": "Create Orders",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1 + floor(n / 20)**</Badge> <Badge color=\"gray\" size=\"md\">Action Weight: **1 / order**</Badge>"
        },
        "description": "Create new orders.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n",
        "requestBody": {
          "description": "Order request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Order ACK response. Order result should be fetched using the get orders endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrderResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      },
      "delete": {
        "operationId": "cancelOrders",
        "summary": "Cancel Orders",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1 + floor(n / 20)**</Badge> <Badge color=\"gray\" size=\"md\">Action Weight: **0**</Badge>"
        },
        "description": "Cancel orders.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n",
        "requestBody": {
          "description": "Cancel request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancel response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CancelResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      },
      "patch": {
        "operationId": "modifyOrders",
        "summary": "Modify Orders",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1 + floor(n / 20)**</Badge> <Badge color=\"gray\" size=\"md\">Action Weight: **1 / order**</Badge>"
        },
        "description": "Modify the price and total quantity of existing orders by exchange order ID.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n",
        "requestBody": {
          "description": "Modify request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModifyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One modify result per requested order, in request order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ModifyResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BatchError400Response"
          },
          "404": {
            "$ref": "#/components/responses/BatchError404Response"
          },
          "429": {
            "$ref": "#/components/responses/BatchError429Response"
          },
          "500": {
            "$ref": "#/components/responses/BatchError500Response"
          }
        }
      }
    },
    "/v1/trade/orders/all": {
      "delete": {
        "operationId": "cancelAllOrders",
        "summary": "Cancel All Orders",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge> <Badge color=\"gray\" size=\"md\">Action Weight: **0**</Badge>"
        },
        "description": "Cancel all open orders for the authenticated account on one instrument.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n",
        "requestBody": {
          "description": "Cancel all request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelAllRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancel all accepted response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/trade/orders-coid": {
      "delete": {
        "operationId": "cancelOrdersByCoid",
        "summary": "Cancel Orders COID",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1 + floor(n / 20)**</Badge> <Badge color=\"gray\" size=\"md\">Action Weight: **0**</Badge>"
        },
        "description": "Cancel orders by client order ID.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n",
        "requestBody": {
          "description": "Cancel by coid request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelByCoidRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Cancel response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CancelResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      },
      "patch": {
        "operationId": "modifyOrdersByCoid",
        "summary": "Modify Orders COID",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1 + floor(n / 20)**</Badge> <Badge color=\"gray\" size=\"md\">Action Weight: **1 / order**</Badge>"
        },
        "description": "Modify the price and total quantity of existing orders by client order ID.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n",
        "requestBody": {
          "description": "Modify by coid request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModifyByCoidRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One modify result per requested order, in request order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ModifyResponse"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BatchError400Response"
          },
          "404": {
            "$ref": "#/components/responses/BatchError404Response"
          },
          "429": {
            "$ref": "#/components/responses/BatchError429Response"
          },
          "500": {
            "$ref": "#/components/responses/BatchError500Response"
          }
        }
      }
    },
    "/v1/trade/auto-cancel": {
      "patch": {
        "operationId": "setAutoCancel",
        "summary": "Set Auto-Cancel",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge> <Badge color=\"gray\" size=\"md\">Action Weight: **10**</Badge>"
        },
        "description": "Set a dead man's switch that cancels all your open orders at the chosen\ntime. The time must be at least 5 seconds in the future. Send 0 to clear\nan active schedule without triggering it; posting a new time replaces the\ncurrent one.\n\nThe switch fires once, then clears itself. It does not cover orders you\nplace after it fires, so re-arm it if you still need protection.\n\nAn account can trigger auto-cancel up to 1000 times per UTC day. After\nthat, the API rejects new schedules with the error\n`auto_cancel_daily_limit_reached` until the next UTC day. Clearing a\nschedule is always allowed. To check the active deadline and today's\ntrigger count, call [Get Auto-Cancel Status](/api-reference/get-auto-cancel-status).\n\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n",
        "requestBody": {
          "description": "Auto-cancel request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutoCancelRequest"
              },
              "examples": {
                "enable": {
                  "summary": "Enable auto-cancel",
                  "value": {
                    "op": {
                      "type": "autoCancel",
                      "args": {
                        "time": 1767000045000
                      }
                    },
                    "sig": "0x2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b1c",
                    "salt": 666666666,
                    "ts": 1767000015000
                  }
                },
                "disable": {
                  "summary": "Disable auto-cancel",
                  "value": {
                    "op": {
                      "type": "autoCancel",
                      "args": {
                        "time": 0
                      }
                    },
                    "sig": "0x8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f1c",
                    "salt": 666666667,
                    "ts": 1767000016000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The effective auto-cancel schedule after the update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoCancelResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "404": {
            "$ref": "#/components/responses/Error404Response"
          },
          "422": {
            "$ref": "#/components/responses/Error422Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/trade/leverage": {
      "patch": {
        "operationId": "updateLeverage",
        "summary": "Update Leverage",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge> <Badge color=\"gray\" size=\"md\">Action Weight: **1**</Badge>"
        },
        "description": "Update leverage for an instrument.\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\n",
        "requestBody": {
          "description": "Leverage request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeverageRequest"
              },
              "examples": {
                "updateLeverage": {
                  "summary": "Update leverage for one instrument",
                  "value": {
                    "op": {
                      "type": "updateLeverage",
                      "args": {
                        "iid": 1,
                        "lev": 5,
                        "cross": false
                      }
                    },
                    "sig": "0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c",
                    "salt": 333333333,
                    "ts": 1767000012000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The instrument's effective leverage configuration after the update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeverageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "422": {
            "$ref": "#/components/responses/Error422Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/trade/leverage/batch": {
      "patch": {
        "operationId": "updateLeverages",
        "summary": "Update Leverage for Multiple Instruments",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1 + floor(n / 20)**</Badge> <Badge color=\"gray\" size=\"md\">Action Weight: **1 / instrument**</Badge>"
        },
        "description": "Update leverage for up to 100 unique instruments. Updates are processed\nsequentially and are not atomic. If only some responses arrive before the\ngateway deadline, missing item results use `internal_error`; whether those\nupdates applied is unknown. If no responses arrive, the request returns 500.\nRequires proxy signature, see [Update Leverage](/perps/trading#update-leverage).\n",
        "requestBody": {
          "description": "Batch leverage request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeverageBatchRequest"
              },
              "examples": {
                "updateLeverages": {
                  "summary": "Update leverage for multiple instruments",
                  "value": {
                    "op": {
                      "type": "updateLeverages",
                      "args": [
                        {
                          "iid": 1,
                          "lev": 5,
                          "cross": false
                        },
                        {
                          "iid": 2,
                          "lev": 10,
                          "cross": true
                        }
                      ]
                    },
                    "sig": "0x59ed57f6dce8d15aa01e774ef53d9957c84801fb34ec655f6a2ea344af8a58843095314730a3f1bd8f0f4560f6dc6f8de69d3f2d0a6f3365fc877f7f4845d40b1c",
                    "salt": 333333333,
                    "ts": 1767000012000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ordered result for each requested instrument.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LeverageBatchResponse"
                  }
                },
                "examples": {
                  "mixedResult": {
                    "summary": "One update succeeds and one is rejected",
                    "value": [
                      {
                        "status": "ok",
                        "instrument_id": 1,
                        "leverage": 5,
                        "cross": false
                      },
                      {
                        "status": "err",
                        "instrument_id": 2,
                        "error": "insufficient_margin"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BatchError400Response"
          },
          "429": {
            "$ref": "#/components/responses/BatchError429Response"
          },
          "500": {
            "$ref": "#/components/responses/BatchError500Response"
          }
        }
      }
    },
    "/v1/account/proxy": {
      "post": {
        "operationId": "createProxy",
        "summary": "Create Proxy",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Create a new proxy to sign orders. Returns an API secret for private account access.\nRequires EOA signature, see [EOA signing](/http/signing#1-eoa-signing).\n",
        "requestBody": {
          "description": "Proxy creation request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProxyRequest"
              },
              "examples": {
                "createProxy": {
                  "summary": "Create a proxy",
                  "value": {
                    "op": {
                      "type": "createProxy",
                      "args": {
                        "owner": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
                        "proxy": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
                        "expiry": 1767225600000
                      }
                    },
                    "sig": "0x4d11d89f6d8e2f0fd22fb5dd9e6e88a35f3a2c0f3a9e4ff9f8f0da5e6c5f241d2ed7d173f7fcb15726b8a7e7f1f1277ec54c060f5b3ab4d72dbf4d0e40ee6e9a1c",
                    "salt": 123456789,
                    "ts": 1767000000000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Proxy creation response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProxyResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "422": {
            "$ref": "#/components/responses/Error422Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      },
      "delete": {
        "operationId": "deleteProxy",
        "summary": "Delete Proxy",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Delete a proxy by address.\nRequires EOA signature, see [EOA signing](/http/signing#1-eoa-signing).\n",
        "requestBody": {
          "description": "Delete proxy request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteProxyRequest"
              },
              "examples": {
                "deleteProxy": {
                  "summary": "Delete a proxy",
                  "value": {
                    "op": {
                      "type": "deleteProxy",
                      "args": {
                        "proxy": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
                      }
                    },
                    "sig": "0x9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a1c",
                    "salt": 888888888,
                    "ts": 1767000020000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete proxy response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "422": {
            "$ref": "#/components/responses/Error422Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/credentials": {
      "get": {
        "operationId": "getCredentials",
        "summary": "Get Credentials",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get the account ID, address, and proxy keys for the authenticated account.",
        "responses": {
          "200": {
            "description": "Credentials response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credentials"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/orders": {
      "get": {
        "operationId": "getOrders",
        "summary": "Get Orders",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight:</Badge>\n<br/>\n<Badge color=\"gray\" size=\"md\">With order ID: **1**</Badge>\n<br/>\n<Badge color=\"gray\" size=\"md\">Without order ID: **10**</Badge>\n"
        },
        "description": "Get historical order snapshots for the authenticated account from the order history database.\nReturns the latest known state for each matching order, including accepted, open, partial,\nfilled, and cancelled orders. For currently resting orders only, use Get Open Orders.\nMaximum of 100 entries returned per request.\n",
        "parameters": [
          {
            "name": "order_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/order_id"
            }
          },
          {
            "name": "client_order_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/coid"
            }
          },
          {
            "name": "instrument_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/iid"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orders response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrderData"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/open-orders": {
      "get": {
        "operationId": "getOpenOrders",
        "summary": "Get Open Orders",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight:</Badge>\n<br/>\n<Badge color=\"gray\" size=\"md\">With instrument ID: **1**</Badge>\n<br/>\n<Badge color=\"gray\" size=\"md\">Without instrument ID: **20**</Badge>\n"
        },
        "description": "Get open orders for the authenticated account.",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/iid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Orders response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrderData"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/balances": {
      "get": {
        "operationId": "getBalances",
        "summary": "Get Balances",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get asset balances for the authenticated account.",
        "responses": {
          "200": {
            "description": "Balances response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Balance"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/portfolio": {
      "get": {
        "operationId": "getPortfolio",
        "summary": "Get Portfolio",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get current portfolio snapshot including open positions, margin summary, and withdrawable balance.\n",
        "responses": {
          "200": {
            "description": "Portfolio response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Portfolio"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/fills": {
      "get": {
        "operationId": "getFills",
        "summary": "Get Fills",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "Get fill history for the authenticated account.\nIf no end time is provided, the current time will be used.\nMaximum of 100 entries returned per request.\nResults are ordered by time; use `sort` to choose newest-first (`desc`,\ndefault) or oldest-first (`asc`). To page through more than 100 fills,\npass the `cursor` returned by the previous page (keep `sort` consistent\nacross pages). Passing the trade ID of the last fill from the previous\npage is also still accepted.\n",
        "parameters": [
          {
            "name": "start_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/cursor"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fills response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountTrades"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/equity": {
      "get": {
        "operationId": "getEquityHistory",
        "summary": "Get Equity",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "Get equity history for the authenticated account.\nIf no end time is provided, the current time will be used.\nEach point is the last equity sample in its `interval` bucket, stamped with\nthat sample's own timestamp rather than the bucket's start — so every\ntimestamp falls within the requested window. Buckets are aligned to the\nUnix epoch.\nEquity history is served at one-minute resolution, so `1s` is served as\n`1m`.\nMaximum of 1000 entries returned per request — of buckets, so a coarser\ninterval covers a longer window before `more` is set. When `more` is true,\npage by re-requesting from one millisecond past the last timestamp\nreturned; that always lands on the next bucket, never back inside the one\njust served.\n",
        "parameters": [
          {
            "name": "interval",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/interval"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Equity history response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EquityHistory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/pnl": {
      "get": {
        "operationId": "getPnlHistory",
        "summary": "Get PnL",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "Get PnL history for the authenticated account.\nIf no end time is provided, the current time will be used.\nEach point is the PnL realized inside its `interval` bucket — not a running\ntotal. Buckets are aligned to the Unix epoch, and one in which nothing was\nrealized is omitted, so the series is sparse.\nA point is stamped with the last populated hour in its bucket, not with the\nbucket's start, so every returned timestamp falls within the requested\nwindow. Window bounds select whole one-hour rollup rows before coarser\nbuckets are formed.\nMaximum of 1000 entries returned per request — of buckets, so a coarser\ninterval covers a longer window before `more` is set. When `more` is true,\npage by re-requesting from one millisecond past the last timestamp\nreturned; that always lands on the next bucket, never back inside the one\njust served.\n",
        "parameters": [
          {
            "name": "interval",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/pnl_interval"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PnL history response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PnlHistory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/funding": {
      "get": {
        "operationId": "getAccountFunding",
        "summary": "Get Funding Charges",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "Get funding payment history for the authenticated account.\nIf no end time is provided, the current time will be used.\nMaximum of 100 entries returned per request.\n",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0,
              "maximum": 4294967295,
              "description": "Instrument ID"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account funding history response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountFundingHistory"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/withdraw": {
      "post": {
        "operationId": "withdraw",
        "summary": "Withdraw",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Submit a signed withdrawal request.\nRequires EOA signature, see [EOA signing](/http/signing#1-eoa-signing).\n\nThe `amount` field is the raw token amount including decimals (e.g. `\"100000000\"` for 100 USDC).\nThis must match the `uint256 amount` value used in the EIP-712 `Withdraw` signature.\n\nThe `ts` field is Unix seconds (not milliseconds) because the on-chain contract validates it\nagainst `block.timestamp`. It must also match the `uint64 ts` in the signed EIP-712 struct.\n",
        "requestBody": {
          "description": "Withdraw request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WithdrawRequest"
              },
              "examples": {
                "withdraw": {
                  "summary": "Withdraw 100 USDC",
                  "value": {
                    "op": {
                      "type": "withdraw",
                      "args": {
                        "account": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
                        "token": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
                        "amount": "100000000",
                        "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
                      }
                    },
                    "sig": "0x5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a1c",
                    "salt": 555555555,
                    "ts": 1767000014
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The accepted withdrawal, carrying its `withdraw_id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WithdrawAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "422": {
            "description": "The withdrawal was rejected on its merits (e.g. insufficient balance).\nThe body carries `withdraw_id` and `error`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WithdrawRejected"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/internal-transfer": {
      "post": {
        "operationId": "internalTransfer",
        "summary": "Internal Transfer",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Submit a signed internal ledger transfer between two exchange accounts.\nRequires proxy signature using the standard signed-op flow.\n",
        "requestBody": {
          "description": "Internal transfer request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InternalTransferRequest"
              },
              "examples": {
                "transfer": {
                  "summary": "Transfer USDC to another account",
                  "value": {
                    "op": {
                      "type": "internalTransfer",
                      "args": {
                        "account": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
                        "token": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
                        "amount": "100.00",
                        "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
                      }
                    },
                    "sig": "0x5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a1c",
                    "salt": 555555555,
                    "ts": 1767000014000,
                    "label": "ops-rebalance"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The accepted transfer, carrying its `transfer_id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalTransferAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "422": {
            "description": "The transfer was rejected on its merits (e.g. insufficient balance,\ntransfer to self). The body carries `transfer_id` and `error`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalTransferRejected"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/deposits": {
      "get": {
        "operationId": "getDeposits",
        "summary": "Get Deposits",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "Get deposit history for the authenticated account.\nIf no end time is provided, the current time will be used.\nMaximum of 100 entries returned per request.\n",
        "parameters": [
          {
            "name": "deposit_status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/deposit_status"
            }
          },
          {
            "name": "hash",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/hash"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deposit history response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deposits"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/internal-transfers": {
      "get": {
        "operationId": "getInternalTransfers",
        "summary": "Get Internal Transfers",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "Get settled internal transfer history for the authenticated account.\nReturns both inbound and outbound transfers.\n",
        "parameters": [
          {
            "name": "start_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Internal transfer history response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalTransfers"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/withdrawals": {
      "get": {
        "operationId": "getWithdrawals",
        "summary": "Get Withdrawals",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "Get withdrawal history for the authenticated account.\nIf no end time is provided, the current time will be used.\nMaximum of 100 entries returned per request.\n",
        "parameters": [
          {
            "name": "withdrawal_status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/withdrawal_status"
            }
          },
          {
            "name": "hash",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/hash"
            }
          },
          {
            "name": "start_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Withdrawal history response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Withdrawals"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/stats": {
      "get": {
        "operationId": "getAccountStats",
        "summary": "Get Account Stats",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get the authenticated account's 7-day trading stats (taker volume, maker volume,\naccount maker share, and entity maker share when applicable).\nStats are cached by UTC day and may be stale by up to 24 hours.\n",
        "responses": {
          "200": {
            "description": "Account stats response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountStats"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/limits": {
      "get": {
        "operationId": "getAccountLimits",
        "summary": "Get Account Limits",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get the authenticated account's effective rate-limit allowances for its current\nvolume-based tier: order-action rate, open-order cap, and the display-only\nmessages-per-minute figure. `open_orders` reflects the account's current live\nopen-order count; the rate-usage counters (`actions_per_minute`,\n`actions_burst`, and `reset`) are not tracked here and are reported as 0.\n",
        "responses": {
          "200": {
            "description": "Account limits response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountLimits"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/rewards": {
      "get": {
        "operationId": "getAccountRewards",
        "summary": "Get Account Rewards",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get per-instrument daily liquidity reward shares for the authenticated account.\nReward periods run from 12:00 UTC to 12:00 UTC and are labeled by their UTC end date.\nOI rewards pay 6% APR on the account's full daily average gross OI across all\ninstruments when the combined daily average gross OI of its rewards entity is\nat least $1M. Accounts without an entity mapping qualify independently.\nThe first reward period starts at 2026-07-06 12:00 UTC. If no date range is provided,\nthe latest computed reward period is returned.\n",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/date"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/start_date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_date"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account rewards response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRewards"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/config": {
      "get": {
        "operationId": "getConfig",
        "summary": "Get Instrument Config",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get per-instrument configuration (leverage and margin mode) for the authenticated account.",
        "parameters": [
          {
            "name": "instrument_id",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/instrument_id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Instrument config response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AccountConfig"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/auto-cancel": {
      "get": {
        "operationId": "getAutoCancel",
        "summary": "Get Auto-Cancel Status",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Get the current auto-cancel status for the authenticated account: the\narmed deadline, how many times the switch has fired today, and when the\ndaily counter resets.\n",
        "responses": {
          "200": {
            "description": "Auto-cancel status response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutoCancelStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/invite": {
      "post": {
        "operationId": "createAccountInvite",
        "summary": "Create Account Invite",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Create or return the authenticated account's primary invite code. The call\nis idempotent for accounts that already have a primary invite code.\n",
        "requestBody": {
          "description": "Empty invite creation request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInviteRequest"
              },
              "examples": {
                "createAccountInvite": {
                  "summary": "Create or get the authenticated account invite code",
                  "value": {}
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account invite response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateInviteResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/referral": {
      "get": {
        "operationId": "getAccountReferral",
        "summary": "Get Account Referral",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Get the authenticated account's invite code, parent referral code, direct\nreferral count, and fee share rate.\n",
        "responses": {
          "200": {
            "description": "Account referral response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountReferral"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      },
      "post": {
        "operationId": "applyReferral",
        "summary": "Apply Referral Code",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Apply a referral code to the authenticated account after signup. Accounts\ncan only apply a referral code if they do not already have one.\n",
        "requestBody": {
          "required": true,
          "description": "Referral code to apply.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountReferralRequest"
              },
              "examples": {
                "applyReferral": {
                  "summary": "Apply a referral code",
                  "value": {
                    "code": "ABC123"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Referral code accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/trade/margin": {
      "patch": {
        "operationId": "updateMargin",
        "summary": "Update Isolated Margin",
        "security": [],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge> <Badge color=\"gray\" size=\"md\">Action Weight: **1**</Badge>"
        },
        "description": "Adjust the signed collateral allocation for an existing isolated position.\nUse a positive amount to add margin and a negative amount to remove it.\nA removal may include unrealized isolated profit, but the resulting\nisolated position equity (allocation + unrealized PnL - settled funding)\nmust remain at or above the position's current required initial margin.\n\nBoth additions and removals are rejected while the account is in cross\nliquidation or the target isolated position is in isolated liquidation.\nAn isolated liquidation on another instrument does not block this request.\n\nCancel-only mode does not gate margin adjustments.\n\nRequires proxy signature, see [proxy signing](/http/signing#2-proxy-signing).\nGateway signature validation rejects a stale or future-skewed timestamp as\n`invalid signature`. A request that passes gateway validation can still fail\nsequencer freshness revalidation with\n`invalid_margin_signature_timestamp`. Reusing the exact signed request\nrejects with `signature_already_used`.\n",
        "requestBody": {
          "description": "Margin request.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MarginRequest"
              },
              "examples": {
                "addMargin": {
                  "summary": "Add margin to a position",
                  "value": {
                    "op": {
                      "type": "updateMargin",
                      "args": {
                        "iid": 1,
                        "amt": "100.00"
                      }
                    },
                    "sig": "0x7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d1c",
                    "salt": 444444444,
                    "ts": 1767000013000
                  }
                },
                "removeMargin": {
                  "summary": "Remove margin or unrealized isolated profit",
                  "value": {
                    "op": {
                      "type": "updateMargin",
                      "args": {
                        "iid": 1,
                        "amt": "-25.00"
                      }
                    },
                    "sig": "0x7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d1c",
                    "salt": 444444445,
                    "ts": 1767000013001
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generic response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "422": {
            "description": "Sequenced domain rejection. Stable errors include\n`position_not_found`, `invalid_margin_mode`,\n`invalid_margin_amount`, `insufficient_margin`,\n`account_liquidating`, `margin_below_required_initial`, and\n`signature_already_used`. `invalid_margin_signature_timestamp`\nspecifically indicates that sequencer freshness revalidation rejected\na request that passed gateway validation.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "description": "Internal server error or timeout. The outcome may be indeterminate if\nthe request was sequenced but its Risk decision did not reach the\ngateway before the timeout. Before retrying, refresh the position using\n`GET /v1/account/portfolio`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error500"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account/notifications": {
      "get": {
        "operationId": "getAccountNotifications",
        "summary": "Get Notifications",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "Get the authenticated account's notifications, newest first.\n\nResults come in pages. Pass the cursor returned by the previous page to\nfetch the next, older one. If your WebSocket connection dropped or you\nreceived a resync frame, pass since_seq to backfill anything you may have\nmissed; the same notification can show up again at the edges of the\nwindow, so deduplicate by id. While paging through a backfill, keep\nsending the same since_seq with each cursor so every page stays inside\nthe same window.\n\nThe response also includes your unread count and durable_source_seq, which\ntells you how far the notification store has caught up. If a backfill has\nnot yet reached your target sequence, wait briefly and retry with the same\nsince_seq.\n",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/notif_cursor"
            }
          },
          {
            "name": "since_seq",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/since_seq"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Notifications page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/account/notifications/read": {
      "post": {
        "operationId": "markAccountNotificationsRead",
        "summary": "Mark Notifications Read",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Mark notifications as read. Send a list of notification ids, or a before\ncursor to mark everything up to and including that point. You can only\nmark your own notifications.\n",
        "requestBody": {
          "required": true,
          "description": "The notifications to mark read.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationsReadRequest"
              },
              "examples": {
                "byIds": {
                  "summary": "Mark specific ids read",
                  "value": {
                    "ids": [
                      "0a5d8f1e-3b2c-5e4a-9f8b-1c2d3e4f5a6b"
                    ]
                  }
                },
                "beforeCursor": {
                  "summary": "Mark everything up to a cursor read",
                  "value": {
                    "before": "eyJ0cyI6MTc2NzIyNTYwMDAwMCwiaWQiOiIwYTVkOGYxZS0zYjJjLTVlNGEtOWY4Yi0xYzJkM2U0ZjVhNmIifQ"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Read markers accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/blp/enrollment": {
      "get": {
        "operationId": "getBlpEnrollment",
        "summary": "Get BLP Enrollment",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **2**</Badge>"
        },
        "description": "Get the authenticated account's Backstop Liquidity Provider (BLP) enrollment\nand the instruments it is subscribed to.\n\nThe endpoint is restricted to program participants: an authenticated account\nthat is not enrolled receives a 404, the same response as an account\nrequesting a route that does not exist for it. A participant that is enrolled\nbut not yet subscribed to any instrument receives an empty `instruments`\nlist.\n\nProgram membership is set by Polymarket under the participation agreement.\nSubscriptions are the participant's own to manage through\n`POST /v1/blp/enroll`; every subscribed instrument runs at the program\nleverage of 3x, which is locked while the subscription stands.\n",
        "responses": {
          "200": {
            "description": "BLP enrollment response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlpEnrollment"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "404": {
            "$ref": "#/components/responses/Error404Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/blp/enroll": {
      "post": {
        "operationId": "postBlpEnroll",
        "summary": "Set BLP Instrument Subscription",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **1**</Badge>"
        },
        "description": "Subscribe the authenticated Backstop Liquidity Provider (BLP) account to an\ninstrument, or unsubscribe it. A participant only receives backstop\nallocations on the instruments it is subscribed to.\n\nThe subscription always applies to the authenticated account — there is no\naccount parameter. Program membership itself is set by Polymarket under the\nparticipation agreement and cannot be changed here: an authenticated account\nthat is not enrolled receives a 404, matching\n`GET /v1/blp/enrollment`.\n\n**Subscribing sets the instrument's leverage to the program leverage of\n3x** before the subscription takes effect, and the instrument's leverage is\nthen locked for as long as the subscription stands — `PATCH\n/v1/trade/leverage` on a subscribed instrument rejects with\n`blp_leverage_locked`. The margin mode is left as it is. Unsubscribing\nreleases the lock and leaves the leverage at 3x; set it to whatever you\nwant afterwards.\n\nIf the leverage change is rejected (for example the instrument's risk tier\ncaps leverage below 3x), the subscription is not applied and the rejection\nis returned unchanged.\n\nThe call is idempotent — subscribing an already-subscribed instrument, or\nunsubscribing one that was never subscribed, succeeds and changes nothing.\nA repeated subscribe leaves the leverage as the first one set it.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlpEnrollRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subscription accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "404": {
            "$ref": "#/components/responses/Error404Response"
          },
          "422": {
            "$ref": "#/components/responses/Error422Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    },
    "/v1/blp/liquidations": {
      "get": {
        "operationId": "getBlpLiquidations",
        "summary": "List BLP Liquidations",
        "security": [
          {
            "polymarket_proxy": [],
            "polymarket_secret": []
          }
        ],
        "x-mint": {
          "content": "<Badge color=\"gray\" size=\"md\">Request Weight: **10**</Badge>"
        },
        "description": "List the backstop liquidations the authenticated Backstop Liquidity Provider (BLP)\naccount received, most recent first by default.\n\nEach record is one absorption and carries the same fields as a frame on the\n`backstop` WebSocket channel, so a participant that missed frames while\ndisconnected can replay them from here rather than reconstructing them from\ntrade history. Records do not identify the liquidated account.\n\n`margin` is the net margin transferred with the positions. It is negative when\nthe absorption carried bad debt — the fund returned more isolated margin than the\naccount's balance covered.\n\nLike the other BLP routes, this one is restricted to program participants: an\nauthenticated account that is not enrolled receives a 404, the same response as an\naccount requesting a route that does not exist for it.\n",
        "parameters": [
          {
            "name": "start_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/start_timestamp"
            }
          },
          {
            "name": "end_timestamp",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/end_timestamp"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/blp_cursor"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/blp_sort"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "BLP liquidation history.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlpLiquidations"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error400Response"
          },
          "401": {
            "$ref": "#/components/responses/Error401Response"
          },
          "404": {
            "$ref": "#/components/responses/Error404Response"
          },
          "429": {
            "$ref": "#/components/responses/Error429Response"
          },
          "500": {
            "$ref": "#/components/responses/Error500Response"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "polymarket_proxy": {
        "type": "apiKey",
        "name": "POLYMARKET-PROXY",
        "in": "header",
        "description": "Proxy address"
      },
      "polymarket_secret": {
        "type": "apiKey",
        "name": "POLYMARKET-SECRET",
        "in": "header",
        "description": "Correponding proxy secret"
      }
    },
    "schemas": {
      "error": {
        "type": "string",
        "description": "Error identifier. For domain rejections and transport errors (`401`/`404`/`429`/`500`) this is a stable, machine-readable snake_case identifier that is part of the API contract and safe to branch on, e.g. `insufficient_margin`, `insufficient_balance`, `order_not_found`, `reduce_only_invalid`, `price_outside_bounds`, `position_not_found`, `invalid_margin_mode`, `invalid_margin_amount`, `margin_below_required_initial`, `account_liquidating`, `unauthorized`, `not_found`. For `400` it is a human-readable validation detail whose wording may change. See the Error handling guide for the domain identifiers. (Post-only / Fill-or-Kill outcomes are order statuses such as `post_only_rejected`, not rejections.)",
        "example": "insufficient_margin"
      },
      "Error429": {
        "title": "Error429",
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "Error500": {
        "title": "Error500",
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "time": {
        "type": "integer",
        "description": "Timestamp in milliseconds",
        "example": 1767225600000
      },
      "Time": {
        "type": "object",
        "required": [
          "time"
        ],
        "properties": {
          "time": {
            "$ref": "#/components/schemas/time"
          }
        }
      },
      "name": {
        "type": "string",
        "description": "Exchange name used in the EIP-712 domain.",
        "example": "Polymarket"
      },
      "version": {
        "type": "string",
        "description": "Exchange version used in the EIP-712 domain.",
        "example": "1"
      },
      "chain_id": {
        "type": "integer",
        "format": "uint32",
        "description": "Chain ID of the network the exchange is deployed on.",
        "example": 137
      },
      "contract": {
        "type": "string",
        "description": "Verifying contract address or the EIP-712 domain.",
        "example": "0x1234567890abcdef1234567890abcdef12345678"
      },
      "cancel_only": {
        "type": "boolean",
        "description": "True while the exchange is in cancel-only (maintenance) mode — only order cancellation is accepted.",
        "example": false
      },
      "engine_version": {
        "type": "string",
        "description": "Engine release version of the build serving this response.",
        "example": "0.0.61"
      },
      "Exchange": {
        "type": "object",
        "required": [
          "name",
          "version",
          "chain_id",
          "contract",
          "cancel_only",
          "engine_version"
        ],
        "properties": {
          "name": {
            "$ref": "#/components/schemas/name"
          },
          "version": {
            "$ref": "#/components/schemas/version"
          },
          "chain_id": {
            "$ref": "#/components/schemas/chain_id"
          },
          "contract": {
            "$ref": "#/components/schemas/contract"
          },
          "cancel_only": {
            "$ref": "#/components/schemas/cancel_only"
          },
          "engine_version": {
            "$ref": "#/components/schemas/engine_version"
          }
        }
      },
      "asset": {
        "type": "string",
        "description": "Asset name",
        "example": "USDC"
      },
      "address": {
        "type": "string",
        "description": "Address",
        "example": "0x1234567890abcdef1234567890abcdef12345678"
      },
      "decimals": {
        "type": "integer",
        "description": "Asset decimals",
        "example": 6
      },
      "collateral_ratio": {
        "type": "string",
        "description": "Collateral ratio",
        "example": "1.00"
      },
      "withdrawal_fee": {
        "type": "string",
        "description": "Withdrawal transaction fee in decimalized asset units",
        "example": "5.00"
      },
      "Asset": {
        "type": "object",
        "required": [
          "asset",
          "address",
          "decimals",
          "collateral_ratio",
          "withdrawal_fee"
        ],
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/asset"
          },
          "address": {
            "$ref": "#/components/schemas/address"
          },
          "decimals": {
            "$ref": "#/components/schemas/decimals"
          },
          "collateral_ratio": {
            "$ref": "#/components/schemas/collateral_ratio"
          },
          "withdrawal_fee": {
            "$ref": "#/components/schemas/withdrawal_fee"
          }
        }
      },
      "instrument_id": {
        "type": "integer",
        "description": "Instrument ID"
      },
      "instrument_type": {
        "type": "string",
        "description": "Instrument type",
        "enum": [
          "perpetual"
        ]
      },
      "category": {
        "type": "string",
        "description": "Instrument category",
        "enum": [
          "equity",
          "commodity",
          "index",
          "crypto"
        ]
      },
      "isolated_only": {
        "type": "boolean",
        "description": "Whether the instrument supports only isolated account margin. When false, both cross and isolated account margin modes are supported."
      },
      "symbol": {
        "type": "string",
        "description": "Instrument symbol",
        "example": "NVDA-USDC"
      },
      "base_asset": {
        "type": "string",
        "description": "Base asset name",
        "example": "NVDA"
      },
      "quote_asset": {
        "type": "string",
        "description": "Quote asset name",
        "example": "USDC"
      },
      "funding_interval": {
        "type": "string",
        "description": "Funding interval",
        "example": "1h"
      },
      "quantity_decimals": {
        "type": "integer",
        "description": "Number of decimal places for quantity.",
        "example": 2
      },
      "price_decimals": {
        "type": "integer",
        "description": "Number of decimal places for price. Non-integer prices have a maximum of 5 significant figures; integer prices are allowed regardless of significant figures.",
        "example": 2
      },
      "price_bounds": {
        "type": "string",
        "description": "Price bounds percentage",
        "example": "0.05"
      },
      "liquidation_fee": {
        "type": "string",
        "description": "Liquidation fee rate",
        "example": "0.025"
      },
      "max_order_count": {
        "type": "integer",
        "description": "Maximum open order count",
        "example": 200
      },
      "min_notional": {
        "type": "string",
        "description": "Minimum notional value in USD",
        "example": "1.00"
      },
      "max_market_notional": {
        "type": "string",
        "description": "Maximum market order notional value in USD",
        "example": "1000000.00"
      },
      "max_limit_notional": {
        "type": "string",
        "description": "Maximum limit order notional value in USD",
        "example": "10000000.00"
      },
      "max_leverage": {
        "type": "integer",
        "description": "Maximum leverage",
        "example": 20
      },
      "lower_bound": {
        "type": "string",
        "description": "Position size lower bound",
        "example": "0"
      },
      "RiskTier": {
        "type": "object",
        "required": [
          "lower_bound",
          "max_leverage"
        ],
        "properties": {
          "lower_bound": {
            "$ref": "#/components/schemas/lower_bound"
          },
          "max_leverage": {
            "$ref": "#/components/schemas/max_leverage"
          }
        }
      },
      "ui_live_time": {
        "type": "integer",
        "nullable": true,
        "minimum": 0,
        "maximum": 253402300799000,
        "description": "Unix timestamp in milliseconds when first-party interfaces may display the instrument. A null value means hidden. This advisory field does not affect trading availability.",
        "example": 1786032000000
      },
      "Instrument": {
        "type": "object",
        "required": [
          "instrument_id",
          "instrument_type",
          "category",
          "isolated_only",
          "symbol",
          "base_asset",
          "quote_asset",
          "funding_interval",
          "quantity_decimals",
          "price_decimals",
          "price_bounds",
          "liquidation_fee",
          "max_order_count",
          "min_notional",
          "max_market_notional",
          "max_limit_notional",
          "max_leverage",
          "risk_tiers",
          "ui_live_time"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/instrument_id"
          },
          "instrument_type": {
            "$ref": "#/components/schemas/instrument_type"
          },
          "category": {
            "$ref": "#/components/schemas/category"
          },
          "isolated_only": {
            "$ref": "#/components/schemas/isolated_only"
          },
          "symbol": {
            "$ref": "#/components/schemas/symbol"
          },
          "base_asset": {
            "$ref": "#/components/schemas/base_asset"
          },
          "quote_asset": {
            "$ref": "#/components/schemas/quote_asset"
          },
          "funding_interval": {
            "$ref": "#/components/schemas/funding_interval"
          },
          "quantity_decimals": {
            "$ref": "#/components/schemas/quantity_decimals"
          },
          "price_decimals": {
            "$ref": "#/components/schemas/price_decimals"
          },
          "price_bounds": {
            "$ref": "#/components/schemas/price_bounds"
          },
          "liquidation_fee": {
            "$ref": "#/components/schemas/liquidation_fee"
          },
          "max_order_count": {
            "$ref": "#/components/schemas/max_order_count"
          },
          "min_notional": {
            "$ref": "#/components/schemas/min_notional"
          },
          "max_market_notional": {
            "$ref": "#/components/schemas/max_market_notional"
          },
          "max_limit_notional": {
            "$ref": "#/components/schemas/max_limit_notional"
          },
          "max_leverage": {
            "$ref": "#/components/schemas/max_leverage"
          },
          "risk_tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RiskTier"
            }
          },
          "ui_live_time": {
            "$ref": "#/components/schemas/ui_live_time"
          }
        }
      },
      "Error400": {
        "title": "Error400",
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "index_price": {
        "type": "string",
        "description": "Index price",
        "example": "100.00"
      },
      "mark_price": {
        "type": "string",
        "description": "Mark price",
        "example": "100.00"
      },
      "last_price": {
        "type": "string",
        "description": "Last traded price",
        "example": "100.00"
      },
      "mid_price": {
        "type": "string",
        "description": "Mid price",
        "example": "100.00"
      },
      "open_interest": {
        "type": "string",
        "description": "Open interest in number of contracts",
        "example": "10.00"
      },
      "funding_rate": {
        "type": "string",
        "description": "Funding rate",
        "example": "0.0001"
      },
      "next_funding": {
        "type": "integer",
        "description": "Next funding timestamp in milliseconds",
        "example": 1767225600000
      },
      "TickerData": {
        "type": "object",
        "required": [
          "instrument_id",
          "symbol",
          "index_price",
          "mark_price",
          "last_price",
          "mid_price",
          "open_interest",
          "funding_rate",
          "next_funding"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/instrument_id"
          },
          "symbol": {
            "$ref": "#/components/schemas/symbol"
          },
          "index_price": {
            "$ref": "#/components/schemas/index_price"
          },
          "mark_price": {
            "$ref": "#/components/schemas/mark_price"
          },
          "last_price": {
            "$ref": "#/components/schemas/last_price"
          },
          "mid_price": {
            "$ref": "#/components/schemas/mid_price"
          },
          "open_interest": {
            "$ref": "#/components/schemas/open_interest"
          },
          "funding_rate": {
            "$ref": "#/components/schemas/funding_rate"
          },
          "next_funding": {
            "$ref": "#/components/schemas/next_funding"
          }
        }
      },
      "timestamp": {
        "type": "integer",
        "description": "Timestamp in milliseconds",
        "example": 1767225600000
      },
      "Ticker": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TickerData"
          },
          {
            "type": "object",
            "required": [
              "timestamp"
            ],
            "properties": {
              "timestamp": {
                "$ref": "#/components/schemas/timestamp"
              }
            }
          }
        ]
      },
      "iid": {
        "type": "integer",
        "description": "Instrument ID",
        "example": 1
      },
      "volume": {
        "type": "string",
        "description": "24-hour trading volume in contracts",
        "example": "1000.00"
      },
      "open_price": {
        "type": "string",
        "description": "Opening price from 24 hours ago",
        "example": "100.50"
      },
      "kline": {
        "type": "array",
        "description": "- `1767225600000` - Open time\n- `\"100.00\"` - Open price\n- `\"105.00\"` - High price\n- `\"99.00\"` - Low price\n- `\"102.00\"` - Close price\n- `\"500.00\"` - Volume (base unit)\n- `42` - Number of trades\n",
        "example": [
          1767225600000,
          "100.00",
          "105.00",
          "99.00",
          "102.00",
          "500.00",
          42
        ]
      },
      "klines": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/kline"
        },
        "description": "Last 24-hour kline data"
      },
      "Statistic": {
        "type": "object",
        "required": [
          "instrument_id",
          "symbol",
          "volume",
          "open_price",
          "klines"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/iid"
          },
          "symbol": {
            "$ref": "#/components/schemas/symbol"
          },
          "volume": {
            "$ref": "#/components/schemas/volume"
          },
          "open_price": {
            "$ref": "#/components/schemas/open_price"
          },
          "klines": {
            "$ref": "#/components/schemas/klines"
          }
        }
      },
      "interval": {
        "type": "string",
        "description": "Kline interval",
        "enum": [
          "1s",
          "1m",
          "5m",
          "15m",
          "30m",
          "1h",
          "4h",
          "6h",
          "12h",
          "1d",
          "1w"
        ]
      },
      "start_timestamp": {
        "type": "integer",
        "description": "Start timestamp in milliseconds",
        "example": 1767225600000
      },
      "end_timestamp": {
        "type": "integer",
        "description": "End timestamp in milliseconds",
        "example": 1767229200000
      },
      "more": {
        "type": "boolean",
        "description": "More data available"
      },
      "KlinesResponse": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/kline"
            },
            "maxItems": 1000
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "MarkHistoryResponse": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/mark_point"
            },
            "maxItems": 1000
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "mark_point": {
        "type": "array",
        "description": "- `1767225600000` - Bucket open time (ms)\n- `\"160.00\"` - Last mark price in bucket\n",
        "example": [
          1767225600000,
          "160.00"
        ]
      },
      "best_bid_price": {
        "type": "string",
        "description": "Best bid price",
        "example": "99.50"
      },
      "best_bid_quantity": {
        "type": "string",
        "description": "Best bid quantity",
        "example": "10.00"
      },
      "best_ask_price": {
        "type": "string",
        "description": "Best ask price",
        "example": "100.50"
      },
      "best_ask_quantity": {
        "type": "string",
        "description": "Best ask quantity",
        "example": "10.00"
      },
      "ts": {
        "type": "integer",
        "description": "Request timestamp. Unix milliseconds for most operations; Unix seconds for withdrawals (must match the on-chain EIP-712 struct verified against block.timestamp).",
        "example": 1767225600000
      },
      "cancel_ts": {
        "type": "integer",
        "description": "Cancellation outcome timestamp in Unix milliseconds",
        "example": 1767225600000
      },
      "BBO": {
        "title": "BBO",
        "type": "object",
        "required": [
          "instrument_id",
          "bid_price",
          "bid_quantity",
          "ask_price",
          "ask_quantity",
          "timestamp"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/iid"
          },
          "bid_price": {
            "$ref": "#/components/schemas/best_bid_price"
          },
          "bid_quantity": {
            "$ref": "#/components/schemas/best_bid_quantity"
          },
          "ask_price": {
            "$ref": "#/components/schemas/best_ask_price"
          },
          "ask_quantity": {
            "$ref": "#/components/schemas/best_ask_quantity"
          },
          "timestamp": {
            "$ref": "#/components/schemas/ts"
          }
        }
      },
      "depth": {
        "type": "integer",
        "description": "Number of book levels to return",
        "enum": [
          10,
          100,
          500,
          1000
        ],
        "default": 100
      },
      "level": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "maxItems": 2,
        "description": "- `\"100.00\"` - Price\n- `\"10.00\"` - Quantity\n",
        "example": [
          "100.00",
          "10.00"
        ]
      },
      "sequence": {
        "type": "integer",
        "description": "Sequence number",
        "example": 1234567890
      },
      "Book": {
        "type": "object",
        "required": [
          "instrument_id",
          "bids",
          "asks",
          "timestamp",
          "sequence"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/instrument_id"
          },
          "bids": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/level"
            },
            "description": "Bid levels"
          },
          "asks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/level"
            },
            "description": "Ask levels"
          },
          "timestamp": {
            "$ref": "#/components/schemas/timestamp"
          },
          "sequence": {
            "$ref": "#/components/schemas/sequence"
          }
        }
      },
      "source": {
        "type": "string",
        "description": "Source name",
        "example": "chainlink"
      },
      "weight": {
        "type": "string",
        "description": "Index constituent weight",
        "example": "0.25"
      },
      "price": {
        "type": "string",
        "description": "Price",
        "example": "100.00"
      },
      "IndexConstituent": {
        "type": "object",
        "required": [
          "source",
          "symbol",
          "weight",
          "price"
        ],
        "properties": {
          "source": {
            "$ref": "#/components/schemas/source"
          },
          "symbol": {
            "$ref": "#/components/schemas/symbol"
          },
          "weight": {
            "$ref": "#/components/schemas/weight"
          },
          "price": {
            "$ref": "#/components/schemas/price"
          }
        }
      },
      "Index": {
        "type": "object",
        "required": [
          "asset",
          "index_price",
          "constituents",
          "ts"
        ],
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/asset"
          },
          "index_price": {
            "$ref": "#/components/schemas/index_price"
          },
          "constituents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IndexConstituent"
            }
          },
          "ts": {
            "$ref": "#/components/schemas/ts"
          }
        }
      },
      "tid": {
        "type": "integer",
        "description": "Trade ID",
        "example": 1
      },
      "side": {
        "type": "string",
        "description": "Side",
        "enum": [
          "long",
          "short"
        ]
      },
      "p": {
        "type": "string",
        "description": "Price",
        "example": "100.00"
      },
      "qty": {
        "type": "string",
        "description": "Quantity in no. of contracts",
        "example": "10.00"
      },
      "hash": {
        "type": "string",
        "description": "On-chain transaction hash, \"0x\" if not yet mined",
        "default": "0x",
        "example": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
      },
      "TradeData": {
        "type": "object",
        "required": [
          "trade_id",
          "instrument_id",
          "side",
          "price",
          "quantity",
          "timestamp",
          "hash"
        ],
        "properties": {
          "trade_id": {
            "$ref": "#/components/schemas/tid"
          },
          "instrument_id": {
            "$ref": "#/components/schemas/iid"
          },
          "side": {
            "$ref": "#/components/schemas/side"
          },
          "price": {
            "$ref": "#/components/schemas/p"
          },
          "quantity": {
            "$ref": "#/components/schemas/qty"
          },
          "timestamp": {
            "$ref": "#/components/schemas/ts"
          },
          "hash": {
            "$ref": "#/components/schemas/hash"
          }
        }
      },
      "Trades": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TradeData"
            },
            "description": "Public trades for the instrument"
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "size": {
        "type": "string",
        "description": "Signed position size in no. of contracts (positive = long, negative = short)",
        "example": "10.00"
      },
      "entry_price": {
        "type": "string",
        "description": "Average entry price",
        "example": "2986.30"
      },
      "unrealized_pnl": {
        "type": "string",
        "description": "Unrealized PnL in USD",
        "example": "-0.01"
      },
      "return_on_equity": {
        "type": "string",
        "description": "Unrealized PnL divided by the position's current required initial margin, as a decimal.",
        "example": "-0.0027"
      },
      "PublicPortfolioPosition": {
        "type": "object",
        "required": [
          "instrument_id",
          "symbol",
          "size",
          "entry_price",
          "unrealized_pnl",
          "return_on_equity"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/instrument_id"
          },
          "symbol": {
            "$ref": "#/components/schemas/symbol"
          },
          "size": {
            "$ref": "#/components/schemas/size"
          },
          "entry_price": {
            "$ref": "#/components/schemas/entry_price"
          },
          "unrealized_pnl": {
            "$ref": "#/components/schemas/unrealized_pnl"
          },
          "return_on_equity": {
            "$ref": "#/components/schemas/return_on_equity"
          }
        }
      },
      "equity": {
        "type": "string",
        "description": "Equity in USD",
        "example": "10000.00"
      },
      "update_timestamp": {
        "type": "integer",
        "description": "Update timestamp in milliseconds",
        "example": 1767225600000
      },
      "PublicPortfolio": {
        "type": "object",
        "required": [
          "positions",
          "equity",
          "timestamp"
        ],
        "properties": {
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicPortfolioPosition"
            }
          },
          "equity": {
            "$ref": "#/components/schemas/equity"
          },
          "timestamp": {
            "$ref": "#/components/schemas/update_timestamp"
          }
        }
      },
      "fr": {
        "type": "string",
        "description": "Funding rate",
        "example": "0.0001"
      },
      "FundingRate": {
        "type": "object",
        "required": [
          "funding_rate",
          "timestamp"
        ],
        "properties": {
          "funding_rate": {
            "$ref": "#/components/schemas/fr"
          },
          "timestamp": {
            "$ref": "#/components/schemas/ts"
          }
        }
      },
      "FundingHistory": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FundingRate"
            }
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "taker_fee_rate": {
        "type": "string",
        "description": "Taker fee rate",
        "example": "0.0002"
      },
      "maker_fee_rate": {
        "type": "string",
        "description": "Maker fee rate",
        "example": "-0.00005"
      },
      "min_volume_30d": {
        "type": "string",
        "description": "Minimum rolling 30-day notional volume in USD required for this tier",
        "example": "5000000"
      },
      "FeeTier": {
        "type": "object",
        "required": [
          "min_volume_30d",
          "taker_fee_rate",
          "maker_fee_rate"
        ],
        "properties": {
          "min_volume_30d": {
            "$ref": "#/components/schemas/min_volume_30d"
          },
          "taker_fee_rate": {
            "$ref": "#/components/schemas/taker_fee_rate"
          },
          "maker_fee_rate": {
            "$ref": "#/components/schemas/maker_fee_rate"
          }
        }
      },
      "FeeScheduleEntry": {
        "type": "object",
        "required": [
          "instrument_type",
          "category",
          "taker_fee_rate",
          "maker_fee_rate",
          "tiers"
        ],
        "properties": {
          "instrument_type": {
            "$ref": "#/components/schemas/instrument_type"
          },
          "category": {
            "$ref": "#/components/schemas/category"
          },
          "taker_fee_rate": {
            "$ref": "#/components/schemas/taker_fee_rate"
          },
          "maker_fee_rate": {
            "$ref": "#/components/schemas/maker_fee_rate"
          },
          "tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeeTier"
            }
          }
        }
      },
      "FeesInfo": {
        "type": "object",
        "required": [
          "fee_schedule"
        ],
        "properties": {
          "fee_schedule": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeeScheduleEntry"
            }
          }
        }
      },
      "min_volume": {
        "type": "string",
        "description": "Minimum volume threshold for this tier",
        "example": "0"
      },
      "rate_per_minute_limit": {
        "type": "integer",
        "description": "Maximum IP request weight per minute. In limit tiers, this is a legacy field and is not used for gateway enforcement.",
        "example": 1200
      },
      "rate_burst_limit": {
        "type": "integer",
        "description": "Legacy limit-tier request-rate field. It is not used for gateway enforcement."
      },
      "actions_per_minute_limit": {
        "type": "integer",
        "description": "Maximum order action tokens per account per minute",
        "example": 300
      },
      "actions_burst_limit": {
        "type": "integer",
        "description": "Additional account action allowance limit"
      },
      "open_orders_limit": {
        "type": "integer",
        "description": "Maximum number of open orders per account",
        "example": 1000
      },
      "messages_per_minute": {
        "type": "integer",
        "description": "Display-only per-minute action/message allowance, equal to actions_per_minute_limit. Not separately configured or enforced.",
        "example": 300
      },
      "LimitTier": {
        "type": "object",
        "required": [
          "min_volume_14d",
          "rate_per_minute_limit",
          "rate_burst_limit",
          "actions_per_minute_limit",
          "actions_burst_limit",
          "open_orders_limit",
          "messages_per_minute"
        ],
        "properties": {
          "min_volume_14d": {
            "$ref": "#/components/schemas/min_volume"
          },
          "rate_per_minute_limit": {
            "$ref": "#/components/schemas/rate_per_minute_limit"
          },
          "rate_burst_limit": {
            "$ref": "#/components/schemas/rate_burst_limit"
          },
          "actions_per_minute_limit": {
            "$ref": "#/components/schemas/actions_per_minute_limit"
          },
          "actions_burst_limit": {
            "$ref": "#/components/schemas/actions_burst_limit"
          },
          "open_orders_limit": {
            "$ref": "#/components/schemas/open_orders_limit"
          },
          "messages_per_minute": {
            "$ref": "#/components/schemas/messages_per_minute"
          }
        }
      },
      "code": {
        "type": "string",
        "description": "Referral or invite code",
        "example": "ABC123"
      },
      "InviteCheckResponse": {
        "type": "object",
        "required": [
          "valid"
        ],
        "properties": {
          "valid": {
            "type": "boolean",
            "description": "Whether the invite code can be used."
          },
          "error": {
            "type": "string",
            "description": "Present when the invite code is invalid or unusable."
          }
        }
      },
      "buy": {
        "type": "boolean",
        "description": "Is buy",
        "example": true
      },
      "tif": {
        "type": "string",
        "description": "Time in force",
        "enum": [
          "gtc",
          "ioc",
          "fok"
        ]
      },
      "po": {
        "type": "boolean",
        "description": "Post only",
        "default": false,
        "example": false
      },
      "ro": {
        "type": "boolean",
        "description": "Reduce only",
        "example": false,
        "default": false
      },
      "coid": {
        "type": "string",
        "description": "Client order ID",
        "minLength": 32,
        "maxLength": 32,
        "pattern": "^[0-9a-f]{32}$",
        "example": "550e8400e29b41d4a716446655440000"
      },
      "market": {
        "type": "boolean",
        "description": "Whether the trigger executes as a market order"
      },
      "trp": {
        "type": "string",
        "description": "Trigger price",
        "example": "110.00"
      },
      "tpsl": {
        "type": "string",
        "description": "Trigger type",
        "enum": [
          "tp",
          "sl"
        ]
      },
      "CreateOrder": {
        "type": "object",
        "required": [
          "iid",
          "buy",
          "qty"
        ],
        "properties": {
          "iid": {
            "$ref": "#/components/schemas/iid"
          },
          "buy": {
            "$ref": "#/components/schemas/buy"
          },
          "p": {
            "$ref": "#/components/schemas/p"
          },
          "qty": {
            "$ref": "#/components/schemas/qty"
          },
          "tif": {
            "$ref": "#/components/schemas/tif"
          },
          "po": {
            "$ref": "#/components/schemas/po"
          },
          "ro": {
            "$ref": "#/components/schemas/ro"
          },
          "c": {
            "$ref": "#/components/schemas/coid"
          },
          "tr": {
            "type": "object",
            "description": "Optional trigger attached to this order.",
            "properties": {
              "market": {
                "$ref": "#/components/schemas/market"
              },
              "trp": {
                "$ref": "#/components/schemas/trp"
              },
              "tpsl": {
                "$ref": "#/components/schemas/tpsl"
              }
            }
          }
        }
      },
      "grp": {
        "type": "string",
        "description": "TPSL grouping",
        "enum": [
          "order",
          "position"
        ]
      },
      "OpCreateOrders": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "createOrders"
            ]
          },
          "args": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateOrder"
            }
          },
          "grp": {
            "$ref": "#/components/schemas/grp"
          }
        }
      },
      "sig": {
        "type": "string",
        "description": "Signature in hex format",
        "example": "0x1234567890..."
      },
      "salt": {
        "type": "integer",
        "description": "Salt",
        "example": 1234567890
      },
      "BaseOp": {
        "type": "object",
        "required": [
          "sig",
          "salt",
          "ts"
        ],
        "properties": {
          "sig": {
            "$ref": "#/components/schemas/sig"
          },
          "salt": {
            "$ref": "#/components/schemas/salt"
          },
          "ts": {
            "$ref": "#/components/schemas/ts"
          }
        }
      },
      "exp": {
        "type": "integer",
        "description": "Command expiry timestamp in Unix milliseconds. If provided, it must be in the future and within the gateway's default command timeout. It can shorten request validity but cannot extend it. This is not an order auto-cancel time.",
        "example": 1767225600000
      },
      "OrderRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpCreateOrders"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          },
          {
            "type": "object",
            "properties": {
              "exp": {
                "$ref": "#/components/schemas/exp"
              }
            }
          }
        ]
      },
      "oid": {
        "type": "integer",
        "description": "Order ID",
        "example": 1234567890
      },
      "OrderAccepted": {
        "type": "object",
        "required": [
          "status",
          "oid"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "oid": {
            "$ref": "#/components/schemas/oid"
          },
          "coid": {
            "$ref": "#/components/schemas/coid",
            "description": "Echoed only when the request carried a client_order_id."
          }
        }
      },
      "OrderRejected": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/error"
          },
          "oid": {
            "$ref": "#/components/schemas/oid"
          },
          "coid": {
            "$ref": "#/components/schemas/coid"
          }
        }
      },
      "OrderResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/OrderAccepted"
          },
          {
            "$ref": "#/components/schemas/OrderRejected"
          }
        ]
      },
      "OpCancelOrders": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "cancelOrders"
            ]
          },
          "args": {
            "type": "array",
            "description": "Array of order IDs to cancel. Cancelling an order that has attached\ntake-profit / stop-loss children (see `CreateOrder.tr`) cascades to\nthose children — they are cancelled with reason `ParentCancelled`.\n",
            "items": {
              "$ref": "#/components/schemas/oid"
            }
          }
        }
      },
      "CancelRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpCancelOrders"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          },
          {
            "type": "object",
            "properties": {
              "exp": {
                "$ref": "#/components/schemas/exp"
              }
            }
          }
        ]
      },
      "CancelAccepted": {
        "type": "object",
        "required": [
          "status",
          "oid",
          "ts"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "oid": {
            "$ref": "#/components/schemas/oid"
          },
          "coid": {
            "$ref": "#/components/schemas/coid",
            "description": "Echoed only when the request carried a client_order_id."
          },
          "ts": {
            "$ref": "#/components/schemas/cancel_ts"
          }
        }
      },
      "CancelRejected": {
        "type": "object",
        "required": [
          "status",
          "error",
          "ts"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "oid": {
            "$ref": "#/components/schemas/oid"
          },
          "coid": {
            "$ref": "#/components/schemas/coid"
          },
          "error": {
            "$ref": "#/components/schemas/error"
          },
          "ts": {
            "$ref": "#/components/schemas/cancel_ts"
          }
        }
      },
      "CancelResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CancelAccepted"
          },
          {
            "$ref": "#/components/schemas/CancelRejected"
          }
        ]
      },
      "OpCancelAll": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "cancelAll"
            ]
          },
          "args": {
            "type": "object",
            "description": "Optional cancel scope. When `iid` is provided, only open orders for\nthat instrument are canceled. When omitted, all open orders for the\nsigning account are canceled.\n",
            "properties": {
              "iid": {
                "$ref": "#/components/schemas/iid"
              }
            }
          }
        }
      },
      "CancelAllRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpCancelAll"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          },
          {
            "type": "object",
            "properties": {
              "exp": {
                "$ref": "#/components/schemas/exp"
              }
            }
          }
        ]
      },
      "GenericAccepted": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          }
        }
      },
      "OpCancelOrdersByCoid": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "cancelOrdersCOID"
            ]
          },
          "args": {
            "type": "array",
            "description": "Array of client order IDs to cancel. Cancelling an order that has\nattached take-profit / stop-loss children (see `CreateOrder.tr`)\ncascades to those children — they are cancelled with reason\n`ParentCancelled`.\n",
            "items": {
              "$ref": "#/components/schemas/coid"
            }
          }
        }
      },
      "CancelByCoidRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpCancelOrdersByCoid"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          },
          {
            "type": "object",
            "properties": {
              "exp": {
                "$ref": "#/components/schemas/exp"
              }
            }
          }
        ]
      },
      "OpAutoCancel": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "autoCancel"
            ]
          },
          "args": {
            "type": "object",
            "required": [
              "time"
            ],
            "properties": {
              "time": {
                "$ref": "#/components/schemas/time"
              }
            }
          }
        }
      },
      "AutoCancelRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpAutoCancel"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          }
        ]
      },
      "auto_cancel_deadline": {
        "type": "integer",
        "description": "Deadline of the armed auto-cancel schedule, in Unix milliseconds. Zero\nmeans no schedule is armed. When the deadline passes, the exchange cancels\nevery open order on the account and the schedule clears.\n",
        "example": 1767000045000
      },
      "AutoCancelResponse": {
        "description": "The auto-cancel schedule now in effect. The deadline field echoes the\narmed time in Unix milliseconds, or 0 if you cleared the schedule.\n",
        "type": "object",
        "required": [
          "status",
          "deadline"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "deadline": {
            "$ref": "#/components/schemas/auto_cancel_deadline"
          }
        }
      },
      "Error404": {
        "title": "Error404",
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "Error408": {
        "title": "Error408",
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "Error413": {
        "title": "Error413",
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "GenericRejected": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "lev": {
        "type": "integer",
        "description": "Leverage",
        "example": 10
      },
      "cross": {
        "type": "boolean",
        "description": "Whether to use cross margin mode"
      },
      "OpUpdateLeverage": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "updateLeverage"
            ]
          },
          "args": {
            "type": "object",
            "required": [
              "iid",
              "lev",
              "cross"
            ],
            "properties": {
              "iid": {
                "$ref": "#/components/schemas/iid"
              },
              "lev": {
                "$ref": "#/components/schemas/lev"
              },
              "cross": {
                "$ref": "#/components/schemas/cross"
              }
            }
          }
        }
      },
      "LeverageRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpUpdateLeverage"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          }
        ]
      },
      "LeverageResponse": {
        "description": "The instrument's effective leverage configuration after the update.",
        "type": "object",
        "required": [
          "status",
          "instrument_id",
          "leverage",
          "cross"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "instrument_id": {
            "$ref": "#/components/schemas/iid"
          },
          "leverage": {
            "$ref": "#/components/schemas/lev"
          },
          "cross": {
            "$ref": "#/components/schemas/cross"
          }
        }
      },
      "OpUpdateLeveragesArgsItem": {
        "type": "object",
        "required": [
          "iid",
          "lev",
          "cross"
        ],
        "properties": {
          "iid": {
            "$ref": "#/components/schemas/iid"
          },
          "lev": {
            "$ref": "#/components/schemas/lev"
          },
          "cross": {
            "$ref": "#/components/schemas/cross"
          }
        }
      },
      "OpUpdateLeverages": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "updateLeverages"
            ]
          },
          "args": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/OpUpdateLeveragesArgsItem"
            }
          }
        }
      },
      "LeverageBatchRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpUpdateLeverages"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          }
        ]
      },
      "LeverageRejected": {
        "type": "object",
        "required": [
          "status",
          "instrument_id",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "instrument_id": {
            "$ref": "#/components/schemas/iid"
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "LeverageBatchResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/LeverageResponse"
          },
          {
            "$ref": "#/components/schemas/LeverageRejected"
          }
        ]
      },
      "owner": {
        "type": "string",
        "description": "Owner address in hex format",
        "example": "0x1234567890abcdef1234567890abcdef12345678"
      },
      "proxy": {
        "type": "string",
        "description": "Proxy address in hex format",
        "example": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
      },
      "expiry": {
        "type": "integer",
        "description": "Expiry timestamp in milliseconds",
        "example": 1767225600000
      },
      "OpCreateProxy": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "createProxy"
            ]
          },
          "args": {
            "type": "object",
            "required": [
              "owner",
              "proxy",
              "expiry"
            ],
            "properties": {
              "owner": {
                "$ref": "#/components/schemas/owner"
              },
              "proxy": {
                "$ref": "#/components/schemas/proxy"
              },
              "expiry": {
                "$ref": "#/components/schemas/expiry"
              }
            }
          }
        }
      },
      "label": {
        "type": "string",
        "description": "Human-readable label for a proxy key or internal transfer",
        "example": "trading-bot"
      },
      "ProxyRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpCreateProxy"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          },
          {
            "type": "object",
            "properties": {
              "label": {
                "$ref": "#/components/schemas/label"
              },
              "code": {
                "$ref": "#/components/schemas/code"
              }
            }
          }
        ]
      },
      "secret": {
        "type": "string",
        "description": "API secret",
        "example": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
      },
      "ProxyResponse": {
        "type": "object",
        "required": [
          "status",
          "secret"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "secret": {
            "$ref": "#/components/schemas/secret"
          }
        }
      },
      "OpDeleteProxy": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "deleteProxy"
            ]
          },
          "args": {
            "type": "object",
            "required": [
              "proxy"
            ],
            "properties": {
              "proxy": {
                "$ref": "#/components/schemas/proxy"
              }
            }
          }
        }
      },
      "DeleteProxyRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpDeleteProxy"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          }
        ]
      },
      "Key": {
        "type": "object",
        "required": [
          "proxy",
          "expiry"
        ],
        "properties": {
          "proxy": {
            "$ref": "#/components/schemas/proxy"
          },
          "label": {
            "$ref": "#/components/schemas/label"
          },
          "expiry": {
            "$ref": "#/components/schemas/expiry"
          }
        }
      },
      "Credentials": {
        "type": "object",
        "required": [
          "address",
          "keys"
        ],
        "properties": {
          "address": {
            "$ref": "#/components/schemas/address"
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Key"
            }
          }
        }
      },
      "Error401": {
        "title": "Error401",
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "order_id": {
        "type": "integer",
        "description": "Order ID"
      },
      "rest": {
        "type": "string",
        "description": "Resting quantity",
        "example": "9.00"
      },
      "fill": {
        "type": "string",
        "description": "Filled quantity",
        "example": "1.00"
      },
      "st": {
        "type": "string",
        "description": "Order status",
        "example": "open"
      },
      "cts": {
        "type": "integer",
        "description": "Create timestamp in milliseconds",
        "example": 1767225600000
      },
      "uts": {
        "type": "integer",
        "description": "Update timestamp in milliseconds",
        "example": 1767225600000
      },
      "kind": {
        "type": "string",
        "description": "Conditional order type (TakeProfit / StopLoss)",
        "enum": [
          "tp",
          "sl"
        ]
      },
      "tr_scope": {
        "type": "string",
        "description": "How the conditional order sizes itself.\n- `order` - child of a parent entry (bracket / OCO ladder). Quantity is required.\n- `position` - attached to an open position. v1 always closes the full position (`qty` must be `\"0\"`).\n",
        "enum": [
          "order",
          "position"
        ]
      },
      "parent_oid": {
        "type": "integer",
        "description": "Parent entry order id. Optional — omit it (do not send `0`) when the parent is created in the same request (inline `CreateOrder.tpsl` or `CreateTpSlArgs.parent`); the gateway auto-wires the child to it. Set it only to attach an order-scoped leg to an existing resting order. Inline `CreateOrder.tpsl` rejects a non-zero value; position-scoped legs carry no parent.",
        "example": 1234567890
      },
      "slip_bps": {
        "type": "integer",
        "minimum": 0,
        "maximum": 10000,
        "description": "Per-order market-trigger slippage cap in basis points. 0 = use the per-instrument default. Clamped to the instrument cap.",
        "example": 1000
      },
      "TpSlOrderFields": {
        "type": "object",
        "description": "TP/SL-specific fields surfaced alongside the regular order shape.",
        "required": [
          "kind",
          "scope",
          "trp"
        ],
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/kind"
          },
          "scope": {
            "$ref": "#/components/schemas/tr_scope"
          },
          "trp": {
            "$ref": "#/components/schemas/trp"
          },
          "parent_oid": {
            "$ref": "#/components/schemas/parent_oid"
          },
          "armed_qty": {
            "$ref": "#/components/schemas/qty",
            "description": "Quantity armed at attach time (OCO) or `\"0\"` for position-based (sized at trigger time)."
          },
          "slip_bps": {
            "$ref": "#/components/schemas/slip_bps"
          }
        }
      },
      "OrderData": {
        "type": "object",
        "required": [
          "order_id",
          "instrument_id",
          "buy",
          "price",
          "quantity",
          "tif",
          "post_only",
          "ro",
          "status",
          "resting_quantity",
          "filled_quantity",
          "created_timestamp",
          "updated_timestamp"
        ],
        "properties": {
          "order_id": {
            "$ref": "#/components/schemas/oid"
          },
          "instrument_id": {
            "$ref": "#/components/schemas/iid"
          },
          "buy": {
            "$ref": "#/components/schemas/buy"
          },
          "price": {
            "$ref": "#/components/schemas/p"
          },
          "quantity": {
            "$ref": "#/components/schemas/qty"
          },
          "tif": {
            "$ref": "#/components/schemas/tif"
          },
          "post_only": {
            "$ref": "#/components/schemas/po"
          },
          "ro": {
            "$ref": "#/components/schemas/ro"
          },
          "resting_quantity": {
            "$ref": "#/components/schemas/rest"
          },
          "filled_quantity": {
            "$ref": "#/components/schemas/fill"
          },
          "status": {
            "$ref": "#/components/schemas/st"
          },
          "created_timestamp": {
            "$ref": "#/components/schemas/cts"
          },
          "updated_timestamp": {
            "$ref": "#/components/schemas/uts"
          },
          "client_order_id": {
            "$ref": "#/components/schemas/coid"
          },
          "tpsl": {
            "$ref": "#/components/schemas/TpSlOrderFields",
            "description": "Conditional-order fields. Present only when the order is a TP/SL conditional order — `null`/omitted for regular orders."
          }
        }
      },
      "balance": {
        "type": "string",
        "description": "Total balance",
        "example": "10000.00"
      },
      "value": {
        "type": "string",
        "description": "USD value",
        "example": "10000.00"
      },
      "Balance": {
        "type": "object",
        "required": [
          "asset",
          "balance",
          "value"
        ],
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/asset"
          },
          "balance": {
            "$ref": "#/components/schemas/balance"
          },
          "value": {
            "$ref": "#/components/schemas/value"
          }
        }
      },
      "leverage": {
        "type": "integer",
        "description": "Leverage",
        "example": 10
      },
      "initial_margin": {
        "type": "string",
        "description": "Current collateral backing the position. For cross positions, this is\nthe required initial margin based on position size, mark price, the\napplicable risk tier, and configured leverage. For isolated positions,\nthis is the position's current equity: signed allocated margin plus\nunrealized PnL minus settled funding.\n\nThe legacy `initial_margin` name is retained for API compatibility;\n`margin` would more accurately describe the field.\n",
        "example": "10.00"
      },
      "maintenance_margin_amount": {
        "type": "string",
        "description": "Maintenance margin amount",
        "example": "100.00"
      },
      "position_value": {
        "type": "string",
        "description": "Notional position value in USD",
        "example": "100.03"
      },
      "liquidation_price": {
        "type": "string",
        "description": "Liquidation price",
        "example": "2866.27"
      },
      "cumulative_funding": {
        "type": "string",
        "description": "Cumulative funding paid/received in USD",
        "example": "514.09"
      },
      "PortfolioPosition": {
        "type": "object",
        "required": [
          "instrument_id",
          "symbol",
          "size",
          "entry_price",
          "leverage",
          "cross",
          "initial_margin",
          "maintenance_margin",
          "position_value",
          "liquidation_price",
          "unrealized_pnl",
          "return_on_equity",
          "cumulative_funding"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/instrument_id"
          },
          "symbol": {
            "$ref": "#/components/schemas/symbol"
          },
          "size": {
            "$ref": "#/components/schemas/size"
          },
          "entry_price": {
            "$ref": "#/components/schemas/entry_price"
          },
          "leverage": {
            "$ref": "#/components/schemas/leverage"
          },
          "cross": {
            "$ref": "#/components/schemas/cross"
          },
          "initial_margin": {
            "$ref": "#/components/schemas/initial_margin"
          },
          "maintenance_margin": {
            "$ref": "#/components/schemas/maintenance_margin_amount"
          },
          "position_value": {
            "$ref": "#/components/schemas/position_value"
          },
          "liquidation_price": {
            "$ref": "#/components/schemas/liquidation_price"
          },
          "unrealized_pnl": {
            "$ref": "#/components/schemas/unrealized_pnl"
          },
          "return_on_equity": {
            "$ref": "#/components/schemas/return_on_equity"
          },
          "cumulative_funding": {
            "$ref": "#/components/schemas/cumulative_funding"
          }
        }
      },
      "total_account_value": {
        "type": "string",
        "description": "Total account value in USD (equity + unrealized PnL)",
        "example": "13109.48"
      },
      "available_order_margin": {
        "type": "string",
        "description": "Collateral available in USD for additional order initial margin after existing exposure, open orders, orders and isolated-margin additions awaiting risk processing, and pending withdrawals or transfers",
        "example": "5055.79"
      },
      "total_initial_margin": {
        "type": "string",
        "description": "Total initial margin in use across all positions",
        "example": "4.97"
      },
      "total_maintenance_margin": {
        "type": "string",
        "description": "Total maintenance margin across all positions",
        "example": "2.49"
      },
      "total_position_value": {
        "type": "string",
        "description": "Total notional position value in USD",
        "example": "100.03"
      },
      "MarginSummary": {
        "type": "object",
        "required": [
          "total_account_value",
          "available_order_margin",
          "total_initial_margin",
          "total_maintenance_margin",
          "total_position_value"
        ],
        "properties": {
          "total_account_value": {
            "$ref": "#/components/schemas/total_account_value"
          },
          "available_order_margin": {
            "$ref": "#/components/schemas/available_order_margin"
          },
          "total_initial_margin": {
            "$ref": "#/components/schemas/total_initial_margin"
          },
          "total_maintenance_margin": {
            "$ref": "#/components/schemas/total_maintenance_margin"
          },
          "total_position_value": {
            "$ref": "#/components/schemas/total_position_value"
          }
        }
      },
      "withdrawable": {
        "type": "string",
        "description": "Withdrawable balance in USD",
        "example": "13104.51"
      },
      "in_liquidation": {
        "type": "boolean",
        "description": "Whether the account is currently under liquidation"
      },
      "Portfolio": {
        "type": "object",
        "required": [
          "positions",
          "margin",
          "withdrawable",
          "in_liquidation",
          "timestamp"
        ],
        "properties": {
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PortfolioPosition"
            }
          },
          "margin": {
            "$ref": "#/components/schemas/MarginSummary"
          },
          "withdrawable": {
            "$ref": "#/components/schemas/withdrawable"
          },
          "in_liquidation": {
            "$ref": "#/components/schemas/in_liquidation"
          },
          "timestamp": {
            "$ref": "#/components/schemas/update_timestamp"
          }
        }
      },
      "cursor": {
        "type": "string",
        "description": "Pagination cursor. Pass the opaque `cursor` returned by the previous page to fetch the next page. Paging follows the `sort` direction (strictly older fills when `sort=desc`, strictly newer when `sort=asc`). The trade ID of the last fill from the previous page is also accepted for backwards compatibility.",
        "example": "eyJ0cyI6MTc2NzIyNTYwMDAwMDAwMDAwMCwiaWQiOjF9"
      },
      "fills_cursor": {
        "type": "string",
        "description": "Opaque keyset pagination cursor for the next page of fills. Present while `more` is true; pass it as `cursor` on the next request, keeping the other parameters the same across pages.",
        "example": "eyJ0cyI6MTc2NzIyNTYwMDAwMDAwMDAwMCwiaWQiOjF9"
      },
      "sort": {
        "type": "string",
        "description": "Time sort direction. `desc` (default) returns newest fills first; `asc` returns oldest first.",
        "default": "desc",
        "enum": [
          "desc",
          "asc"
        ]
      },
      "taker": {
        "type": "boolean",
        "description": "Whether this side was the taker"
      },
      "fee": {
        "type": "string",
        "description": "Fee amount for this trade side",
        "example": "1.25"
      },
      "fea": {
        "type": "string",
        "description": "Fee asset name",
        "example": "USDC"
      },
      "psz": {
        "type": "string",
        "description": "Position size before the fill",
        "example": "26.86"
      },
      "pep": {
        "type": "string",
        "description": "Position entry price before the fill",
        "example": "100.00"
      },
      "pnl": {
        "type": "string",
        "description": "PnL in USD",
        "example": "100.00"
      },
      "liq": {
        "type": "boolean",
        "description": "Whether this fill was part of a liquidation of the account's position — true on forced closes and on any fill executed while the account was under liquidation on the instrument, maker or taker. False on the counterparty leg of an auto-deleveraging or backstop match — its fill is part of someone else's liquidation, flagged by `adl` where applicable"
      },
      "adl": {
        "type": "boolean",
        "description": "Whether the fill came from auto-deleveraging"
      },
      "AccountTradeData": {
        "type": "object",
        "required": [
          "trade_id",
          "order_id",
          "instrument_id",
          "side",
          "price",
          "quantity",
          "taker",
          "fee",
          "fee_asset",
          "previous_size",
          "previous_entry_price",
          "pnl",
          "timestamp",
          "liquidation",
          "adl",
          "hash"
        ],
        "properties": {
          "trade_id": {
            "$ref": "#/components/schemas/tid"
          },
          "order_id": {
            "$ref": "#/components/schemas/oid"
          },
          "instrument_id": {
            "$ref": "#/components/schemas/iid"
          },
          "side": {
            "$ref": "#/components/schemas/side"
          },
          "price": {
            "$ref": "#/components/schemas/p"
          },
          "quantity": {
            "$ref": "#/components/schemas/qty"
          },
          "taker": {
            "$ref": "#/components/schemas/taker"
          },
          "fee": {
            "$ref": "#/components/schemas/fee"
          },
          "fee_asset": {
            "$ref": "#/components/schemas/fea"
          },
          "previous_size": {
            "$ref": "#/components/schemas/psz"
          },
          "previous_entry_price": {
            "$ref": "#/components/schemas/pep"
          },
          "pnl": {
            "$ref": "#/components/schemas/pnl"
          },
          "liquidation": {
            "$ref": "#/components/schemas/liq"
          },
          "adl": {
            "$ref": "#/components/schemas/adl"
          },
          "timestamp": {
            "$ref": "#/components/schemas/ts"
          },
          "hash": {
            "$ref": "#/components/schemas/hash"
          }
        }
      },
      "AccountTrades": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountTradeData"
            },
            "description": "Account's trade history"
          },
          "more": {
            "$ref": "#/components/schemas/more"
          },
          "cursor": {
            "$ref": "#/components/schemas/fills_cursor"
          }
        }
      },
      "EquityHistory": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "description": "- `1767225600000` - Timestamp\n- `\"10000.00\"` - Equity\n",
            "items": {
              "type": "array",
              "example": [
                1767225600000,
                "10000.00"
              ]
            },
            "maxItems": 1000
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "pnl_interval": {
        "type": "string",
        "description": "PnL interval",
        "enum": [
          "1h",
          "4h",
          "1d",
          "1w"
        ]
      },
      "PnlHistory": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "description": "- `1767225600000` - Timestamp\n- `\"100.50\"` - PnL\n",
            "items": {
              "type": "array",
              "example": [
                1767225600000,
                "100.50"
              ]
            },
            "maxItems": 1000
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "sz": {
        "type": "string",
        "description": "Signed position size in no. of contracts (positive = long, negative = short)",
        "example": "10.00"
      },
      "fua": {
        "type": "string",
        "description": "Funding asset name",
        "example": "USDC"
      },
      "fund": {
        "type": "string",
        "description": "Funding paid in USD",
        "example": "1.00"
      },
      "fid": {
        "type": "integer",
        "description": "Funding payment ID. Probabilistically unique (same guarantees as trade IDs) and stable across REST and WebSocket for the same funding record.",
        "example": 3055723280187747
      },
      "AccountFundingData": {
        "type": "object",
        "required": [
          "id",
          "instrument_id",
          "size",
          "funding_rate",
          "funding_asset",
          "funding",
          "timestamp"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/fid"
          },
          "instrument_id": {
            "$ref": "#/components/schemas/iid"
          },
          "size": {
            "$ref": "#/components/schemas/sz"
          },
          "funding_rate": {
            "$ref": "#/components/schemas/fr"
          },
          "funding_asset": {
            "$ref": "#/components/schemas/fua"
          },
          "funding": {
            "$ref": "#/components/schemas/fund"
          },
          "timestamp": {
            "$ref": "#/components/schemas/ts"
          }
        }
      },
      "AccountFundingHistory": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountFundingData"
            }
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "account": {
        "type": "string",
        "description": "Account address in hex format",
        "example": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
      },
      "token": {
        "type": "string",
        "description": "Token contract address in hex format",
        "example": "0xaf88d065e77c8cc2239327c5edb3a432268e5831"
      },
      "amount": {
        "type": "string",
        "description": "Token amount in decimal units (e.g. \"100\" for 100 USDC).",
        "example": "100"
      },
      "op_amount": {
        "type": "string",
        "description": "Raw token amount in base units, matching the uint256 amount in the EIP-712 signature (e.g. \"100000000\" for 100 USDC with 6 decimals).",
        "example": "100000000"
      },
      "to": {
        "type": "string",
        "description": "Destination address in hex format",
        "example": "0x1234567890abcdef1234567890abcdef12345678"
      },
      "OpWithdraw": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "withdraw"
            ]
          },
          "args": {
            "type": "object",
            "required": [
              "account",
              "token",
              "amount",
              "to"
            ],
            "properties": {
              "account": {
                "$ref": "#/components/schemas/account"
              },
              "token": {
                "$ref": "#/components/schemas/token"
              },
              "amount": {
                "$ref": "#/components/schemas/op_amount"
              },
              "to": {
                "$ref": "#/components/schemas/to"
              }
            }
          }
        }
      },
      "WithdrawRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpWithdraw"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          }
        ]
      },
      "withdraw_id": {
        "type": "integer",
        "description": "Withdraw ID"
      },
      "WithdrawAccepted": {
        "type": "object",
        "required": [
          "status",
          "withdraw_id"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "withdraw_id": {
            "$ref": "#/components/schemas/withdraw_id"
          }
        }
      },
      "WithdrawRejected": {
        "type": "object",
        "required": [
          "status",
          "withdraw_id",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "withdraw_id": {
            "$ref": "#/components/schemas/withdraw_id"
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "OpInternalTransfer": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "internalTransfer"
            ]
          },
          "args": {
            "type": "object",
            "required": [
              "account",
              "token",
              "amount",
              "to"
            ],
            "properties": {
              "account": {
                "$ref": "#/components/schemas/account"
              },
              "token": {
                "$ref": "#/components/schemas/token"
              },
              "amount": {
                "$ref": "#/components/schemas/amount"
              },
              "to": {
                "$ref": "#/components/schemas/to"
              }
            }
          }
        }
      },
      "InternalTransferRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpInternalTransfer"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          },
          {
            "type": "object",
            "properties": {
              "label": {
                "$ref": "#/components/schemas/label"
              }
            }
          }
        ]
      },
      "transfer_id": {
        "type": "integer",
        "description": "Internal transfer ID"
      },
      "InternalTransferAccepted": {
        "type": "object",
        "required": [
          "status",
          "transfer_id"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "transfer_id": {
            "$ref": "#/components/schemas/transfer_id"
          }
        }
      },
      "InternalTransferRejected": {
        "type": "object",
        "required": [
          "status",
          "transfer_id",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "transfer_id": {
            "$ref": "#/components/schemas/transfer_id"
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "deposit_status": {
        "type": "string",
        "description": "Deposit status",
        "enum": [
          "pending",
          "confirmed",
          "removed"
        ]
      },
      "from": {
        "type": "string",
        "description": "Sender address in hex format",
        "example": "0x1234567890abcdef1234567890abcdef12345678"
      },
      "confirmations": {
        "type": "integer",
        "description": "Number of block confirmations",
        "example": 12
      },
      "required_confirmations": {
        "type": "integer",
        "description": "Required number of block confirmations",
        "example": 12
      },
      "created_timestamp": {
        "type": "integer",
        "description": "Creation timestamp in milliseconds",
        "example": 1767225600000
      },
      "confirmed_timestamp": {
        "type": "integer",
        "description": "Confirmation timestamp in milliseconds",
        "example": 1767225600000
      },
      "Deposit": {
        "type": "object",
        "required": [
          "hash",
          "asset",
          "amount",
          "status",
          "from",
          "to",
          "confirmations",
          "required_confirmations",
          "created_timestamp"
        ],
        "properties": {
          "hash": {
            "$ref": "#/components/schemas/hash"
          },
          "asset": {
            "$ref": "#/components/schemas/asset"
          },
          "amount": {
            "$ref": "#/components/schemas/amount"
          },
          "from": {
            "$ref": "#/components/schemas/from"
          },
          "to": {
            "$ref": "#/components/schemas/to"
          },
          "status": {
            "$ref": "#/components/schemas/deposit_status"
          },
          "confirmations": {
            "$ref": "#/components/schemas/confirmations"
          },
          "required_confirmations": {
            "$ref": "#/components/schemas/required_confirmations"
          },
          "created_timestamp": {
            "$ref": "#/components/schemas/created_timestamp"
          },
          "confirmed_timestamp": {
            "$ref": "#/components/schemas/confirmed_timestamp"
          }
        }
      },
      "Deposits": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Deposit"
            }
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "direction": {
        "type": "string",
        "description": "Transfer direction relative to the authenticated account",
        "enum": [
          "in",
          "out"
        ]
      },
      "counterparty": {
        "type": "string",
        "description": "Counterparty account address in hex format",
        "example": "0x1234567890abcdef1234567890abcdef12345678"
      },
      "InternalTransfer": {
        "type": "object",
        "required": [
          "transfer_id",
          "asset",
          "amount",
          "direction",
          "counterparty",
          "created_timestamp"
        ],
        "properties": {
          "transfer_id": {
            "$ref": "#/components/schemas/transfer_id"
          },
          "asset": {
            "$ref": "#/components/schemas/asset"
          },
          "amount": {
            "$ref": "#/components/schemas/amount"
          },
          "direction": {
            "$ref": "#/components/schemas/direction"
          },
          "counterparty": {
            "$ref": "#/components/schemas/counterparty"
          },
          "label": {
            "$ref": "#/components/schemas/label"
          },
          "created_timestamp": {
            "$ref": "#/components/schemas/created_timestamp"
          }
        }
      },
      "InternalTransfers": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InternalTransfer"
            }
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "withdrawal_status": {
        "type": "string",
        "description": "Withdrawal status",
        "enum": [
          "pending",
          "confirmed",
          "removed",
          "failed"
        ]
      },
      "Withdrawal": {
        "type": "object",
        "required": [
          "withdraw_id",
          "asset",
          "amount",
          "fee",
          "status",
          "to",
          "hash",
          "confirmations",
          "required_confirmations",
          "created_timestamp"
        ],
        "properties": {
          "withdraw_id": {
            "$ref": "#/components/schemas/withdraw_id"
          },
          "asset": {
            "$ref": "#/components/schemas/asset"
          },
          "amount": {
            "$ref": "#/components/schemas/amount"
          },
          "to": {
            "$ref": "#/components/schemas/to"
          },
          "fee": {
            "$ref": "#/components/schemas/withdrawal_fee"
          },
          "status": {
            "$ref": "#/components/schemas/withdrawal_status"
          },
          "hash": {
            "$ref": "#/components/schemas/hash"
          },
          "confirmations": {
            "$ref": "#/components/schemas/confirmations"
          },
          "required_confirmations": {
            "$ref": "#/components/schemas/required_confirmations"
          },
          "created_timestamp": {
            "$ref": "#/components/schemas/created_timestamp"
          },
          "confirmed_timestamp": {
            "$ref": "#/components/schemas/confirmed_timestamp"
          }
        }
      },
      "Withdrawals": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Withdrawal"
            }
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "volume_7d": {
        "type": "string",
        "description": "Rolling 7-day perpetual trading volume in USD",
        "example": "5000000"
      },
      "taker_volume_7d": {
        "type": "string",
        "description": "Rolling 7-day perpetual taker volume in USD",
        "example": "3500000"
      },
      "maker_volume_7d": {
        "type": "string",
        "description": "Rolling 7-day perpetual maker volume in USD",
        "example": "1500000"
      },
      "account_maker_share_7d": {
        "type": "string",
        "description": "Rolling 7-day account maker volume divided by total exchange volume",
        "example": "0.35"
      },
      "entity_maker_share_7d": {
        "type": "string",
        "description": "Rolling 7-day entity maker volume divided by total exchange volume",
        "example": "0.35"
      },
      "entity_id": {
        "type": "integer",
        "description": "Liquidity rewards entity ID",
        "example": 42
      },
      "entity_name": {
        "type": "string",
        "description": "Liquidity rewards entity name",
        "example": "desk"
      },
      "AccountStats": {
        "type": "object",
        "required": [
          "volume_7d",
          "taker_volume_7d",
          "maker_volume_7d",
          "account_maker_share_7d"
        ],
        "properties": {
          "volume_7d": {
            "$ref": "#/components/schemas/volume_7d"
          },
          "taker_volume_7d": {
            "$ref": "#/components/schemas/taker_volume_7d"
          },
          "maker_volume_7d": {
            "$ref": "#/components/schemas/maker_volume_7d"
          },
          "account_maker_share_7d": {
            "$ref": "#/components/schemas/account_maker_share_7d"
          },
          "entity_maker_share_7d": {
            "$ref": "#/components/schemas/entity_maker_share_7d"
          },
          "entity_id": {
            "$ref": "#/components/schemas/entity_id"
          },
          "entity_name": {
            "$ref": "#/components/schemas/entity_name"
          }
        }
      },
      "actions_per_minute": {
        "type": "integer",
        "description": "Order action tokens used by the account in the current minute",
        "example": 23
      },
      "actions_burst": {
        "type": "integer",
        "description": "Additional account action allowance remaining"
      },
      "open_orders": {
        "type": "integer",
        "description": "Current number of open orders",
        "example": 42
      },
      "rate_reset": {
        "type": "integer",
        "description": "Timestamp in milliseconds when the current interval resets",
        "example": 1767225660000
      },
      "AccountLimits": {
        "type": "object",
        "required": [
          "actions_per_minute",
          "actions_per_minute_limit",
          "actions_burst",
          "actions_burst_limit",
          "open_orders",
          "open_orders_limit",
          "reset",
          "messages_per_minute"
        ],
        "properties": {
          "actions_per_minute": {
            "$ref": "#/components/schemas/actions_per_minute"
          },
          "actions_per_minute_limit": {
            "$ref": "#/components/schemas/actions_per_minute_limit"
          },
          "actions_burst": {
            "$ref": "#/components/schemas/actions_burst"
          },
          "actions_burst_limit": {
            "$ref": "#/components/schemas/actions_burst_limit"
          },
          "open_orders": {
            "$ref": "#/components/schemas/open_orders"
          },
          "open_orders_limit": {
            "$ref": "#/components/schemas/open_orders_limit"
          },
          "reset": {
            "$ref": "#/components/schemas/rate_reset"
          },
          "messages_per_minute": {
            "$ref": "#/components/schemas/messages_per_minute"
          }
        }
      },
      "date": {
        "type": "string",
        "description": "UTC reward period end date in YYYY-MM-DD format",
        "example": "2026-05-10"
      },
      "start_date": {
        "type": "string",
        "description": "Inclusive UTC start date in YYYY-MM-DD format",
        "example": "2026-05-01"
      },
      "end_date": {
        "type": "string",
        "description": "Inclusive UTC end date in YYYY-MM-DD format",
        "example": "2026-05-10"
      },
      "limit": {
        "type": "integer",
        "description": "Maximum number of entries to return",
        "example": 100
      },
      "maker_share_7d": {
        "type": "string",
        "description": "Rolling 7-day account maker volume divided by total exchange volume",
        "example": "0.35"
      },
      "reward_distributed": {
        "type": "boolean",
        "description": "Whether rewards for this period have been marked as distributed",
        "example": true
      },
      "reward_pool": {
        "type": "string",
        "description": "Configured reward pool for the instrument",
        "example": "1000"
      },
      "reward_amount": {
        "type": "string",
        "description": "Reward amount attributed to this reward row",
        "example": "127.50344"
      },
      "AccountRewardInstrument": {
        "type": "object",
        "required": [
          "instrument_id",
          "reward_pool",
          "reward_amount"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/instrument_id"
          },
          "reward_pool": {
            "$ref": "#/components/schemas/reward_pool"
          },
          "reward_amount": {
            "$ref": "#/components/schemas/reward_amount"
          }
        }
      },
      "account_oi": {
        "type": "string",
        "description": "Daily average gross open-interest notional for this account across all instruments",
        "example": "3200000"
      },
      "AccountRewardOi": {
        "type": "object",
        "required": [
          "account_oi",
          "reward_amount"
        ],
        "properties": {
          "account_oi": {
            "$ref": "#/components/schemas/account_oi"
          },
          "reward_amount": {
            "$ref": "#/components/schemas/reward_amount"
          }
        }
      },
      "AccountReward": {
        "type": "object",
        "required": [
          "date",
          "maker_share_7d",
          "reward_distributed",
          "breakdown"
        ],
        "properties": {
          "date": {
            "$ref": "#/components/schemas/date"
          },
          "maker_share_7d": {
            "$ref": "#/components/schemas/maker_share_7d"
          },
          "reward_distributed": {
            "$ref": "#/components/schemas/reward_distributed"
          },
          "breakdown": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountRewardInstrument"
            }
          },
          "oi_rewards": {
            "$ref": "#/components/schemas/AccountRewardOi"
          }
        }
      },
      "AccountRewards": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountReward"
            }
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "AccountConfig": {
        "description": "Account configuration.",
        "type": "object",
        "required": [
          "instrument_id",
          "leverage",
          "cross"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/iid"
          },
          "leverage": {
            "$ref": "#/components/schemas/lev"
          },
          "cross": {
            "$ref": "#/components/schemas/cross"
          }
        }
      },
      "auto_cancel_triggered": {
        "type": "integer",
        "description": "Number of times auto-cancel has fired for this account during the\ncurrent UTC day. Resets to zero at 00:00 UTC.\n",
        "example": 0
      },
      "auto_cancel_daily_limit": {
        "type": "integer",
        "description": "Maximum number of auto-cancel triggers allowed per UTC day.\n",
        "example": 1000
      },
      "auto_cancel_next_reset": {
        "type": "integer",
        "description": "Unix-ms timestamp of the next UTC midnight when the daily trigger\ncount resets to zero.\n",
        "example": 1767052800000
      },
      "AutoCancelStatus": {
        "type": "object",
        "required": [
          "deadline",
          "triggered",
          "daily_limit",
          "next_reset"
        ],
        "properties": {
          "deadline": {
            "$ref": "#/components/schemas/auto_cancel_deadline"
          },
          "triggered": {
            "$ref": "#/components/schemas/auto_cancel_triggered"
          },
          "daily_limit": {
            "$ref": "#/components/schemas/auto_cancel_daily_limit"
          },
          "next_reset": {
            "$ref": "#/components/schemas/auto_cancel_next_reset"
          }
        }
      },
      "CreateInviteRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "CreateInviteResponse": {
        "type": "object",
        "required": [
          "status",
          "code",
          "referrals_available",
          "cooldown_ms"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "code": {
            "$ref": "#/components/schemas/code"
          },
          "referrals_available": {
            "type": "integer",
            "minimum": 0,
            "description": "Remaining lifetime referrals for this invite code."
          },
          "cooldown_ms": {
            "type": "integer",
            "nullable": true,
            "minimum": 0,
            "description": "Milliseconds until referrals become available again. Null for lifetime caps because no windowed cooldown applies."
          }
        }
      },
      "children_count": {
        "type": "integer",
        "description": "Number of directly referred child accounts",
        "example": 12
      },
      "active_children_count": {
        "type": "integer",
        "description": "Number of directly referred child accounts that have traded at least once since their referral was applied",
        "example": 8
      },
      "children_volume": {
        "type": "string",
        "description": "Total notional volume traded by directly referred child accounts since their referral was applied",
        "example": "125000.50"
      },
      "children_fees": {
        "type": "string",
        "description": "Total fees paid by directly referred child accounts since their referral was applied",
        "example": "312.75"
      },
      "referrals_left": {
        "type": "integer",
        "description": "Number of additional referrals remaining for this account's invite code",
        "example": 11
      },
      "fee_share_rate": {
        "type": "string",
        "description": "Referral fee share rate. Defaults to 0.2.",
        "example": "0.2"
      },
      "AccountReferral": {
        "type": "object",
        "required": [
          "code",
          "children_count",
          "active_children_count",
          "children_volume",
          "children_fees",
          "referrals_left",
          "fee_share_rate"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/code"
          },
          "parent": {
            "$ref": "#/components/schemas/code",
            "description": "Parent referral code, omitted when the account has no parent referral."
          },
          "children_count": {
            "$ref": "#/components/schemas/children_count"
          },
          "active_children_count": {
            "$ref": "#/components/schemas/active_children_count"
          },
          "children_volume": {
            "$ref": "#/components/schemas/children_volume"
          },
          "children_fees": {
            "$ref": "#/components/schemas/children_fees"
          },
          "referrals_left": {
            "$ref": "#/components/schemas/referrals_left"
          },
          "fee_share_rate": {
            "$ref": "#/components/schemas/fee_share_rate"
          }
        }
      },
      "AccountReferralRequest": {
        "type": "object",
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/code"
          }
        }
      },
      "MarginRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpUpdateMargin"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          }
        ]
      },
      "OpUpdateMargin": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "updateMargin"
            ]
          },
          "args": {
            "type": "object",
            "required": [
              "iid",
              "amt"
            ],
            "properties": {
              "iid": {
                "$ref": "#/components/schemas/iid"
              },
              "amt": {
                "$ref": "#/components/schemas/margin_amount"
              }
            }
          }
        }
      },
      "GenericResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/GenericAccepted"
          },
          {
            "$ref": "#/components/schemas/GenericRejected"
          }
        ]
      },
      "margin_amount": {
        "type": "string",
        "description": "Signed isolated-margin adjustment in the instrument quote asset. Positive values add allocation; negative values remove it.",
        "example": "100.00"
      },
      "notif_cursor": {
        "type": "string",
        "nullable": true,
        "description": "Opaque pagination cursor. Pass the next_cursor value from the previous page to fetch the next, older page. Null when there are no more pages.",
        "example": "eyJ0cyI6MTc2NzIyNTYwMDAwMCwiaWQiOiIwYTVkOGYxZS0zYjJjLTVlNGEtOWY4Yi0xYzJkM2U0ZjVhNmIifQ"
      },
      "since_seq": {
        "type": "integer",
        "description": "Backfill anchor for gap recovery. Pass the sequence number (sq) of the last notifications data frame you processed before the gap, never the sq of a resync frame. The bound is inclusive, so the response repeats the boundary event in full; deduplicate by notification id.",
        "example": 1043
      },
      "read_at": {
        "type": "integer",
        "nullable": true,
        "description": "When the recipient marked this notification read, Unix milliseconds; null if unread.",
        "example": 1767225600000
      },
      "NotificationItem": {
        "type": "object",
        "required": [
          "notification",
          "read_at",
          "ts"
        ],
        "properties": {
          "notification": {
            "type": "object",
            "description": "The notification payload. Fields vary by notification type; see the [Notifications channel](/api-reference/wss/perps-notifications) for the per-type shapes."
          },
          "read_at": {
            "$ref": "#/components/schemas/read_at"
          },
          "ts": {
            "$ref": "#/components/schemas/ts"
          }
        }
      },
      "unread": {
        "type": "integer",
        "description": "Count of the authenticated owner's unread notifications within the retention window.",
        "example": 3
      },
      "durable_source_seq": {
        "type": "integer",
        "description": "Highest notification sequence the store has persisted for your account. If it is still below the sequence you are catching up to, the store is lagging; retry the backfill until it catches up.",
        "example": 1043
      },
      "NotificationsResponse": {
        "type": "object",
        "required": [
          "items",
          "unread",
          "durable_source_seq",
          "has_more",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotificationItem"
            }
          },
          "unread": {
            "$ref": "#/components/schemas/unread"
          },
          "durable_source_seq": {
            "$ref": "#/components/schemas/durable_source_seq"
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether older notifications exist beyond this page."
          },
          "next_cursor": {
            "$ref": "#/components/schemas/notif_cursor"
          }
        }
      },
      "notif_id": {
        "type": "string",
        "description": "Stable notification id. The same notification always has the same id on the WebSocket feed and in the notifications history, so you can safely deduplicate across the two.",
        "example": "0a5d8f1e-3b2c-5e4a-9f8b-1c2d3e4f5a6b"
      },
      "NotificationsReadRequest": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "ids"
            ],
            "additionalProperties": false,
            "properties": {
              "ids": {
                "type": "array",
                "description": "Notification ids to mark read.",
                "items": {
                  "$ref": "#/components/schemas/notif_id"
                }
              }
            }
          },
          {
            "type": "object",
            "required": [
              "before"
            ],
            "additionalProperties": false,
            "properties": {
              "before": {
                "type": "string",
                "description": "Pagination cursor. Marks every notification at or before this point as read."
              }
            }
          }
        ]
      },
      "blp": {
        "type": "boolean",
        "description": "True when the account is enrolled in the Backstop Liquidity Provider program.",
        "example": true
      },
      "BlpInstrument": {
        "type": "object",
        "required": [
          "instrument_id",
          "symbol"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/instrument_id"
          },
          "symbol": {
            "$ref": "#/components/schemas/symbol"
          }
        }
      },
      "BlpEnrollment": {
        "type": "object",
        "required": [
          "blp",
          "instruments"
        ],
        "properties": {
          "blp": {
            "$ref": "#/components/schemas/blp"
          },
          "instruments": {
            "type": "array",
            "description": "Instruments the account is subscribed to, in ascending instrument-id\norder. Empty when the account is enrolled but not yet subscribed to\nany instrument.\n",
            "items": {
              "$ref": "#/components/schemas/BlpInstrument"
            }
          }
        }
      },
      "blp_active": {
        "type": "boolean",
        "description": "True subscribes the account to the instrument, false unsubscribes it.",
        "example": true
      },
      "BlpEnrollRequest": {
        "type": "object",
        "required": [
          "instrument_id",
          "active"
        ],
        "properties": {
          "instrument_id": {
            "$ref": "#/components/schemas/instrument_id"
          },
          "active": {
            "$ref": "#/components/schemas/blp_active"
          }
        }
      },
      "lid": {
        "type": "integer",
        "description": "Liquidation ID. Identifies one absorption of an account's positions by the insurance fund. Probabilistically unique (same guarantees as trade IDs).",
        "example": 1234567890
      },
      "mgn": {
        "type": "string",
        "description": "Net margin transferred to the insurance fund in USD, covering the quote asset only. Negative when the fund returned more isolated margin than the account's balance covered, i.e. it absorbed bad debt.",
        "example": "150.00"
      },
      "blp_cursor": {
        "type": "integer",
        "description": "Pagination cursor. Pass the liquidation ID of the last record from the previous page to fetch the next page. Paging follows the `sort` direction (strictly older records when `sort=desc`, strictly newer when `sort=asc`).",
        "example": 1234567890
      },
      "blp_sort": {
        "type": "string",
        "description": "Time sort direction. `desc` (default) returns the most recent liquidations first; `asc` returns the oldest first.",
        "default": "desc",
        "enum": [
          "desc",
          "asc"
        ]
      },
      "BlpLiquidationTrade": {
        "type": "object",
        "description": "One trade booked for a position absorbed in the liquidation.",
        "required": [
          "trade_id",
          "instrument_id",
          "side",
          "quantity",
          "price"
        ],
        "properties": {
          "trade_id": {
            "$ref": "#/components/schemas/tid"
          },
          "instrument_id": {
            "$ref": "#/components/schemas/iid"
          },
          "side": {
            "$ref": "#/components/schemas/side"
          },
          "quantity": {
            "$ref": "#/components/schemas/qty"
          },
          "price": {
            "$ref": "#/components/schemas/p"
          }
        }
      },
      "BlpLiquidation": {
        "type": "object",
        "description": "One absorption of an account's positions and margin, matching a single `backstop` WebSocket frame.",
        "required": [
          "liquidation_id",
          "timestamp",
          "cross",
          "margin",
          "trades"
        ],
        "properties": {
          "liquidation_id": {
            "$ref": "#/components/schemas/lid"
          },
          "timestamp": {
            "$ref": "#/components/schemas/ts"
          },
          "cross": {
            "$ref": "#/components/schemas/cross"
          },
          "margin": {
            "$ref": "#/components/schemas/mgn"
          },
          "trades": {
            "type": "array",
            "description": "Trades booked for the positions absorbed in this liquidation, in the order they were booked.",
            "items": {
              "$ref": "#/components/schemas/BlpLiquidationTrade"
            }
          }
        }
      },
      "BlpLiquidations": {
        "type": "object",
        "required": [
          "data",
          "more"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlpLiquidation"
            },
            "description": "Backstop liquidations the account received"
          },
          "more": {
            "$ref": "#/components/schemas/more"
          }
        }
      },
      "ModifyAccepted": {
        "type": "object",
        "required": [
          "status",
          "order"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "order": {
            "$ref": "#/components/schemas/Order"
          }
        }
      },
      "ModifyByCoidRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpModifyOrdersByCoid"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          },
          {
            "type": "object",
            "properties": {
              "exp": {
                "$ref": "#/components/schemas/exp"
              }
            }
          }
        ]
      },
      "ModifyOrder": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "oid",
          "p",
          "qty"
        ],
        "properties": {
          "oid": {
            "$ref": "#/components/schemas/oid"
          },
          "p": {
            "$ref": "#/components/schemas/p"
          },
          "qty": {
            "$ref": "#/components/schemas/qty"
          }
        }
      },
      "ModifyOrderByCoid": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "coid",
          "p",
          "qty"
        ],
        "properties": {
          "coid": {
            "$ref": "#/components/schemas/coid"
          },
          "p": {
            "$ref": "#/components/schemas/p"
          },
          "qty": {
            "$ref": "#/components/schemas/qty"
          }
        }
      },
      "ModifyRejected": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "err"
            ]
          },
          "oid": {
            "$ref": "#/components/schemas/oid"
          },
          "coid": {
            "$ref": "#/components/schemas/coid"
          },
          "error": {
            "$ref": "#/components/schemas/error"
          }
        }
      },
      "ModifyRequest": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "op"
            ],
            "properties": {
              "op": {
                "$ref": "#/components/schemas/OpModifyOrders"
              }
            }
          },
          {
            "$ref": "#/components/schemas/BaseOp"
          },
          {
            "type": "object",
            "properties": {
              "exp": {
                "$ref": "#/components/schemas/exp"
              }
            }
          }
        ]
      },
      "ModifyResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ModifyAccepted"
          },
          {
            "$ref": "#/components/schemas/ModifyRejected"
          }
        ]
      },
      "OpModifyOrders": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "modifyOrders"
            ]
          },
          "args": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/ModifyOrder"
            }
          }
        }
      },
      "OpModifyOrdersByCoid": {
        "type": "object",
        "required": [
          "type",
          "args"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "modifyOrdersCOID"
            ]
          },
          "args": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/ModifyOrderByCoid"
            }
          }
        }
      },
      "Order": {
        "type": "object",
        "required": [
          "oid",
          "iid",
          "buy",
          "p",
          "qty",
          "tif",
          "po",
          "ro",
          "status",
          "rest",
          "fill",
          "cts",
          "uts"
        ],
        "properties": {
          "oid": {
            "$ref": "#/components/schemas/oid"
          },
          "iid": {
            "$ref": "#/components/schemas/iid"
          },
          "buy": {
            "$ref": "#/components/schemas/buy"
          },
          "p": {
            "$ref": "#/components/schemas/p"
          },
          "qty": {
            "$ref": "#/components/schemas/qty"
          },
          "tif": {
            "$ref": "#/components/schemas/tif"
          },
          "po": {
            "$ref": "#/components/schemas/po"
          },
          "ro": {
            "$ref": "#/components/schemas/ro"
          },
          "rest": {
            "$ref": "#/components/schemas/rest"
          },
          "fill": {
            "$ref": "#/components/schemas/fill"
          },
          "cts": {
            "$ref": "#/components/schemas/cts"
          },
          "uts": {
            "$ref": "#/components/schemas/uts"
          },
          "status": {
            "$ref": "#/components/schemas/st"
          },
          "coid": {
            "$ref": "#/components/schemas/coid"
          }
        }
      }
    },
    "responses": {
      "Error429Response": {
        "description": "Too Many Requests. `error` distinguishes the limit that was hit:\n`ip_rate_limited` (per-IP token bucket), `action_rate_limited` (per-account\naction rate), or `open_orders_limit` (resting open-order cap).\n",
        "headers": {
          "Retry-After": {
            "description": "Whole seconds to wait before retrying. Present only on token-bucket\nrate-limit rejections (`ip_rate_limited` and `action_rate_limited`); a\nconservative estimate of when enough capacity will have refilled to\nadmit the request. Absent on `open_orders_limit`, which is a capacity\nlimit, not a rate limit — waiting does not free order slots; cancel\nresting orders or wait for fills instead.\n",
            "schema": {
              "type": "integer",
              "example": 2
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error429"
            }
          }
        }
      },
      "Error500Response": {
        "description": "Internal server error. `error` is `internal_error`.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error500"
            }
          }
        }
      },
      "Error400Response": {
        "description": "Bad request — the request was malformed or failed validation (bad query\nparameters, unparseable body, invalid signature, or a domain pre-check).\nThe `error` field is a human-readable validation detail.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error400"
            }
          }
        }
      },
      "BatchError400Response": {
        "description": "Bad request — the batch request was malformed or failed validation\n(unparseable body, invalid signature, or a domain pre-check). Request-level\nfailures are returned as a single rejected item so batch endpoints\nalways return an array. The `error` field is a human-readable validation\ndetail.\n",
        "content": {
          "application/json": {
            "schema": {
              "type": "array",
              "minItems": 1,
              "maxItems": 1,
              "items": {
                "$ref": "#/components/schemas/GenericRejected"
              }
            }
          }
        }
      },
      "BatchError429Response": {
        "description": "Too Many Requests. Request-level failures are returned as a single\nrejected item so batch endpoints always return an array. `error`\ndistinguishes the limit that was hit: `ip_rate_limited` (per-IP token\nbucket), `action_rate_limited` (per-account action rate), or\n`open_orders_limit` (resting open-order cap).\n",
        "headers": {
          "Retry-After": {
            "description": "Whole seconds to wait before retrying. Present only on token-bucket\nrate-limit rejections (`ip_rate_limited` and `action_rate_limited`); a\nconservative estimate of when enough capacity will have refilled to\nadmit the request. Absent on `open_orders_limit`, which is a capacity\nlimit, not a rate limit — waiting does not free order slots; cancel\nresting orders or wait for fills instead.\n",
            "schema": {
              "type": "integer",
              "example": 2
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "array",
              "minItems": 1,
              "maxItems": 1,
              "items": {
                "$ref": "#/components/schemas/GenericRejected"
              }
            }
          }
        }
      },
      "BatchError500Response": {
        "description": "Internal server error. Request-level failures are returned as a single\nrejected item so batch endpoints always return an array. `error` is\n`internal_error`.\n",
        "content": {
          "application/json": {
            "schema": {
              "type": "array",
              "minItems": 1,
              "maxItems": 1,
              "items": {
                "$ref": "#/components/schemas/GenericRejected"
              }
            }
          }
        }
      },
      "Error404Response": {
        "description": "Not found — the endpoint is disabled on this venue (e.g. auto-cancel) or\nthe route does not exist. `error` is `not_found`.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error404"
            }
          }
        }
      },
      "Error422Response": {
        "description": "Unprocessable Entity — the request was well-formed but a domain rule\nrejected it on its merits (insufficient balance, invalid leverage,\nproxy already exists, …). The body is the discriminated rejection\n(`status: err`) with the engine error identifier in `error`.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/GenericRejected"
            }
          }
        }
      },
      "Error401Response": {
        "description": "Unauthorized — missing or invalid `POLYMARKET-PROXY` / `POLYMARKET-SECRET`\ncredentials. `error` is `unauthorized`.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error401"
            }
          }
        }
      },
      "BatchError404Response": {
        "description": "Not found — the batch endpoint is disabled on this venue. Request-level\nfailures are returned as a single rejected item so batch endpoints always\nreturn an array. `error` is `not_found`.\n",
        "content": {
          "application/json": {
            "schema": {
              "type": "array",
              "minItems": 1,
              "maxItems": 1,
              "items": {
                "$ref": "#/components/schemas/GenericRejected"
              }
            }
          }
        }
      },
      "Error408Response": {
        "description": "Request Timeout — the request body was not delivered within the\ngateway's read deadline. Protects against slow uploads holding\nconnections open; send the complete body promptly and retry.\n`error` is `request_body_timeout`.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error408"
            }
          }
        }
      },
      "Error413Response": {
        "description": "Content Too Large — the request body exceeds the gateway's size cap,\njudged on the declared `Content-Length` or the actual stream. Split\noversized batches into smaller requests. `error` is\n`payload_too_large`.\n",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error413"
            }
          }
        }
      }
    }
  }
}
