I am exploring ways to automate the process of buying SPL Solana tokens using Python and the Solana SDK. I have been working with the Solana blockchain and understand the basics of creating wallets, sending transactions, and interacting with smart contracts.

However, I am specifically looking for guidance on programmatically buying SPL tokens. I would appreciate it if anyone could provide a step-by-step example or code snippet demonstrating how to initiate a purchase of SPL tokens using Python and the Solana SDK.

Executing the transaction and obtaining confirmation. I've gone through the official Solana documentation, but a practical example or code snippet would be immensely helpful. Any insights, code samples, or recommended resources would be greatly appreciated.

Thank you in advance for your assistance!

1 Answer 1


I recommend you to use Jupiter’s swap API..

It helps you gather all the information you needed for a transaction. You just have to sign and send it.

  • hey you idea worked well but can you help me with something i have an error that states Error sending transaction: invalid transaction: Transaction loads an address table account that doesn't exist Feb 4 at 11:00

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.