Remove cash events logic from fund observability#12
Merged
Conversation
The interest inference in _sync_interest_from_balance_locked() was fundamentally flawed. It ran after each fill sync, comparing a stale broker cash balance against incrementally-synced fill data. This caused each fill's notional value to be misattributed as "interest", producing phantom entries like $1,033,369 on a $1M fund. There is no reliable way to infer interest from a point-in-time balance snapshot against incrementally-synced data, so removing this entirely is the correct fix. - Remove _sync_interest_from_balance_locked() and related methods - Remove provider parameter from FundSyncService - Remove cash_events.json file handling - Update tests to match Co-authored-by: Bryce Bjork <brycedbjork@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Removed the flawed cash events inference system that was generating phantom interest entries. The
_sync_interest_from_balance_locked()method was fundamentally broken—it ran after each fill sync, comparing a stale broker cash balance against incrementally-synced fill data, causing each fill's notional value to be misattributed as interest. This produced bogus entries like $1,033,369 on a $1M fund.Changes
_sync_interest_from_balance_locked()method and related helpersFundSyncService.__init__()Testing
All 94 daemon tests pass. The service now only syncs decisions and fills.
🤖 Generated with Claude Code