Learn · Updated November 18, 2026

Compute budget instructions and what they tell you

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#

TagInstructionArgumentData lengthRule
0unusednonereserved, deprecated
1RequestHeapFrameu32 bytes5a multiple of 1,024, from 32 KiB to 256 KiB
2SetComputeUnitLimitu32 units5capped at 1,400,000
3SetComputeUnitPriceu64 micro-lamports per unit9one micro-lamport is a millionth of a lamport
4SetLoadedAccountsDataSizeLimitu32 bytes5default 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 dataDecodedMeaning
02 a0860100tag 2, u32 100,000compute unit limit: 100,000
03 0100000000000000tag 3, u64 1price: 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 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.

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 covers those.

From budget to fee#

Working out the priority fee turns these values into lamports for every format, the fees and tips recipe decodes them in code, and instruction data explains the compiled form they arrive in. To read them from live traffic, start with a first decode.

Sources#

Raw shreds on your own server

Ultra Low Latency Shreds is $200 and Standard Shreds is $100. You pay in crypto, tell us which IPv4 address and UDP port should receive the stream, and we wire it up by hand.