{"id":38028016,"url":"https://github.com/ilkamo/jupiter-go","last_synced_at":"2026-01-16T19:36:35.762Z","repository":{"id":221204462,"uuid":"753581286","full_name":"ilkamo/jupiter-go","owner":"ilkamo","description":"Go client for Jupiter (https://jup.ag/)","archived":false,"fork":false,"pushed_at":"2025-09-24T19:14:58.000Z","size":165,"stargazers_count":116,"open_issues_count":1,"forks_count":40,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-24T21:15:24.329Z","etag":null,"topics":["blockchain","go","golang","golang-library","jupiter","solana","swap","trading"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ilkamo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-06T12:07:22.000Z","updated_at":"2025-09-24T19:14:06.000Z","dependencies_parsed_at":"2024-03-19T01:25:07.513Z","dependency_job_id":"0dae8b64-d4bd-4575-a8f5-d7938d0e6da7","html_url":"https://github.com/ilkamo/jupiter-go","commit_stats":null,"previous_names":["ilkamo/jupiter-go"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/ilkamo/jupiter-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilkamo%2Fjupiter-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilkamo%2Fjupiter-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilkamo%2Fjupiter-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilkamo%2Fjupiter-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ilkamo","download_url":"https://codeload.github.com/ilkamo/jupiter-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ilkamo%2Fjupiter-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481887,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","go","golang","golang-library","jupiter","solana","swap","trading"],"created_at":"2026-01-16T19:36:35.637Z","updated_at":"2026-01-16T19:36:35.738Z","avatar_url":"https://github.com/ilkamo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jupiter-go\n\n### Go library to interact with [Jupiter](https://jup.ag) to get quotes, perform swaps and send them on-chain\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GoDoc](https://pkg.go.dev/badge/github.com/ilkamo/jupiter-go?status.svg)](https://pkg.go.dev/github.com/ilkamo/jupiter-go?tab=doc)\n[![Go Report Card](https://goreportcard.com/badge/github.com/ilkamo/jupiter-go)](https://goreportcard.com/report/ilkamo/jupiter-go)\n\nThis library provides a simple way to interact with the [Jupiter](https://jup.ag) API to get quotes and perform swaps. \n\nIt also provides: \n- A [solana client](solana/client.go) to send the swap transaction on-chain and check its status.\n- A [solana monitor](solana/monitor.go) to wait for a transaction to reach a specific commitment status.\n\n\u003cimg align=\"right\" width=\"200\" src=\"assets/jup-gopher.png\"\u003e\n\n## Installation\n\n```bash\ngo get github.com/ilkamo/jupiter-go\n```\n\n## Usage\n\nHere's a simple example to get a quote and the related swap instructions from Jupiter:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\n\t\"github.com/ilkamo/jupiter-go/jupiter\"\n)\n\nfunc main() {\n\tjupClient, err := jupiter.NewClientWithResponses(jupiter.DefaultAPIURL)\n\t// handle the error\n\n\tctx := context.TODO()\n\n\tslippageBps := uint64(250)\n\n\t// Get the current quote for a swap.\n\t// Ensure that the input and output mints are valid.\n\t// The amount is the smallest unit of the input token.\n\tquoteResponse, err := jupClient.QuoteGetWithResponse(ctx, \u0026jupiter.QuoteGetParams{\n\t\tInputMint:   \"So11111111111111111111111111111111111111112\",\n\t\tOutputMint:  \"JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN\",\n\t\tAmount:      100000,\n\t\tSlippageBps: \u0026slippageBps,\n\t})\n\t// handle the error\n\t\n\tquote := quoteResponse.JSON200\n\n\t// Define the prioritization fee in lamports.\n\tprioritizationFeeLamports := \u0026struct {\n\t\tJitoTipLamports              *uint64 `json:\"jitoTipLamports,omitempty\"`\n\t\tPriorityLevelWithMaxLamports *struct {\n\t\t\tMaxLamports   *uint64                                                                                   `json:\"maxLamports,omitempty\"`\n\t\t\tPriorityLevel *jupiter.SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsPriorityLevel `json:\"priorityLevel,omitempty\"`\n\t\t} `json:\"priorityLevelWithMaxLamports,omitempty\"`\n\t}{\n\t\tPriorityLevelWithMaxLamports: \u0026struct {\n\t\t\tMaxLamports   *uint64                                                                                   `json:\"maxLamports,omitempty\"`\n\t\t\tPriorityLevel *jupiter.SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsPriorityLevel `json:\"priorityLevel,omitempty\"`\n\t\t}{\n\t\t\tMaxLamports:   new(uint64),\n\t\t\tPriorityLevel: new(jupiter.SwapRequestPrioritizationFeeLamportsPriorityLevelWithMaxLamportsPriorityLevel),\n\t\t},\n\t}\n\n\t*prioritizationFeeLamports.PriorityLevelWithMaxLamports.MaxLamports = 1000\n\t*prioritizationFeeLamports.PriorityLevelWithMaxLamports.PriorityLevel = jupiter.High\n\t\n\t// If you prefer to set a Jito tip, you can use the following line instead of the above block.\n\t// Look at _examples/jitoswap/main.go for more details.\n\t// *prioritizationFeeLamports.JitoTipLamports = 1000\n\n\tdynamicComputeUnitLimit := true\n\t// Get instructions for a swap.\n\t// Ensure your public key is valid.\n\tswapResponse, err := jupClient.SwapPostWithResponse(ctx, jupiter.SwapPostJSONRequestBody{\n\t\tPrioritizationFeeLamports: prioritizationFeeLamports,\n\t\tQuoteResponse:             *quote,\n\t\tUserPublicKey:             \"{YOUR_PUBLIC_KEY}\",\n\t\tDynamicComputeUnitLimit:   \u0026dynamicComputeUnitLimit,\n\t})\n\t// handle the error\n\t\n\tswap := swapResponse.JSON200\n}\n```\n\nOnce you have the swap instructions, you can use the [solana client](solana/client.go) to sign and send the transaction on-chain.\nPlease remember, when a transaction is sent on-chain it doesn't mean that the swap is completed. The instruction could error, that's why you [should monitor the transaction status](_examples/txmonitor/main.go) and confirm the transaction is finalized without errors.\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\n\t\"github.com/ilkamo/jupiter-go/jupiter\"\n\t\"github.com/ilkamo/jupiter-go/solana\"\n)\n\nfunc main() {\n\t// ... previous code\n\t// swap := swapResponse.JSON200\n\n\t// Create a wallet from private key\n\twalletPrivateKey := \"{YOUR_PRIVATE_KEY}\"\n\twallet, err := solana.NewWalletFromPrivateKeyBase58(walletPrivateKey)\n\t// handle the error\n\n\t// Create a Solana client. Change the URL to the desired Solana node.\n\tsolanaClient, err := solana.NewClient(wallet, \"https://api.mainnet-beta.solana.com\")\n\t// handle the error\n\n\t// Sign and send the transaction.\n\tsignedTx, err := solanaClient.SendTransactionOnChain(ctx, swap.SwapTransaction)\n\t// handle the error\n\n\t// Wait a bit to let the transaction propagate to the network.\n\t// This is just an example and not a best practice.\n\t// You could use a ticker or initialize a monitor to wait for the transaction to be confirmed.\n\ttime.Sleep(20 * time.Second)\n\n\t// Get the status of the transaction (pull the status from the blockchain at intervals \n\t// until the transaction is confirmed).\n\tconfirmed, err := solanaClient.CheckSignature(ctx, signedTx)\n\t// handle the error\n}\n```\n\nA full swap example is available in the [examples/swap](_examples/swap) folder. For a swap with Jito tips, check the [examples/jitoswap](_examples/jitoswap) folder.\n\nA transaction monitoring example using websocket is available in the [examples/txmonitor](_examples/txmonitor) folder.\n\n## Jupiter client\n\nThe Jupiter client is generated from the [official Jupiter openapi definition](https://github.com/jup-ag/jupiter-quote-api-node/blob/main/swagger.yaml) and provides the following methods to interact with the Jupiter API:\n\n```go\n// ProgramIdToLabelGetWithResponse request\nProgramIdToLabelGetWithResponse(\n\tctx context.Context, \n\treqEditors ...RequestEditorFn,\n) (*ProgramIdToLabelGetResponse, error)\n\n// QuoteGetWithResponse request\nQuoteGetWithResponse(\n\tctx context.Context, \n\tparams *QuoteGetParams, \n\treqEditors ...RequestEditorFn, \n) (*QuoteGetResponse, error)\n\n// SwapPostWithBodyWithResponse request with any body\nSwapPostWithBodyWithResponse(\n\tctx context.Context, \n\tcontentType string, \n\tbody io.Reader, \n\treqEditors ...RequestEditorFn, \n) (*SwapPostResponse, error)\n\nSwapPostWithResponse(\n\tctx context.Context, \n\tbody SwapPostJSONRequestBody, \n\treqEditors ...RequestEditorFn,\n) (*SwapPostResponse, error)\n\n// SwapInstructionsPostWithBodyWithResponse request with any body\nSwapInstructionsPostWithBodyWithResponse(\n\tctx context.Context, \n\tcontentType string, \n\tbody io.Reader, \n\treqEditors ...RequestEditorFn,\n) (*SwapInstructionsPostResponse, error)\n\nSwapInstructionsPostWithResponse(\n\tctx context.Context, \n\tbody SwapInstructionsPostJSONRequestBody, \n\treqEditors ...RequestEditorFn, \n) (*SwapInstructionsPostResponse, error)\n```\n\n## Solana client\n\nThe Solana client provides the following methods to interact with the Solana blockchain:\n\n```go\n// SendTransactionOnChain signs and sends a transaction on-chain.\nSendTransactionOnChain(\n\tctx context.Context, \n\ttxBase64 string,\n) (TxID, error)\n\n// CheckSignature checks the status of a transaction on-chain.\nCheckSignature(\n\tctx context.Context, \n\ttx TxID,\n) (bool, error)\n\n// GetTokenAccountBalance returns the balance of an SPL token account.\nGetTokenAccountBalance(\n\tctx context.Context, \n\ttokenAccount string, \n) (TokenAccount, error)\n\n// Close closes the client.\nClose() error\n```\n\n## Solana monitor\n\nThe Solana monitor provides the following methods to monitor the Solana blockchain:\n\n```go\n// WaitForCommitmentStatus waits for a transaction to reach a specific commitment status.\nWaitForCommitmentStatus(\n    context.Context, \n    TxID, \n    CommitmentStatus,\n) (MonitorResponse, error)\n```\n\n## Notes\n- Starting with **v0.2.0**, methods and parameters were renamed to align with the Jupiter OpenAPI definition.\n- Starting with **v0.1.0**, _jupiter-go_ supports the new Jupiter API as documented at [station.jup.ag/docs](https://station.jup.ag/docs/).\n  - It supports both **prioritization fee** and **Jito tips**.\n- For those who need to use the legacy API, **v0.0.24** is the final version supporting it. Note that legacy Jupiter API hostnames will be fully deprecated on **June 1, 2025**.\n\n## Contribute\n\nContributions are welcome! Feel free to open an issue or submit a pull request if you find a bug or want to add a new feature.\n\n## License\n\nThis library is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Donate\n\nIf you find this library useful and want to support its development, consider donating some JUP/Solana to the following address:\n\n`BXzmfHxfEMcMj8hDccUNdrwXVNeybyfb2iV2nktE1VnJ`\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=ilkamo/jupiter-go\u0026type=Date)](https://www.star-history.com/#ilkamo/jupiter-go\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filkamo%2Fjupiter-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filkamo%2Fjupiter-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filkamo%2Fjupiter-go/lists"}