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:
@@ -299,6 +299,13 @@ export class DriftService {
|
||||
return this.driftClient!
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Solana connection instance
|
||||
*/
|
||||
getConnection(): Connection {
|
||||
return this.connection
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user instance
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user