{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/currencycore/json-schema/currencycore-safe-haven-response-schema.json",
  "title": "SafeHavenResponse",
  "x-generated": "2026-12-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/currencycore-api-openapi.json#/components/schemas/SafeHavenResponse",
  "type": "object",
  "properties": {
    "base": {
      "type": "string"
    },
    "from": {
      "type": "string"
    },
    "to": {
      "type": "string"
    },
    "crisis": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string"
        },
        "from": {
          "type": "string"
        },
        "to": {
          "type": "string"
        }
      },
      "required": [
        "label",
        "from",
        "to"
      ],
      "additionalProperties": false
    },
    "universe": {
      "type": "string",
      "enum": [
        "liquid",
        "majors"
      ]
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string"
          },
          "score": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "volatility": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "maxDrawdownPct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "crisisReturnPct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "score",
          "volatility",
          "maxDrawdownPct",
          "crisisReturnPct"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "base",
    "from",
    "to",
    "crisis",
    "results"
  ],
  "additionalProperties": false
}