X

Compute Unit Price

Understand and optimize your Solana compute unit bid

Solana Compute Unit Price | How to Optimize Your CU Bid

Introduction

Compute Unit Price (CU price) is the amount in micro-lamports you are willing to pay per compute unit consumed by your transaction. Setting an optimal CU price is the key lever for controlling transaction priority on Solana without overpaying.

CU Price vs CU Limit

CU price is your micro-lamport bid per unit of computation. CU limit is the maximum units your transaction can consume — exceeding this causes the transaction to fail. Both are set via ComputeBudgetProgram instructions. Setting CU limit accurately (not too high) helps validators schedule your transaction more efficiently.

Scheduler Priority

Solana's scheduler ranks transactions using: priority = (validator_reward × 1,000,000) / estimated_cost. Validator reward = priority fee + non-burned portion of base fee. Estimated cost is the CU cost of execution. Higher CU price directly raises your priority score, moving your transaction to the front of the queue.

The Compute Unit Price is set using:

ComputeBudgetProgram.setComputeUnitPrice({
  microLamports: 50000  // your bid per CU
});

And the Compute Unit Limit:

ComputeBudgetProgram.setComputeUnitLimit({
  units: 200000  // max CU for this tx
});

Key constants:

  • Default CU price: 0 microlamports (no priority)
  • Max CU per transaction: 1,400,000
  • Max CU per block: 48,000,000
  • Signature cost: 720 CU each

Related Resources

compute budget

01
SetComputeUnitPrice Instruction
02
SetComputeUnitLimit Instruction
03
Scheduler Priority Formula
04
Block Compute Budget
Compute Unit Pricing Guide
1M
microlamports per lamport
1.4M
Max CU per Transaction
0
Default CU Price

user feedback

Priority Fees Solana

Liam P.

Solana user

Understanding CU price vs CU limit completely changed how I write Solana programs. Optimizing both reduced my transaction costs by 40%.

Priority Fees Solana

Aisha N.

Solana user

The scheduler priority formula explained here was the missing piece. Now our arbitrage bot consistently outbids competitors in the mempool.