{
  "openapi": "3.1.0",
  "info": {
    "title": "Tilt Hyperliquid Data API",
    "version": "1.0.0",
    "summary": "Live, structured data on every open position on Hyperliquid, read from our own node.",
    "description": "Tilt runs its own Hyperliquid node and turns the whole exchange into structured, queryable data:\nevery open position on every perp on every dex (native and HIP-3) with its size, leverage,\nliquidation price and PnL; every fill and liquidation as it happens, and every one since the\nindex began; every resting stop and take-profit; and derived views such as the liquidation map.\nData is typically under a second behind the chain. Every response says exactly how old it is.\n\n**Start here**\n1. `POST /v1/keys` with any identifier (an email, a name, a project). A key comes back immediately. It is free.\n2. Send it as `Authorization: Bearer <key>` on every other request.\n3. `GET /v1/markets` to see what exists, then `GET /v1/markets/BTC/positions` for the whole book.\n\n**Conventions**\n- One envelope: `{ \"data\": ..., \"as_of\": { \"block\", \"time\", \"lag_ms\" }, \"next\": cursor|null }`.\n- Sides are `long`/`short` on positions and `buy`/`sell` on orders. Never `A`/`B`.\n- Units live in field names: `size_coin`, `notional_usd`, `price_usd`, `leverage`, `*_pct` (0–100).\n- Times are ISO 8601 UTC. Blocks are Hyperliquid L1 block numbers.\n- Every derived number carries a `definition`.\n- Cursor pagination: pass `next` back as `?cursor=`.\n- One error shape: `{ \"error\": { \"code\", \"message\" } }`. Unknown or invalid query parameters are a `400`, never ignored.\n- Limits (free tier): 300 requests per minute and 20,000 per day per key, 3 stream connections, 1,000,000 stream messages a day. Every response carries `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` (seconds) and `X-Daily-Limit`, `X-Daily-Remaining`, `X-Daily-Reset` (seconds to 00:00 UTC). A `429` adds `Retry-After` and its `code` is `rate_limited` (per minute) or `daily_limit`. More is one request away: `POST /v1/limits/request`. A key turned off for abuse gets `403 key_revoked`.\n\n**Coverage** is measured, not assumed: `GET /v1/status` reports our positions against the exchange's\npublished open interest every minute, plus latency and the last spot check against the public API.\n",
    "contact": {
      "url": "https://tilt.markets/docs"
    },
    "license": {
      "name": "Terms",
      "url": "https://tilt.markets/docs#terms"
    }
  },
  "servers": [
    {
      "url": "https://api.tilt.markets/v1",
      "description": "Production"
    },
    {
      "url": "https://tilt.markets/v1",
      "description": "The same API through the website domain, one hop slower"
    }
  ],
  "tags": [
    {
      "name": "Stream",
      "description": "Push delivery of the same objects, over one WebSocket."
    },
    {
      "name": "Start",
      "description": "Discover the API and get a key."
    },
    {
      "name": "Markets",
      "description": "Everything about one market, live."
    },
    {
      "name": "Wallets",
      "description": "Everything about one wallet, live."
    },
    {
      "name": "History",
      "description": "What happened, by block or time."
    },
    {
      "name": "Status"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/": {
      "get": {
        "x-example": "/",
        "tags": [
          "Start"
        ],
        "operationId": "start",
        "summary": "Machine-readable start page",
        "description": "No key needed. Returns what this API is, how to get a key, and every endpoint with one example. Agents should call this first.",
        "security": [],
        "responses": {
          "200": {
            "description": "Start page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "get_a_key": {
                      "type": "string",
                      "description": "How to obtain a key in one request."
                    },
                    "docs": {
                      "type": "string",
                      "format": "uri"
                    },
                    "openapi": {
                      "type": "string",
                      "format": "uri"
                    },
                    "llms_txt": {
                      "type": "string",
                      "format": "uri"
                    },
                    "status": {
                      "type": "string",
                      "format": "uri",
                      "description": "The machine-readable status route."
                    },
                    "stream": {
                      "type": "string",
                      "description": "The WebSocket stream URL and its channels."
                    },
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "method": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "example": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/keys": {
      "post": {
        "x-example": "/keys",
        "tags": [
          "Start"
        ],
        "operationId": "createKey",
        "summary": "Create an API key",
        "description": "Free, instant, no verification. Any identifier works; it is only used so you can find your own keys later. Keep the key private.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "identifier"
                ],
                "properties": {
                  "identifier": {
                    "type": "string",
                    "description": "An email, a name, or a project. Anything.",
                    "example": "dev@example.com"
                  },
                  "contact": {
                    "type": "string",
                    "description": "Optional way to reach you about the key."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "example": "tilt_live_8f3a..."
                    },
                    "rate_limit": {
                      "type": "object",
                      "properties": {
                        "requests_per_minute": {
                          "type": "integer",
                          "example": 600
                        }
                      }
                    },
                    "usage": {
                      "type": "string",
                      "description": "Send as Authorization: Bearer <key>"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/limits/request": {
      "post": {
        "x-example": "/limits/request",
        "tags": [
          "Start"
        ],
        "operationId": "requestLimits",
        "summary": "Ask for higher limits",
        "description": "Every key starts on the free tier: 300 requests a minute, 20,000 a day, 3 stream connections\nwith 100 subscriptions each, 1,000,000 stream messages a day. Hit one and the `429` says which.\nTo go past it, send your key, an email and what you are building. A person reads it within\nminutes and replies to the email, usually within a day, with limits raised on the same key.\nNo form, no account, no card.\n",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "use_case"
                ],
                "properties": {
                  "key": {
                    "type": "string",
                    "description": "Your key, or send it as Authorization Bearer instead."
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "use_case": {
                    "type": "string",
                    "description": "A sentence or two on what you are building."
                  },
                  "requested": {
                    "type": "string",
                    "description": "What you need",
                    "e.g. \"5": null,
                    "000/min and 2M/day\".": null
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Recorded and delivered.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "current": {
                      "type": "object",
                      "description": "Your current limits."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/markets": {
      "get": {
        "x-example": "/markets",
        "tags": [
          "Markets"
        ],
        "operationId": "listMarkets",
        "summary": "Every market",
        "description": "Every perp on the native dex and on HIP-3 dexes, with live mark, funding, open interest and volume, followed by every spot pair with `type: spot` (id such as `@107`, symbol such as `HYPE/USDC`, supply and volume). Spot pairs have fills and order events under their id; balances are per wallet. Filter with `type`.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "perp",
                "spot"
              ]
            },
            "description": "Only perps, or only spot pairs. Default is both."
          }
        ],
        "responses": {
          "200": {
            "description": "Markets",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Market"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/tokens": {
      "get": {
        "x-example": "/tokens",
        "tags": [
          "Markets"
        ],
        "operationId": "listTokens",
        "summary": "Every spot token",
        "description": "Name, decimals, whether it is a canonical Hyperliquid token, and its HyperEVM contract when it has one. Spot pair ids map to tokens through `/markets?type=spot`.",
        "responses": {
          "200": {
            "description": "Tokens",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "index": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "size_decimals": {
                                "type": "integer"
                              },
                              "wei_decimals": {
                                "type": "integer"
                              },
                              "canonical": {
                                "type": "boolean"
                              },
                              "evm_contract": {
                                "type": "string",
                                "nullable": true
                              }
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/markets/{market}": {
      "get": {
        "x-example": "/markets/BTC",
        "tags": [
          "Markets"
        ],
        "operationId": "getMarket",
        "summary": "One market, live",
        "description": "Mark and mid price, hourly funding, open interest, 24h volume, max leverage and size decimals for one perp; supply and volume for one spot pair. Spot pairs resolve by id (`@107`) or symbol (`HYPE/USDC`).",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          }
        ],
        "responses": {
          "200": {
            "description": "Market",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Market"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/markets/{market}/positions": {
      "get": {
        "x-example": "/markets/BTC/positions?side=long&max_distance_to_liquidation_pct=5",
        "tags": [
          "Markets"
        ],
        "operationId": "listPositions",
        "summary": "Every open position in a market",
        "description": "The whole book for this market, one row per wallet, each within a second of its last fill.\nSorted by notional descending by default. Use filters to pull the slice you need:\n`side=long&max_distance_to_liquidation_pct=5` is \"longs that get liquidated on a 5% drop\".\nAdd `at=<time>` for the book as it was: positions from the newest hourly state snapshot at or\nbefore that time (size, entry and leverage; liquidation price and PnL are not in the state).\nWith `at`, the other filters do not apply and `cursor` pages by size.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          },
          {
            "name": "at",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "A time (ISO 8601 or epoch ms). Returns the book at the newest hourly snapshot at or before it."
          },
          {
            "name": "side",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "long",
                "short"
              ]
            },
            "description": "Only longs or only shorts."
          },
          {
            "name": "min_notional_usd",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Only positions at least this large at the mark."
          },
          {
            "name": "max_distance_to_liquidation_pct",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Only positions whose liquidation price is within this many percent of the mark."
          },
          {
            "name": "min_leverage",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Only positions at this leverage or higher."
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "notional_usd",
                "distance_to_liquidation_pct",
                "unrealized_pnl_usd"
              ],
              "default": "notional_usd"
            },
            "description": "Field to sort by."
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            },
            "description": "Sort direction."
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Positions",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Position"
                          }
                        },
                        "summary": {
                          "$ref": "#/components/schemas/PositionsSummary"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/markets/{market}/leverage": {
      "get": {
        "x-example": "/markets/BTC/leverage",
        "tags": [
          "Markets"
        ],
        "operationId": "getLeverage",
        "summary": "Open interest by leverage and by distance to liquidation",
        "description": "The market's open positions folded into buckets, long and short, by the leverage the trader set (1x to 3x, 3x to 5x, and so on) and by how far the mark must move to reach their liquidation price. Rebuilt every second from every position.",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          }
        ],
        "responses": {
          "200": {
            "description": "Leverage breakdown",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Leverage"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/markets/{market}/liquidation-map": {
      "get": {
        "x-example": "/markets/BTC/liquidation-map",
        "tags": [
          "Markets"
        ],
        "operationId": "getLiquidationMap",
        "summary": "Forced flow by price",
        "description": "Notional that gets liquidated at each 1% step from the mark, −30% to +30%. Longs liquidate below the mark, shorts above.",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          }
        ],
        "responses": {
          "200": {
            "description": "Liquidation map",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/LiquidationMap"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/markets/{market}/exit-orders": {
      "get": {
        "x-example": "/markets/BTC/exit-orders",
        "tags": [
          "Markets"
        ],
        "operationId": "getExitOrders",
        "summary": "Resting stops and take-profits by price",
        "description": "Declared exits: orders that would reduce an open position and state intent (trigger orders,\nreduce-only orders, position TP/SL). Plain limit quotes are not counted. Long stops sit below\nthe mark and long take-profits above; shorts are mirrored.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          }
        ],
        "responses": {
          "200": {
            "description": "Exit orders",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/ExitOrders"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/markets/{market}/book": {
      "get": {
        "x-example": "/markets/BTC/book",
        "tags": [
          "Markets"
        ],
        "operationId": "getBook",
        "summary": "The order book, twenty levels a side",
        "description": "Live from Hyperliquid's public feed for the largest markets (about the top sixty perps by open\ninterest and twenty spot pairs by volume; `/markets` shows `book: true` on those). This is the one\ndataset on the API served from Hyperliquid's servers rather than our node. Add `at=<time>` for the\nnewest stored snapshot at or before that time. Snapshots arrive about every three seconds and are\nkept thirty days.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          },
          {
            "name": "at",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "A time; returns the stored snapshot at or before it."
          }
        ],
        "responses": {
          "200": {
            "description": "Book",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Book"
                        },
                        "definition": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/markets/{market}/book-history": {
      "get": {
        "x-example": "/markets/BTC/book-history?limit=100",
        "tags": [
          "Markets"
        ],
        "operationId": "getBookHistory",
        "summary": "Mid, spread and depth per snapshot",
        "description": "One row per stored book snapshot, newest first, without the levels. For the levels at one moment use `/book?at=`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Book history",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "time": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "mid_price_usd": {
                                "type": "number"
                              },
                              "spread_bps": {
                                "type": "number"
                              },
                              "bid_depth_1pct_usd": {
                                "type": "number"
                              },
                              "ask_depth_1pct_usd": {
                                "type": "number"
                              }
                            }
                          }
                        },
                        "definition": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/markets/{market}/health": {
      "get": {
        "x-example": "/markets/BTC/health",
        "tags": [
          "Markets"
        ],
        "operationId": "getHealth",
        "summary": "PnL versus margin, both sides",
        "description": "How much of each side is bleeding or sitting on gains, relative to the margin backing it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          }
        ],
        "responses": {
          "200": {
            "description": "Health",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/MarketHealth"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{address}": {
      "get": {
        "x-example": "/wallets/0x5b5d51203a0f9079f8aeb098a6523a13f298c060",
        "tags": [
          "Wallets"
        ],
        "operationId": "getWallet",
        "summary": "One wallet, everything, live",
        "description": "Positions in every market, spot balances, open orders, vault equity and staking, read from the node the moment you ask.",
        "parameters": [
          {
            "$ref": "#/components/parameters/address"
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Wallet"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/wallets/{address}/positions": {
      "get": {
        "x-example": "/wallets/0x5b5d51203a0f9079f8aeb098a6523a13f298c060/positions",
        "tags": [
          "Wallets"
        ],
        "operationId": "getWalletPositions",
        "summary": "A wallet's open positions",
        "description": "Every open perp position of this address across every dex, read from the node the moment you ask, with size, entry, leverage, liquidation price and PnL. Add `at=<time>` for what it held at a past hour, from the state snapshots.",
        "parameters": [
          {
            "$ref": "#/components/parameters/address"
          }
        ],
        "responses": {
          "200": {
            "description": "Positions",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Position"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{address}/orders": {
      "get": {
        "x-example": "/wallets/0x5b5d51203a0f9079f8aeb098a6523a13f298c060/orders",
        "tags": [
          "Wallets"
        ],
        "operationId": "getWalletOrders",
        "summary": "A wallet's open orders",
        "description": "Resting orders across every market, including trigger orders, with price, size, type and reduce-only flags. Empty when the wallet has nothing resting.",
        "parameters": [
          {
            "$ref": "#/components/parameters/address"
          }
        ],
        "responses": {
          "200": {
            "description": "Orders",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Order"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/wallets/{address}/position-history": {
      "get": {
        "x-example": "/wallets/0x5b5d51203a0f9079f8aeb098a6523a13f298c060/position-history?market=BTC",
        "tags": [
          "Wallets"
        ],
        "operationId": "getWalletPositionHistory",
        "summary": "A wallet's positions hour by hour",
        "description": "One row per market per hourly state snapshot in which the wallet held a position, newest first. Size, entry price and leverage as the chain's state held them. `/wallets/{address}/positions?at=<time>` gives one moment; this gives the series.",
        "parameters": [
          {
            "$ref": "#/components/parameters/address"
          },
          {
            "name": "at",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "A time. Returns the wallet's positions at the newest hourly state snapshot at or before it."
          },
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this market."
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Position history",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/SnapshotPosition"
                          }
                        },
                        "definition": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/wallets/{address}/fills": {
      "get": {
        "x-example": "/wallets/0x5b5d51203a0f9079f8aeb098a6523a13f298c060/fills?from=2026-09-23",
        "tags": [
          "Wallets"
        ],
        "operationId": "getWalletFills",
        "summary": "A wallet's fill history",
        "description": "Every trade this address made, newest first, with realized PnL and fee on each, plus the fills\nwhere it was the liquidated party. Every wallet's history is served from the same index, built\nfrom the chain's own records, so it starts on the same date for everyone; `history.coverage`\ngives the start of each dataset (fills, funding, ledger, order events, TWAPs, snapshots).\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/address"
          },
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this market."
          },
          {
            "name": "liquidations_only",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Only the fills where this wallet was liquidated."
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "name": "since_block",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Only fills at or after this L1 block."
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Fills",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Fill"
                          }
                        },
                        "history": {
                          "$ref": "#/components/schemas/FillHistory"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/wallets/{address}/order-events": {
      "get": {
        "x-example": "/wallets/0x5b5d51203a0f9079f8aeb098a6523a13f298c060/order-events",
        "tags": [
          "Wallets"
        ],
        "operationId": "getWalletOrderEvents",
        "summary": "Every order event of a wallet",
        "description": "One row per order status transition the chain recorded for this address: `open`, `filled`,\n`canceled`, `triggered`, and the rejection codes (`badAloPxRejected`, `perpMarginRejected`, ...),\nnewest first, from the fill index. Kept for thirty days. This is the placement and cancel\nhistory that fills alone cannot show.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/address"
          },
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this market."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One status, e.g. `filled` or `canceled`."
          },
          {
            "name": "order_id",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Follow one order through its transitions."
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Order events",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/OrderEvent"
                          }
                        },
                        "history": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "Where the rows came from and how far back this wallet's history reaches."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/wallets/{address}/twaps": {
      "get": {
        "x-example": "/wallets/0x5b5d51203a0f9079f8aeb098a6523a13f298c060/twaps",
        "tags": [
          "Wallets"
        ],
        "operationId": "getWalletTwaps",
        "summary": "A wallet's TWAP orders, with their execution",
        "description": "Every TWAP order this wallet ran, newest last fill first, summed from its slices, on every market:\n22 March to 25 May 2025 and 2 August 2025 on (the chain did not mark TWAP slices in between).\nOrders placed since 2026-09-23 also carry their status from our node's TWAP stream. `from` and `to` select orders with a fill in the window.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/address"
          },
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this market."
          },
          {
            "name": "side",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "buy",
                "sell"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "TWAP orders",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Twap"
                          }
                        },
                        "definition": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/wallets/{address}/ledger": {
      "get": {
        "x-example": "/wallets/0x5b5d51203a0f9079f8aeb098a6523a13f298c060/ledger",
        "tags": [
          "Wallets"
        ],
        "operationId": "getWalletLedger",
        "summary": "Deposits, withdrawals, transfers and vault flows of a wallet",
        "description": "Every ledger entry where this address was either party, newest first: `deposit`, `withdraw`,\n`send`, `spotTransfer`, `internalTransfer`, `accountClassTransfer`, `subAccountTransfer`,\n`vaultDeposit`, `vaultWithdraw`, `vaultLeaderCommission`, `borrowLend`, `rewardsClaim`,\n`cStakingTransfer`, `Delegation`, `CDeposit`, `CWithdrawal`, and the rest as the chain names\nthem. Funding payments have their own route, `/wallets/{address}/funding`. `detail` carries\nthe raw event for fields a kind has that the columns do not.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/address"
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One kind, e.g. `deposit` or `withdraw`."
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Ledger entries",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/LedgerEntry"
                          }
                        },
                        "history": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "Where the rows came from and how far back this wallet's history reaches."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/markets/{market}/order-events": {
      "get": {
        "x-example": "/markets/BTC/order-events?status=filled",
        "tags": [
          "Markets"
        ],
        "operationId": "listMarketOrderEvents",
        "summary": "Order status events in a market",
        "description": "The market's order flow as status transitions, newest first. Filter by `status` to see only fills, only cancels, or only rejections. Kept for thirty days.",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One status, e.g. `filled`, `canceled`, `open`, or a rejection code."
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Order events",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/OrderEvent"
                          }
                        },
                        "history": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "Where the rows came from and how far back this wallet's history reaches."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/markets/{market}/twaps": {
      "get": {
        "x-example": "/markets/BTC/twaps?limit=20",
        "tags": [
          "Markets"
        ],
        "operationId": "listMarketTwaps",
        "summary": "TWAP orders in a market, with their execution",
        "description": "Every TWAP order that filled in this market, newest last fill first, summed from its slices:\nsize executed, notional, average price, fee, first and last fill, on every market, spot included:\n22 March to 25 May 2025 (from Hyperliquid's trades archive, without fee or PnL) and 2 August 2025\non, when the chain began stamping every fill with its TWAP order id. Slices between those dates\nwere not marked by the chain. Orders placed since 2026-09-23 also carry their status from our node's TWAP stream.\n`from` and `to` select orders with a fill in the window; the execution always covers the whole order.\n",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          },
          {
            "name": "side",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "buy",
                "sell"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "TWAP orders",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Twap"
                          }
                        },
                        "definition": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/wallets/{address}/funding": {
      "get": {
        "x-example": "/wallets/0x5b5d51203a0f9079f8aeb098a6523a13f298c060/funding",
        "tags": [
          "Wallets"
        ],
        "operationId": "getWalletFunding",
        "summary": "Every funding payment of a wallet",
        "description": "One row per market per hourly settlement, newest first, from the index. `amount_usd` is positive when the wallet received funding and negative when it paid.",
        "parameters": [
          {
            "$ref": "#/components/parameters/address"
          },
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this market."
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Funding payments",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "time": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "market": {
                                "type": "string"
                              },
                              "amount_usd": {
                                "type": "number"
                              },
                              "size_coin": {
                                "type": "number",
                                "description": "The signed position the payment was computed on."
                              },
                              "rate_hourly": {
                                "type": "number",
                                "description": "The funding rate applied; positive means longs paid shorts."
                              }
                            }
                          }
                        },
                        "history": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "Where the rows came from and how far back this wallet's history reaches."
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/markets/{market}/funding-history": {
      "get": {
        "x-example": "/markets/BTC/funding-history?limit=24",
        "tags": [
          "Markets"
        ],
        "operationId": "getMarketFundingHistory",
        "summary": "Hourly funding history of a market",
        "description": "One row per hourly settlement, newest first, computed from every settled position in the index. Reaches back to when the funding stream began.",
        "parameters": [
          {
            "$ref": "#/components/parameters/market"
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/limit"
          }
        ],
        "responses": {
          "200": {
            "description": "Funding history",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "time": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "rate_hourly": {
                                "type": "number"
                              },
                              "paid_by_longs_usd": {
                                "type": "number"
                              },
                              "positions_settled": {
                                "type": "integer"
                              }
                            }
                          }
                        },
                        "definition": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/twaps": {
      "get": {
        "x-example": "/twaps?status=active",
        "tags": [
          "History"
        ],
        "operationId": "listTwaps",
        "summary": "TWAP orders by status, from the node's TWAP stream",
        "description": "One row per TWAP order at its latest status, newest first, from our node's TWAP status stream\n(kept since 2026-09-23). `status=active` lists the orders running right now (activated and\nwith minutes left; TWAPs run up to 10,080 minutes), on every market or one market;\n`status=waiting` lists orders waiting for their trigger price; `finished`, `terminated`,\n`stopped` and `error` list orders that ended that way. Each row also carries the order's\nexecution summed from its fills and `completion_pct`. Orders placed before 2026-09-23 have no\nstatus; find them by market or wallet under `/markets/{market}/twaps` and `/wallets/{address}/twaps`.\n",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "waiting",
                "finished",
                "terminated",
                "stopped",
                "error"
              ]
            },
            "description": "Latest status. `active` means running now (Hyperliquid's own name for it is `activated`); `waiting` means waiting for its trigger price (`waitingForTrigger`)."
          },
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this market."
          },
          {
            "name": "wallet",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this wallet."
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "TWAP orders",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Twap"
                          }
                        },
                        "definition": {
                          "type": "string"
                        },
                        "note": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/twaps/flow": {
      "get": {
        "x-example": "/twaps/flow",
        "tags": [
          "History"
        ],
        "operationId": "getTwapFlow",
        "summary": "What running TWAPs still have to buy and sell, per market",
        "description": "Every TWAP running now, summed per market and side: how many, the size they still have to\ntrade (order size less what has filled), its value at the current mark, and the pace at which\nit reaches the book if every order runs to its end. `net_remaining_notional_usd` is buy less\nsell. Sorted by the size of the net, largest first. Live: statuses from our node within about\ntwo seconds, fills within about one.\n",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this market."
          }
        ],
        "responses": {
          "200": {
            "description": "Remaining TWAP flow per market",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "market": {
                                "type": "string"
                              },
                              "mark_price_usd": {
                                "type": "number",
                                "nullable": true
                              },
                              "buy": {
                                "$ref": "#/components/schemas/TwapFlowSide"
                              },
                              "sell": {
                                "$ref": "#/components/schemas/TwapFlowSide"
                              },
                              "net_remaining_notional_usd": {
                                "type": "number",
                                "nullable": true,
                                "description": "Buy less sell."
                              }
                            }
                          }
                        },
                        "definition": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/twaps/stats": {
      "get": {
        "x-example": "/twaps/stats?market=BTC&interval=1d",
        "tags": [
          "History"
        ],
        "operationId": "getTwapStats",
        "summary": "TWAP volume per hour or day, one market or all",
        "description": "TWAP slices per UTC hour or day: fills, distinct orders and wallets, notional bought and sold by\nTWAPs, and (for one market) size bought and sold. Buckets without TWAP fills are left out. At most\n1,000 buckets a call; defaults to the last 48 hours hourly or the last 30 days daily. Covers\n22 March to 25 May 2025 and 2 August 2025 on (the chain did not mark TWAP slices in between).\n",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only this market; all markets when left out."
          },
          {
            "name": "interval",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1h",
                "1d"
              ],
              "default": "1h"
            },
            "description": "Bucket size."
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          }
        ],
        "responses": {
          "200": {
            "description": "TWAP volume per bucket",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "time": {
                                "type": "string",
                                "format": "date-time",
                                "description": "Start of the bucket."
                              },
                              "fills": {
                                "type": "integer"
                              },
                              "twaps": {
                                "type": "integer",
                                "description": "Distinct TWAP orders with a fill in the bucket."
                              },
                              "wallets": {
                                "type": "integer"
                              },
                              "buy_notional_usd": {
                                "type": "number"
                              },
                              "sell_notional_usd": {
                                "type": "number"
                              },
                              "buy_size_coin": {
                                "type": "number",
                                "nullable": true,
                                "description": "One market only."
                              },
                              "sell_size_coin": {
                                "type": "number",
                                "nullable": true,
                                "description": "One market only."
                              }
                            }
                          }
                        },
                        "definition": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/twaps/{id}": {
      "get": {
        "x-example": "/twaps/2261178",
        "tags": [
          "History"
        ],
        "operationId": "getTwap",
        "summary": "One TWAP order, its status, its execution and every slice",
        "description": "The order by its id (the `twap_id` on fills): its latest status when our node saw it\n(since 2026-09-23), its execution summed from its fills, and every fill that belongs to it,\noldest first, up to 10,000. Fills from 22 March to 25 May 2025 come from Hyperliquid's trades\narchive, which has no fee, realized PnL or trade id; those fields are null, never zero.\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The TWAP order id."
          }
        ],
        "responses": {
          "200": {
            "description": "The TWAP order",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "allOf": [
                            {
                              "$ref": "#/components/schemas/Twap"
                            },
                            {
                              "properties": {
                                "fills": {
                                  "type": "array",
                                  "items": {
                                    "$ref": "#/components/schemas/Fill"
                                  }
                                }
                              }
                            }
                          ]
                        },
                        "definition": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/fills": {
      "get": {
        "x-example": "/fills?market=BTC",
        "tags": [
          "History"
        ],
        "operationId": "listFills",
        "summary": "Fills, newest first",
        "description": "Every fill, both wallets, with the position before each fill, the realized PnL and fee, and a\n`liquidation` block when it was one. The newest fills are served from memory. A `from`/`to`\nrange, a `wallet`, or a `since_block` older than memory is served from the fill index, which\nholds every fill on every market since `history.indexed_from`. Pass `since_block` to resume a\nlive feed from where you left off.\n",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One market id, e.g. BTC, xyz:GOLD, or a spot id or symbol."
          },
          {
            "name": "wallet",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Fills where this address was either side, or the liquidated party."
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "name": "since_block",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Only fills at or after this L1 block; the way to resume a feed without missing or repeating anything."
          },
          {
            "name": "liquidations_only",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Only fills that were liquidations."
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Fills",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Fill"
                          }
                        },
                        "history": {
                          "$ref": "#/components/schemas/FillHistory"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/liquidations": {
      "get": {
        "x-example": "/liquidations?market=BTC",
        "tags": [
          "History"
        ],
        "operationId": "listLiquidations",
        "summary": "Liquidations, newest first",
        "description": "Same records as `/fills` filtered to liquidations, every market, with the liquidated wallet and the mark it fired at. With no range, the last day; with `from`/`to`, any window back to when the index began.",
        "parameters": [
          {
            "name": "market",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "One market id. Omit for every market."
          },
          {
            "$ref": "#/components/parameters/from"
          },
          {
            "$ref": "#/components/parameters/to"
          },
          {
            "name": "since_block",
            "in": "query",
            "schema": {
              "type": "integer"
            },
            "description": "Only liquidations at or after this L1 block."
          },
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Liquidations",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Envelope"
                    },
                    {
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Fill"
                          }
                        },
                        "history": {
                          "$ref": "#/components/schemas/FillHistory"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/stream": {
      "get": {
        "x-example": "/stream",
        "tags": [
          "Stream"
        ],
        "operationId": "stream",
        "summary": "WebSocket stream of fills, liquidations, positions, orders, TWAPs, ledger, funding and books",
        "description": "Connect with a WebSocket client to `wss://api.tilt.markets/v1/stream?key=<key>` (or send the\nkey as `Authorization: Bearer`). Then send subscriptions as JSON:\n\n- `{\"op\":\"subscribe\",\"channel\":\"fills\",\"market\":\"BTC\"}` — every fill in a market as it lands.\n- `{\"op\":\"subscribe\",\"channel\":\"fills\",\"wallet\":\"0x...\"}` — a wallet's fills.\n- `{\"op\":\"subscribe\",\"channel\":\"fills\",\"market\":\"BTC\",\"since_block\":1162000000}` — replay the\n  tape from that block (messages carry `\"replay\": true`, then `{\"op\":\"replay_done\"}`), then live.\n- `{\"op\":\"subscribe\",\"channel\":\"liquidations\"}` — every liquidation on every market.\n- `{\"op\":\"subscribe\",\"channel\":\"positions\",\"market\":\"BTC\"}` — every position change the node\n  reads: opens, resizes, closes (`\"closed\": true`). Also by `wallet`.\n- `{\"op\":\"subscribe\",\"channel\":\"orders\",\"wallet\":\"0x...\"}` — order status events. Also by `market`.\n- `{\"op\":\"subscribe\",\"channel\":\"ledger\",\"wallet\":\"0x...\"}` — deposits, withdrawals, transfers.\n- `{\"op\":\"subscribe\",\"channel\":\"twaps\",\"market\":\"BTC\"}` — TWAP order status changes: placed,\n  finished, terminated, error. Also by `wallet`. Each message carries `twap_id`, `wallet`, `market`, `side` and `order`.\n- `{\"op\":\"subscribe\",\"channel\":\"funding\",\"market\":\"BTC\"}` — hourly settlements. Also by `wallet`.\n- `{\"op\":\"subscribe\",\"channel\":\"book\",\"market\":\"BTC\"}` — each book snapshot as it arrives, largest markets only.\n- `{\"op\":\"unsubscribe\", ...}` and `{\"op\":\"ping\"}`.\n\nEach message is `{\"channel\", \"market\"|\"wallet\", \"data\", \"as_of\"}` where `data` has exactly the\nshape the REST route for that object returns. The server pings every 20 seconds; a client that\nfalls more than 32 MB behind is disconnected with code 1008. The free tier allows 3 connections\nper key, 100 subscriptions per connection and 1,000,000 messages a day; `POST /v1/limits/request`\nfor more. The key goes in the URL or the Authorization header. A plain HTTP GET on this path returns 426.\n",
        "security": [],
        "responses": {
          "426": {
            "description": "Not a WebSocket upgrade.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/status": {
      "get": {
        "x-example": "/status",
        "tags": [
          "Status"
        ],
        "operationId": "getStatus",
        "summary": "Is the data complete and current right now?",
        "description": "Coverage against the exchange's open interest, node lag, last spot check against the public API, and whether the node is streaming. No key needed.",
        "security": [],
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Not wrapped in the envelope; this is the one response that is about the service itself.",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "True when every check is within bounds."
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Why `ok` is false, in plain words. Empty when ok."
                    },
                    "node_lag_s": {
                      "type": "number",
                      "nullable": true,
                      "description": "Age of the newest block our node has applied."
                    },
                    "coverage": {
                      "type": "object",
                      "description": "Our tracked notional against the open interest Hyperliquid publishes, per side, in percent, for the thirty largest markets by open interest.",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "long_pct": {
                            "type": "number"
                          },
                          "short_pct": {
                            "type": "number"
                          },
                          "open_interest_usd": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "coverage_summary": {
                      "type": "object",
                      "description": "The same measure across every market with open interest, weighted by open interest.",
                      "properties": {
                        "markets": {
                          "type": "integer"
                        },
                        "weighted_long_pct": {
                          "type": "number"
                        },
                        "weighted_short_pct": {
                          "type": "number"
                        },
                        "markets_below_98_pct": {
                          "type": "integer"
                        }
                      }
                    },
                    "markets": {
                      "type": "integer",
                      "description": "Perp markets known across every dex, delisted ones included."
                    },
                    "last_spot_check": {
                      "type": "object",
                      "nullable": true,
                      "properties": {
                        "pass_rate": {
                          "type": "number",
                          "description": "Fraction 0–1 of sampled wallets that matched the public API."
                        },
                        "checked": {
                          "type": "integer"
                        }
                      }
                    },
                    "fill_chain_gaps_1h": {
                      "type": "integer",
                      "nullable": true,
                      "description": "Fills in the last hour whose before-position did not chain from the previous fill. Zero is the bound."
                    },
                    "positions": {
                      "type": "integer",
                      "description": "Open positions tracked right now."
                    },
                    "holders": {
                      "type": "integer",
                      "description": "Wallets with at least one tracked position."
                    },
                    "fills_in_memory": {
                      "type": "integer"
                    },
                    "as_of": {
                      "$ref": "#/components/schemas/AsOf"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "The key from `POST /v1/keys`."
      }
    },
    "parameters": {
      "market": {
        "name": "market",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Market id as listed by `/markets`, e.g. `BTC`, a HIP-3 id like `xyz:XYZ100`, or a spot id like `@107` (a spot symbol like `HYPE/USDC` is accepted too).",
        "example": "BTC"
      },
      "address": {
        "name": "address",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^0x[0-9a-fA-F]{40}$"
        },
        "example": "0x5b5d51203a0f9079f8aeb098a6523a13f298c060"
      },
      "limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "default": 100
        }
      },
      "cursor": {
        "name": "cursor",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "The `next` value from the previous page. Opaque; do not construct one."
      },
      "from": {
        "name": "from",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "Start of the time range, inclusive. ISO 8601 (`2026-09-26T12:00:00Z`, or a date) or epoch milliseconds.",
        "example": "2026-09-26T00:00:00Z"
      },
      "to": {
        "name": "to",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "End of the time range, exclusive. Same formats as `from`."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "An unknown or invalid query parameter. The message names the parameter and what it accepts.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Rate limited. `Retry-After` says when.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "example": "not_found"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "AsOf": {
        "type": "object",
        "description": "How current the data is. `lag_ms` is the time between the newest chain block we hold and now.",
        "properties": {
          "block": {
            "type": "integer",
            "nullable": true,
            "example": 1159480000
          },
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "lag_ms": {
            "type": "integer",
            "example": 412
          }
        }
      },
      "Envelope": {
        "type": "object",
        "required": [
          "data",
          "as_of"
        ],
        "properties": {
          "data": {},
          "as_of": {
            "$ref": "#/components/schemas/AsOf"
          },
          "next": {
            "type": "string",
            "nullable": true,
            "description": "Cursor for the next page, or null."
          }
        }
      },
      "Market": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "BTC"
          },
          "type": {
            "type": "string",
            "enum": [
              "perp",
              "spot"
            ]
          },
          "dex": {
            "type": "string",
            "description": "Empty for the native dex, otherwise the HIP-3 dex name."
          },
          "mark_price_usd": {
            "type": "number"
          },
          "mid_price_usd": {
            "type": "number",
            "nullable": true
          },
          "funding_rate_hourly": {
            "type": "number",
            "description": "Fraction per hour. Positive means longs pay shorts."
          },
          "open_interest_coin": {
            "type": "number",
            "description": "Both sides summed, as Hyperliquid publishes it."
          },
          "open_interest_usd": {
            "type": "number",
            "description": "One side, at mark."
          },
          "volume_24h_usd": {
            "type": "number"
          },
          "max_leverage": {
            "type": "integer"
          },
          "size_decimals": {
            "type": "integer"
          },
          "tracked": {
            "type": "boolean",
            "description": "True when positions, exit orders and liquidation maps are available (every perp). False for spot pairs, which have fills and order events only."
          },
          "book": {
            "type": "boolean",
            "description": "True when the order book is followed for this market (the largest by open interest and spot volume)."
          },
          "symbol": {
            "type": "string",
            "description": "Spot only, e.g. HYPE/USDC."
          },
          "base_token": {
            "type": "string",
            "description": "Spot only."
          },
          "quote_token": {
            "type": "string",
            "description": "Spot only."
          },
          "prev_day_price_usd": {
            "type": "number",
            "description": "Spot only."
          },
          "volume_24h_base": {
            "type": "number",
            "description": "Spot only, in the base token."
          },
          "circulating_supply": {
            "type": "number",
            "description": "Spot only."
          },
          "total_supply": {
            "type": "number",
            "description": "Spot only."
          }
        }
      },
      "Position": {
        "type": "object",
        "properties": {
          "wallet": {
            "type": "string"
          },
          "market": {
            "type": "string"
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ]
          },
          "size_coin": {
            "type": "number",
            "description": "Absolute size in coin units."
          },
          "notional_usd": {
            "type": "number",
            "description": "size_coin × mark."
          },
          "leverage": {
            "type": "number"
          },
          "margin_mode": {
            "type": "string",
            "enum": [
              "cross",
              "isolated"
            ]
          },
          "entry_price_usd": {
            "type": "number",
            "nullable": true
          },
          "liquidation_price_usd": {
            "type": "number",
            "nullable": true,
            "description": "Null when the wallet cannot be liquidated at any positive price."
          },
          "distance_to_liquidation_pct": {
            "type": "number",
            "nullable": true,
            "description": "How far the mark must move against the position, in percent of mark."
          },
          "unrealized_pnl_usd": {
            "type": "number"
          },
          "margin_used_usd": {
            "type": "number"
          },
          "pnl_to_margin": {
            "type": "number",
            "nullable": true,
            "description": "unrealized_pnl_usd ÷ margin_used_usd. −0.5 means half the margin is lost."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this row last changed."
          }
        }
      },
      "PositionsSummary": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "long_notional_usd": {
            "type": "number"
          },
          "short_notional_usd": {
            "type": "number"
          },
          "coverage_long_pct": {
            "type": "number",
            "description": "Our long notional ÷ exchange open interest per side, ×100."
          },
          "coverage_short_pct": {
            "type": "number"
          }
        }
      },
      "Leverage": {
        "type": "object",
        "properties": {
          "buckets": {
            "type": "array",
            "description": "Notional by the leverage the trader set.",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "example": "21–40x"
                },
                "long_notional_usd": {
                  "type": "number"
                },
                "short_notional_usd": {
                  "type": "number"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "distance_bands": {
            "type": "array",
            "description": "Notional by distance to liquidation.",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "example": "Within 10%"
                },
                "long_notional_usd": {
                  "type": "number"
                },
                "short_notional_usd": {
                  "type": "number"
                },
                "long_count": {
                  "type": "integer"
                },
                "short_count": {
                  "type": "integer"
                }
              }
            }
          },
          "definition": {
            "type": "string"
          }
        }
      },
      "LiquidationMap": {
        "type": "object",
        "properties": {
          "mark_price_usd": {
            "type": "number"
          },
          "rungs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "from_pct": {
                  "type": "integer",
                  "description": "Lower edge of the rung relative to mark, e.g. −2 means −2% to −1%."
                },
                "price_from_usd": {
                  "type": "number"
                },
                "price_to_usd": {
                  "type": "number"
                },
                "long_notional_usd": {
                  "type": "number"
                },
                "short_notional_usd": {
                  "type": "number"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "beyond_range": {
            "type": "object",
            "properties": {
              "long_notional_usd": {
                "type": "number",
                "description": "Longs with liquidation below −30%."
              },
              "short_notional_usd": {
                "type": "number",
                "description": "Shorts with liquidation above +30%."
              }
            }
          },
          "definition": {
            "type": "string"
          }
        }
      },
      "ExitOrders": {
        "type": "object",
        "properties": {
          "mark_price_usd": {
            "type": "number"
          },
          "rungs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "from_pct": {
                  "type": "integer"
                },
                "long_stop_usd": {
                  "type": "number"
                },
                "long_take_profit_usd": {
                  "type": "number"
                },
                "short_stop_usd": {
                  "type": "number"
                },
                "short_take_profit_usd": {
                  "type": "number"
                }
              }
            }
          },
          "within_5_pct": {
            "type": "object",
            "properties": {
              "long_stops_usd": {
                "type": "number"
              },
              "long_take_profits_usd": {
                "type": "number"
              },
              "short_stops_usd": {
                "type": "number"
              },
              "short_take_profits_usd": {
                "type": "number"
              }
            }
          },
          "largest": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "wallet": {
                  "type": "string"
                },
                "side": {
                  "type": "string",
                  "enum": [
                    "long",
                    "short"
                  ]
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "stop",
                    "take_profit"
                  ]
                },
                "trigger_price_usd": {
                  "type": "number"
                },
                "distance_from_mark_pct": {
                  "type": "number"
                },
                "notional_usd": {
                  "type": "number"
                }
              }
            }
          },
          "holders_scanned": {
            "type": "integer"
          },
          "holders_with_exit_orders": {
            "type": "integer"
          },
          "definition": {
            "type": "string"
          }
        }
      },
      "MarketHealth": {
        "type": "object",
        "properties": {
          "buckets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "example": "lost 50–75%"
                },
                "long_notional_usd": {
                  "type": "number"
                },
                "short_notional_usd": {
                  "type": "number"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "trapped": {
            "type": "object",
            "description": "Notional that has lost more than half its margin.",
            "properties": {
              "long_notional_usd": {
                "type": "number"
              },
              "short_notional_usd": {
                "type": "number"
              },
              "long_pct_of_side": {
                "type": "number"
              },
              "short_pct_of_side": {
                "type": "number"
              }
            }
          },
          "definition": {
            "type": "string"
          }
        }
      },
      "Order": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string"
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ]
          },
          "type": {
            "type": "string",
            "example": "Stop Market"
          },
          "price_usd": {
            "type": "number",
            "description": "Trigger price for trigger orders, limit price otherwise."
          },
          "size_coin": {
            "type": "number"
          },
          "reduce_only": {
            "type": "boolean"
          },
          "is_trigger": {
            "type": "boolean"
          },
          "placed_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Wallet": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "account_value_usd": {
            "type": "number"
          },
          "margin_used_usd": {
            "type": "number"
          },
          "withdrawable_usd": {
            "type": "number"
          },
          "positions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Position"
            }
          },
          "orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Order"
            }
          },
          "spot_balances": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "token": {
                  "type": "string"
                },
                "total": {
                  "type": "number"
                },
                "hold": {
                  "type": "number"
                }
              }
            }
          },
          "vault_equities": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "vault": {
                  "type": "string"
                },
                "equity_usd": {
                  "type": "number"
                }
              }
            }
          },
          "staking": {
            "type": "object",
            "properties": {
              "delegated": {
                "type": "number"
              },
              "undelegated": {
                "type": "number"
              },
              "pending_withdrawal": {
                "type": "number"
              }
            }
          }
        }
      },
      "FillHistory": {
        "type": "object",
        "description": "Where this page came from and how far back the fill index reaches.",
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "memory",
              "index"
            ],
            "description": "memory is the live tape, index is the fill index on disk."
          },
          "fills_in_memory": {
            "type": "integer"
          },
          "indexed_from": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "The oldest fill in the index. Every fill on every market since then is queryable."
          },
          "indexed_fills": {
            "type": "integer"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Fill": {
        "type": "object",
        "properties": {
          "block": {
            "type": "integer"
          },
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "market": {
            "type": "string"
          },
          "wallet": {
            "type": "string"
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ]
          },
          "price_usd": {
            "type": "number"
          },
          "size_coin": {
            "type": "number"
          },
          "position_before_coin": {
            "type": "number",
            "description": "Signed position before this fill."
          },
          "position_after_coin": {
            "type": "number"
          },
          "direction": {
            "type": "string",
            "example": "Open Long"
          },
          "realized_pnl_usd": {
            "type": "number",
            "nullable": true
          },
          "fee_usd": {
            "type": "number",
            "nullable": true,
            "description": "Negative is a rebate."
          },
          "taker": {
            "type": "boolean",
            "nullable": true,
            "description": "True when this side crossed the book."
          },
          "tx_hash": {
            "type": "string",
            "nullable": true
          },
          "trade_id": {
            "type": "integer",
            "nullable": true
          },
          "twap_id": {
            "type": "integer",
            "nullable": true,
            "description": "The TWAP order this fill is a slice of, when it is one; see /twaps/{id}. Stamped by the chain since 2 August 2025; TWAP slices from 22 March to 25 May 2025 carry it under /twaps."
          },
          "liquidation": {
            "type": "object",
            "nullable": true,
            "properties": {
              "liquidated_wallet": {
                "type": "string"
              },
              "mark_price_usd": {
                "type": "number"
              },
              "method": {
                "type": "string"
              }
            }
          }
        }
      },
      "Twap": {
        "type": "object",
        "description": "A TWAP order: Hyperliquid slices it and sends a piece to the book every 30 seconds until the size or the minutes run out (up to 10,080 minutes). `order` is its latest status from our node's TWAP stream (since 2026-09-23); `execution` is summed from its fills (22 March to 25 May 2025, and 2 August 2025 on). Either is null when that source does not know the order.",
        "properties": {
          "twap_id": {
            "type": "integer"
          },
          "wallet": {
            "type": "string"
          },
          "market": {
            "type": "string"
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ]
          },
          "order": {
            "type": "object",
            "nullable": true,
            "properties": {
              "status": {
                "type": "string",
                "description": "waitingForTrigger, activated (running), finished, terminated, stopped, or error."
              },
              "size_coin": {
                "type": "number",
                "description": "The size the order was placed for."
              },
              "executed_size_coin": {
                "type": "number",
                "description": "Executed size as the chain reported it at this status."
              },
              "executed_notional_usd": {
                "type": "number"
              },
              "minutes": {
                "type": "integer",
                "description": "The duration the order was placed for."
              },
              "reduce_only": {
                "type": "boolean"
              },
              "randomize": {
                "type": "boolean",
                "description": "True when slice timing was randomized."
              },
              "started_at": {
                "type": "string",
                "format": "date-time",
                "description": "When the order was placed."
              },
              "ends_at": {
                "type": "string",
                "format": "date-time",
                "description": "When its minutes run out."
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "description": "When this status was recorded."
              },
              "block": {
                "type": "integer"
              },
              "error": {
                "type": "string",
                "nullable": true,
                "description": "The chain's reason when status is error."
              }
            }
          },
          "execution": {
            "type": "object",
            "nullable": true,
            "properties": {
              "fills": {
                "type": "integer",
                "description": "Number of fills that belong to the order."
              },
              "executed_size_coin": {
                "type": "number"
              },
              "executed_notional_usd": {
                "type": "number"
              },
              "average_price_usd": {
                "type": "number",
                "nullable": true,
                "description": "Notional over size."
              },
              "fee_usd": {
                "type": "number",
                "nullable": true,
                "description": "Negative is a rebate. Null when any fill came from the March to May 2025 trades archive, which has no fees."
              },
              "realized_pnl_usd": {
                "type": "number",
                "nullable": true,
                "description": "Null for the same reason as fee_usd."
              },
              "first_fill": {
                "type": "string",
                "format": "date-time"
              },
              "last_fill": {
                "type": "string",
                "format": "date-time"
              },
              "first_block": {
                "type": "integer",
                "nullable": true,
                "description": "Null for fills from the March to May 2025 trades archive",
                "which has no block numbers.": null
              },
              "last_block": {
                "type": "integer",
                "nullable": true
              }
            }
          },
          "completion_pct": {
            "type": "number",
            "nullable": true,
            "description": "Executed size over the order's size, 0 to 100. Null when the order's size is not known (placed before 2026-09-23)."
          }
        }
      },
      "TwapFlowSide": {
        "type": "object",
        "properties": {
          "twaps": {
            "type": "integer",
            "description": "Running TWAPs on this side."
          },
          "remaining_size_coin": {
            "type": "number",
            "description": "Order size less what has filled."
          },
          "remaining_notional_usd": {
            "type": "number",
            "nullable": true,
            "description": "The remaining size at the current mark."
          },
          "notional_per_minute_usd": {
            "type": "number",
            "nullable": true,
            "description": "The pace at which it reaches the book if every order runs to its end."
          }
        }
      },
      "OrderEvent": {
        "type": "object",
        "description": "One order status transition as the chain recorded it.",
        "properties": {
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "block": {
            "type": "integer"
          },
          "wallet": {
            "type": "string"
          },
          "market": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "open, filled, canceled, triggered, marginCanceled, reduceOnlyCanceled, or a rejection code such as badAloPxRejected."
          },
          "order_id": {
            "type": "integer"
          },
          "client_order_id": {
            "type": "string",
            "nullable": true
          },
          "side": {
            "type": "string",
            "enum": [
              "buy",
              "sell"
            ]
          },
          "price_usd": {
            "type": "number"
          },
          "size_coin": {
            "type": "number",
            "description": "Remaining size at this event."
          },
          "original_size_coin": {
            "type": "number"
          },
          "type": {
            "type": "string",
            "description": "Limit, Market, Stop Market, Stop Limit, Take Profit Market, Take Profit Limit."
          },
          "time_in_force": {
            "type": "string",
            "nullable": true,
            "description": "Gtc, Ioc, Alo (post-only), FrontendMarket."
          },
          "is_trigger": {
            "type": "boolean"
          },
          "trigger_price_usd": {
            "type": "number",
            "nullable": true
          },
          "trigger_condition": {
            "type": "string",
            "nullable": true
          },
          "reduce_only": {
            "type": "boolean"
          },
          "position_tpsl": {
            "type": "boolean"
          },
          "placed_at": {
            "type": "string",
            "format": "date-time"
          },
          "tx_hash": {
            "type": "string",
            "nullable": true
          },
          "builder": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "LedgerEntry": {
        "type": "object",
        "description": "One movement of value on the chain involving the wallet.",
        "properties": {
          "time": {
            "type": "string",
            "format": "date-time"
          },
          "block": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "description": "deposit, withdraw, send, spotTransfer, internalTransfer, accountClassTransfer, subAccountTransfer, vaultDeposit, vaultWithdraw, and others as the chain names them."
          },
          "wallet": {
            "type": "string",
            "description": "The initiating address."
          },
          "counterparty": {
            "type": "string",
            "nullable": true,
            "description": "The other party, vault, or destination when there is one."
          },
          "token": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "description": "In the token's units."
          },
          "usdc_value": {
            "type": "number"
          },
          "fee_usd": {
            "type": "number"
          },
          "source_dex": {
            "type": "string",
            "nullable": true
          },
          "destination_dex": {
            "type": "string",
            "nullable": true
          },
          "tx_hash": {
            "type": "string",
            "nullable": true
          },
          "detail": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true,
            "description": "The raw event as written."
          }
        }
      },
      "SnapshotPosition": {
        "type": "object",
        "description": "A position as the chain's hourly state snapshot held it.",
        "properties": {
          "wallet": {
            "type": "string"
          },
          "market": {
            "type": "string"
          },
          "side": {
            "type": "string",
            "enum": [
              "long",
              "short"
            ]
          },
          "size_coin": {
            "type": "number"
          },
          "entry_price_usd": {
            "type": "number",
            "nullable": true
          },
          "leverage": {
            "type": "integer"
          },
          "margin_mode": {
            "type": "string",
            "enum": [
              "cross",
              "isolated"
            ]
          },
          "snapshot_time": {
            "type": "string",
            "format": "date-time"
          },
          "block": {
            "type": "integer"
          }
        }
      },
      "Book": {
        "type": "object",
        "properties": {
          "market": {
            "type": "string"
          },
          "time": {
            "type": "string",
            "format": "date-time",
            "description": "The exchange's time for the snapshot."
          },
          "bids": {
            "type": "array",
            "description": "Best first.",
            "items": {
              "type": "object",
              "properties": {
                "price_usd": {
                  "type": "number"
                },
                "size_coin": {
                  "type": "number"
                },
                "orders": {
                  "type": "integer"
                }
              }
            }
          },
          "asks": {
            "type": "array",
            "description": "Best first.",
            "items": {
              "type": "object",
              "properties": {
                "price_usd": {
                  "type": "number"
                },
                "size_coin": {
                  "type": "number"
                },
                "orders": {
                  "type": "integer"
                }
              }
            }
          },
          "mid_price_usd": {
            "type": "number"
          },
          "spread_bps": {
            "type": "number",
            "nullable": true
          },
          "bid_depth_1pct_usd": {
            "type": "number",
            "description": "Notional resting within 1% below mid."
          },
          "ask_depth_1pct_usd": {
            "type": "number",
            "description": "Notional resting within 1% above mid."
          }
        }
      }
    }
  }
}