| Crates.io | jup-ag-sdk |
| lib.rs | jup-ag-sdk |
| version | 1.0.6 |
| created_at | 2025-05-08 11:54:05.008788+00 |
| updated_at | 2025-07-07 14:04:46.220908+00 |
| description | A Rust SDK for Jupiter exchange APIs. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1665261 |
| size | 169,167 |
A Rust SDK to interact with the Jupiter Aggregator APIs.
Easily fetch token quotes and execute swaps programmatically from your Rust applications.
cargo add jup-ag-sdk
or Add this to your Cargo.toml:
[dependencies]
jup-ag-sdk = "1.0.6"
Below is a simple example that shows how to fetch and execute an Ultra order with the SDK. For detailed example checkout examples/
use jup_ag_sdk::{
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 = 10_000_000; // 10 USDC (in micro units)
// Create an order request and specify the taker's wallet address
let order_request = UltraOrderRequest::new(input_token, output_token, amount)
.add_taker("your taker wallet address");
// Fetch the unsigned transaction and request ID from Jupiter
let order_response = client
.get_ultra_order(&order_request)
.await
.expect("Failed to fetch ultra order");
let unsigned_tx_base64 = 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 {
signed_transaction: signed_tx_base64,
request_id: quote.request_id,
};
// Send the signed transaction to Jupiter for execution
let execute_response = client
.ultra_execute_order(&execute_request)
.await
.expect("Failed to execute transaction");
// Print the transaction signature
let tx_signature = execute_response
.signature
.expect("No signature found in execution response");
println!("✅ Transaction submitted: {}", tx_signature);
}
git clone https://github.com/Jupiter-DevRel/jup-rust-sdk
cd jup-rust-sdk
cargo build
open to contributions and suggestions.
MIT License