Files
nofx/trader
ZhouYongyou c46f0be315 fix(trader): prevent division by zero in autoSyncBalanceIfNeeded
- Add check for oldBalance <= 0 before calculating changePercent
- Directly update to actualBalance if initialBalance is invalid
- Add warning logs for database nil scenarios
- Prevent panic when initial_balance is 0 in database

Applies same critical fix from feat/auto-balance-sync (3a5dea7)
to z-dev branch with adapted database type handling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-04 21:07:55 +08:00
..