{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cryptodataapi-com/json-schema/cryptodataapi-com-backtest-liq-density-response-schema.json",
  "title": "BacktestLiqDensityResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cryptodataapi-com-backtesting-api-openapi.yml#/components/schemas/BacktestLiqDensityResponse",
  "properties": {
    "grain": {
      "$ref": "#/$defs/GrainDescriptor"
    },
    "coverage": {
      "$ref": "#/$defs/CoverageInfo"
    },
    "next_cursor": {
      "title": "Next Cursor",
      "type": [
        "string",
        "null"
      ]
    },
    "has_more": {
      "type": "boolean",
      "title": "Has More",
      "default": false
    },
    "coin": {
      "type": "string",
      "title": "Coin"
    },
    "interval": {
      "type": "string",
      "title": "Interval"
    },
    "bands_pct": {
      "items": {
        "type": "number"
      },
      "type": "array",
      "title": "Bands Pct"
    },
    "count": {
      "type": "integer",
      "title": "Count"
    },
    "data": {
      "items": {
        "$ref": "#/$defs/BacktestLiqDensityPoint"
      },
      "type": "array",
      "title": "Data"
    }
  },
  "type": "object",
  "required": [
    "coin",
    "interval",
    "bands_pct",
    "count",
    "data"
  ],
  "$defs": {
    "BacktestLiqDensityPoint": {
      "properties": {
        "time": {
          "type": "integer",
          "title": "Time"
        },
        "coin": {
          "type": "string",
          "title": "Coin"
        },
        "snapshot_time": {
          "type": "integer",
          "title": "Snapshot Time"
        },
        "mark": {
          "title": "Mark",
          "type": [
            "number",
            "null"
          ]
        },
        "long_below": {
          "additionalProperties": {
            "type": "number"
          },
          "type": "object",
          "title": "Long Below"
        },
        "short_above": {
          "additionalProperties": {
            "type": "number"
          },
          "type": "object",
          "title": "Short Above"
        },
        "by_trader_type": {
          "title": "By Trader Type",
          "additionalProperties": {
            "$ref": "#/$defs/LiqDensitySides"
          },
          "type": [
            "object",
            "null"
          ]
        },
        "by_leverage": {
          "title": "By Leverage",
          "additionalProperties": {
            "$ref": "#/$defs/LiqDensitySides"
          },
          "type": [
            "object",
            "null"
          ]
        }
      },
      "type": "object",
      "required": [
        "time",
        "coin",
        "snapshot_time",
        "mark",
        "long_below",
        "short_above"
      ],
      "title": "BacktestLiqDensityPoint",
      "description": "One coin at one sampled 5-min liquidation-map snapshot."
    },
    "CoverageInfo": {
      "properties": {
        "local_first": {
          "title": "Local First",
          "type": [
            "integer",
            "null"
          ]
        },
        "local_last": {
          "title": "Local Last",
          "type": [
            "integer",
            "null"
          ]
        },
        "archive_hint": {
          "title": "Archive Hint",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object",
      "title": "CoverageInfo",
      "description": "Local retention bounds (ms) for the queried scope. ``archive_hint`` is set\nwhen the window starts before ``local_first`` — those rows are not missing,\nthey live in the daily Parquet archive."
    },
    "GrainDescriptor": {
      "properties": {
        "kind": {
          "type": "string",
          "title": "Kind"
        },
        "cadence": {
          "title": "Cadence",
          "type": [
            "string",
            "null"
          ]
        },
        "is_cumulative": {
          "type": "boolean",
          "title": "Is Cumulative",
          "default": false
        },
        "sum_ok": {
          "type": "boolean",
          "title": "Sum Ok",
          "default": false
        },
        "window": {
          "title": "Window",
          "type": [
            "string",
            "null"
          ]
        },
        "settlements_per_day": {
          "title": "Settlements Per Day",
          "type": [
            "integer",
            "null"
          ]
        },
        "note": {
          "type": "string",
          "title": "Note"
        }
      },
      "type": "object",
      "required": [
        "kind",
        "note"
      ],
      "title": "GrainDescriptor",
      "description": "What ONE ROW of a series is, stated on the payload so it cannot be mis-summed.\n\n``kind``: ``event`` (one fill), ``bar`` (a closed bucket), ``rate_snapshot``\n(the live rate sampled on a timer), ``rolling_window`` (a trailing total\nsampled on a timer), ``settled_payment`` (one settlement print).\n``sum_ok`` — adding rows across time is meaningful. ``is_cumulative`` — a row\nalready contains its predecessors' flow. ``settlements_per_day`` is set for\nfunding series only."
    },
    "LiqDensitySides": {
      "properties": {
        "long_below": {
          "additionalProperties": {
            "type": "number"
          },
          "type": "object",
          "title": "Long Below"
        },
        "short_above": {
          "additionalProperties": {
            "type": "number"
          },
          "type": "object",
          "title": "Short Above"
        }
      },
      "type": "object",
      "required": [
        "long_below",
        "short_above"
      ],
      "title": "LiqDensitySides",
      "description": "Liquidatable notional (USD) inside each band of the mark, keyed by band\nhalf-width in percent (\"0.5\", \"1\", \"2\", \"3\", \"5\"). Bands are cumulative —\n\"2\" includes \"1\". ``long_below`` = long positions whose liquidation price\nis below the mark (fuel for a down-move); ``short_above`` = shorts whose\nliquidation price is above it (fuel for an up-move)."
    }
  }
}