Problem: Bot reported '32 open orders' when Drift UI showed 0 orders Root Cause: Filter checked orderId > 0 but didn't verify baseAssetAmount Impact: Misleading logs suggesting ghost order accumulation Fix: Enhanced filter with proper empty slot detection: - Check orderId exists and is non-zero - Check baseAssetAmount exists and is non-zero (BN comparison) - Added logging to show: 'Found X orders (checked 32 total slots)' Result: Bot now correctly reports 0 orders when none exist Verification: Container restart shows no false positives Files: lib/drift/orders.ts (cancelAllOrders function)
34 KiB
34 KiB