You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #409 (milestone: Account Margin Admission). Step 3 of 8. Depends on #410, #411.
Problem
account.Snapshot exposes each position's AvgPrice and a single aggregate UnrealizedPnL, but no per-position current mark. An account-level rule therefore cannot value positions other than the proposal's.
The simulator already tracks per-listing marks internally (s.marks in internal/adapters/broker/sim/account.go) but doesn't expose them.
The simulator's BuyingPower/MarginAvailable mirror cash and MarginUsed is always zero (a documented M3 placeholder). Cash can go negative with no check.
Scope
Expose a per-position current mark (and/or market value) on the snapshot, following ADR-066's valuation decision, and document its staleness ("as of the simulator's last observation of that listing").
Add InitialMarginRatio to sim.Config, validated as positive; default per ADR-066.
Part of #409 (milestone: Account Margin Admission). Step 3 of 8. Depends on #410, #411.
Problem
account.Snapshotexposes each position'sAvgPriceand a single aggregateUnrealizedPnL, but no per-position current mark. An account-level rule therefore cannot value positions other than the proposal's.s.marksininternal/adapters/broker/sim/account.go) but doesn't expose them.BuyingPower/MarginAvailablemirror cash andMarginUsedis always zero (a documented M3 placeholder). Cash can go negative with no check.Scope
InitialMarginRatiotosim.Config, validated as positive; default per ADR-066.MarginUsed= required margin on current gross notionalMarginAvailable= equity − MarginUsedBuyingPower= MarginAvailable / ratioBuyingPower, respect the ratio automatically. Verify that.ConfigDigest.Acceptance criteria
AdvanceMarginAvailableand no forced actionsimtests still pass. Where expected values change (margin fields), explain the reason in the PR.go test -race ./internal/adapters/broker/sim/...passes.