Solana compute budget and priority fee estimator
Set a compute unit limit and an urgency level, and read the fee the transaction will actually cost — plus the two ComputeBudgetProgram instructions that encode it.
How Solana fees work
A Solana transaction pays a flat base fee of 5,000 lamports plus a priority fee you set yourself, quoted in micro-lamports per compute unit. Both halves matter: too low a priority fee and the transaction is dropped during congestion, too high a compute unit limit and you pay for units the program never uses.
Transfer, ~5kDEX swap, ~200kBlock max, 1.4M
Urgency
Fee breakdown
Base network fee
0.000005 SOL
5,000 lamports, fixed
Priority fee
0.000050 SOL
50,000 lamports
Total
0.000055 SOL
250,000 µL/CU × 200,000 CU
import { ComputeBudgetProgram, Transaction } from '@solana/web3.js';
const tx = new Transaction();
// 1. Set optimal Compute Unit Limit
tx.add(
ComputeBudgetProgram.setComputeUnitLimit({
units: 200000,
})
);
// 2. Set dynamic Priority Fee (High (Priority Land, <1 block))
tx.add(
ComputeBudgetProgram.setComputeUnitPrice({
microLamports: 250000,
})
);Reading the result
- Raising the compute unit limit raises the priority fee proportionally, because the fee is charged per unit requested — not per unit consumed.
- A limit below what the program needs fails the transaction outright with an exceeded-compute-budget error. Simulate first, then add roughly 10% headroom.
- Turbo rates are for contested mints and arbitrage. For an ordinary swap they are money handed to a validator for nothing.