feat(DISPLAY-002): GLD mode shows real share prices

This commit is contained in:
Bu5hm4nn
2026-03-28 21:45:00 +01:00
parent 24c74cacbd
commit dac0463d55
8 changed files with 800 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
id: DISPLAY-002
title: GLD Mode Shows Real GLD Pricing
status: backlog
status: done
priority: P0
size: S
depends_on:
@@ -15,13 +15,14 @@ acceptance_criteria:
- LTV calculated using GLD position value as collateral
- Options strike selection in GLD mode uses GLD share prices directly
- Hedge cost shown as $/share or $/position, not $/oz
notes:
- This is the key insight: GLD mode should NOT convert to gold
- User bought shares, they think in shares, they should see share metrics
- GLD backing decay is irrelevant in GLD mode (baked into price)
- Only when switching to XAU mode is conversion needed
implementation_hints:
- GLD mode short-circuits conversion logic
- Overview in GLD mode: position value = shares × GLD_price
- Hedge in GLD mode: strike = GLD_share_price × strike_pct
- Add `position.is_gld()` helper to check display treatment
implementation_notes:
- Added `display_mode` field to PortfolioConfig (default: "XAU")
- Created app/domain/conversions.py for display mode conversion utilities
- Updated portfolio_math.py to respect display_mode in spot resolution and snapshots
- Updated overview.py to show share prices/units in GLD mode
- Updated hedge.py to show share prices/units in GLD mode
- Updated settings.py to allow display mode selection
- Added tests/test_display_mode.py with comprehensive test coverage
- Default display mode remains "XAU" to preserve existing behavior
- GLD mode short-circuits conversion logic, showing share prices directly
completed: 2026-03-28