- Group trades by symbol before validation - Keep only most recent trade per symbol - Close older duplicates with DUPLICATE_CLEANUP reason - Prevents reopening old closed trades when checking recent trades Bug: Startup validator was reopening ALL closed trades for a symbol if Drift showed one position, causing 3 trades to be tracked when only 1 actual position existed on Drift. Impact: Position Manager was tracking ghost positions, causing confusion and potential missed risk management.
7.8 KiB
7.8 KiB