How transaction fees work on Solana
Solana 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 (CU)
T
can be defined as F(T)
, where F(T)
is the “fee-per compute-unit”, calculated by:
This means that the more compute units a transaction requests, the more additional fee it will have to pay to maintain the priority in the transaction queue. This prevents computationally heavy transactions from being easily spammed or from filling blocks.
Priority fee calculation
Priority fees are calculated as, where,How Phantom applies priority fees to app transactions
Although dapps can set their own priority fees on transactions they generate, we highly discourage doing so as it often surfaces unnecessary complexity to end-users. Instead, we recommend that dapp developers let Phantom apply priority fees on the user’s behalf. Phantom will calculate and apply Priority Fees to all dapp-generated transactions, provided:- The transaction(s) do not already have signature(s) present.
- The transaction(s) do not have existing priority fee instructions (
computeUnitBudget
orcomputeUnitLimit
). - After enhancing transaction(s) with Priority Fees, the size of each transaction will still be less than the byte size limit (1232 bytes).
signAndSendTransaction
, signTransaction
, signAllTransactions
) across all environments (extension, mobile in-app browser, deeplinks, mobile wallet adapter).