Canonical: https://solanashreds.xyz/learn/compute-budget-instructions

# Compute budget instructions and what they tell you

The Solana compute budget instruction sets a compute unit limit and price. Its instruction tags and arguments, exactly as they appear in raw transaction data.

A Solana compute budget instruction is a call to `ComputeBudget111111111111111111111111111111` with no accounts and a few bytes of data: a one-byte tag, then one little-endian number. Tag 2 sets the compute unit limit, tag 3 the price per unit in micro-lamports, tag 4 a loaded-data size limit and tag 1 the heap size.

## The four instructions, by tag

| Tag | Instruction | Argument | Data length | Rule |
| --- | --- | --- | --- | --- |
| 0 | unused | none | | reserved, deprecated |
| 1 | `RequestHeapFrame` | `u32` bytes | 5 | a multiple of 1,024, from 32 KiB to 256 KiB |
| 2 | `SetComputeUnitLimit` | `u32` units | 5 | capped at 1,400,000 |
| 3 | `SetComputeUnitPrice` | `u64` micro-lamports per unit | 9 | one micro-lamport is a millionth of a lamport |
| 4 | `SetLoadedAccountsDataSizeLimit` | `u32` bytes | 5 | default and maximum 64 MiB |

The encoding is not Borsh with a discriminator: it is a single tag byte followed directly by the number, little-endian. A transaction may contain each kind at most once. A second instruction of the same kind makes the whole transaction invalid with a duplicate-instruction error.

## What applies when a transaction sets nothing

Without a limit instruction, the runtime gives each instruction a default allowance: 200,000 compute units for a program instruction and up to 3,000 for a builtin such as the System or Compute Budget program, with the total capped at 1,400,000. Without a price instruction, the price is zero and the transaction pays no priority fee. The heap stays at 32 KiB and the loaded-data limit at 64 MiB.

The defaults matter for decoding because absence carries meaning. A transaction with no price instruction is not missing data; it is a transaction that offered no priority fee.

## A real pair, decoded and checked against the fee

This legacy transaction from mainnet slot 470,901,815 opens with two compute budget instructions:

| Instruction data | Decoded | Meaning |
| --- | --- | --- |
| `02 a0860100` | tag 2, `u32` 100,000 | compute unit limit: 100,000 |
| `03 0100000000000000` | tag 3, `u64` 1 | price: 1 micro-lamport per unit |

The priority fee is the price times the limit, divided by one million and rounded up: 1 × 100,000 / 1,000,000 = 0.1, which rounds up to 1 lamport. With one signature at 5,000 lamports, the fee is 5,001 lamports, exactly what the block's metadata records. The transaction actually used 43,563 units, but the fee was set by the limit it asked for, not by what it consumed.

## How often transactions set them

Across two consecutive mainnet blocks on 18 November 2026, 509 legacy and v0 transactions:

- 461 set a compute unit limit;
- 275 set a compute unit price, with a median of 520 micro-lamports per unit;
- 60 set a loaded-data size limit, and 1 asked for a larger heap;
- 28 had no compute budget instruction at all.

These are two blocks, not a market survey; they show the shape of real traffic, not a benchmark.

## v1 transactions ignore them

[Transaction v1](https://solanashreds.xyz/learn/transaction-v1) moves all of this into a configuration mask in the transaction itself: a priority fee as a total in lamports, a compute unit limit, a loaded-data limit and a heap size. If a v1 transaction also contains compute budget instructions, the runtime ignores them for configuration; they still cost compute units, and they succeed as no-ops. In the same two blocks every one of the 272 v1 transactions set a compute unit limit in its mask, and 245 set a priority fee.

A decoder therefore has to branch: read compute budget instructions for legacy and v0, read the mask for v1, and never mix the two.

## What compute budget data is worth to a shred decoder

The compute budget is part of the request, so it is fully visible in raw transactions, before execution. That makes it one of the few cost signals you can compute from shreds alone: what each transaction offered to pay for priority and how much compute it reserved. Filtering by program is cheap here too, since the program ID is always a static key. The steps from these numbers to a fee are on [what a transaction paid in priority fee](https://solanashreds.xyz/learn/priority-fee-from-a-transaction).

## Questions about compute budget instructions

### What unit is the compute unit price in?

Micro-lamports per compute unit, a millionth of a lamport. Multiply by the limit, divide by 1,000,000 and round up to get lamports.

### Does a transaction pay for the units it used or the units it requested?

The priority fee is based on the requested limit, or the default limit if none was set, not on units consumed.

### Can a transaction set the price twice to raise it?

No. Two instructions of the same kind make the transaction invalid.

## What these instructions cannot tell you

They show what a sender offered and reserved, not what happened. Units consumed, whether the transaction succeeded and the fee actually charged all come from execution metadata. They also say nothing about other payments for inclusion, such as tips paid as ordinary transfers; the [fees and tips recipe](https://solanashreds.xyz/docs/programs/fees-and-tips) covers those.

## From budget to fee

[Working out the priority fee](https://solanashreds.xyz/learn/priority-fee-from-a-transaction) turns these values into lamports for every format, the [fees and tips recipe](https://solanashreds.xyz/docs/programs/fees-and-tips) decodes them in code, and [instruction data](https://solanashreds.xyz/learn/compiled-instructions) explains the compiled form they arrive in. To read them from live traffic, [start with a first decode](https://solanashreds.xyz/docs/quickstart).
