Skip to content

fix: include blockchain fees in totalMinus calculation#3442

Merged
TaprootFreak merged 1 commit intodevelopfrom
fix/financial-changes-total-minus
Mar 16, 2026
Merged

fix: include blockchain fees in totalMinus calculation#3442
TaprootFreak merged 1 commit intodevelopfrom
fix/financial-changes-total-minus

Conversation

@TaprootFreak
Copy link
Collaborator

Summary

  • Bug fix: totalBlockchainFee was never included in totalMinus in getChangeLog() (since DEV-3275, Oct 2024), causing the Net Total on the Financial Log dashboard to be overstated
  • DTO expansion: Expose bank and kraken expense categories in the financial changes API response for full transparency

Changes

log-job.service.ts

- const totalMinus = bankTxFee + totalKrakenFee + totalBinanceFee + totalRefReward;
+ const totalMinus = bankTxFee + totalKrakenFee + totalBinanceFee + totalRefReward + totalBlockchainFee;

financial-log.dto.ts + dashboard-financial.service.ts

  • Added bank: number and kraken: { total, withdraw, trading } to the minus object in FinancialChangesEntryDto
  • Added corresponding mapping in mapChangesLogToEntry()

Test plan

  • Verify financial changes endpoint returns bank and kraken fields
  • Verify minus.total now equals ref + binance + blockchain + bank + kraken
  • Verify total equals plus.total - minus.total
  • Compare dashboard Net Total before/after — expect lower values reflecting actual blockchain costs

Closes #3438

The getChangeLog() method excluded blockchain fees (cryptoInputFee,
payoutOrderFee, tradingOrderFee) from totalMinus, causing the net
total on the financial dashboard to be overstated. Also expose bank
and kraken expense categories in the changes DTO for full transparency.

Refs #3438
@TaprootFreak TaprootFreak marked this pull request as ready for review March 16, 2026 17:18
@TaprootFreak TaprootFreak merged commit e840db0 into develop Mar 16, 2026
8 checks passed
@TaprootFreak TaprootFreak deleted the fix/financial-changes-total-minus branch March 16, 2026 17:18
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.

Financial Changes Log: totalBlockchainFee missing from totalMinus calculation

1 participant