solana-trading-cli icon indicating copy to clipboard operation
solana-trading-cli copied to clipboard

Error: InvalidSplTokenProgram for Raydium basic swaps

Open runzsh opened this issue 8 months ago • 7 comments

Unable to land raydium swaps with the cli. The error, when tried to force land txn with bloXroute, as seen on solscan comes out to be:

#3 Raydium Liquidity Pool V4 instruction
> Program log: Error: InvalidSplTokenProgram
> Program 
image
[Raydium Liquidity Pool V4](https://solscan.io/account/675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8) consumed 10088 of 61012 compute units
> Program returned error: custom program error: 0x26

Txn https://solscan.io/tx/37SHUfxWtp6LXnyG7LtGtXi3m1Y1Ak1YxWGmnb9PraTDyYNyHMe6Se7XsPnhmaVMwYBZpCTe2iCqtJhH4jtGyEfE

runzsh avatar Apr 11 '25 18:04 runzsh

please help tested again, thanks, i updated the swapOnlyAmmUsingBloXRoute method

outsmartchad avatar Apr 11 '25 18:04 outsmartchad

thanks, just tested i feel its not about jito or bloX. its related to raydium txn generation. with jito unable to confirm the txn even with high fee, and blox just lands it as a failure (nature of it).

i noticed in src/raydium/pool/swap.ts you have used raydium-sdk (not the v2), could it be the problem. thanks.

runzsh avatar Apr 11 '25 18:04 runzsh

Ah yes, we need to rewrite it as raydium sdk package somehow keeps changing its function, I will find the latest IDL of Raydium program later and try anchor client to generate the swap txn. Thanks

outsmartchad avatar Apr 11 '25 18:04 outsmartchad

Come to dc channel if u need help thanks !

outsmartchad avatar Apr 11 '25 18:04 outsmartchad

Yeahh, pls share link. The last one is expired ig. Thanks

runzsh avatar Apr 11 '25 18:04 runzsh

https://discord.gg/pVXx52jk

outsmartchad avatar Apr 11 '25 18:04 outsmartchad

From what i noted is we have to change every @raydium-io/raydium-sdk usage to v2 and the respective functions. Raydium v2 has different functions for formatting pool info eg. ApiPoolInfoV4 and more. @outsmartchad can you help me do it faster since you know the code in and out. I am struggling with solana-trading-cli/src/raydium/Pool/formatAmmKeysById.ts formatting especillay. thanks

PS I referred to raydium-sdk-V2-demo to confirm we have to make changes.

runzsh avatar Apr 12 '25 03:04 runzsh