Base Fee Prediction API
Gas price trends for the next 5 blocks.
Predictions are made for the next 5 blocks at a 99% confidence level (highest inclusion guarantee at the expense of some overpayment) and 50% confidence level (likely inclusion with reduced overpayment).
Authentication
Use of this endpoint requires an API key for proper authorization. Request an API key here.
API Endpoint
GET
https://api.blocknative.com/gasprices/basefee-estimates
Returns a range of confidence intervals for gas prices needed to qualify a transaction for inclusion in the next block. Order of confidence intervals is subject to change.
Fields
Each payload contains header fields followed by base fee predictions for the next 5 blocks after the current pending block.
Header Fields
Field Name | Description |
---|---|
system | Type of chain (EVM = “ethereum”) |
network | Name of network (chain id 1 = “main”) |
unit | Type of unit for fee values (currently all fee values are in gwei) |
currentBlockNumber | Block number at time of prediction |
msSinceLastBlock | Time, in milliseconds, since last block (i.e. how far into slot time) |
baseFeePerGas | Base fee for current pending block |
blobBaseFeePerGas | Blob base fee for current pending block |
estimatedBaseFees | Future pending block estimates (see below) |
Estimate Fields
Field Name | Description |
---|---|
pending+n | Future pending block for the estimate (current n = 1…5). This is the pending block after the current pending block. The base fee and blob base fee for the current pending block is already fixed and included in the header. |
confidence | Indicates how likely predictions are to being greater than or equal to the actual base fee or blob base fee for that future block number. For example the 99% confidence level attempts to make a prediction that is greater than or equal to the actual base fees 99% of the time, while minimizing the gap between the prediction and actual fee. And the 50% confidence level attempts to make a prediction that is greater than or equal to the actual base fees 50% of the time, while minimizing the gap between the prediction and actual fee. Therefore, the 99% confidence level will always make a prediction that is higher than the 50% confidence level in order to achieve its 99% confidence. |
baseFee | The estimated base fee at the specified confidence level for the specified future pending block. |
blobBaseFee | The estimated blob base fee at the specified confidence level for the specified future pending block. |
Example Request
Example Response
The response payload contains the predictions for the base fee and blob base fee for the current pending block + X where X can be 1 through 5.
In the above example response, you receive the system (Ethereum), network (main), unit (gwei), current block number, time since last block (ms), base fee (gwei), and blob base fee (gwei) as well as the estimated base fee predictions (over the next 5 blocks after the current pending block) for the base fee and the blob base fee at a 99% confidence level and 50% confidence level.
Questions
If you have any questions, please reach out to Blocknative.
Last updated