Closed tushar-sahoo closed 5 months ago
please ensure you have enough sol in your wallet, this isn't a bug.
@cruzshia What I am facing is I have enough SOL in my wallet to cover the trnx fees. I am swapping from a token to SOL. But the error I am getting is that the SOL I already have in my account should be more than the SOL I will receive after the swap.
It is maybe because it is calling swap base out instead of swap base in for token to SOL swap. I did the swap on Raydium v3 UI and they are using swap base in.
pull latest code, run yarn install to update sdk and try again
Thanks @cruzshia for the update! The code works fine now 💯
This fails with insufficient lamports error if the amount of SOL to be received is less than the balance of the owner account but if I do a transaction in which I get less SOL than the balance of the owner account it succeeds.