{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bountyapi-com/json-schema/bountyapi-com-invest-calc-request-schema.json",
  "title": "InvestCalcRequest",
  "description": "Request body for POST /invest/calculate.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/bountyapi-com-api-openapi.json#/components/schemas/InvestCalcRequest",
  "properties": {
    "principal": {
      "type": "number",
      "minimum": 0.0,
      "title": "Principal",
      "description": "Initial amount invested (any currency). 0 is allowed for contributions-only growth."
    },
    "annual_rate": {
      "type": "number",
      "minimum": 0.0,
      "title": "Annual Rate",
      "description": "Annual interest / growth rate as a percent (e.g. 7 means 7%)."
    },
    "years": {
      "type": "integer",
      "minimum": 1.0,
      "title": "Years",
      "description": "Investment horizon in whole years."
    },
    "contribution_monthly": {
      "type": "number",
      "minimum": 0.0,
      "title": "Contribution Monthly",
      "description": "Recurring contribution amount per period. Its cadence is set by `contribution_frequency`: when monthly (default) this amount is added every month; when annual it is added once per year.",
      "default": 0.0
    },
    "contribution_frequency": {
      "$ref": "#/$defs/ContributionFrequency",
      "description": "How often `contribution_monthly` is added: monthly or annual.",
      "default": "monthly"
    },
    "interest_type": {
      "$ref": "#/$defs/InterestType",
      "description": "simple = interest accrues linearly on deposited capital only; compound = interest is earned on previously-accrued interest.",
      "default": "compound"
    },
    "compounding_frequency": {
      "$ref": "#/$defs/CompoundingFrequency",
      "description": "Compounding cadence for compound interest. Ignored when `interest_type` is simple. Monthly is the default.",
      "default": "monthly"
    }
  },
  "type": "object",
  "required": [
    "principal",
    "annual_rate",
    "years"
  ],
  "$defs": {
    "CompoundingFrequency": {
      "type": "string",
      "enum": [
        "monthly",
        "annually",
        "quarterly",
        "daily",
        "continuous"
      ],
      "title": "CompoundingFrequency",
      "description": "Compounding cadence for compound interest (ignored for simple interest)."
    },
    "ContributionFrequency": {
      "type": "string",
      "enum": [
        "monthly",
        "annual"
      ],
      "title": "ContributionFrequency",
      "description": "Cadence at which `contribution_monthly` is added to the balance."
    },
    "InterestType": {
      "type": "string",
      "enum": [
        "simple",
        "compound"
      ],
      "title": "InterestType",
      "description": "Whether interest accrues linearly (simple) or on prior interest (compound)."
    }
  }
}