Files
trading_bot_v4/.github
mindesbunister 9b280a4016 docs: Add Common Pitfall #57 - P&L calculation inaccuracy fix
- Documented Nov 20, 2025 fix for 36% P&L calculation errors
- External closure handler was using monitoring loop's stale currentPrice
- Real incident: Database -$101.68 vs Drift -$138.35 actual
- Fix: Query Drift's userAccount.perpPositions[].settledPnl directly
- Fallback to calculation if Drift query fails
- Updated #56 commit reference from [pending] to a3a6222
- Both fixes deployed Nov 20, 2025 15:25 CET
2025-11-20 15:34:07 +01:00
..