{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coinrithm-com/json-schema/coinrithm-com-public-liquidations-response-schema.json",
  "title": "PublicLiquidationsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coinrithm-com-public-market-data-api-openapi.yml#/components/schemas/PublicLiquidationsResponse",
  "type": "object",
  "required": [
    "version",
    "generatedAt",
    "base",
    "venue",
    "window",
    "totals",
    "venues",
    "biggest",
    "latest",
    "truncated",
    "source"
  ],
  "properties": {
    "version": {
      "type": "integer"
    },
    "generatedAt": {
      "type": "string",
      "format": "date-time"
    },
    "base": {
      "type": "string"
    },
    "venue": {
      "type": [
        "string",
        "null"
      ],
      "description": "The venue filter applied, or null for every captured venue."
    },
    "window": {
      "$ref": "#/$defs/PublicLiquidationsWindow"
    },
    "totals": {
      "$ref": "#/$defs/PublicLiquidationTotals"
    },
    "venues": {
      "type": "array",
      "description": "One entry per venue with captured events in the window.",
      "items": {
        "$ref": "#/$defs/PublicLiquidationVenueSummary"
      }
    },
    "biggest": {
      "type": "array",
      "description": "Largest events by notional.",
      "items": {
        "$ref": "#/$defs/PublicLiquidationEvent"
      }
    },
    "latest": {
      "type": "array",
      "description": "Most recent events.",
      "items": {
        "$ref": "#/$defs/PublicLiquidationEvent"
      }
    },
    "truncated": {
      "type": "boolean",
      "description": "True when the row cap was reached; totals are then a lower bound."
    },
    "source": {
      "$ref": "#/$defs/PublicMarketFeedSource"
    }
  },
  "$defs": {
    "PublicLiquidationEvent": {
      "type": "object",
      "required": [
        "venue",
        "instId",
        "eventAt",
        "liquidatedSide",
        "contracts",
        "price",
        "notionalUsd",
        "marketUrl"
      ],
      "properties": {
        "venue": {
          "type": "string"
        },
        "instId": {
          "type": "string",
          "description": "Venue instrument id, e.g. `BTCUSDT` or `XAU-USDT-SWAP`."
        },
        "eventAt": {
          "type": "string",
          "format": "date-time"
        },
        "liquidatedSide": {
          "type": "string",
          "description": "`long` (a long was liquidated, a forced sell) or `short`."
        },
        "contracts": {
          "type": "number",
          "description": "Size in venue contract units."
        },
        "price": {
          "type": "number",
          "description": "OKX bankruptcy price; Binance liquidation order price."
        },
        "notionalUsd": {
          "type": "number",
          "description": "Notional in USDT, rounded to cents."
        },
        "marketUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "PublicLiquidationTotals": {
      "type": "object",
      "description": "Captured liquidation sums in USD (rounded to whole dollars) and event counts.",
      "required": [
        "longUsd",
        "shortUsd",
        "totalUsd",
        "longEvents",
        "shortEvents",
        "events"
      ],
      "properties": {
        "longUsd": {
          "type": "number"
        },
        "shortUsd": {
          "type": "number"
        },
        "totalUsd": {
          "type": "number"
        },
        "longEvents": {
          "type": "integer"
        },
        "shortEvents": {
          "type": "integer"
        },
        "events": {
          "type": "integer"
        }
      }
    },
    "PublicLiquidationVenueSummary": {
      "type": "object",
      "required": [
        "venue",
        "longUsd",
        "shortUsd",
        "totalUsd",
        "longEvents",
        "shortEvents",
        "events",
        "instIds",
        "capturedPct",
        "lastEventAt"
      ],
      "properties": {
        "venue": {
          "type": "string",
          "description": "`binance` or `okx`."
        },
        "longUsd": {
          "type": "number"
        },
        "shortUsd": {
          "type": "number"
        },
        "totalUsd": {
          "type": "number"
        },
        "longEvents": {
          "type": "integer"
        },
        "shortEvents": {
          "type": "integer"
        },
        "events": {
          "type": "integer"
        },
        "instIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "capturedPct": {
          "type": [
            "number",
            "null"
          ],
          "description": "Lower bound of capture uptime for the window, 0-100. Null when no\ncapture was recorded: a gap, never evidence of no liquidations.\n"
        },
        "lastEventAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "PublicLiquidationsWindow": {
      "type": "object",
      "required": [
        "from",
        "to",
        "hours"
      ],
      "properties": {
        "from": {
          "type": "string",
          "format": "date-time"
        },
        "to": {
          "type": "string",
          "format": "date-time"
        },
        "hours": {
          "type": "integer"
        }
      }
    },
    "PublicMarketFeedSource": {
      "type": "object",
      "required": [
        "provider",
        "venues",
        "method"
      ],
      "properties": {
        "provider": {
          "type": "string"
        },
        "venues": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PublicMarketFeedVenue"
          }
        },
        "method": {
          "type": "string",
          "description": "How rows are selected and valued."
        },
        "coverage": {
          "type": "string",
          "description": "Which markets are collected, and the gap caveat."
        }
      }
    },
    "PublicMarketFeedVenue": {
      "type": "object",
      "required": [
        "venue",
        "name",
        "url",
        "feed"
      ],
      "properties": {
        "venue": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "feed": {
          "type": "string",
          "description": "The venue's public feed the collector reads."
        },
        "note": {
          "type": "string",
          "description": "Venue-specific coverage limitation, when published."
        }
      }
    }
  }
}