102: EMC Perps: show liquidation risk and account health

This commit is contained in:
2026-10-25 16:35:17 +01:00
parent 2f30712004
commit b4c7fe87d9
30 changed files with 1070 additions and 48 deletions
@@ -0,0 +1,14 @@
## ADDED Requirements
### Requirement: Read venue account health independently of TWAP
The reader SHALL resolve the official trader account for authority/PDA/subaccount and read its venue risk classification, effective collateral, maintenance margin and position liquidation prices. It SHALL validate identities and amounts, use venue reference prices with original observation times and normalize sentinel liquidation prices to unavailable. Existing pacing, cooldown, timeout and failure retention contracts SHALL apply without signing or TWAP dependence.
#### Scenario: Same-symbol isolated and Cross accounts
- **WHEN** the wallet holds the same market in multiple accounts without active TWAPs
- **THEN** each visible account receives only its own reported risk and liquidation data
- **AND** a mismatched trader identity or position size fails the observation
#### Scenario: Missing or unsupported risk field
- **WHEN** a response has missing optional risk values or an unknown tier
- **THEN** those values remain unavailable without assuming a safe state
- **AND** a nonpositive liquidation-price sentinel does not invalidate independent account health