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
| Parameter | Type | Required | Description |
|---|---|---|---|
chainIndex | String | Yes | Unique chain identifier |
Response Parameters
EVM Networks
| Parameter | Type | Description |
|---|---|---|
normal | String | Medium-tier gasPrice (wei) |
min | String | Low-tier gasPrice (wei) |
max | String | High-tier gasPrice (wei) |
supporteip1559 | Boolean | Whether EIP-1559 is supported |
eip1559Protocol | Object | EIP-1559 protocol details |
EIP-1559 Protocol Structure
| Parameter | Type | Description |
|---|---|---|
baseFee | String | Base fee (wei) |
proposePriorityFee | String | Medium-tier priority fee (wei) |
safePriorityFee | String | Low-tier priority fee (wei) |
fastPriorityFee | String | High-tier priority fee (wei) |
BRC-20/UTXO Networks
| Parameter | Type | Description |
|---|---|---|
normalFeeRate | String | Medium-tier fee rate |
maxFeeRate | String | High-tier fee rate |
minFeeRate | Object | Low-tier fee rate |
inscriptionOutput | String | Inscription output size |
minOutput | String | Minimum inscription output (satoshis, typically 546) |
normalCost | String | Single inscription transaction cost (satoshis) |
maxCost | String | Max inscription transaction cost (satoshis) |
minCost | String | Min 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?
- Low-tier: For non-urgent transactions (higher risk of delays).
- Medium-tier: Balanced speed/cost for most use cases.
- High-tier: Time-sensitive transactions (e.g., NFT minting).
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.