Jupiter's primary mission is to deliver the best developer experience and most competitive pricing for every token swap on Solana. However, during periods of network congestion, users often face challenges in getting their transactions processed efficiently.
Common Transaction Failure Factors
Several factors can impact your transaction success rate:
- Insufficient priority fees
- Improper slippage settings
- Suboptimal compute unit allocation
- Poor transaction broadcasting strategies
๐ Master Solana transaction optimization
Quick Start Guide
Getting Quotes via API
const quoteResponse = await (await fetch('https://quote-api.jup.ag/v6/quote?inputMint=So111...11112&outputMint=EPjFW...TDt1v&amount=100000000&restrictIntermediateTokens=true')).json();Key parameter:
restrictIntermediateTokens: Set totrueto route transactions only through high-liquidity intermediate tokens, improving success rates.
Executing Swaps
const { swapTransaction } = await (await fetch('https://quote-api.jup.ag/v6/swap', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
quoteResponse,
userPublicKey: wallet.publicKey.toString(),
dynamicComputeUnitLimit: true, // Optimizes CU usage
dynamicSlippage: {
maxBps: 300 // Prevents MEV while ensuring success
},
prioritizationFeeLamports: {
priorityLevelWithMaxLamports: {
maxLamports: 10000000,
priorityLevel: "veryHigh" // For faster execution
}
}
})
})).json();Recommended RPC Endpoints
- Helius:
https://www.helius.dev/ - Triton:
https://triton.one/
Advanced Optimization Techniques
1. Priority Fees Explained
Priority fees are optional micro-lamport payments per compute unit that give your transaction queue priority.
Calculation:
priority fees = computeBudget * computeUnitPrice (CUP)๐ Understand Solana fee mechanics
2. Jupiter's Priority Fee Estimation
Jupiter uses Triton's API to analyze recent fee data across 20 slots:
| Priority Level | Percentile | Use Case |
|---|---|---|
| Medium | 25% | Cost-sensitive transactions |
| High | 50% | Balanced approach |
| Very High | 75% | Time-sensitive swaps |
prioritizationFeeLamports: {
priorityLevelWithMaxLamports: {
maxLamports: 4000000,
global: false, // Account-specific estimation
priorityLevel: "veryHigh"
}
}Key Terminology
| Term | Definition |
|---|---|
| Global Priority Fee | Network-wide fee estimation |
| Local Fee Market | Fees for specific writable accounts |
| CUP | Compute Unit Price (micro-lamports/CU) |
FAQ Section
Q: Why does my transaction fail during congestion?
A: Typically due to insufficient priority fees or improper slippage settings. Use Jupiter's dynamic parameters for automatic optimization.
Q: How do I choose between global and local fee estimates?
A: Use local (global: false) when modifying specific accounts; global for general network conditions.
Q: What's the ideal slippage setting?
A: Start with Jupiter's dynamic slippage (maxBps: 300) which automatically adjusts based on market conditions.
Q: How can I reduce transaction costs?
A: Monitor network congestion patterns and schedule swaps during lower-activity periods when possible.