Gas (network fee)
Gas (gas fee, network fee) is the payment for executing a transaction on a blockchain. It pays for the work of the network and is charged in the network's main coin: ETH on Ethereum, BNB on BNB Chain. The size of the fee depends on how complex the operation is and how busy the network is at that moment.
Worked example
On Ethereum the gas price is quoted in gwei: 1 gwei is one billionth of an ETH. Say a swap on a DEX needs 150,000 units of gas and the gas price is 20 gwei. Fee = 150,000 × 20 = 3,000,000 gwei, or 0.003 ETH. With ETH at $3,000, that is $9.
What the fee depends on
- Complexity. A simple transfer is cheaper than a swap, and a swap is usually cheaper than a transfer through a bridge.
- Network load. When there are many transactions, the gas price rises.
- Network. On layer 2 networks and a number of other blockchains, fees are many times lower than on Ethereum.
- Priority. Paying extra gets a transaction into a block faster.
Gas in arbitrage
Gas does not depend on the trade amount, so on small sizes it eats the spread. Say a 2% spread on a $300 trade is $6, while gas for the purchase and the transfer is $9: the trade loses money.
Two more rules. You need the destination network's coin in advance to pay gas there. And the fee is still charged for a failed transaction.
Questions and answers
Why is the network fee sometimes high and sometimes low?
Block space is limited. When many people want to send transactions, they compete on gas price and the fee goes up. When the network is quiet, it falls.
Is gas refunded if the transaction fails?
No. The network spent resources trying to execute it, so the fee for a failed transaction is not returned.