in-solana by Supanode

What Is Compute Unit in Solana?

A compute unit (CU) is the smallest unit of computational work on Solana. Every instruction in a transaction consumes compute units, and each transaction has a compute unit limit. If the limit is exceeded, the transaction fails with ComputationalBudgetExceeded.

Key numbers

LimitValue
Default per instruction200,000 CU
Maximum per transaction1,400,000 CU
Block limit48,000,000 CU

Why compute units matter

  1. Priority fees. The total priority fee = computeUnitPrice * computeUnitsConsumed / 1,000,000. Lower CU usage means lower fees.
  2. Block packing. Validators fit transactions into blocks up to the block compute limit. Tighter CU budgets make your transaction easier to include.

Setting compute limits

Use the setComputeUnitLimit instruction from the Compute Budget program to set an explicit limit. Without it, each instruction defaults to 200,000 CU. Simulate your transaction first to find the actual consumption, then set the limit to that value plus a small margin.

See the compute units optimization guide for detailed instructions.

Updated: