Gas Price Estimation for Blockchain Transactions

ยท

Overview

Dynamically retrieve estimated gas prices across various blockchain networks, including support for EIP-1559 (Ethereum Improvement Proposal) and coverage for EVM (Ethereum Virtual Machine) and UTXO (Unspent Transaction Output) model networks.

API Endpoint

Request Method:
GET https://web3.okx.com/api/v5/wallet/pre-transaction/gas-price

Request Parameters

ParameterTypeRequiredDescription
chainIndexStringYesUnique chain identifier

Response Parameters

EVM Networks

ParameterTypeDescription
normalStringMedium-tier gasPrice (wei)
minStringLow-tier gasPrice (wei)
maxStringHigh-tier gasPrice (wei)
supporteip1559BooleanWhether EIP-1559 is supported
eip1559ProtocolObjectEIP-1559 protocol details

EIP-1559 Protocol Structure

ParameterTypeDescription
baseFeeStringBase fee (wei)
proposePriorityFeeStringMedium-tier priority fee (wei)
safePriorityFeeStringLow-tier priority fee (wei)
fastPriorityFeeStringHigh-tier priority fee (wei)

BRC-20/UTXO Networks

ParameterTypeDescription
normalFeeRateStringMedium-tier fee rate
maxFeeRateStringHigh-tier fee rate
minFeeRateObjectLow-tier fee rate
inscriptionOutputStringInscription output size
minOutputStringMinimum inscription output (satoshis, typically 546)
normalCostStringSingle inscription transaction cost (satoshis)
maxCostStringMax inscription transaction cost (satoshis)
minCostStringMin inscription transaction cost (satoshis)

Usage Examples

๐Ÿ‘‰ Explore EVM gas price estimation
๐Ÿ‘‰ Learn about UTXO fee structures

FAQs

What is EIP-1559?

EIP-1559 is an Ethereum upgrade that introduces a base fee mechanism to make gas fees more predictable. It burns part of the transaction fee, reducing ETH supply over time.

How do I choose between gas tiers?

Why do UTXO networks have different fee parameters?

UTXO-based chains like Bitcoin use fee rates (sat/vByte) instead of gas, calculated differently due to their transaction model.

How often are gas prices updated?

Estimates refresh dynamically based on real-time network congestion. For critical transactions, always verify current rates before broadcasting.

Can I use this API for testnets?

Yes, specify the testnet chainIndex (e.g., Ethereum Goerli) to get testnet gas estimates.