{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/monerometrics-net/json-schema/monerometrics-net-order-book-response-schema.json",
  "title": "OrderBookResponse",
  "description": "The live Haveno order book for one pair, both sides, priced against spot.\n\n`asks` are makers selling XMR, so taking one means buying; `bids` are makers\nbuying XMR, so taking one means selling. Levels are sorted outward from spot\nand carry a running total, which is what a depth chart plots. `reversible`\nflags a level whose payment rails let the buyer claw funds back after the\nXMR is released; when a level aggregates several methods it is true if any\nof them is reversible.\n\n`observed_at` is when this book was actually read from the upstream feed and\n`age_seconds` how old it is. They matter: in a book this thin a single offer\nleaving moves the floor by several points, so a snapshot a few minutes old can\nbe badly wrong while looking exactly as clean as a fresh one. When the upstream\nfeed fails we serve the last book we know rather than an empty panel, and\n`stale` is set so that is visible instead of silent.",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/monerometrics-net-openapi.json#/components/schemas/OrderBookResponse",
  "properties": {
    "pair": {
      "type": "string",
      "title": "Pair"
    },
    "observed_at": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Observed At"
    },
    "age_seconds": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Age Seconds"
    },
    "stale": {
      "type": "boolean",
      "title": "Stale",
      "default": false
    },
    "official_usd": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Official Usd"
    },
    "asks": {
      "items": {
        "$ref": "#/$defs/BookLevel"
      },
      "type": "array",
      "title": "Asks",
      "default": []
    },
    "bids": {
      "items": {
        "$ref": "#/$defs/BookLevel"
      },
      "type": "array",
      "title": "Bids",
      "default": []
    },
    "ask_amount": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ask Amount"
    },
    "bid_amount": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bid Amount"
    },
    "ask_offers": {
      "type": "integer",
      "title": "Ask Offers",
      "default": 0
    },
    "bid_offers": {
      "type": "integer",
      "title": "Bid Offers",
      "default": 0
    },
    "ask_avg_premium_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ask Avg Premium Pct"
    },
    "bid_avg_premium_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Bid Avg Premium Pct"
    },
    "round_trip_cost_pct": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Round Trip Cost Pct"
    }
  },
  "type": "object",
  "required": [
    "pair"
  ],
  "$defs": {
    "BookLevel": {
      "properties": {
        "price": {
          "type": "number",
          "title": "Price"
        },
        "premium_pct": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Premium Pct"
        },
        "amount": {
          "type": "number",
          "title": "Amount"
        },
        "cumulative": {
          "type": "number",
          "title": "Cumulative"
        },
        "offers": {
          "type": "integer",
          "title": "Offers",
          "default": 1
        },
        "payment_methods": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Payment Methods",
          "default": []
        },
        "reversible": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reversible"
        }
      },
      "type": "object",
      "required": [
        "price",
        "amount",
        "cumulative"
      ],
      "title": "BookLevel"
    }
  }
}