Solana Compute Units and Priority Fees: A Builder's Guide
Every Solana instruction has a compute budget, and every transaction has a fee that is charged whether it succeeds or fails. Here is how the numbers fit together and how to set them.

Not financial advice. Solsmint publishes educational content about crypto assets. Prices are volatile, and nothing here is a recommendation to buy, sell, or invest. Verify every contract, authority, and fee yourself before you transact.
Last updated: November 24, 2026
A Solana transaction does not have a gas price in the Ethereum sense. It has a compute budget, a base fee and an optional priority fee, and the three interact in ways that surprise people who learned fee mechanics on another chain. A transaction can fail because it ran out of compute, or because it requested too little priority fee to be included, and those are different problems with different fixes.
The numbers are simple once you see them together. Each instruction gets a default budget of 200,000 compute units, a transaction can request up to 1.4 million, the base fee is 5,000 lamports per signature, and the priority fee is the requested compute limit multiplied by a price you choose. The complications come from what counts, what is charged and what is wasted.
This guide explains the mechanics, the fee formula and the mistakes that make transactions fail or overpay.
This article is for informational purposes only and is not financial, legal, or investment advice. Not financial advice. DYOR.
Key takeaways
- A compute unit is a measure of the work an instruction performs. Each instruction gets 200,000 by default, and a transaction can request up to 1.4 million.
- The base fee is 5,000 lamports per signature. Half is burned and half goes to the validator.
- The priority fee is
compute unit limit × price in micro-lamports / 1,000,000, charged on the limit you request rather than the compute you use. - Requesting more compute than you need raises the priority fee without improving the chance of inclusion.
- If a transaction is included and fails, the fee is still charged. A transaction that never lands is not charged.
- Priority fees are not Jito tips. A tip is a separate transfer to a block engine, and it does not replace the base or priority fee.
What a compute unit actually is
Every Solana instruction consumes compute. A simple transfer costs a few thousand units; a token mint with metadata can cost tens of thousands; a complex program with cross-program invocations can approach the per-transaction ceiling. Compute units are the budget the runtime meters against, and when the budget runs out the transaction fails.
The unit is not a price. It is a quantity of work, similar to a fuel gauge rather than a fuel price. The fee is calculated from the limit you request and the price per unit you set, not from the amount of work the transaction actually performs.
That separation is the source of most confusion. A transaction that uses 40,000 units but requests 200,000 pays the priority fee on 200,000. A transaction that requests 60,000 units and needs 70,000 fails, even if it could have paid for more. The limit is a cap, and the price is a bid.
The budget: 200K per instruction, 1.4M per transaction
If a transaction does not include a compute budget instruction, each instruction is budgeted at 200,000 compute units. That default is generous for simple programs and tight for complex ones. The runtime also caps a single transaction at 1.4 million compute units, regardless of how many instructions it contains.
The per-instruction default and the per-transaction cap are different limits. A transaction with five instructions does not automatically get one million units; the default applies per instruction, and the sum has to stay within the transaction cap. Adding instructions without adjusting the limit can produce a failure that looks like a program bug but is really a budget problem.
The 1.4 million cap is a hard ceiling. If a transaction genuinely needs more, it has to be split. That is one reason complex DeFi routes are sometimes executed in several transactions rather than one.
| Limit | Value | What it means |
|---|---|---|
| Default per instruction | 200,000 CU | Applied when no compute limit is set |
| Maximum per transaction | 1,400,000 CU | Hard cap; split the work if you need more |
| Base fee | 5,000 lamports per signature | 50% burned, 50% to the validator |
| Priority fee | Limit × price / 1,000,000 lamports | Based on the requested limit, not actual usage |
Why transactions fail
There are four common failure modes, and they need different responses.
Compute exhausted. The transaction used more units than its limit. The fix is to raise the limit with SetComputeUnitLimit, usually after simulating to find the real consumption.
Too little priority fee. The transaction was valid but not competitive for block space, so it was dropped. The fix is to raise the price per compute unit, not the limit.
Stale blockhash. The transaction waited too long and its recent blockhash expired. The fix is to rebuild and resubmit with a fresh blockhash.
Program error. The program rejected the instruction because of slippage, an invalid account, a failed check or a business rule. Raising compute or fees will not help; the instruction itself has to change.
Distinguishing these matters because the wrong fix wastes SOL. Raising the priority fee on a transaction that is failing due to slippage just makes the failure more expensive.
The fee formula, with numbers
The total fee is the base fee plus the priority fee. The base fee is 5,000 lamports per signature. The priority fee is calculated in micro-lamports per compute unit, where one micro-lamport is one millionth of a lamport.
The formula is:
priority fee (lamports) = compute unit limit × price (micro-lamports per CU) / 1,000,000
| Compute limit | Price (micro-lamports/CU) | Priority fee | Plus base fee |
|---|---|---|---|
| 200,000 | 1,000 | 200 lamports | 5,200 lamports |
| 200,000 | 10,000 | 2,000 lamports | 7,000 lamports |
| 400,000 | 10,000 | 4,000 lamports | 9,000 lamports |
| 1,400,000 | 10,000 | 14,000 lamports | 19,000 lamports |
The numbers are small in SOL terms. One thousand lamports is 0.000001 SOL, so the difference between the first and last row is 0.0000138 SOL. That is negligible for a single transaction and material for a programme sending thousands of them.
The important pattern is that the fee scales with the limit. Doubling the requested compute doubles the priority fee at the same price. That is why an inflated limit is not free.
Priority fee is not a Jito tip
A priority fee is part of the transaction’s fee, paid to the validator that includes it. A Jito tip is a separate SOL transfer to a block engine, used to bid for inclusion in a bundle. They are different payments with different purposes.
A transaction can pay a priority fee without a tip, or a tip without a priority fee, or both. The tip does not replace the base fee, and it does not change the compute budget. Confusing the two leads to transactions that overpay one channel while starving the other.
For most applications, the priority fee is the relevant lever. Tips matter when you are specifically using a bundle service and need the bundle to be competitive.
Why failed transactions still cost
Solana charges the fee when a transaction is included in a block and processed, even if the execution fails. The base fee and priority fee are deducted, and the compute that was consumed is gone. A failed swap due to slippage is a paid lesson, not a free attempt.
The nuance is inclusion. A transaction that never lands, because its blockhash expired or because no leader included it, is not charged. The distinction is between a transaction that reached execution and one that did not.
This is why retry logic needs to be deliberate. Blindly resubmitting a failing transaction with a higher fee can burn SOL without changing the outcome. Simulate first, fix the instruction, then resubmit.
Setting the limit and the price
The two instructions are ComputeBudgetProgram.setComputeUnitLimit and ComputeBudgetProgram.setComputeUnitPrice. The first sets the cap, and the second sets the price per unit.
A typical pattern is to simulate the transaction, read unitsConsumed, add a buffer of 10% to 20%, and set the limit to that figure. Then set the price based on current network conditions rather than a fixed constant.
const simulation = await connection.simulateTransaction(transaction)
const units = simulation.value.unitsConsumed ?? 200_000
transaction.add(
ComputeBudgetProgram.setComputeUnitLimit({ units: Math.ceil(units * 1.15) }),
ComputeBudgetProgram.setComputeUnitPrice({ microLamports: 10_000 }),
)
The buffer covers small differences between simulation and execution, such as account state changing between the two. It should not be so large that you pay for compute you will never use.
Setting the price is a judgement call. A quiet network needs less; a congested one needs more. Some applications read recent priority fees from an RPC provider and choose a percentile, while others set a floor and let retries escalate. Either approach is better than a hardcoded price that is wrong most of the time.
Estimating with simulation
simulateTransaction runs the transaction against current bank state without submitting it. It returns a result, logs and, on success, the compute units consumed. That number is the best available estimate of what the transaction will cost in compute.
Simulation is not a guarantee. State can change between the simulation and the real submission, especially in a busy pool or a popular mint. That is why the buffer exists. It is also why a transaction that simulated successfully can still fail on chain.
For a programme that sends many similar transactions, simulate a representative sample and use the maximum plus a buffer rather than simulating every one. For a one-off high-value transaction, simulate the exact instruction set and check the logs for warnings.
Common mistakes
Setting the limit to 1.4 million by default. It removes the compute failure but multiplies the priority fee by seven compared with a 200,000 limit at the same price. It also masks inefficient instructions.
Setting the price too low and blaming the program. A valid transaction that is never included looks like a failure but is a fee problem. Check whether the transaction landed before changing the instruction.
Forgetting the base fee. The priority fee is not the total fee. Each signature adds 5,000 lamports, and a multi-signature transaction pays for each one.
Assuming unused compute is refunded. It is not. The fee is based on the limit, and the unused portion is simply unused.
Confusing compute with account limits. A transaction can fail because it touches too many accounts or exceeds a size limit, not because it ran out of compute. The error message usually says which.
Retrying without a fresh blockhash. A stale blockhash cannot be fixed by a higher fee. Rebuild the transaction before resubmitting.
What we still don’t know
How priority fees evolve as Solana’s fee market matures is unresolved. The current model is a simple bid for block space, and it may change as scheduling, local fee markets and validator incentives develop. A strategy that works today may need adjustment.
The interaction between priority fees and MEV is also changing. Tips, bundles and priority fees all compete for inclusion, and the cheapest path depends on the transaction and the moment. There is no single formula that is optimal for every case.
And the tooling for fee estimation is uneven. Simulation gives compute usage, but it does not tell you what price will be competitive in the next slot. Applications still rely on recent-fee heuristics and retries, which is an approximation rather than a guarantee.
What is settled is the arithmetic: the limit sets the cap, the price sets the bid, and the fee is charged on the limit whether the transaction succeeds or fails. Getting those three straight prevents most of the expensive mistakes.
FAQ: Solana compute units and priority fees
What is a compute unit on Solana?
A compute unit is a measure of the work an instruction performs. Each instruction has a default budget of 200,000 units, and a transaction can request up to 1.4 million. When the budget is exhausted, the transaction fails.
How is the priority fee calculated?
The priority fee in lamports is the compute unit limit multiplied by the price in micro-lamports per unit, divided by one million. At a 200,000 limit and a price of 10,000 micro-lamports, the priority fee is 2,000 lamports.
Is the priority fee charged on actual compute usage?
No. It is charged on the limit you request. Requesting 200,000 units but using 40,000 still pays the fee on 200,000, which is why an inflated limit is expensive.
Do failed Solana transactions cost a fee?
Yes, if the transaction is included and processed. The base fee and priority fee are charged even when execution fails. A transaction that never lands because its blockhash expired is not charged.
What is the maximum compute per Solana transaction?
The cap is 1.4 million compute units per transaction. If an operation needs more, it has to be split across multiple transactions.
How do I set the compute limit and price?
Use ComputeBudgetProgram.setComputeUnitLimit to set the cap and ComputeBudgetProgram.setComputeUnitPrice to set the price per unit. Simulate first, add a 10% to 20% buffer to the consumed units, and choose a price based on current network conditions.
Is a priority fee the same as a Jito tip?
No. A priority fee is part of the transaction fee and goes to the validator that includes it. A Jito tip is a separate SOL transfer to a block engine used to bid for bundle inclusion. They are different payments and neither replaces the other.
Continue reading
- Read the Solana token creation guide for the transactions a launch actually requires.
- See how to airdrop Solana tokens, where compute limits and priority fees decide whether a batch lands.
- Then read what Alpenglow’s 150ms finality changes for the network side of transaction confirmation.
- Ready to launch? Create a Solana token without code and leave the transaction mechanics to the tool.
Disclaimer: This article is for information and education only and is not financial, investment, or tax advice. Crypto assets are volatile and you can lose money. Always verify token authorities and contract details yourself before interacting with any asset.
Ready to create your own token?
Launch an SPL token on Solana in minutes. No code, 0.05 SOL total, metadata and authorities handled for you.

Amir Ali
Founder of Solsmint | Solana Ecosystem Builder | Crypto & Web3 Enthusiast
Amir Ali is the founder of Solsmint, a Solana-based platform focused on making token launches and on-chain tools more accessible. He writes about Solana, crypto, memecoins, blockchain technology, and the evolving Web3 ecosystem.
Through Solsmint, Amir aims to simplify token creation and liquidity management by building practical, affordable tools for creators, developers, and crypto communities. His work focuses on making blockchain technology easier to use and helping builders turn their ideas into reality.
Follow Amir and explore his work at Solsmint.com.


