Prediction API - Base Fee and Blob Fee
Gas price trends for the next 5 blocks.
The Blocknative API provides real-time predictions for both the base fee and the blob base fee on the Ethereum network. These predictions assist users in setting optimal gas fees for transactions, ensuring timely confirmations without overpaying.
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
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
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 70% confidence level attempts to make a prediction that is greater than or equal to the actual base fees 70% 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 70% 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.
Questions
If you have any questions, please reach out to Blocknative.
Last updated