Rust SDK for Jupiter Exchange APIs.
Jup-Rust-SDK
A Rust SDK to interact with the Jupiter Aggregator APIs.
Easily fetch token quotes and execute swaps programmatically from your Rust applications.
Installation 🛠️
cargo add jup-ag-sdk
or Add this to your Cargo.toml:
[dependencies]
jup-ag-sdk = "1.0.6"
Features
- Complete API Coverage - All Jupiter APIs included Ultra, Swap, Trigger, Recurring, Token and Price
- Strongly typed – Full Rust structs for all request/response types
- Composable builders – Chainable methods to customize request payloads (e.g. taker, referral, fee, excluded routers)
Usage
Below is a simple example that shows how to fetch and execute an Ultra order with the SDK. For detailed example checkout examples/
use jupagsdk::{
JupiterClient,
types::{UltraExecuteOrderRequest, UltraOrderRequest},
};
#[tokio::main] async fn main() { // Initialize the Jupiter client with the Lite API endpoint let client = JupiterClient::new("https://lite-api.jup.ag");
// Example: swap: 10 USDC (6 decimals) to SOL let input_token = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"; // USDC let output_token = "So11111111111111111111111111111111111111112"; // SOL let amount = 10000000; // 10 USDC (in micro units)
// Create an order request and specify the taker's wallet address let orderrequest = UltraOrderRequest::new(inputtoken, output_token, amount) .add_taker("your taker wallet address");
// Fetch the unsigned transaction and request ID from Jupiter let order_response = client .getultraorder(&order_request) .await .expect("Failed to fetch ultra order");
let unsignedtxbase64 = order_response .transaction .expect("No transaction found in ultra order response");
// sign the transaction. Checkout examples/src/lib.rs on how to sign the transaction
// execute the signed transaction let execute_request = UltraExecuteOrderRequest { signedtransaction: signedtx_base64, requestid: quote.requestid, };
// Send the signed transaction to Jupiter for execution let execute_response = client .ultraexecuteorder(&execute_request) .await .expect("Failed to execute transaction");
// Print the transaction signature let txsignature = executeresponse .signature .expect("No signature found in execution response");
println!("✅ Transaction submitted: {}", tx_signature); }
Support
Local
git clone https://github.com/Jupiter-DevRel/jup-rust-sdk
cd jup-rust-sdk
cargo build
open to contributions and suggestions.
License
MIT License