Navigating transactions on the Solana can be challenging due to network congestion. This guide is designed to equip you with the essential strategies to ensure your transactions are processed smoothly and efficiently when using Dynamic-powered Solana embedded wallets. With the high demand on Solana, it’s crucial to have a well-thought-out approach, including selecting the right RPC (Remote Procedure Call) endpoint and understanding how to set priority fees. By carefully choosing an RPC, you can access less congested nodes, which can significantly speed up your transaction times. Additionally, setting appropriate priority fees ensures that your transactions are given the necessary attention by validators. This guide will walk you through these steps, providing practical tips and insights and achieve successful transactions with greater ease and reliability.

Which Solana RPC do I use?

  • We found that Helius, Helius.dev was the most reliable RPC.
  • Ironforge, Ironforge.cloud can be used to improve transaction landing rates by sending transactions to multiple RPCs at a time.

How do I add a priority fee to my transactions?

Validators on the Solana network are incentivized by priority fees. Higher fees can attract validators to include a transaction in the next block, thus ensuring faster confirmation times for users willing to pay more.

  // Priority fee
  const addPriorityFee = ComputeBudgetProgram.setComputeUnitPrice({
    microLamports: 1,
  });
  
   // Total fee will be 5,001 Lamports for 1M CU
  const transaction = new Transaction()
    .add(addPriorityFee)
    .add(
      SystemProgram.transfer({
        fromPubkey: payer.publicKey,
        toPubkey: toAccount,
        lamports: 10000000,
      }),
    );

What is the compute unit limit and why should I modify it?

  • Solana programs have a compute limitations: Max Compute per block: 48 million CU
  • Therefore, if you decrease/optimize the compute unit limit for your transaction, it is more likely to land since it is more likely to fit in the block. E.g, only 48 transactions with 1 million CU can fit in one block, but 96 transactions with 0.5 million CU can fit in a block.
 // Compute unit budget
  const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({
    units: 1000000,
  });
 
 
  // Total fee will be 5,001 Lamports for 1M CU
  const transaction = new Transaction()
    .add(modifyComputeUnits)
    .add(
      SystemProgram.transfer({
        fromPubkey: payer.publicKey,
        toPubkey: toAccount,
        lamports: 10000000,
      }),
    );
 

General Tips

  • Refresh the blockhash in your transaction before sending it, as a transaction will fail if the blockhash it references is 150 blocks old.

    
     const connection = await primaryWallet.getConnection();
     
     const signer = await primaryWallet.getSigner();
        
        const { blockhash } = await connection.getLatestBlockhash();
    
        transaction.message.recentBlockhash = blockhash;
    
        await signer
          .signAndSendTransaction(transaction)
    
  • implement your own manual method to rebroadcast transactions. After a transaction is signed, you can keep sending the transaction to the RPC for about another minute before it expires.

https://www.helius.dev/blog/how-to-land-transactions-on-solana

https://solana.com/developers/cookbook/transactions/add-priority-fees