Order Book

Subscribe to order book data updates for a specific instrument.

Subscribe Request

{
  "id": 2,
  "method": "SUBSCRIBE",
  "params": {
    "chainId": 143,
    "instrument": "0x73ada1ea346cc3908f41cf67a040f0acd7808be0",
    "expiry": 4294967295,
    "type": "orderBook"
  }
}

Unsubscribe Request

{
  "id": 2,
  "method": "UNSUBSCRIBE",
  "params": {
    "chainId": 143,
    "instrument": "0x73ada1ea346cc3908f41cf67a040f0acd7808be0",
    "expiry": 4294967295,
    "type": "orderBook"
  }
}

Parameter Description

  • chainId (required): Chain ID

  • instrument (required): Instrument address (lowercase)

  • expiry (required): Expiry timestamp

  • type (required): Must be "orderBook"

Data Stream Message

Order Book Data Structure

  • chainId (top-level): Chain ID of the order book update

  • instrument (top-level): Instrument address corresponding to the update

  • expiry (top-level): Expiry timestamp

  • data: Map of order book entries, keyed by depth level (string: "1", "10", "100", "200"). Each entry contains:

    • blockInfo: Block information

      • height: Block height

      • timestamp: Block timestamp

    • bids: Buy order list (sorted by price from high to low)

    • asks: Sell order list (sorted by price from low to high)

    • Each order item contains:

      • tick: Price tick

      • price: Price (string format)

      • baseSize: Base asset quantity

      • quoteSize: Quote asset quantity

      • baseSum: Cumulative base asset quantity

      • quoteSum: Cumulative quote asset quantity

Depth Levels

The order book provides data at four depth levels:

  • "1": 1-level depth

  • "10": 10-level depth

  • "100": 100-level depth

  • "200": 200-level depth

Last updated