{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/backquant-com/json-schema/backquant-com-probability-density-response-schema.json",
  "title": "ProbabilityDensityResponse",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/backquant-com-api-openapi.json#/components/schemas/ProbabilityDensityResponse",
  "properties": {
    "success": {
      "type": "boolean",
      "const": true,
      "title": "Success",
      "default": true
    },
    "data": {
      "$ref": "#/$defs/ProbabilityDensityData"
    },
    "meta": {
      "$ref": "#/$defs/V2Meta"
    }
  },
  "type": "object",
  "required": [
    "data",
    "meta"
  ],
  "$defs": {
    "ProbabilityConfidenceBand": {
      "properties": {
        "confidence": {
          "type": "number",
          "title": "Confidence"
        },
        "lower": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Lower"
        },
        "upper": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Upper"
        },
        "lower_percentile": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Lower Percentile"
        },
        "upper_percentile": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Upper Percentile"
        },
        "available": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Available"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reason"
        }
      },
      "type": "object",
      "required": [
        "confidence"
      ],
      "title": "ProbabilityConfidenceBand"
    },
    "ProbabilityDensityData": {
      "properties": {
        "expiries": {
          "additionalProperties": {
            "$ref": "#/$defs/ProbabilityExpiryPayload"
          },
          "type": "object",
          "title": "Expiries",
          "description": "Keyed by expiry token (e.g. `28MAR25`)."
        },
        "spot_price": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Spot Price"
        },
        "filtered_dte_max": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Filtered Dte Max"
        },
        "confidence_band_requested": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Confidence Band Requested"
        }
      },
      "type": "object",
      "required": [
        "expiries"
      ],
      "title": "ProbabilityDensityData"
    },
    "ProbabilityExpiryPayload": {
      "properties": {
        "strikes": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Strikes"
        },
        "pdf": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pdf"
        },
        "pdf_normalized": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pdf Normalized"
        },
        "cdf_above": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cdf Above"
        },
        "cdf_below": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cdf Below"
        },
        "mode": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mode"
        },
        "mean": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mean"
        },
        "std": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Std"
        },
        "skewness": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Skewness"
        },
        "kurtosis": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Kurtosis"
        },
        "prob_25": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Prob 25"
        },
        "prob_50": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Prob 50"
        },
        "prob_75": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Prob 75"
        },
        "forward": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Forward",
          "description": "The expiry's forward the distribution is centred on."
        },
        "confidence_band": {
          "anyOf": [
            {
              "$ref": "#/$defs/ProbabilityConfidenceBand"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": true,
      "type": "object",
      "title": "ProbabilityExpiryPayload",
      "description": "Per-expiry PDF/CDF data. Many fields are optional because the cache\nshape evolves with worker versions; SDKs treat absent fields as null."
    },
    "V2Meta": {
      "properties": {
        "version": {
          "type": "string",
          "const": "2.0",
          "title": "Version",
          "description": "API version tag."
        },
        "timestamp": {
          "type": "string",
          "title": "Timestamp",
          "description": "ISO 8601 wall-clock when the response was built."
        },
        "request_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Request Id",
          "description": "X-Request-ID for tracing across logs / Sentry."
        },
        "symbol": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Symbol",
          "description": "Symbol the response is about, if applicable."
        },
        "spot_price": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Spot Price",
          "description": "Current spot price for the symbol."
        },
        "computed_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Computed At",
          "description": "ISO 8601 of when the underlying cache value was last written."
        },
        "freshness_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Freshness Seconds",
          "description": "`now - computed_at` in seconds; useful for staleness alarms."
        },
        "source": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source",
          "description": "Upstream venue list the data flowed through."
        },
        "exchanges_filtered": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exchanges Filtered",
          "description": "Echo of the `?exchanges=` filter when one was applied."
        },
        "rate_limit": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rate Limit",
          "description": "`{limit, remaining, reset}` echo of the rate-limit headers."
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extra",
          "description": "Open dict for endpoint-specific metadata (filter_hash, etc.)."
        }
      },
      "type": "object",
      "required": [
        "version",
        "timestamp"
      ],
      "title": "V2Meta",
      "description": "The meta block returned alongside every v2 response.\n\nEvery field after `version`/`timestamp` is optional because endpoints\nattach different combinations - e.g. `/v2/status` skips `symbol`, the\nchain endpoint sets `extra.filter_hash`, etc. Listing them here means\nSDKs get a typed accessor for each instead of a generic `meta: dict`."
    }
  }
}