Compute Budget Program
What is the Compute Budget Program?
The Compute Budget program allows transactions to request additional compute units and set priority fees, giving developers control over transaction resource limits and network prioritization.
Compute Unit Limits
Request more compute units for complex transactions that need additional processing power.
Priority Fees
Set higher fees to prioritize your transaction during network congestion.
Resource Optimization
Fine-tune transaction costs by requesting exactly the compute units needed.
Program Details
Program ID: ComputeBudget111111111111111111111111111111
Key Instructions
RequestUnitsDeprecated: (Deprecated) Request additional compute units
SetComputeUnitLimit: Set the maximum compute units for the transaction
SetComputeUnitPrice: Set the priority fee (micro-lamports per compute unit)
RequestHeapFrame: Request additional heap memory
SetLoadedAccountsDataSizeLimit: Set max total size of loaded account data
How It Works
Every Solana transaction has a compute unit budget that limits how much computation it can perform. By default, this is 200,000 compute units per instruction, but transactions can request more through the Compute Budget program.
Priority fees allow transactions to pay extra to be processed faster during network congestion. Validators prioritize transactions with higher fees per compute unit.
Usage Patterns
Include compute budget instructions at the start of your transaction
Set compute unit limit slightly higher than what your transaction actually needs
Monitor network congestion and adjust priority fees accordingly
For complex programs, estimate compute units through simulation first
Best Practices
Don't request excessive compute units - you pay for what you request
Use priority fees strategically during high network load
Test transactions to determine actual compute unit usage
Consider user experience - higher fees mean faster confirmation
Resources
Solana Compute Budget Documentation
Priority Fees Guide
Transaction Optimization Best Practices