Skip to content

Run continuous shared capital with settlement, FX and margin state - #32

Merged
PureSaber merged 2 commits into
mainfrom
codex/shared-capital-events
Oct 12, 2026
Merged

PureSaber merged 2 commits into
mainfrom
codex/shared-capital-events

Conversation

@PureSaber

@PureSaber PureSaber commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Continuous multi-strategy research now uses one exact QExec account with disjoint sleeve attribution. Explicit events cover fills/fees, cash and unit settlement holds, internal transfers, FX marks/conversions, outside flows, charges and linear-futures variation settlement. Every accepted event reconciles cash, positions, NAV and balanced journals; rejected events are atomic.

Native-currency futures losses are reserved directly from book cost, preventing base-FX reporting rounding from overstating buying power. Initial buying-power deficits and maintenance calls are separate. Losses remain visible, risk increases are blocked when underfunded, and explicit reductions/deposits/partial internal transfers may improve a deficit. Checkpoints bind full opening configuration and the accepted journal; mismatched or invalid restoration fails atomically. Existing APIs/schemas remain compatible. QDK is pinned to f85128307dd0e3407d24350282fe7b679b591309 (QDK PR #42).

Verification

  • Full Windows/Python 3.12 suite: 411 passed, 87.44% total coverage; all existing >=90% core pure branch gates passed.
  • Ruff check/format passed.
  • Independent Decimal tests cover two sleeves competing for the same cash, unsettled-unit/proceeds refusal, reinvestment, FX, futures settlements, exact PnL conservation, margin states, partial remediation, one-shot/chunk equality, ID conflicts and configuration-bound checkpoints.
  • Actual portfolio CLI integration: synthetic old/new NAV 1034/1026, independently expected PnL difference -8.
  • Exact final-head CI and CodeQL passed on Python 3.10–3.12 (CI). No merge or deployment requested.

Finite scope: long cash equities/ETFs and linear futures with declared notional-rate margin; fixed instrument ownership, no cross-sleeve offsets, inverse/options/short cash assets, automatic liquidation or broker execution. Synthetic tests do not establish market validity. No secrets or generated research artifacts are included. Roll back through revert while retaining historical results. Implements authorized batch item 4; no separate issue required.

@PureSaber
PureSaber merged commit c2cec00 into main Oct 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant