How to get your transactions finalized on Solana

Explore blockchain's evolution with Solana, focusing on Priority Fees for faster transactions in busy networks.

How to get your transactions finalized on Solana

Solana is one of the most popular blockchain ecosystems and has exploded in usage the past couple of months. During the recent surge in popularity, we’ve seen a lot of confusion around Priority Fees. The QuickNode team has focused on researching and sharing clear, effective approaches for managing fees to improve transaction success on the Solana network.

Using these methods, we were able to get over 98% of transactions finalized for thousands of transactions during very busy network conditions.

Transaction Settlement

Transactions on Solana are processed by validators. At predetermined intervals, called "slots" a validator is selected to act as the "leader" for that slot. This leader is responsible for processing transactions, packaging them into a block, and proposing this block to the network.

When you submit a Solana transaction through an RPC provider such as QuickNode, the transaction is broadcast to the current slot's leader, according to a publicly known leader schedule. The leader validates the transaction, executes it if it's valid, and includes it in the block for that slot. This block is then confirmed by other validators in the network through the consensus process.

Transaction Fees

Transaction fees are a mechanism designed to compensate validators for the computational resources required to process transactions and maintain the network's integrity.

There is a required base fee that is currently 5000 lamports. In addition to this, users can add priority fees to their transactions.

Priority Fees

Priority Fees on Solana are an optional, additional fee that users can pay to give their transactions a higher chance of being processed quickly, especially during high network congestion. Unlike the base transaction fee, which compensates for the computational effort of processing a transaction, priority fees are essentially a bid for expedited processing. Users specify this extra fee on top of the base fee to signal the importance or urgency of their transaction.

This system creates a competitive environment where transactions with higher priority fees are more likely to be selected and processed by validators ahead of others, facilitating faster confirmation times. Priority fees are localized, meaning they vary by program you are interacting with. If there’s a hot program mint or high demand for a particular DEX’s swaps at any given time, priority fees may be higher for those specific Solana programs.

You gotta pay to play

In recent conditions (at the time of this writing in March 2024), we’ve seen that transactions have almost no chance of being finalized if they do not properly set fees.

But don’t take our word for it! Here is a graph illustrating the point. We sent 10 batches of 100 transactions, both with fees properly set and without priority fees. The blue line has no priority fees set, and the orange line has fees properly set with a helper function from our QuickNode SDK (more on that in a bit).

The difference is stark. In these conditions you need to set priority fees and you need to set them correctly to have your transactions finalized.

Stick to the budget

There’s two variables that developers can set for priority fees, Compute Unit Limit and Compute Unit Price, both part of the Compute Budget. The total fee for a transaction is calculated by multiplying the number of compute units required for the transaction by the current compute unit price, along with any applicable base fees.

  • Compute Unit Limit: This refers to the maximum number of compute units that a single transaction can consume. Solana assigns compute units to every operation within a transaction as a way to quantify the computational work required. The CU limit ensures that no single transaction can monopolize network resources, maintaining fairness and efficiency in block production. Transactions that exceed this budget are rejected, necessitating careful optimization by developers to ensure their transactions fit within the allowed CU budget.
  • Compute Unit Price: This is the cost associated with executing transactions, measured per compute unit. This price determines how much a user pays for each unit of computational work required by their transaction. As network congestion varies, so too can the compute unit price, reflecting the demand for processing power at any given time.

Tricks of the trade

How do I know what to set? It’s not easy at first glance, but don’t worry, we will help you!

  • Compute Unit Limit, you need to specify your compute unit limit to match what your transaction actually needs. You can either see the compute units consumed on a block explorer for a previous similar transactions and set it to that amount, or you can use the simulateTransaction RPC method for your transaction and see the Compute Units consumed by your simulated transaction. You might be asking yourself, why can’t I just set a high Compute Unit Limit and not worry about it? Well, astute reader, not only is that overly expensive, that’s actually counterproductive. There are compute unit budgets per account and per block in addition to per transaction. The more your transactions fill these compute unit budgets, the less of them a validator can accept, meaning your transactions are more likely to be dropped.
  • Compute Unit Price, which is ever-changing according to the demands of the network and local program demand. Solana offers a RPC method, getRecentPrioritizationFees which returns recent prioritization fees. We've observed that this method’s practical application can be challenging, as it tends to oversimplify the current fee market. That’s why we created the Priority Fee API add-on in our QuickNode marketplace. This returns a detailed breakdown of priority fees per compute unit and transaction based on the latest fee data. We have our Solana Priority Fee Tracker website with the recent priority fee data for a quick glance Solana Priority Fee Tracker.

For more details and code examples, we have our How to Improve Solana Transaction Performance guide.

I’m overwhelmed, just make it easy

We get it! You just want your transactions to be finalized. We added Solana support and a sendSmartTransaction function to our QuickNode SDK. This simulates your transaction, sets the compute unit limit, then fetches the latest priority fee data from our Priority Fee API add-on and sets the Compute Unit Price based on the results. You just call one function and sit back, sipping your coffee while validators pick up your transactions.

We used this function for our testing and consistently saw over 98% of transactions finalized for thousands of transactions during very busy network conditions.

Wrapping up

Solana transactions can be sent with Priority Fees to increase your chances of your transaction being finalized in a block. During extremely busy network conditions, priority fees are mostly necessary when sending transactions. As a developer, you have the ability to specify two key parameters in your transaction to indicate your priority fee preferences to validators: the Compute Unit Limit and the Compute Unit Price.

To help facilitate setting these for developers, QuickNode has created the Priority Fee API add-on and SDK functions such as sendSmartTransaction that make setting Priority fees on Solana easier.

💡
Check out our Solana add-ons in the QuickNode Marketplace

Why QuickNode for Solana? 👇

Reinvesting in Our Solana Architecture
QuickNode’s Response to Solana Network’s Latest Innovations: The SPL-20 Surge and Compressed NFTs.
QuickNode: The Quickest Solana Node Provider
In this article, we compare Solana node providers to determine who offers the fastest response times while maintaining stability, as well as high data reliability to ensure the best infrastructure experience.


About QuickNode

QuickNode is building infrastructure to support the future of Web3. Since 2017, we've worked with hundreds of developers and companies, helping scale dApps and providing high-performance access to 26+ blockchains. Subscribe to our newsletter for more content like this, and stay in the loop with what's happening in web3!