How to Execute Successful Transactions on Jupiter (Solana) and Key Considerations

ยท

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:

๐Ÿ‘‰ 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:

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

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 LevelPercentileUse Case
Medium25%Cost-sensitive transactions
High50%Balanced approach
Very High75%Time-sensitive swaps
prioritizationFeeLamports: {
  priorityLevelWithMaxLamports: {
    maxLamports: 4000000,
    global: false, // Account-specific estimation
    priorityLevel: "veryHigh"
  }
}

Key Terminology

TermDefinition
Global Priority FeeNetwork-wide fee estimation
Local Fee MarketFees for specific writable accounts
CUPCompute 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.