eth_feeHistory | Optimism

Optimism API method eth_feeHistory retrieves historical gas fee data, providing insights into gas price trends and block utilization over time. This method is valuable for estimating transaction fees and understanding network congestion.

๐Ÿ‘

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • blockCount โ€” the number of blocks to include in the history.
  • newestBlock โ€” the newest block (by number or one of the strings "earliest", "latest", or "pending") to include in the history.
  • rewardPercentiles โ€” an array of percentiles to calculate effective priority fees over the requested blocks.

Response

  • result โ€” an object containing:
    • oldestBlock โ€” the oldest block number in the history.
    • baseFeePerGas โ€” an array of base fees per gas for each block.
    • gasUsedRatio โ€” an array of ratios of gas used to gas limit for each block.
    • reward โ€” an array of arrays containing the priority fees at the specified percentiles for each block.

Use case

The eth_feeHistory method is essential for:

  • Wallets and interfaces providing users with data-driven gas price suggestions.
  • Applications and services monitoring Optimism network congestion and optimizing transaction fee estimates.
  • Analysts studying Optimism gas fee trends and block space utilization.

Try the eth_feeHistory RPC method yourself

Language
Click Try It! to start a request and see the response here!