100: Add Perps collateral, leverage, value, uPnL and gross-exposure totals in EMC

This commit is contained in:
2026-10-24 17:53:30 +02:00
parent e0b69f6430
commit 828f01db7c
10 changed files with 154 additions and 9 deletions
@@ -0,0 +1,22 @@
# Design
## Context
See proposal.md. Venue snapshots include successful-empty, not-yet-read and failed scopes. Cross accounts hold capital independently of positions, so position count alone cannot determine visibility.
## Goals / Non-Goals
**Goals:** Remove childless headings while preserving capital totals and failure visibility.
**Non-Goals:** Changing integration reads, snapshot data, wallet visibility or refresh scheduling.
## Decisions
- Skip a venue during tree reconciliation only when both its positions and Cross-account lists are empty. Filtering the service snapshot instead would lose unknown scopes and could produce misleading totals.
- Include childless venues' read status in wallet tooltip notes so hiding their headings does not hide the reason for unavailable totals. Keep the existing venue tooltips when rows exist.
- Reconcile surviving items with the existing IDs; a venue returning after removal is a new expanded group. Its wallet and other venue rows remain retained.
## Risks / Trade-offs
- Hidden failed/initial reads can resemble a successfully empty portfolio → preserve unavailable totals and expose the exact status on the wallet row.
- A Phoenix account may have capital without positions → treat the Cross account itself as a child.