Soldev

Solana fees

Last updated:

There are two types of fees on Solana.

  1. Transaction fees
  2. Rent fees

These fees must be paid for by an account that is owned by the System Program. This account is usually referred to as a fee payer.

Before a transaction's instructions are processed, the fee payers balance will be deducted to pay for transaction fees. If the payer does not have the balance the transaction is dropped.

Once these fees are deducted, they are not given back. It does not matter if the transaction is successful or not. When a transaction fails, all account changes except the transaction fee will be rolled back.

Transaction fees

Transaction fees are usually called gas fees on other chains like Ethereum.

Unlike other chains, these fees were originally supposed to be deterministic and you cannot pay higher fees for a chance of being included in a block. Since then Solana has added the ability to pay an additional prioritization fee to increase the chance the validator processes your transaction.

The base fee for a transaction is 5000 lamports per signature. The additional prioritization fee is (compute_unit_limit * compute_unit_price).

The important part is that even though these fees can fluctuate, they can be calculated deterministically when creating and before signing a transaction.

To get the fee by finding the block whose blockhash matches the recent_blockhash field in a transaction. This is why transactions with expired blockhashes are ignored.

During block validation, each transaction's recent blockhash is checked to ensure it has not expired yet. The max age of a blockhash is only 150 blocks.

This fee is then taken and split two ways:

  1. 50% burned
  2. 50% distributed to the validator that processed the transaction

Rent fees

Rent fees are charged based on how much storage an account needs to hold whatever it is its holding (some kind of arbitrary data).

The amount of resources used by a specific transaction do not impact the cost of fees in any way. They are calculated based on the number of signatures that need to be verified in a transaction.