Understanding Priority Fees
Learn what priority fees are and why they matter on Solana
What Are Priority Fees?
On Solana, each transaction has a base fee. Priority fees allow you to pay an additional fee so your transaction is prioritized over others in the validator’s queue. This extra amount helps ensure validators process your transaction before ones offering a lower fee.
In practice, you set a price for each compute unit (CU) your transaction may use. The higher the price, the more likely your transaction will be included first.
Why Priority Fees Matter
When the Solana network is busy, transactions without priority fees can experience delays. Adding a priority fee helps your transaction get confirmed faster. Common use cases include:
- Minting NFTs during popular launches
- Swapping tokens during market volatility
- Making time-sensitive trades
- Any operation during high network congestion
Priority fees keep your transaction ahead of the crowd by incentivizing validators to process it first.
How Priority Fees Work
Priority fees are implemented using the Solana Compute Budget Program. You add two special instructions to your transaction:
setComputeUnitPrice
- Sets the price (in micro-lamports) you’ll pay for each compute unitsetComputeUnitLimit
- (Optional) Increases the maximum compute units your transaction can use
These instructions tell validators how much you’re willing to pay to prioritize your transaction.
How Much Should You Pay?
The appropriate priority fee depends on:
- Current network conditions
- How quickly you need confirmation
- What others are paying for similar transactions
Rather than guessing, Helius provides the getPriorityFeeEstimate
API to calculate an appropriate fee based on recent transactions. The API offers several priority levels:
- “Min” (0th percentile)
- “Low” (25th percentile)
- “Medium” (50th percentile)
- “High” (75th percentile)
- “VeryHigh” (95th percentile)
Basic Implementation Pattern
Here’s the general pattern for adding priority fees to your transactions:
Priority Fees with Staked Connections
When using Helius’ Staked Connections, priority fees play an important role:
- For Shared Staked Endpoints, your priority fees must meet or exceed the
recommended
value from the Priority Fee API to access staked connections - For Dedicated Staked Endpoints, priority fees still determine your transaction’s position in the validator queue