X

COMPUTE UNIT PRICE

How compute units drive Solana transaction priority

Compute Unit Price Guide for Solana

Compute Unit Price Guide for Solana

Every operation that runs on the Solana runtime has a compute cost measured in compute units (CUs). Arithmetic operations, memory accesses, system calls, and cross-program invocations all consume CUs. Understanding this resource model is the foundation of efficient Solana development.

Compute units are Solana's gas equivalent — and the compute unit price is what drives your transaction's priority in the validator queue.

Default Compute Budget

If your transaction does not include a SetComputeUnitLimit instruction, the runtime assigns a default budget of 200,000 CUs per non-built-in instruction (3,000 CUs for built-in instructions). For a transaction with one program call and no explicit budget, you get 200,000 CUs by default.

The maximum compute budget per transaction is capped at 1.4 million CUs. If your transaction exceeds its budget, it fails — even if it had enough SOL to pay fees. The fee is still charged.

Setting Compute Unit Price

The compute unit price — expressed in microlamports per CU — is set with the SetComputeUnitPrice instruction. This value multiplied by your compute unit limit (divided by 1,000,000) gives your priority fee in lamports. Higher prices move your transaction ahead in the scheduler's queue relative to transactions with lower prices on the same set of accounts.

Optimizing CU Consumption

Solana programs can be optimized to use fewer CUs through techniques like reducing cross-program invocations, using more efficient data serialization, and minimizing account data reads. Developers building high-frequency applications should profile CU usage with each code change. The Solana CLI's solana-test-validator logs CU consumption per transaction, making local profiling straightforward.

Block-Level CU Limits

Each Solana block has a maximum of 48 million CUs. Individual transaction accounts are capped at 12 million CUs per block. These limits mean that during high-traffic events, transactions with efficient CU usage have a structural advantage — validators can fit more of them per block, and their fee-per-CU efficiency is directly comparable to competing transactions.

Priority Fee Solana

About this guide

priorityfeesolana.com is a dedicated resource for Solana developers and users who want to understand and optimize transaction priority fees. All guides are based on the latest Solana documentation and real-world fee market data.

Leave A Comment