Skip to content

feat: add historical account FX lifecycle#125

Merged
luisleo526 merged 1 commit into
mainfrom
codex/historical-account-fx
Jul 20, 2026
Merged

feat: add historical account FX lifecycle#125
luisleo526 merged 1 commit into
mainfrom
codex/historical-account-fx

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

What

  • add an append-only C ABI for effective-time quote-to-account FX curves
  • route historical sizing, admission, open P&L, commissions, realized P&L, and the TV-pinned 1x carried-long broker rollover through the active FX value
  • freeze signal-time FX and entry-time commission snapshots at their actual lifecycle boundaries
  • add the JSON daily-close adapter and fingerprint the exact effective values plus raw provider provenance
  • fail closed for unsupported streaming/COOF/magnifier routes, carried short/leveraged rate changes, and any failed public-corpus execution
  • document the 27-symbol ABI and historical-run support boundary

Why

The previous scalar account_currency_fx setting applied one present-day value to an entire historical run. That retroactively repriced position notional, P&L, and fees, and it also mixed signal-time sizing with fill-time conversion. A second masking defect recomputed already-paid open-entry commission at the new rate during an FX rollover. Together those lifecycle errors could hide or manufacture broker margin actions.

The new curve is inclusive as-of with scalar fallback before its first point. Daily provider closes become effective at D+1 00:00 UTC in the harness. Entry fees remain fixed at their fill-time account value while TradingView-compatible realized trade reporting continues to convert the complete trade at exit-time FX.

Verification

  • ctest --test-dir build --output-on-failure -j 16: 113/113 passed
  • python3 scripts/fingerprint_self_test.py: 78/78 passed
  • python3 scripts/run_corpus_self_test.py: 5/5 fail-closed cases passed
  • JOBS=16 scripts/run_corpus.sh: 252/252 strategy executions passed; 247 Excellent / 4 Strong / 1 known anomaly
  • canonical 416-strategy downstream gate: 355 Excellent / 46 Strong / 4 Moderate / 2 Weak, +1 upgrade / 0 downgrades; expected error identities unchanged
  • exhaustive N=5 interaction matrix: 32/32 cells passed, GO; all-off consumer Strong, all-on Excellent at 100% and count delta 0; direct production tapes match the all-on cell exactly
  • final production identity rerun matched both graded consumers across all 12 semantic/tape fields (domain-result.json SHA-256 5f85f1491efe1969055c94d09eb9db3432b2b6f021f78e76266ddfb865ac089a)
  • injected runner-failure smoke: error surfaced and run_corpus.sh exited before stale-output verification
  • bash -n scripts/run_corpus.sh and git diff --check

@luisleo526
luisleo526 merged commit f268342 into main Jul 20, 2026
7 checks passed
@luisleo526
luisleo526 deleted the codex/historical-account-fx branch July 20, 2026 22:59
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