103: EMC Perps: propagate Phoenix TWAP warnings through the tree to Perpetual Contracts
This commit is contained in:
@@ -33,8 +33,8 @@ HTTP, authentication, malformed schema, identity mismatch and numeric conversion
|
||||
- **THEN** the read fails instead of returning an empty or partial portfolio
|
||||
|
||||
#### Scenario: Empty account
|
||||
- **WHEN** a valid trader snapshot has no subaccounts or no nonzero positions
|
||||
- **THEN** an empty result is returned without market-price or TWAP requests
|
||||
- **WHEN** a valid trader snapshot has no subaccounts
|
||||
- **THEN** an empty result is returned without market-price or TWAP requests; existing empty subaccounts still receive TWAP discovery
|
||||
|
||||
#### Scenario: Public API rate limit
|
||||
- **WHEN** the shared adapter issues requests for PROD and TEST
|
||||
@@ -62,7 +62,7 @@ Equity SHALL include collateral, undiscounted price PnL and signed unsettled fun
|
||||
- **AND** effective Cross leverage uses 103 USD as its denominator
|
||||
|
||||
### Requirement: Read precise TWAP snapshots for held markets
|
||||
The reader SHALL read official TWAP snapshots through its existing paced transport and associate orders by authority, PDA, subaccount and market identity. Only orders with actual fills and remaining children on an existing position SHALL be exposed. Quantities SHALL use exact lot conversion and explicit/legacy dust semantics. Unavailable size inputs SHALL remain unknown. Existing mark prices SHALL be reused without Ticker reads.
|
||||
The reader SHALL read official TWAP snapshots through its existing paced transport and associate orders by authority, PDA, subaccount and market identity. Only orders with actual fills and remaining children SHALL be exposed. Matched orders SHALL retain position progress; valid unresolved orders SHALL retain account-owned warnings with identity, raw counters/fills and original observation time. Existing accounts without positions SHALL receive TWAP discovery. Quantities SHALL use exact lot conversion and explicit/legacy dust semantics. Unavailable size inputs SHALL remain unknown. Existing mark prices SHALL be reused without Ticker reads.
|
||||
|
||||
#### Scenario: Explicit and legacy dust
|
||||
- **WHEN** total children are 5, regular size 10 lots and explicit dust count/size are 2/3
|
||||
@@ -71,7 +71,24 @@ The reader SHALL read official TWAP snapshots through its existing paced transpo
|
||||
|
||||
#### Scenario: Identity mismatch or unfilled order
|
||||
- **WHEN** authority/PDA/subaccount/asset identities disagree or an order has no fills
|
||||
- **THEN** disagreement fails the read, while a valid unfilled order is absent from returned positions' TWAP data
|
||||
- **THEN** disagreement fails the read, while a valid unfilled order is absent from all TWAP data and warnings
|
||||
|
||||
#### Scenario: Missing market or missing position
|
||||
- **WHEN** a filled outstanding order has missing market metadata or no matching open position
|
||||
- **THEN** a warning preserves its identity and raw progress without inventing a symbol, conversion, price or execution status
|
||||
- **AND** healthy positions and account risk remain available
|
||||
|
||||
#### Scenario: Existing empty account
|
||||
- **WHEN** an account has no held positions but has a filled outstanding TWAP
|
||||
- **THEN** TWAP discovery returns its warning without fetching market prices or creating positions
|
||||
|
||||
#### Scenario: Completed order
|
||||
- **WHEN** an order has no remaining children
|
||||
- **THEN** it is absent from active TWAP data and warnings
|
||||
|
||||
#### Scenario: Matched order with unavailable timing
|
||||
- **WHEN** an otherwise valid matched filled order has no usable future next-execution estimate
|
||||
- **THEN** its progress remains available with a timing warning that does not assert execution has stopped
|
||||
|
||||
### Requirement: TWAP time estimates disclose their slot assumption
|
||||
The reader SHALL estimate future execution times from snapshot slot, due slot and cooldown using a documented nominal slot duration and response observation time. Completion SHALL derive from remaining executions, never expiry. Already-due schedules, invalidated completion schedules and unrepresentable estimates SHALL remain unavailable instead of predicting fills.
|
||||
|
||||
Reference in New Issue
Block a user