I am using the Raydium script to swap transactions, and I'm currently testing on the mainnet. I tried to swap a small amount of 0.001 SOL, but each time I do this, I receive a transaction hash. However, when I copy and paste this hash for verification, it shows nothing. Additionally, no tokens appear in my wallet, nor is any SOL deducted. When I run the script again with the same code, it attempts to swap again. Could this issue be due to the low amount I am swapping, or is there another problem?
https://solscan.io/tx/2fy1tsER1KbcYp6hPeWQGxmvipFV7kyEZHprug5VhcesvyBMBiEL8TJ1dLuj6hu62criv9t9qm6Xuv4qzJneHf5X
const swapTransaction = await Liquidity.makeSwapInstructionSimple({
connection: this.connection,
makeTxVersion: useVersionedTransaction ? 0 : 1,
poolKeys: {
...poolKeys,
},
userKeys: {
tokenAccounts: userTokenAccounts,
owner: this.wallet.publicKey,
},
amountIn: amountIn,
amountOut: minAmountOut,
fixedSide: fixedSide,
config: {
bypassAssociatedCheck: false,
},
});
const recentBlockhashForSwap = await this.connection.getLatestBlockhash();
const instructions =
swapTransaction.innerTransactions[0].instructions.filter(Boolean);
if (useVersionedTransaction) {
const versionedTransaction = new VersionedTransaction(
new TransactionMessage({
payerKey: this.wallet.publicKey,
recentBlockhash: recentBlockhashForSwap.blockhash,
instructions: instructions,
}).compileToV0Message()
);
versionedTransaction.sign([this.wallet]);
return versionedTransaction;
}
const legacyTransaction = new Transaction({
blockhash: recentBlockhashForSwap.blockhash,
lastValidBlockHeight: recentBlockhashForSwap.lastValidBlockHeight,
feePayer: this.wallet.publicKey,
});
legacyTransaction.add(...instructions);
return legacyTransaction;
}