Skip to main content
POST
/
eth_feeHistory
curl --request POST \
  --url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_feeHistory",
  "params": [
    "0x4",
    "latest",
    [
      25,
      75
    ]
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {}
}
Monad API method that returns historical gas information, allowing you to track trends over time. This method is essential for building sophisticated gas estimation strategies based on recent network conditions.
Monad-specific behavior: Currently returns default values. This is temporary and will be updated with actual historical data in the future.
Get you own node endpoint todayStart 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 in the requested range (1 to 1024).
  • newestBlock — the highest block of the requested range as a hexadecimal string or block tag.
  • rewardPercentiles — an array of floating point values between 0 and 100 to sample the effective priority fees.

Response

  • result — an object containing:
    • oldestBlock — the oldest block in the range
    • baseFeePerGas — array of base fees per gas for each block
    • gasUsedRatio — array of gas used ratios for each block
    • reward — array of arrays containing the requested percentile values of effective priority fees

eth_feeHistory code examples

const { ethers } = require("ethers");

const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");

async function getFeeHistory() {
  const feeHistory = await provider.send("eth_feeHistory", ["0x4", "latest", [25, 50, 75]]);
  console.log(`Oldest block: ${parseInt(feeHistory.oldestBlock, 16)}`);
  console.log("Base fees:", feeHistory.baseFeePerGas.map(fee => ethers.formatUnits(fee, "gwei") + " gwei"));
  console.log("Gas used ratios:", feeHistory.gasUsedRatio);
}

getFeeHistory();

Use case

A practical use case for eth_feeHistory is building a gas price oracle that analyzes historical trends to predict optimal gas prices, or creating dashboards that visualize network congestion over time.

Body

application/json
id
integer
default:1
jsonrpc
string
default:2.0
method
string
default:eth_feeHistory
params
any[]

Response

200 - application/json

Fee history for the requested block range.

jsonrpc
string
id
integer
result
object