{
  "schemaVersion": 1,
  "slug": "down-payment-calculator",
  "category": "finance",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "fba81dd6a0f7251c2b79adab4c0130c6663d76d54cd7986b157c871f14baf7b4",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/down-payment-calculator.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": "L = P × (1 − d ÷ 100); M = L × r × (1+r)^n ÷ ((1+r)^n − 1); I = M × n − L",
    "vars": [
      [
        "P",
        "home price"
      ],
      [
        "d",
        "down payment, %"
      ],
      [
        "L",
        "loan amount"
      ],
      [
        "r",
        "monthly interest rate"
      ],
      [
        "n",
        "number of months"
      ],
      [
        "M",
        "monthly payment"
      ],
      [
        "I",
        "total interest"
      ]
    ],
    "note": "r = annual rate ÷100÷12 and n = years×12. If r = 0 the payment is L÷n; I is the total interest over the full term."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "OpenStax — Loan amortization",
        "url": "https://openstax.org/books/principles-finance-2e/pages/8-3-loan-amortization"
      }
    ],
    "basis": "Fixed monthly payment = P × i / (1 - (1 + i)^(-n)); i is annual percent / 1200. At zero interest, payment = P / n. P is home price minus the percentage down payment.",
    "limitations": "Fixed nominal rate and monthly payments; fees, insurance, taxes and lender-specific daily accrual are excluded. Fractional month counts are mathematical projections, not an actual payment schedule.",
    "implementationHash": "fba81dd6a0f7251c2b79adab4c0130c6663d76d54cd7986b157c871f14baf7b4"
  },
  "contract": {
    "compute": "const loan = homePrice*(1-downPercent/100); const r=rate/100/12, n=years*12; const m = r ? loan*r*Math.pow(1+r,n)/(Math.pow(1+r,n)-1) : loan/n; return { downPayment: homePrice*downPercent/100, loanAmount:loan, monthly:m, totalInterest:m*n-loan };",
    "inputs": [
      {
        "name": "homePrice",
        "type": "number",
        "default": 400000,
        "min": 0,
        "max": 100000000,
        "step": 1000
      },
      {
        "name": "downPercent",
        "type": "number",
        "default": 20,
        "min": 0,
        "max": 100,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "rate",
        "type": "number",
        "default": 6.5,
        "min": 0,
        "max": 30,
        "step": 0.01,
        "slider": true
      },
      {
        "name": "years",
        "type": "number",
        "default": 30,
        "min": 1,
        "max": 50,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "downPayment",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "loanAmount",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "monthly",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "totalInterest",
        "precision": 2,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
