# Calculation Method

## Snapshot selection

Values come from actual rows in `fidelity`, not interpolated values.

- End value: newest snapshot for standard ranges, or newest snapshot on/before custom end date.
- Start value: newest snapshot on/before the calculated start cutoff.
- One day / Previous snapshot: start value is the immediately preceding snapshot row.

This makes the report resilient to weekends, holidays, missing imports, and uneven snapshot times.

## Total return

`total return = ending value - beginning value`

## Total return percentage

`total return percent = ((ending value - beginning value) / beginning value) * 100`

## CAGR

`actual years = actual calendar days between selected snapshots / 365.25`

`CAGR = ((ending value / beginning value) ^ (1 / actual years) - 1) * 100`

CAGR is annualized. The report suppresses CAGR as `N/A` when the actual interval is less than 30 days, when beginning value is under $1.00, or when the ratio is invalid. The 30-day minimum prevents extreme annualized percentages for daily or weekly movements.

## Example

If snapshots are 1,098 days apart:

`actual years = 1098 / 365.25 = 3.006`

The report uses 3.006 as the CAGR exponent denominator rather than assuming exactly three years.
