Miners and validators receive a reward for successfully validating transactions and discouraging spam and malicious activity.
For blockchains using fee structures that vary depending on network activity, fees can get expensive due to network congestion. The fee amount paid determines the transaction's priority: the higher the fee paid, the faster the confirmation process.
Fireblocks allows you to set the fee when creating a new transaction.
- Custom fee: This is a customer-set fee. Custom fees are not adjusted once set. The fee specified is included when the transaction is submitted and signed.
- Tentative fee: This allows customers to select between slow, medium, and high fee rates that are dynamically calculated. The fee rate dictates the speed at which your transaction will be picked up and confirmed by the network. When setting a tentative fee rate, the displayed amount is an estimate and the fee calculation is not finalized until your transaction is signed.
Ethereum fee rate calculation
In August 2021, the fee structure in Ethereum changed to the EIP-1559 fee format (London fork). Before the London fork, users chose a gas price for the transaction. Now, the user can choose a maxFee and a maxPriorityFee.
In the new fee format, each block has a base fee that changes from block to block. If the network is busy with many transactions being sent, the fee increases. When EIP-1559 was planned, the idea was to keep prices stable. However, this did not work out as intended, and the base fee can change drastically.
When you create a transaction, you must pay at least the base fee for the transaction to be mined. As a result, the max priority fee you choose must be more than the current base fee. If it is less than the current base fee, the transaction may go to an internal queue of the node instead of the mempool and will not appear in an Etherscan search.
The base fee of the transaction is burned rather than transferred to the miner. To incentivize miners to choose Fireblocks transactions over other transactions in the mempool, Fireblocks allows you to choose a priority fee. In theory, you can set your priority fee to 0 to save costs. However, in this scenario, it is uncertain when the transaction will be mined.
When the transaction is created, there are two parameters: maxFee and maxPriorityFee. The second parameter is called maxPriorityFee instead of priorityFee because the actual priority fee paid to the miner will be min(maxPriorityFee, maxFee - block base fee).
For example, if you set maxFee=100, maxPriorityFee=20 and the block base fee is 50, the actual priority fee will be 20 and the total gas price will be 70.
However, if the block base fee is 90, the actual priority fee will be 100-90=10 and the total gas price will be the same as the maxFee: 100.
All the fees are per unit of gas. The max fee for the transaction is (gas limit) * (maxFee). Note that 1maxFee = gasLimit * maxFee.
You can use our APIs to calculate custom fees by providing maxFee, PriorityFee, and gas limit values. You can obtain the block base fee from the blockchain.
If (block base fee + PriorityFee) < maxFee, then (block base fee + PriorityFee) = gas price.
However, if the (block base fee + PriorityFee) > maxFee, then max fee = gas price.
Note
If you want to empty a wallet of funds, you must manually calculate the required fee for that (treatAsGrossAmount = true). When Fireblocks calculates the fee estimate, we include a delta to protect you from fee shortage. This delta is eventually partially returned to the wallet and remains there, preventing you from fully emptying it. To empty your wallet without the delta, you must set the fee by yourself.
How does Fireblocks fee estimation work for EVM-based transactions?
During transaction signing, the fee and gas price may also increase. The Fireblocks algorithm factors this possibility into its calculation, preventing it from causing the transaction to get stuck in the mempool.
This is why the actual fee you pay for a transaction through Fireblocks is usually higher than the fee you would expect to pay based on the blockchain’s fees at the moment you submit it.
- Fee estimation: Use the estimateFee API endpoint to get the current estimated fee.
- A delta: We add this to the estimated fee to mitigate sudden spikes by sending slightly more than the estimate. This prevents the transaction from getting stuck in the mempool if the fee increases.
General fee rates for other blockchain systems
- Slow: Spend less on fees but take longer to confirm
- Medium: Spend an average fee amount and confirm in average time
- Fast: Spend more and confirm more quickly
Fee source and minimum balance
Fees are paid with a blockchain's native asset from the vault account used for the transaction, including non-native token transfers. We recommend keeping a sufficient balance of native assets in that vault account to cover blockchain fees.
When you have the Fireblocks Gas Station enabled in your workspace, the Gas Station account automatically sends a default amount of a base asset to your vault account when relevant tokens are detected there. For example, if an empty vault account is Gas Station enabled and it receives a deposit of 20 USDC on the Ethereum network, your workspace Gas Station account sends 0.01 ETH to that vault account so that sufficient funds are available to draw from in a future transfer.
Transaction fees on Fireblocks
Fireblocks Console
When you choose a fee level, Fireblocks calculates the recommended priority fee for that level based on the priority fees in previous blocks. To calculate the max fee, we take the base fee of the previous block, add a delta to allow for rising prices, and add the priority fee.
The max fee is calculated as maxFee = previousBlockBaseFee + delta + priorityFee.
Note
The tentative fee displayed in the Console is the maxFee without the delta. It is the previousBlockBaseFee + priorityFee. If you choose a custom fee, we will use it as both the maxFee and priorityFee, which means the actual priority fee will be maxFee - blockBaseFee. The priority fee is calculated as priorityFee = maxFee - blockBaseFee.
API
You can choose one of the options below when selecting a fee via the Fireblocks API. Choosing an option in the API is the same as choosing it in the Console.
- priorityFee and maxFee
- gasPrice and gasLimit (If the gasLimit was not provided, Fireblocks will simulate transactions for gasLimit estimation)
- feeLevel
Preset fees
To save the trouble of calculating the gas required for each transaction, Fireblocks offers preset fees for both the Console (slow, medium, and fast) and the API (low, medium, and high). Fee calculations are based on recent blocks and a certain percentile of the data collected.
Fireblocks retrieves the latest block data every minute and inspects the gas price of the most recent blocks to determine the fee rate and automatically set the gas limit.
In addition to verifying the latest data, Fireblocks also simulates the desired transactions to estimate the fee. Fireblocks then sends the transaction parameters to an API endpoint on the node which returns an estimated calculation for the transaction fee.
Gross transfers
Since the actual gas price paid depends on the blockBaseFee, the amount spent in a gross transfer will likely be less than the requested amount. If you want to make the amount spent the same as the chosen amount without leaving any dust (trace cryptocurrency amounts left after a transaction), you can choose a custom fee. This forces maxFee = priorityFee, which means the actual gas price will be the same as the maxFee.