Skip to main content

rollup_gasPrices RPC Method

Returns the L1 and L2 gas prices that are being used by the Sequencer to calculate fees.

Updated on
Nov 2, 2023

rollup_gasPrices RPC Method

After the Bedrock upgrade it is recommended to use eth_gasPrice instead of rollup_gasPrices since the fees for both Layer 1 (L1) and Layer 2 (L2) are now consolidated and returned as a single value.

Parameters

This method does not accept any parameters

Returns

object
object
An object with the following fields:
l1GasPrice
L1 gas price in wei encoded as a hexadecimal that the Sequencer will use to estimate the L1 portion of fees (calldata costs)
l2GasPrice
L2 gas price in wei encoded as a hexadecimal that the Sequencer will use to estimate the L2 portion of fees (execution costs)
Request
1
curl https://docs-demo.optimism.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{"method":"rollup_gasPrices","params":[],"id":1,"jsonrpc":"2.0"}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free