• Updated in Real-Time 24/7
  • contact@solanabasefee.com
  • solanabasefee.com
Solana Compute Units – How They Affect Your Fees
  • By SolanaBaseFee.com
  • Updated 2025

Solana Compute Units – How They Affect Your Fees

A compute unit (CU) is Solana's measure of computational work. Every operation in a transaction — arithmetic, memory access, system calls — costs a fixed number of CUs. Understanding compute units is essential for controlling transaction costs and avoiding failed transactions.

How Compute Units Affect Fees

Compute units directly control the priority fee you pay. Priority Fee = ceil(CU_price × CU_limit / 1,000,000) lamports. A higher CU limit request means a higher priority fee even if your transaction uses fewer CUs. This is why you should always simulate transactions and set CU limit close to actual usage.

Default and Maximum CU Limits

If you do not specify a CU limit, Solana assigns a default limit based on the transaction type. The absolute maximum CU limit per transaction is 1,400,000. Most simple transfers use fewer than 1,000 CUs; token swaps typically use 50,000–200,000 CUs; complex DeFi operations can reach 400,000+ CUs.

Setting Compute Unit Price

Include a SetComputeUnitPrice instruction in your transaction with your desired micro-lamports per CU. The default price is 0 (no priority fee). For competitive inclusion during congestion, query getRecentPrioritizationFees and set a price at the 75th–90th percentile of recent successful transactions.

Block-Level CU Limits

Each Solana block has a maximum of 48,000,000 CUs. The scheduler uses a cost model that accounts for signature verification costs, write-lock account costs, instruction data size, and program execution costs to rank transactions by their priority-to-cost ratio.

Solana Compute Units – How They Affect Your Fees

Frequently Asked Questions

What happens if I exceed my compute unit limit?

If a transaction exceeds its requested CU limit, it fails immediately. The base fee is still charged. Set your CU limit to at least 110% of simulated usage to avoid this.

Does the actual CU usage affect my fee?

No. The priority fee is calculated on the requested CU limit, not actual usage. Only actual usage matters for execution success (it must not exceed the limit).

How do I find out how many CUs my transaction uses?

Use the simulateTransaction RPC method. It returns the actual CU consumption without broadcasting the transaction to the network.

Related Fee Topics

Base Fee

Base Fee

Every transaction on the Solana blockchain requires a mandatory base fee of 5,000 lamports (0.000005...

Transaction Fee

Transaction Fee

A Solana transaction fee has two components: a mandatory base fee and an optional priority fee. Unde...

Priority Fee

Priority Fee

The Solana priority fee is an optional payment that increases the scheduling priority of your transa...