Skip to content

Add a CAGR (annualized total return) column to the comparison #21

Description

@DanMat

Goal

report.summarize() reports total_return_pct (cumulative) and xirr_pct (money-weighted). A CAGR column (time-annualized total return) is a familiar third lens people ask for.

What to do

  1. In src/divvy/report.py summarize(), add a cagr_pct column: (ending_value / total_contributed) ** (1/years) - 1, where years is the span from first contribution to as_of. (It's a rough measure for a DCA account — document that in a comment; XIRR remains the rigorous one.)
  2. Add the {:.2f}% format in the CLI table and the Streamlit UI styler (src/divvy/ui.py).
  3. Add a test in tests/ (see tests/test_analytics.py for the pattern).

Acceptance criteria

  • New cagr_pct column shows in CLI + UI; test passes; ruff clean.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions