Functional Weave
Code in Rust

invest.drawdown-sustainability@1.0.0

README.md

1,617 bytes · view raw

# invest.drawdown-sustainability

How long a pot lasts when a fixed (or inflation-rising) income is drawn from
it each year and the rest grows at a constant rate: the arithmetic behind
"will my pension last?" and the 4% rule.

## The convention

Each year, in whole minor units:

1. The withdrawal is taken at the **start** of the year: the planned amount,
   or everything left if that is less.
2. What remains grows by `annualGrowthBasisPoints`, rounded half away from
   zero (`money.apply-rate`, half-up).
3. The next year's planned withdrawal rises by
   `withdrawalIncreaseBasisPoints`, rounded the same way.

The run stops in the year the pot reaches zero, or after `maxYears`.
`fullYears` counts the years in which the whole planned income was paid; a
last, partial year appears in the schedule but not in `fullYears`. A pot that
reaches exactly zero on a full withdrawal counts that year and is
`exhausted`.

Taking the withdrawal first and growing the remainder is the cautious order,
and the one an income drawn in advance follows. Growing first and then
withdrawing gives a longer life for the same inputs; the vectors pin the
order used here.

## What it does not do

It uses a single constant growth rate, so it says nothing about sequence of
returns risk; run it for several rates, or use a stochastic model, for that.
It ignores charges (see `invest.fee-drag`), tax on withdrawals and the tax-free
lump sum; pass net figures if you need them.

## Errors

A negative pot, a withdrawal of 0 or less, growth or an increase below
-10000, `maxYears` outside 1-100, fractional amounts and mixed currencies.