0

I working on solana trading bot, i am using @solana/web3 for blockchain communication and raydium amm pools for performing swaps. I need the fastest way to perform transactions and know if it processed or rejected. Now I am using this code

const transactionHash = await connection.sendTransaction(transaction);
const latestBlockHash = await connection.getLatestBlockhash();

await connection.confirmTransaction({
  blockhash: latestBlockHash.blockhash,
  lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
  signature: transactionHash,
}, 'processed');

But it takes usually 1 minute to perform transaction or get rejected and it is too long

1 Answer 1

1

Are you using the public RPC endpoints?

You could change RPC providers and manually benchmark to see which one is the fastest. I'd recommend checking out Triton One but a full list can be found here https://solana.com/rpc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.