{
  "schemaVersion": 1,
  "slug": "investment-calculator-euro",
  "category": "finance",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "5ca7946597caf95f5b13fdb918c4f7bdde2b1b87618e9667f2a5290347db8a03",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/investment-calculator-euro.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "B_{k+1} = B_k × (1 + r_m) + M; r_m = (1 + r_a)^(1/12) − 1",
    "vars": [
      [
        "B_k",
        "Balance after k months"
      ],
      [
        "r_m",
        "Monthly rate"
      ],
      [
        "r_a",
        "Annual return (%)"
      ],
      [
        "M",
        "Monthly contribution (€)"
      ],
      [
        "n",
        "Number of months"
      ]
    ],
    "note": "No annualized return is calculated because regular contribution timing is simplified. Tax is applied once to positive aggregate growth at the end."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-12",
    "sources": [
      {
        "name": "Investor.gov — compound growth and monthly contributions",
        "url": "https://www.investor.gov/financial-tools-calculators/calculators/compound-interest-calculator"
      }
    ],
    "basis": "The annual return is treated as an effective rate, with monthly rate (1 + r)^(1/12) − 1. Contributions are added at each month’s end. The entered tax rate is deducted once from positive total growth at the end, and inflation discounts that net balance. Euro is the currency, not a country tax regime; fees, tax timing and variable returns are excluded.",
    "limitations": "Euro is the currency, not a country tax regime; fees, tax timing and variable returns are excluded.",
    "implementationHash": "5ca7946597caf95f5b13fdb918c4f7bdde2b1b87618e9667f2a5290347db8a03",
    "domain": "finance"
  },
  "contract": {
    "compute": "const r=annualReturn/100; const rm=Math.pow(1+r,1/12)-1; const n=Math.max(0,Math.round(years*12)); let bal=initialAmount; for(let i=0;i<n;i++) bal=bal*(1+rm)+monthlyContribution; const contributed=initialAmount+monthlyContribution*n; const growth=bal-contributed; const tax=growth>0?growth*taxRate/100:0; const net=bal-tax; const deflator=Math.pow(1+inflationRate/100,years); return {finalBalance:bal,totalContributed:contributed,totalGrowth:growth,taxesDue:tax,netBalance:net,realValue:deflator>0?net/deflator:net,doublingYears:r>0?Math.log(2)/Math.log(1+r):null};",
    "inputs": [
      {
        "name": "initialAmount",
        "type": "number",
        "default": 10000,
        "min": 0,
        "max": 5000000,
        "step": 100
      },
      {
        "name": "monthlyContribution",
        "type": "number",
        "default": 200,
        "min": 0,
        "max": 100000,
        "step": 10
      },
      {
        "name": "annualReturn",
        "type": "number",
        "default": 7,
        "min": -20,
        "max": 30,
        "step": 0.1,
        "slider": true
      },
      {
        "name": "years",
        "type": "number",
        "default": 20,
        "min": 1,
        "max": 60,
        "step": 1,
        "slider": true
      },
      {
        "name": "taxRate",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 60,
        "step": 0.005
      },
      {
        "name": "inflationRate",
        "type": "number",
        "default": 2,
        "min": 0,
        "max": 20,
        "step": 0.1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "finalBalance",
        "precision": 2,
        "unit": "€"
      },
      {
        "name": "totalContributed",
        "precision": 2,
        "unit": "€"
      },
      {
        "name": "totalGrowth",
        "precision": 2,
        "unit": "€"
      },
      {
        "name": "taxesDue",
        "precision": 2,
        "unit": "€"
      },
      {
        "name": "netBalance",
        "precision": 2,
        "unit": "€"
      },
      {
        "name": "realValue",
        "precision": 2,
        "unit": "€"
      },
      {
        "name": "doublingYears",
        "precision": 1,
        "unit": "years",
        "optional": true
      }
    ],
    "interpret": null
  }
}
