precious-void / raydium-swap

Swap example using the Raydium SDK
128 stars 43 forks source link

Swap not executed #5

Closed SlavaGeorgiev closed 2 months ago

SlavaGeorgiev commented 7 months ago

Hi,

thank you for providing this peace of app. I have used in my app for a sniper. Feel free to give feedback i copied the most from your repo.

I'm wondering why the transaction is not going through. I changed the parameter executeSwap to true. It gives me a solscan transaction id. Ether on solscan I can see the transaction nether in my wallet I see the token.

Can you help me?

precious-void commented 7 months ago

@SlavaGeorgiev transaction id is simply a hash, it doesn't prove the transaction has actually landed. You should implement transaction confirmation logic (connection.confirmTransaction) to poll the signature result unless it has at least 1 confirmation.

Additionally, during congestion times a lot of transactions are dropped. You can try increasing fee, or spamming the transactions. Also probably the quality of RPC affects the success.