Swap Solana Tokens in Go Without the Headaches

jupiter-go
I'm excited to share with all of you jupiter-go, a library that makes interacting with Jupiter's DEX aggregator straightforward for Go developers. If you're building apps that need to swap tokens on Solana, this might just make your life a whole lot easier.
Have you ever tried writing backend code to swap tokens on Solana? There's a lot to handle. Getting quotes, building transactions, signing them, sending them to validators, checking if they worked... it's a lot of moving parts. I wanted something that just worked without having to handle all the complexity.
What's Inside?
The library bundles everything you need:
- A Jupiter API client for getting quotes and swap instructions
- A Solana client to send your swaps to the blockchain
- A transaction monitor that watches your transactions until they're confirmed
- From version 0.1.0, it fully supports Jito tips
Everything is designed with simplicity in mind while still giving you the flexibility to handle advanced scenarios.
Getting Started is Easy
Installation is straightforward with a simple go get:
go get github.com/ilkamo/jupiter-go
And getting a quote to swap SOL to another token takes just a few lines of code:
jupClient, _ := jupiter.NewClientWithResponses(jupiter.DefaultAPIURL) slippageBps := float32(250.0) // 2.5% slippage quoteResponse, _ := jupClient.GetQuoteWithResponse(ctx, &jupiter.GetQuoteParams{ InputMint: "So11111111111111111111111111111111111111112", // SOL OutputMint: "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN", // JUP Amount: 100000, // in smallest units (lamports) SlippageBps: &slippageBps, })
Give It a Try
If you're building Solana applications in Go, jupiter-go might save you days of development time. The code is open-source, MIT licensed, and ready to use in your projects. Check out the examples folder for complete working code that you can adapt to your needs.
Have ideas to make it better? Found a bug? Want to chat about how you're using it? The GitHub repo is open for issues and pull requests - I'd love to hear from you! Building stuff on Solana should be fun, not frustrating. I hope jupiter-go helps make your coding journey a bit smoother. Happy swapping!