CRITICAL FIX: Add transaction confirmation to detect failed orders

- Added getConnection() method to DriftService
- Added proper transaction confirmation in openPosition()
- Check confirmation.value.err to detect on-chain failures
- Return error if transaction fails instead of assuming success
- Prevents phantom trades that never actually execute

This fixes the issue where bot was recording trades with transaction
signatures that don't exist on-chain (like 2gqrPxnvGzdRp56...).
This commit is contained in:
mindesbunister
2025-11-01 02:26:47 +01:00
parent a6005b6a5b
commit c82da51bdc
3 changed files with 36 additions and 3 deletions

3
.env
View File

@@ -351,4 +351,5 @@ NEW_RELIC_LICENSE_KEY=
USE_TRAILING_STOP=true
TRAILING_STOP_PERCENT=0.3
TRAILING_STOP_ACTIVATION=0.5
TRAILING_STOP_ACTIVATION=0.5
MIN_QUALITY_SCORE=40