mindesbunister
9572b54775
fix(drift): calculate realizedPnL with leverage on USD notional, not base asset
- Old calculation: (closePrice - entryPrice) * sizeInBaseAsset = tiny P&L in dollars
- New calculation: profitPercent * leverage * notionalUSD / 100 = correct leveraged P&L
- Example: -0.13% price move * 10x leverage * $540 notional = -$7.02 (not -$0.38)
- Fixes trades showing -$0.10 to -$0.77 losses when they should be -$5 to -$40
- Applied to both DRY_RUN and real execution paths
2025-11-02 20:45:57 +01:00
..
2025-10-31 11:12:07 +01:00
2025-11-02 20:45:57 +01:00
2025-10-24 14:24:36 +02:00
2025-10-27 23:27:48 +01:00
2025-11-02 20:34:59 +01:00