Skip to content

Support per-holding expense ratios in the bucket YAML #20

Description

@DanMat

Goal

Today divvy compare --expense-ratio 0.0006 applies one fee to every holding. Real baskets mix cheap and pricey funds (e.g. SCHD 0.06% vs. an active fund 0.5%). Let a bucket YAML optionally carry per-ticker fees.

What to do

  1. Support an optional expense_ratios: map in the bucket YAML, e.g.:
    weights: { SCHD: 0.5, VYM: 0.5 }
    expense_ratios: { SCHD: 0.0006, VYM: 0.0006 }
  2. In src/divvy/cli.py, read it from the YAML and pass it to run_backtest(..., expense_ratios=...) (the engine already accepts a per-symbol dict — see src/divvy/engine.py). Fall back to the flat --expense-ratio when the map is absent.
  3. Add a test.

Acceptance criteria

  • A YAML with expense_ratios: applies per-ticker fees; missing key → unchanged behavior; 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