Transaction Fee

From Home>Solana Documentation>Core Concepts>Transaction Fees

Why pay transaction fee

As each transaction (which contains one or more instructions) is sent through the network, it gets processed by the current leader validation-client. Once confirmed as a global state transaction, this transaction fee is paid to the network to help support the economic design of the Solana blockchain.

Transaction fees can be both small or large, depending on the network activity. Market forces can also influence the fees you pay. While high fees can hinder wider blockchain adoption, very low fees could potentially bring security concerns.

For most blockchains, transaction fees are reasonably cheap, but they can get quite expensive depending on network traffic. As a user, the amount you choose to pay in fees determines your transaction's priority in being added to the next block. The higher the fee paid, the quicker the confirmation process.

Calculating transaction fees

Transactions fees are calculated based on two main parts:

  • a statically set base fee per signature, and

  • the computational resources used during the transaction, measured in "compute units"

Prioritization fee

A Solana transaction can include an optional fee to prioritize itself against others known as a "prioritization fee". Paying this additional fee helps boost how a transaction is prioritized against others, resulting in faster execution times.

A transaction's prioritization fee is calculated by multiplying the maximum number of compute units by the compute unit price (measured in micro-lamports).

Fee Collection

Transactions are required to have at least one account which has signed the transaction and is writable. Writable signer accounts are serialized first in the list of transaction accounts and the first of these accounts is always used as the "fee payer".

Before any transaction instructions are processed, the fee payer account balance will be deducted to pay for transaction fees. If the fee payer balance is not sufficient to cover transaction fees, the transaction will be dropped by the cluster. If the balance was sufficient, the fees will be deducted whether the transaction is processed successfully or not. In fact, if any of the transaction instructions return an error or violate runtime restrictions, all account changes except the transaction fee deduction will be rolled back.

Last updated