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

View File

@@ -299,6 +299,13 @@ export class DriftService {
return this.driftClient!
}
/**
* Get Solana connection instance
*/
getConnection(): Connection {
return this.connection
}
/**
* Get user instance
*/