chainstacklabs / raydium-sdk-swap-example-typescript

An example to swap tokens on Solana using the Raydium SDK, TypeScript, and Chainstack
MIT License
99 stars 35 forks source link

Transaction Signed but not appearing on solscan #12

Closed umaid56 closed 1 month ago

umaid56 commented 3 months ago

I am using the Raydium script to swap transactions, and I'm currently testing on the mainnet. 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

elroydo commented 3 months ago

Same issue on my end

Edit: It works! Turns out you need to ensure you set the direction in your 'swapConfig.ts' correctly. When swapping SOL for another token, setting the direction to 'out' works because it specifies the amount of the other token you want to receive. The system then calculates how much SOL you need to provide to get that amount.

image

miaoluyao commented 3 months ago

me too

fafaly commented 3 months ago

always happens,what should i do?

RomarioOP commented 2 months ago

Im having the same issue regardless of whether i set it to out. I get a transaction id but it's empty on solscan. Also nothing is deducted from my wallet and no trade is made

akegaviar commented 1 month ago

Hey guys, I updated the project to only use the trimmed version of mainnet.json. Details here https://github.com/chainstacklabs/raydium-sdk-swap-example-typescript/blob/main/README.md#tldr-quick-run

I did a test and it runs the transaction is executed. Feel free to check again.