calculate_payback_period
Calculate the payback period: how many years (including a fractional final year) until cumulative cash flows recover the initial investment, ignoring the time value of money. Formula: Payback = the year t where cumulative cash flow turns positive. WHEN TO USE: Use as a quick liquidity/risk screen — shorter payback means capital is at risk for less time. Useful alongside NPV/IRR, never as the sole investment criterion. WHEN NOT TO USE: Do NOT use as the primary decision metric — it ignores cash flows after payback, profitability, and the time value of money (use calculate_npv or calculate_irr for those). BEHAVIOUR: If cumulative cash flow never turns positive, an explicit error is returned ("investment is never recovered within the provided cash flows") rather than a number. RETURNS: JSON object { payback_period_years: number (e.g. 3.4), inputs }. If the cash flows never recover the investment, returns an explicit error stating no payback occurs. PARAMETERS: cash_flows (required): Ordered cash flows starting at time 0 (first element is the initial investment, typically negative), e.g. [-250000, 50000, 75000, 100000, 125000]. Must contain at least one negative (investment) followed by inflows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cash_flows | Yes | Ordered cash flows starting at time 0 (first element is the initial investment, typically negative), e.g. [-250000, 50000, 75000, 100000, 125000]. Must contain at least one negative (investment) followed by inflows. |