Skip to main content

eth_feeHistory

Returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range.

Transaction fee history

Parameters (by position)

blockCount string required

Requested range of blocks. Clients will return less than the requested range if not all blocks are available.


newestBlock string or string required

Highest block of the requested range.


Show Option 1 Block number string

Block number fields

Highest block of the requested range.

newestBlock string required

Highest block of the requested range.

Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


Show Option 2 Block tag string

Block tag fields

earliest: The lowest numbered block the client has available; finalized: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; safe: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; latest: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; pending: A sample next block built by the client on top of latest and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for finalized or safe block MUST be responded to with -39001: Unknown block error

newestBlock string required

Highest block of the requested range.

Allowed values: earliest finalized safe latest pending


rewardPercentiles array<number> required

A monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the corresponding effective tip for the percentile will be determined, accounting for gas consumed.


Result

Fee history result object

Fee history for the returned block range. This can be a subsection of the requested range if not all blocks are available.


Show Fee history result object

Fee history result fields

Fee history for the returned block range. This can be a subsection of the requested range if not all blocks are available.

  • oldestBlock string required

    Lowest number block of returned range.

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • baseFeePerGas array<string> required

    An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • baseFeePerBlobGas array<string>

    An array of block base fees per blob gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-4844 blocks.

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • gasUsedRatio array<number> required

    An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit.

    Range: >= 0 and <= 1


  • blobGasUsedRatio array<number>

    An array of block blob gas used ratios. These are calculated as the ratio of blobGasUsed and the max blob gas per block.

    Range: >= 0 and <= 1


  • reward array<string>

    A two-dimensional array of effective priority fees per gas at the requested block percentiles.

    Match pattern: ^0x(0|[1-9a-f][0-9a-f]*)$


  • additionalProperties false


Examples

eth_feeHistory example

Request

{
"params": [
"0x5",
"latest",
[
20,
30
]
]
}

Response

{
"oldestblock": "0x10b52f",
"baseFeePerGas": [
"0x3fa63a3f",
"0x37f999ee",
"0x3e36f20a",
"0x4099f79a",
"0x430d532d",
"0x46fcd4a4"
],
"baseFeePerBlobGas": [
"0x7b7609c19",
"0x6dbe41789",
"0x7223341d4",
"0x6574a002c",
"0x7223341d4",
"0x6574a002c"
],
"gasUsedRatio": [
0.017712333333333333,
0.9458865666666667,
0.6534561,
0.6517375666666667,
0.7347769666666667
],
"blobGasUsedRatio": [
0,
0.6666666666666666,
0,
1,
0
],
"reward": [
[
"0x3b9aca00",
"0x59682f00"
],
[
"0x3a13012",
"0x3a13012"
],
[
"0x3a13012",
"0x3a13012"
],
[
"0xf4240",
"0xf4240"
],
[
"0xf4240",
"0xf4240"
]
]
}