{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/530amodel-com/json-schema/530amodel-com-scenario-schema.json",
  "title": "Scenario",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/530amodel-com-api-openapi.json#/components/schemas/Scenario",
  "type": "object",
  "required": [
    "asOf",
    "birthDate",
    "targetAgeMonths"
  ],
  "properties": {
    "asOf": {
      "type": "string",
      "format": "date"
    },
    "birthDate": {
      "type": "string",
      "format": "date"
    },
    "includeSeed": {
      "type": "boolean",
      "default": true
    },
    "annualReturn": {
      "type": "number",
      "default": 0.07,
      "minimum": -0.5,
      "maximum": 0.2
    },
    "returnIsReal": {
      "type": "boolean",
      "default": true
    },
    "annualInflation": {
      "type": "number",
      "default": 0.025,
      "minimum": 0,
      "maximum": 0.2
    },
    "annualFee": {
      "type": "number",
      "default": 0.0003,
      "minimum": 0,
      "maximum": 0.05
    },
    "annualVolatility": {
      "type": "number",
      "default": 0.15,
      "minimum": 0,
      "maximum": 0.6
    },
    "targetAgeMonths": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1428
    },
    "mcSeed": {
      "type": "integer",
      "default": 530
    },
    "mcPaths": {
      "type": "integer",
      "default": 2000,
      "minimum": 100,
      "maximum": 5000
    },
    "sources": {
      "type": "array",
      "maxItems": 8,
      "items": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "schedule"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "family",
              "relative",
              "charity",
              "employer"
            ]
          },
          "stepUpRate": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "schedule": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "type",
                  "amountCents",
                  "startAgeMonths",
                  "endAgeMonths"
                ],
                "properties": {
                  "type": {
                    "const": "monthly"
                  },
                  "amountCents": {
                    "type": "string",
                    "pattern": "^\\d{1,12}$"
                  },
                  "startAgeMonths": {
                    "type": "integer"
                  },
                  "endAgeMonths": {
                    "type": "integer"
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "type",
                  "amountCents",
                  "monthOfYear",
                  "startAgeMonths",
                  "endAgeMonths"
                ],
                "properties": {
                  "type": {
                    "const": "annual"
                  },
                  "amountCents": {
                    "type": "string",
                    "pattern": "^\\d{1,12}$"
                  },
                  "monthOfYear": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12
                  },
                  "startAgeMonths": {
                    "type": "integer"
                  },
                  "endAgeMonths": {
                    "type": "integer"
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "type",
                  "amountCents",
                  "atAgeMonths"
                ],
                "properties": {
                  "type": {
                    "const": "once"
                  },
                  "amountCents": {
                    "type": "string",
                    "pattern": "^\\d{1,12}$"
                  },
                  "atAgeMonths": {
                    "type": "integer"
                  }
                }
              }
            ]
          }
        }
      }
    }
  }
}