{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arena-predictions-com/json-schema/arena-predictions-com-instrument-book-schema.json",
  "title": "InstrumentBook",
  "description": "Only while the venue-data switch and the combined-book switch are on (1.14.0): every venue's book for the instrument merged into one ladder in its YES terms, and the same ladder seen from NO. Equal prices merge; nearby prices never do. A price older than 15 s at its source is left out (venuesLeftOut, reason \"price older than 15 s\"). ProphetX is left out too: its prices come from its sandbox exchange, so they never enter the ladder or decide its top, and venuesLeftOut gives that sentence as the reason (its price is on GET /instruments/{ref}/quotes). Kalshi's book (8 levels a side, in whole cents) and Polymarket's (20) come from Arena's proxy; on a Kalshi market priced finer than a cent, or when the proxy's levels disagree with Kalshi's quote, Kalshi adds its top of book only. Novig adds its top of book only (venueDepth, note \"top of book only\"). A venue whose contract is a different one has no listing on the instrument, so it is absent from the answer.",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arena-predictions-com-openapi.json#/components/schemas/InstrumentBook",
  "type": "object",
  "required": [
    "instrumentId",
    "label",
    "oppositeLabel",
    "queryMeans",
    "crossVenue",
    "yes",
    "no",
    "venuesIncluded",
    "venuesLeftOut",
    "venueDepth",
    "lowestAsk",
    "asOf",
    "disclaimer"
  ],
  "properties": {
    "instrumentId": {
      "type": "string"
    },
    "label": {
      "type": "string"
    },
    "oppositeLabel": {
      "type": [
        "string",
        "null"
      ]
    },
    "queryMeans": {
      "type": "string"
    },
    "crossVenue": {
      "type": "boolean",
      "description": "False while Arena shows Kalshi only: then the book is Kalshi's alone."
    },
    "yes": {
      "type": "object",
      "properties": {
        "bids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BookLevel"
          },
          "description": "Highest first."
        },
        "asks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BookLevel"
          },
          "description": "Lowest first."
        }
      }
    },
    "no": {
      "type": "object",
      "description": "NO bids are the YES asks at 1 - p and NO asks the YES bids at 1 - p, from venues that sell both sides.",
      "properties": {
        "bids": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BookLevel"
          }
        },
        "asks": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/BookLevel"
          }
        }
      }
    },
    "venuesIncluded": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "venuesLeftOut": {
      "type": "array",
      "description": "Venues with a price that are not in the ladder, and why: a price more than 15 s old, a sandbox exchange's price (ProphetX), or an empty book.",
      "items": {
        "type": "object",
        "properties": {
          "venue": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        }
      }
    },
    "venueDepth": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "venue": {
            "type": "string"
          },
          "depth": {
            "type": "string",
            "enum": [
              "book",
              "top"
            ]
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "lowestAsk": {
      "$ref": "#/$defs/LowestAsks"
    },
    "asOf": {
      "type": "string",
      "format": "date-time"
    },
    "disclaimer": {
      "type": "string"
    }
  },
  "$defs": {
    "BookLevel": {
      "type": "object",
      "required": [
        "probability",
        "percent",
        "contracts",
        "cumulativeContracts",
        "venues"
      ],
      "description": "Only while the venue-data switch is on (1.14.0): one price of the combined book.",
      "properties": {
        "probability": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Only while the venue-data switch is on. The level's price for the instrument's YES (or NO, on the no side)."
        },
        "percent": {
          "type": "number",
          "description": "The same price in percent, to a tenth."
        },
        "contracts": {
          "type": [
            "number",
            "null"
          ],
          "description": "Contracts ($1 each) at this price from the venues that merge (fungibility exact). A condition_scope venue is listed and not counted. Null when one of them does not say its size (a top of book read without sizes): an unknown size is never counted as 0."
        },
        "cumulativeContracts": {
          "type": [
            "number",
            "null"
          ],
          "description": "contracts summed from the top of the book through this level; null from the first level with null contracts down."
        },
        "venues": {
          "type": "array",
          "description": "Every venue at this price, listed Kalshi, Novig, Polymarket, ProphetX.",
          "items": {
            "type": "object",
            "required": [
              "venue",
              "contracts",
              "asOf",
              "fungibility",
              "note"
            ],
            "properties": {
              "venue": {
                "type": "string",
                "enum": [
                  "kalshi",
                  "novig",
                  "polymarket",
                  "prophetx"
                ]
              },
              "contracts": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Null when the venue does not say."
              },
              "asOf": {
                "type": "string",
                "format": "date-time"
              },
              "fungibility": {
                "type": "string",
                "enum": [
                  "exact",
                  "condition_scope"
                ]
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    },
    "LowestAsk": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "venue",
        "probability",
        "percent",
        "asOf"
      ],
      "description": "One side's lowest ask (1.14.0). Null when no venue counts on that side.",
      "properties": {
        "venue": {
          "type": "string",
          "enum": [
            "kalshi",
            "novig",
            "polymarket",
            "prophetx"
          ]
        },
        "probability": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "percent": {
          "type": "number",
          "description": "The same price in percent, to a tenth."
        },
        "asOf": {
          "type": "string",
          "format": "date-time",
          "description": "When that venue's price was current."
        }
      }
    },
    "LowestAsks": {
      "type": "object",
      "required": [
        "yes",
        "no"
      ],
      "description": "Only while the venue-data switch is on (1.14.0): the lowest ask on each side among prices at most 15 s old, from venues that sell both sides, never a sandbox price (ProphetX today). A tie goes to the first venue listed Kalshi, Novig, Polymarket, ProphetX. no is the lowest price to buy NO, 1 minus the highest YES bid.",
      "properties": {
        "yes": {
          "$ref": "#/$defs/LowestAsk"
        },
        "no": {
          "$ref": "#/$defs/LowestAsk"
        }
      }
    }
  }
}