{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/backquant-com/json-schema/backquant-com-iv-term-structure-response-schema.json",
  "title": "IvTermStructureResponse",
  "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/IvTermStructureResponse",
  "properties": {
    "success": {
      "type": "boolean",
      "const": true,
      "title": "Success",
      "default": true
    },
    "data": {
      "$ref": "#/$defs/IvTermStructureData"
    },
    "meta": {
      "$ref": "#/$defs/V2Meta"
    }
  },
  "type": "object",
  "required": [
    "data",
    "meta"
  ],
  "$defs": {
    "IvTermCompare": {
      "properties": {
        "days_ago": {
          "type": "integer",
          "title": "Days Ago"
        },
        "target_date": {
          "type": "string",
          "title": "Target Date"
        },
        "historical": {
          "items": {
            "$ref": "#/$defs/IvTermHistoricalBucket"
          },
          "type": "array",
          "title": "Historical"
        },
        "shape": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Shape"
        },
        "matched_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Matched Count"
        },
        "available": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Available"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reason"
        }
      },
      "type": "object",
      "required": [
        "days_ago",
        "target_date",
        "historical"
      ],
      "title": "IvTermCompare"
    },
    "IvTermHistoricalBucket": {
      "properties": {
        "dte_bucket": {
          "type": "integer",
          "title": "Dte Bucket"
        },
        "atm_iv": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Atm Iv",
          "description": "ATM implied volatility in percent (33.0 = 33%)."
        },
        "ts": {
          "type": "string",
          "title": "Ts"
        }
      },
      "type": "object",
      "required": [
        "dte_bucket",
        "ts"
      ],
      "title": "IvTermHistoricalBucket"
    },
    "IvTermStructureData": {
      "properties": {
        "expiries": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expiries"
        },
        "dtes": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Dtes"
        },
        "days_to_expiry": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Days To Expiry",
          "description": "Days to each expiry's 08:00 UTC settle (fractional, e.g. 0.8)."
        },
        "atm_iv": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Atm Iv",
          "description": "ATM implied volatility per expiry, in percent (33.0 = 33%), read at the expiry's forward; null where the chosen venues do not quote the expiry."
        },
        "forwards": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Forwards",
          "description": "The forward each expiry's ATM was read at, parallel to `expiries`."
        },
        "ts": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ts"
        },
        "spot_price": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Spot Price"
        },
        "filtered_dte_window": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Filtered Dte Window"
        },
        "compare": {
          "anyOf": [
            {
              "$ref": "#/$defs/IvTermCompare"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": true,
      "type": "object",
      "title": "IvTermStructureData",
      "description": "The shape varies slightly by collector version - we document the\nfields we know about and leave room for additional ones via extra=allow."
    },
    "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`."
    }
  }
}