{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://klarfort.com/tools/deposit-calculator/schema.json",
  "title": "Deposit and savings interest 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": "Deposit principal",
      "description": "Deposit principal",
      "minimum": 0,
      "maximum": 1000000000,
      "default": 10000
    },
    "annualRate": {
      "type": "number",
      "title": "Nominal annual interest rate (%)",
      "description": "Nominal annual interest rate (%)",
      "minimum": 0,
      "maximum": 100,
      "default": 4
    },
    "compoundsPerYear": {
      "type": "integer",
      "title": "Compounding periods per year",
      "description": "1 annual, 2 semiannual, 4 quarterly, 12 monthly, 365 daily.",
      "enum": [
        1,
        2,
        4,
        12,
        365
      ],
      "default": 12
    },
    "months": {
      "type": "integer",
      "title": "First deposit maturity months",
      "description": "First deposit maturity months",
      "minimum": 1,
      "maximum": 600,
      "default": 12
    },
    "taxPercent": {
      "type": "number",
      "title": "Tax rate on net positive interest (%)",
      "description": "Tax rate on net positive interest (%)",
      "minimum": 0,
      "maximum": 100,
      "default": 0
    },
    "withdrawAfterMonths": {
      "type": "integer",
      "title": "Withdrawal month (0 means each maturity)",
      "description": "Withdrawal month (0 means each maturity)",
      "minimum": 0,
      "maximum": 600,
      "default": 0
    },
    "penaltyInterestMonths": {
      "type": "integer",
      "title": "Early penalty in months of simple interest",
      "description": "Early penalty in months of simple interest",
      "minimum": 0,
      "maximum": 120,
      "default": 0
    },
    "mode": {
      "type": "string",
      "title": "Deposit structure",
      "description": "Deposit structure",
      "enum": [
        "single",
        "ladder"
      ],
      "default": "single"
    },
    "ladderRungs": {
      "type": "integer",
      "title": "Ladder rungs",
      "description": "Ladder rungs",
      "minimum": 1,
      "maximum": 12,
      "default": 3
    },
    "ladderSpacingMonths": {
      "type": "integer",
      "title": "Months between ladder maturities",
      "description": "Months between ladder maturities",
      "minimum": 1,
      "maximum": 60,
      "default": 12
    },
    "ladderRateStep": {
      "type": "number",
      "title": "Annual rate increase per rung (percentage points)",
      "description": "Annual rate increase per rung (percentage points)",
      "minimum": -20,
      "maximum": 20,
      "default": 0
    }
  },
  "required": [
    "currency",
    "principal",
    "annualRate",
    "compoundsPerYear",
    "months",
    "taxPercent",
    "withdrawAfterMonths",
    "penaltyInterestMonths",
    "mode",
    "ladderRungs",
    "ladderSpacingMonths",
    "ladderRateStep"
  ]
}