⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today →
Skip to main content

rollup_gasPrices

Returns the L2 gas-price oracle data that Unichain uses to compute total fees. The payload mirrors Optimism Bedrock networks and includes:

  • gasPrice — Total gas price Unichain applies to transactions.
  • l1GasPrice — Current L1 gas price component applied to calldata.
  • l2GasPrice — The execution gas component on Unichain itself.
  • baseFeeScalar, blobBaseFeeScalar, overhead — Scalars used by the sequencer when combining L1/L2 costs.

Use this method when you must break down L1 calldata charges, size cross-chain deposits, or monitor Unichain fee dynamics beyond what eth_gasPrice exposes.

Parameters

This method accepts no parameters.

Returns

An object describing the current Unichain gas oracle state. Each field is returned as a hexadecimal string representing wei.

Implementation Example

curl -X POST https://api-unichain-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "rollup_gasPrices",
"params": [],
"id": 1
}'

Response Example

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"gasPrice": "0x9184e72a000",
"l1GasPrice": "0x4a817c800",
"l2GasPrice": "0x9184e72a",
"baseFeeScalar": "0x1f4",
"blobBaseFeeScalar": "0x0",
"overhead": "0xaae60"
}
}

Need help? Contact our support team or check the Unichain documentation.