Files
trading_bot_v4/lib
mindesbunister c1bff0d0f4 fix: Use actual fill price from Drift tx logs instead of oracle price
- Added getActualFillPriceFromTx() helper using Drift SDK LogParser
- Extracts OrderActionRecord from transaction logs for real fill data
- P&L now calculated from exitPrice (actual fill) not oraclePrice
- Fixes ~5.7% P&L over-reporting issue ($7.53 on $133 trade)

Root cause: Oracle price at close time differs from actual fill price
Evidence: Drift showed $133.03, database showed $140.56
2026-01-11 20:45:20 +01:00
..