{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://klarfort.com/tools/overpay-or-invest/schema.json",
  "title": "Overpay the mortgage or invest calculator",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "currency": {
      "type": "string",
      "title": "Currency",
      "description": "Currency",
      "enum": [
        "USD",
        "EUR",
        "GBP",
        "JPY",
        "CHF",
        "CAD",
        "AUD",
        "CNY",
        "INR",
        "MXN",
        "BRL",
        "SGD",
        "HKD",
        "SEK",
        "NOK",
        "DKK",
        "NZD",
        "ZAR",
        "KRW",
        "TRY",
        "PLN",
        "CZK",
        "HUF",
        "AED",
        "THB",
        "IDR",
        "MYR",
        "PHP"
      ],
      "default": "USD"
    },
    "principal": {
      "type": "number",
      "title": "Mortgage balance",
      "description": "Mortgage balance",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 300000
    },
    "homeValue": {
      "type": "number",
      "title": "Home value for insurance removal",
      "description": "Home value for insurance removal",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 400000
    },
    "mortgageRate": {
      "type": "number",
      "title": "Mortgage annual rate (%)",
      "description": "Mortgage annual rate (%)",
      "minimum": 0,
      "maximum": 100,
      "default": 5
    },
    "mortgageMonths": {
      "type": "integer",
      "title": "Mortgage remaining months",
      "description": "Mortgage remaining months",
      "minimum": 1,
      "maximum": 600,
      "default": 300
    },
    "extraMonthly": {
      "type": "number",
      "title": "Extra cash each month",
      "description": "Extra cash each month",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 500
    },
    "horizonMonths": {
      "type": "integer",
      "title": "Common comparison horizon months",
      "description": "Common comparison horizon months",
      "minimum": 1,
      "maximum": 600,
      "default": 300
    },
    "investmentReturn": {
      "type": "number",
      "title": "Expected effective annual investment return (%)",
      "description": "Expected effective annual investment return (%)",
      "minimum": -50,
      "maximum": 50,
      "default": 6
    },
    "volatility": {
      "type": "number",
      "title": "Annual investment volatility (%)",
      "description": "Annual investment volatility (%)",
      "minimum": 0,
      "maximum": 100,
      "default": 15
    },
    "paths": {
      "type": "integer",
      "title": "Simulation paths",
      "description": "Simulation paths",
      "minimum": 1,
      "maximum": 1000,
      "default": 250
    },
    "seed": {
      "type": "string",
      "title": "Seed (empty or 16 hexadecimal characters)",
      "description": "Seed (empty or 16 hexadecimal characters)",
      "maxLength": 64,
      "pattern": "^(?:[a-fA-F0-9]{16})?$",
      "default": ""
    },
    "initialInvestment": {
      "type": "number",
      "title": "Initial investment cash outside reserve",
      "description": "Initial investment cash outside reserve",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 20000
    },
    "protectedCash": {
      "type": "number",
      "title": "Protected cash outside investment portfolio",
      "description": "Protected cash outside investment portfolio",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 10000
    },
    "overpaymentClosingCost": {
      "type": "number",
      "title": "Upfront cost charged to overpayment option",
      "description": "Upfront cost charged to overpayment option",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 0
    },
    "monthlyMortgageInsurance": {
      "type": "number",
      "title": "Monthly mortgage insurance",
      "description": "Monthly mortgage insurance",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 0
    },
    "insuranceRemovalLTV": {
      "type": "number",
      "title": "Insurance removal loan-to-value (%)",
      "description": "Insurance removal loan-to-value (%)",
      "minimum": 0,
      "maximum": 100,
      "default": 78
    }
  },
  "required": [
    "currency",
    "principal",
    "homeValue",
    "mortgageRate",
    "mortgageMonths",
    "extraMonthly",
    "horizonMonths",
    "investmentReturn",
    "volatility",
    "paths",
    "seed",
    "initialInvestment",
    "protectedCash",
    "overpaymentClosingCost",
    "monthlyMortgageInsurance",
    "insuranceRemovalLTV"
  ]
}