feat(log): expose the fx pnl component in the financial data log#4218
Merged
Conversation
Collaborator
Author
|
Both review tracks (conventions + correctness) came back clean on the first pass. Verified explicitly: the price-effect decomposition (previous net position times price change, quantity effect stays in the yield residual, no cross term), the skew-safe reference point (the predecessor is the last valid entry, matching how the chart consumes the series), the financialType filter parity with the balance buckets (synthetic RefCredit contributes nothing), and single-parse reuse of the predecessor message in the every-minute job. |
Total balance moves through transactional yield, price drift on open positions and errors - the price component was only derivable as a residual. Every financial data log entry now carries fxPnlChf: the sum of previous net position times price change per financialType asset since the previous snapshot. Additive and backward-compatible: the first entry omits the field, the dashboard maps missing values to zero, the valid-flag chain and safety mode are untouched.
926c935 to
352f47f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
totalBalanceChf(the operating equity) moves through transactional yield, price drift on open positions (FX) and errors. The FX component has not been visible anywhere - it was only derivable as a residual between the change log and the balance delta.Every
FinancialDataLogentry now carriesbalancesTotal.fxPnlChf: the price effect since the previous snapshot, computed as the previous net position times the price change, summed over all financialType assets. With it, every equity move decomposes into yield + fx + rest.Test plan
format:check/lint/type-checkclean