{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/revolut/main/json-schema/revolut-order-book-public-schema.json",
  "title": "OrderBookPublic",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/revolut-public-market-data-api-openapi.yml#/components/schemas/OrderBookPublic",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "asks": {
          "type": "array",
          "description": "The list of asks (sell orders), sorted by price in descending order.",
          "items": {
            "$ref": "#/$defs/OrderBookPublicPriceLevel"
          }
        },
        "bids": {
          "type": "array",
          "description": "The list of bids (buy orders), sorted by price in descending order.",
          "items": {
            "$ref": "#/$defs/OrderBookPublicPriceLevel"
          }
        }
      },
      "required": [
        "asks",
        "bids"
      ]
    },
    "metadata": {
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the order book snapshot was generated, returned as [ISO-8601](https://wikipedia.org/wiki/ISO_8601) string."
        }
      },
      "required": [
        "timestamp"
      ]
    }
  },
  "required": [
    "data",
    "metadata"
  ],
  "$defs": {
    "OrderBookPublicPriceLevel": {
      "type": "object",
      "description": "A single order book price level.",
      "properties": {
        "aid": {
          "type": "string",
          "description": "Crypto-asset ID code."
        },
        "anm": {
          "type": "string",
          "description": "Crypto-asset full name."
        },
        "s": {
          "type": "string",
          "description": "The side of the price level.",
          "enum": [
            "SELL",
            "BUYI"
          ]
        },
        "p": {
          "type": "string",
          "description": "Price in major currency units. For example, for USD, 4600 represents 4600 dollars."
        },
        "pc": {
          "type": "string",
          "description": "Price currency."
        },
        "pn": {
          "type": "string",
          "description": "Price notation."
        },
        "q": {
          "type": "string",
          "description": "Aggregated quantity at this price level."
        },
        "qc": {
          "type": "string",
          "description": "Quantity currency."
        },
        "qn": {
          "type": "string",
          "description": "Quantity notation."
        },
        "ve": {
          "type": "string",
          "description": "Venue of execution. Always equals `REVX`."
        },
        "no": {
          "type": "string",
          "description": "Number of orders at the price level."
        },
        "ts": {
          "type": "string",
          "description": "Trading system. Always equals `CLOB` (Central Limit Order Book)."
        },
        "pdt": {
          "type": "string",
          "format": "date-time",
          "description": "Publication date and time, returned as [ISO-8601](https://wikipedia.org/wiki/ISO_8601) string."
        }
      },
      "required": [
        "aid",
        "anm",
        "s",
        "p",
        "pc",
        "pn",
        "q",
        "qc",
        "qn",
        "ve",
        "no",
        "ts",
        "pdt"
      ]
    }
  }
}