Skip to content

dca plan: target_weights keys differing only in case collapse silently #848

Description

@eaitbrahim

Found reviewing #846.

select_universe (keel/commands/dca_plan.py:227) folds target_weights keys with .upper() in a dict comprehension, and _parse_target_weights does not validate or dedupe keys. A config with both btc and BTC keeps whichever comes last and drops the other with no excluded line.

Reproduced: target_weights={"btc": 0.9, "BTC": 0.1, "ETH": 0.5} -> allocations [(BTC, 0.1), (ETH, 0.5)], excluded names only PAXG; the 0.9 weight vanished.

Fix: refuse (DcaPlanError naming both keys) when two keys fold to the same asset, with a test.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions