{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/currencycore/json-schema/currencycore-history-analysis-response-schema.json",
  "title": "HistoryAnalysisResponse",
  "x-generated": "2026-12-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/currencycore-api-openapi.json#/components/schemas/HistoryAnalysisResponse",
  "type": "object",
  "properties": {
    "base": {
      "type": "string"
    },
    "from": {
      "type": "string"
    },
    "to": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": [
        "compare",
        "movers"
      ]
    },
    "sort": {
      "type": "string",
      "enum": [
        "strengthened",
        "weakened"
      ]
    },
    "assetClass": {
      "type": "string",
      "enum": [
        "fiat",
        "metals",
        "all",
        "crypto"
      ]
    },
    "interval": {
      "type": "string",
      "enum": [
        "daily",
        "weekly",
        "monthly",
        "yearly"
      ]
    },
    "stats": {
      "type": "boolean"
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string"
          },
          "startDate": {
            "type": "string"
          },
          "endDate": {
            "type": "string"
          },
          "startRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "endRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "changePct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "strengthenedPct": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "stats": {
            "type": "object",
            "properties": {
              "min": {
                "type": "number"
              },
              "max": {
                "type": "number"
              },
              "avg": {
                "type": "number"
              }
            },
            "required": [
              "min",
              "max",
              "avg"
            ],
            "additionalProperties": false
          },
          "series": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": "number"
            }
          },
          "volatility": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "note": {
            "type": "string"
          }
        },
        "required": [
          "currency",
          "startDate",
          "endDate",
          "startRate",
          "endRate",
          "changePct",
          "strengthenedPct"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "base",
    "from",
    "to",
    "mode",
    "stats",
    "results"
  ],
  "additionalProperties": false
}