{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quantustik-com/json-schema/quantustik-com-market-conditions-response-schema.json",
  "title": "MarketConditionsResponse",
  "description": "Measured VIX, yield curve, credit spread and Fear and Greed readings. Observations only.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quantustik-com-openapi.json#/components/schemas/MarketConditionsResponse",
  "properties": {
    "readings": {
      "additionalProperties": {
        "$ref": "#/$defs/MarketConditionReading"
      },
      "type": "object",
      "title": "Readings"
    },
    "unavailable": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Unavailable",
      "description": "Keys of readings whose source failed."
    }
  },
  "type": "object",
  "required": [
    "readings",
    "unavailable"
  ],
  "$defs": {
    "MarketConditionReading": {
      "properties": {
        "key": {
          "type": "string",
          "title": "Key"
        },
        "label": {
          "type": "string",
          "title": "Label"
        },
        "available": {
          "type": "boolean",
          "title": "Available"
        },
        "value": {
          "anyOf": [
            {},
            {
              "type": "null"
            }
          ],
          "title": "Value",
          "description": "Measured value; null when the source failed."
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unit"
        },
        "as_of": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "As Of",
          "description": "When the source last published this reading (ISO 8601)."
        },
        "date": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Date",
          "description": "Calendar date the reading was computed for."
        },
        "source": {
          "type": "string",
          "title": "Source"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reason",
          "description": "Why the reading is unavailable."
        },
        "stale": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Stale"
        },
        "stale_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Stale Reason"
        },
        "age_hours": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Age Hours"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "key",
        "label",
        "available",
        "source"
      ],
      "title": "MarketConditionReading",
      "description": "One measured reading with its unit, source and observation time."
    }
  }
}