Fees on OP Mainnet (also known as L2) are, for the most part, significantly lower than on the L1 Ethereum network.
Every OP Mainnet transaction has two costs: An L2 (execution) fee and an L1 (security) fee. At a high level, the L2 fee is the cost to execute your transaction in L2 and the L1 fee is the estimated cost to publish your transaction on L1 (in a rollup batch). Typically the L1 security fee is much higher than the L2 execution fee, so if you can wait it makes sense to postpone transactions until gas prices are lower (for example, over the weekend).
-
L2 execution fee is charged as
tx.gasPrice * l2GasUsed
(up totx.gasLimit
). You can check the current L2 gas price here. The transaction gas price is composed of two components: a base fee and a priority fee, because we are EIP 1559 compliant (although with different parameter values). -
L1 security fee that pays for the cost of publishing the transaction on L1 (the cost of Ethereum equivalent security). It is deducted automatically from the user's ETH balance on OP Mainnet. It is based on three factors that are multiplied together:
-
The gas price for L1 transactions (when the transaction was processed). You can see the current value here. Note that while this value changes, it does not track L1 gas prices precisely, so spikes in L1 gas price can only affect your transaction's cost by up to 25%.
-
The gas used on L1 to publish the transaction. This is based on the transaction length, as well as the byte value (whether it is zero or a different value) for each byte.
-
The L1 fee scalar, which is at writing 1. You can see the current value in the contract. Take the value provided by the contract and divide by a million.
-