Tac
Tac
eth_gasPrice
eth_gasPrice returns the legacy gas price in wei that the node would suggest for a new transaction. It exists for backwards compatibility with pre-EIP-1559 wallets and tooling. For any modern transaction, prefer the EIP-1559 family — they price priority and base fees separately, which gives you more control.
Parameters
None.
Response shape
A hex-encoded integer in wei:
0x4a817c800 = 20,000,000,000 wei = 20 gwei.
When to use it
- Building a legacy transaction that targets a chain without EIP-1559 (rare today).
- Quick sanity check of network conditions — the returned value is "what does the node think a reasonable price is right now?"
- Backwards-compatibility code paths in tooling that still has to support pre-London chains.
When to not use it
- Building an EIP-1559 transaction. Use eth_maxPriorityFeePerGas + eth_feeHistory instead.
- Estimating gas usage. That's eth_estimateGas.
- Targeting a specific congestion level (low / standard / fast). Use a fee oracle or
eth_feeHistorypercentiles.
See also
- eth_maxPriorityFeePerGas — EIP-1559 priority fee suggestion.
- eth_feeHistory — historical fee distribution for percentile-based pricing.