What is compute unit?
Solana's measure of the work a transaction performs, equivalent in role to gas on Ethereum.
Not yet verifiedHow we verify
3 min read
In this entry
Solana's measure of the work a transaction performs, equivalent in role to gas on Ethereum.
Each transaction has a compute budget and instructions consume units as they run. Exceeding the budget fails the transaction rather than charging more, which is the first difference from Ethereum that catches people out: on Solana you pay for a failed transaction and get nothing.
The second difference is where the cost actually sits. The base fee barely moves, and it is the optional priority component that rises when the network is busy. A wallet offering a priority level is setting the price you pay per compute unit.
How it works
The Solana documentation sets the maximum at 1,400,000 compute units per transaction, with a default of 200,000 units per instruction unless the transaction requests otherwise (source: the Solana documentation).
Fees have two parts. The base fee is 5,000 lamports per signature, split between being burned and paid to the validator. The prioritization fee is calculated as the compute unit price, quoted in micro-lamports, multiplied by the requested compute unit limit and divided by 1,000,000, rounded up, and all of it goes to the validator (source: the Solana documentation).
The crucial detail is in that formula. The priority fee applies to the compute unit limit a transaction requests, not to what it actually consumes. Requesting far more headroom than needed inflates the fee for no benefit, which is why well-built applications simulate a transaction first and set a limit close to the measured usage.
Solana processes many transactions in parallel where they touch different accounts, so congestion is often specific to a hot account rather than network-wide. A busy token launch can make one market expensive while the rest of the chain is cheap.
Example
Illustrative. A swap requests a compute unit limit of 200,000 and sets a compute unit price of 10,000 micro-lamports. The priority fee is 200,000 multiplied by 10,000, divided by 1,000,000, which is 2,000,000 lamports, or 0.002 SOL. Add a base fee of 5,000 lamports for one signature and the transaction costs 2,005,000 lamports. Had the application measured actual usage at 60,000 units and requested that instead, the priority fee would be 600,000 lamports, roughly 70 percent less for the identical work.
Why it matters when you buy
If you buy on Solana rather than through a centralized exchange, the priority setting in your wallet is most of what you pay, and the default is not always tuned to conditions. Network fee levels differ enormously between chains, which the chain pages compare, and gas fees explained covers the same problem across networks.
Related terms
gas — the equivalent measure on Ethereum; program — what consumes the units; priority fee — the component that rises with demand; network fee — the total you pay to transact; spl token — the token standard most transactions touch.
Questions
Why did my Solana transaction fail and still cost money?
Fees pay for the attempt, not the outcome. If the transaction exhausted its compute budget or the swap conditions moved, it fails on chain and the fee is still collected.
Should I raise the priority fee?
Raising it increases the chance of inclusion during congestion and increases the cost proportionally. Wallets generally estimate a level from recent blocks, and overriding it upward is worth doing only when transactions are actually failing to land.
Is Solana always cheaper than Ethereum?
Base fees are far lower, and priority fees during a congested event on a popular market can rise sharply. Comparing a quiet moment on one chain against a busy moment on another is not a comparison.