eth_gasPrice
JSON-RPC method returns the base fee for the next small block on Hyperliquid EVM. This method provides the gas price for standard (small) block transactions.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
This method takes no parameters.Response
The method returns the current gas price as a hexadecimal string representing wei.Response structure
Gas price:result
— The base fee for the next small block in wei as a hexadecimal string
Data interpretation
Gas price format:- Returned as hexadecimal string with
0x
prefix - Value represents wei (smallest unit of ether)
- Convert to gwei by dividing by 10^9
- Convert to ether by dividing by 10^18
- 1 gwei = 10^9 wei
- 1 ether = 10^18 wei
- Example:
0x3b9aca00
= 1,000,000,000 wei = 1 gwei
Usage example
Basic implementation
Hyperliquid gas pricing
Small vs big blocks
Small block pricing:eth_gasPrice
returns the base fee for the next small block- Used for standard transactions
- Default pricing for most operations
eth_bigBlockGasPrice
returns the base fee for the next big block- Used for addresses that are using big blocks
- Check with
eth_usingBigBlocks
to determine if an address uses big blocks
Transaction fee calculation
Basic calculation:- Transaction cost = gas price × gas limit
- Use
eth_gasPrice
for standard transactions - Use
eth_bigBlockGasPrice
if the address uses big blocks
- 1 gwei = 10^9 wei
- 1 ether = 10^18 wei
- Example:
0x3b9aca00
= 1,000,000,000 wei = 1 gwei
Example request
Shell
Use cases
Theeth_gasPrice
method is essential for applications that need to:
- Standard transaction pricing: Get gas price for small block transactions
- Fee estimation: Calculate transaction costs for standard operations
- Wallet applications: Display gas prices for regular transactions
- Cost comparison: Compare small block vs big block pricing
- Transaction planning: Determine appropriate gas pricing strategy
- Development tools: Test applications with current small block pricing
- Analytics platforms: Monitor small block gas price trends
- Automated systems: Set gas prices for standard automated transactions
On Hyperliquid,
eth_gasPrice
returns the base fee for the next small block. For addresses using big blocks, use eth_bigBlockGasPrice
instead. Check if an address uses big blocks with eth_usingBigBlocks
.Body
application/json