X

COMPUTE UNIT PRICE GUIDE

Microlamports, compute budgets, and transaction optimization

Solana Compute Unit Price Guide – Microlamports Explained

Solana Compute Unit Price Guide – Microlamports Explained

The compute unit (CU) is the fundamental unit of computational cost on Solana. Every operation — from arithmetic to account reads to cross-program invocations — consumes a defined number of compute units. The compute unit price, measured in microlamports per CU, is the lever you use to set your transaction's priority fee.

One lamport equals 1,000,000 micro-lamports. The compute unit price directly determines the prioritization fee: higher price per CU means higher priority in the validator's scheduler.

What Is a Compute Unit?

A compute unit represents a single unit of processing work performed by the Solana runtime. Simple operations like integer addition cost 1 CU, while more complex operations like SHA-256 hashing, cross-program invocations, or account data reads carry larger CU costs. Transactions have a maximum compute budget of 1,400,000 CUs total, with each individual instruction limited to 200,000 CUs by default unless explicitly raised.

SetComputeUnitLimit

The SetComputeUnitLimit instruction (from the Compute Budget Program) explicitly sets the maximum number of CUs your transaction may consume. If you do not include this instruction, the runtime assigns a default based on the number and type of instructions in your transaction. Always set this explicitly and as tight as possible — since priority fees are charged on the limit, not actual usage, wasteful limits directly cost money.

SetComputeUnitPrice

The SetComputeUnitPrice instruction sets the price you are willing to pay per compute unit in microlamports. Including this instruction with a value greater than 0 activates your transaction's priority fee. The value you choose should be calibrated to current network conditions — too low and your transaction may not be processed during congestion; too high and you overpay unnecessarily.

Compute Budget Program

Both SetComputeUnitLimit and SetComputeUnitPrice are instructions of the native Compute Budget Program on Solana. These instructions must be added to your transaction before any other instructions. The Solana SDK exposes these via ComputeBudgetProgram.setComputeUnitLimit() and ComputeBudgetProgram.setComputeUnitPrice() in the web3.js library.

Estimating CU Usage Before Sending

To set the most efficient compute limit, you can simulate your transaction first using the simulateTransaction RPC method. The simulation response includes the number of compute units consumed during a dry run, allowing you to set your limit to exactly that amount (plus a small safety margin of 5–10%) before submission.

Microlamports Reference Table

1 SOL = 1,000,000,000 lamports = 1,000,000,000,000,000 microlamports

A CU price of 50,000 microlamports on a 200,000 CU transaction: 50,000 × 200,000 / 1,000,000 = 10,000 lamports = 0.00001 SOL ≈ $0.001 at $100/SOL.

This negligible cost is why priority fees are broadly adopted — they provide substantial scheduling advantages for a fraction of a cent.

Solana Priority Fee

About This Guide

This guide is part of the priorityfeesolana.org knowledge base — a comprehensive resource for understanding Solana transaction fees, compute unit pricing, and best practices for landing transactions on the Solana network.

Leave A Comment