102: EMC Perps: show liquidation risk and account health

This commit is contained in:
2026-10-26 06:05:26 +01:00
parent 2f30712004
commit e71a8daa8d
30 changed files with 1070 additions and 48 deletions
@@ -95,3 +95,16 @@ The service SHALL publish immutable TWAP observations only on matching existing
- **WHEN** the TWAP read fails after a successful venue observation
- **THEN** prior positions, TWAP observations and original timestamps remain with failed venue status
- **AND** other venues and wallets continue refreshing
### Requirement: Risk observations preserve scope and exact meaning
Snapshots SHALL preserve isolated risk prices and Cross account tiers/thresholds with original observation times. Signed price distance SHALL use the current venue reference as denominator and preserve boundary crossing. Cross MM utilization SHALL use effective collateral, with nonpositive denominators unavailable. Group risk SHALL count each isolated position and shared account once and retain worst known severity plus unknown/stale counts without averaging.
#### Scenario: Shared positions and incomplete data
- **WHEN** a Cross account owns multiple positions and another scope has unknown risk
- **THEN** account risk contributes once and the aggregate exposes the unknown count
- **AND** its closing Value is not substituted for effective collateral
#### Scenario: Boundary and zero denominator
- **WHEN** isolated distance reaches/crosses zero or effective collateral is nonpositive
- **THEN** the signed boundary is preserved or MM percentage is unavailable respectively
- **AND** display rounding does not determine risk classification