Skip to content

fix(log): restore unfiltered pending netting#4348

Merged
TaprootFreak merged 1 commit into
developfrom
fix/log-unfiltered-pending-netting
Jul 23, 2026
Merged

fix(log): restore unfiltered pending netting#4348
TaprootFreak merged 1 commit into
developfrom
fix/log-unfiltered-pending-netting

Conversation

@TaprootFreak

Copy link
Copy Markdown
Collaborator

Summary

  • preserve signed unfiltered Kraken and Scrypt pending legs until aggregate netting
  • keep the existing aggregate floor for a net-negative pending balance
  • add a regression test with opposing Kraken legs for the same bank asset

Root cause

A recent change floored every unfiltered pending leg independently. This erased a negative counterpart before aggregation, allowing an opposing positive Kraken leg to survive as a phantom pending balance.

The filtered path remains unchanged. The unfiltered path now again nets all signed components before the existing totalPlusPending guard applies its zero floor.

Verification

  • regression test fails against the previous implementation with a positive phantom balance
  • affected test suite: 68 tests passed
  • npm run format:check
  • npm run lint
  • npm run type-check

@github-actions

Copy link
Copy Markdown

ℹ️ New TODOs/FIXMEs (1)

+        address: yapealEUR.bic.padEnd(11, 'XXX'),

@TaprootFreak

Copy link
Copy Markdown
Collaborator Author

Review record:

  • Preliminary review found one conformance issue in the new test helper; it was fixed before the final commit.
  • Pre-PR verification: 2 independent reviewers, 0 findings.
  • Final PR verification: 2 independent reviewers, 0 findings.
  • CI: all 7 checks passed, including Build and test.

No unresolved findings remain.

@TaprootFreak
TaprootFreak marked this pull request as ready for review July 23, 2026 19:28
@TaprootFreak
TaprootFreak merged commit b5b0e3d into develop Jul 23, 2026
7 checks passed
@TaprootFreak
TaprootFreak deleted the fix/log-unfiltered-pending-netting branch July 23, 2026 19:37
TaprootFreak added a commit that referenced this pull request Jul 23, 2026
…4349)

The four pending leg fields (fromKraken/toKraken/fromScrypt/toScrypt) dropped negative values from the FinancialDataLog JSON breakdown, because getJsonValue defaults returnNegativeValue to false. Since #4348 lets the unfiltered legs net negative, a negative leg silently disappeared from the breakdown while still subtracting from totalPlusPending, so the visible components no longer summed to the total. Pass returnNegativeValue=true (matching this file's convention for plusBalanceChf/minusBalanceChf/totalBalanceChf/plusBalance/minusBalance/totalPlus/liquidity) so signed legs stay visible and the breakdown reconciles — restoring the diagnostic used to spot equity phantoms.
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