SummaryTotal fee = base fee (5,000 lamports/signature, 50% burned) + priority fee
(CU_price * CU_limit / 1M lamports, 100% to validator). Charged whether the
transaction succeeds or fails.
Fee calculation algorithm
The total fee for a transaction is computed bycalculate_fee_details:
Total fee formula
lamports_per_signature
(currently 5,000), and the prioritization fee derived from compute budget
instructions. The total fee is deducted from the fee payer before execution
begins. If the transaction fails, the fee is still charged.
Base fee
The base fee covers the cost of Ed25519 signature verification plus any precompile signature verifications. Every signature in the transaction is charged, including signatures verified by the Ed25519, Secp256k1, and Secp256r1 precompile programs. Thecalculate_signature_fee
function computes:
Base fee formula
num_transaction_signatures: the number of Ed25519 signatures on the transaction (typically one per signer).num_ed25519_signatures,num_secp256k1_signatures,num_secp256r1_signatures: signatures verified by the corresponding precompile programs.lamports_per_signature: currently 5,000 lamports.
Fee distribution
The base fee and prioritization fee are distributed differently. Thecalculate_reward_and_burn_fee_details
function in the runtime computes:
Fee distribution
- Base fee (transaction_fee): 50% is
burned
(removed from circulating supply) and 50% goes to the block-producing
validator. The burn percent is
DEFAULT_BURN_PERCENT = 50. - Prioritization fee: 100% goes to the validator (none is burned), per SIMD-0096.
Prioritization fee
The prioritization fee is an optional fee that increases the scheduling priority of a transaction. A compute unit (CU) is a unit of computation that the runtime meters during transaction execution. Every operation (arithmetic, memory access, syscall) costs a fixed number of CUs. You can set the prioritization fee by including compute budget instructions in your transaction. (See the How to Use Priority Fees guide for details.)Prioritization fee formula
Theget_prioritization_fee
function computes:
Prioritization fee formula
| Variable | Description | Default |
|---|---|---|
compute_unit_price | Micro-lamports per CU, set via SetComputeUnitPrice | 0 micro-lamports |
compute_unit_limit | Maximum CUs the transaction may consume, set via SetComputeUnitLimit | Sum of per-instruction defaults |
1,000,000 | Conversion factor from micro-lamports to lamports (MICRO_LAMPORTS_PER_LAMPORT) | — |
v1 transactions set the fee directlyThis price-times-limit formula applies to legacy and v0 transactions. In the
v1 format, the
priority fee is an absolute total in lamports set directly in the message
config — no per-CU price, no multiplication, no rounding.
Compute unit limit
The compute unit limit is the maximum number of CUs a transaction may consume. If noSetComputeUnitLimit
instruction is included, the default is calculated from the number and type of
instructions (200,000 CUs per non-builtin instruction, 3,000 per builtin). See
Compute Budget for details on the default
calculation.
The priority fee is based on the requested CU limit, not actual CU usage.
Setting a higher limit than needed means paying for unused compute units.
Compute unit price
The compute unit price is an optional amount of micro-lamports paid for each requested CU. The CU price directly determines the prioritization fee. To set the CU price, include aSetComputeUnitPrice
instruction in your transaction.
The default CU price is 0, meaning the default prioritization fee is also 0.
| Provider | Priority Fee API |
|---|---|
| Helius | Documentation |
| QuickNode | Documentation |
| Triton | Documentation |
Transaction scheduling priority
The scheduler ranks transactions using thecalculate_priority_and_cost
function:
Transaction priority formula
- reward: the validator’s fee income = prioritization fee + non-burned
portion of the base fee. Computed by
calculate_reward_for_transaction. - cost: the scheduler’s estimated CU cost (signature costs + write lock costs + instruction data costs + program execution costs + loaded accounts data size cost). See Compute Budget for details.
- 1,000,000: a multiplier to preserve precision, since cost often exceeds reward in raw lamports.
- +1: prevents division by zero.
Example: Setting the CU limit and CU price
The examples below show how to set the CU limit and CU price on a transaction using Solana SDKs.| SDK | Source Code Reference |
|---|---|
@solana/web3.js v3 (Typescript) | ComputeBudgetProgram |
@solana/web3.js (legacy, Typescript) | ComputeBudgetProgram |
solana-sdk (Rust) | ComputeBudgetInstruction |
@solana/web3.js 1.x is no longer actively maintainedIt receives critical fixes only. Use Kit for new code. To migrate existing code, follow the Kit upgrade guide, or the web3.js v3 migration guide to keep the class-based API.To run this code, install 1.x with npm install @solana/web3.js@1. A plain npm install @solana/web3.js installs v3, which this code doesn’t run on.The Rust tabs on this page use the 2.x Solana crates. Install the
dependencies with (tested with Rust 1.89 and 1.98):
@solana/web3.js 1.x is no longer actively maintainedIt receives critical fixes only. Use Kit for new code. To migrate existing code, follow the Kit upgrade guide, or the web3.js v3 migration guide to keep the class-based API.To run this code, install 1.x with npm install @solana/web3.js@1. A plain npm install @solana/web3.js installs v3, which this code doesn’t run on.