In the world of Ethereum and blockchain development, understanding gas pricing is crucial—especially when executing transactions like minting or transferring NFTs. These actions require state changes on the blockchain and must be submitted as transactions, which in turn depend on accurate gas price estimation to ensure timely inclusion in a block. Recently, while developing NFT-related functionality, I noticed a subtle but important difference between the gas price suggested by Alchemy and the three-tier pricing model (slow, standard, fast) offered by wallets like MetaMask.
This discrepancy prompted a deep dive into how platforms like Alchemy determine their recommended gasPrice, ultimately tracing the logic back to core Ethereum client implementations—specifically Geth (Go-Ethereum).
Understanding Gas Price Sources
At first glance, MetaMask appears to offer more nuanced options, pulling from services like Eth Gas Station that provide multiple transaction speed tiers. In contrast, Alchemy’s API endpoint for gas pricing—such as eth_gasPrice—returns only a single value.
🔗 View Alchemy’s Transaction Tutorial
🔗 Polygon API: eth_gasPrice
But where does this single recommended value come from?
👉 Discover how leading blockchain platforms calculate optimal gas fees with real-time data tools.
From Alchemy to Web3.js
After searching through documentation and online resources, there was little direct explanation—except for a brief mention in EIP-1155. However, Alchemy’s web3 wrapper library is open source:
🔗 Alchemy Web3 GitHub Repository
Reviewing the code revealed no custom logic or modifications applied to gasPrice. Instead, it relies directly on the standard web3.eth.gasPrice method. According to the web3.js documentation, this value comes from a gas price oracle built into the Ethereum node software.
Since web3.js is also open source:
We can trace the call further: web3.eth.gasPrice makes a JSON-RPC request to the underlying Ethereum node using the eth_gasPrice method. This means the actual computation happens not in Alchemy’s layer, nor in web3.js, but in the Ethereum client itself—most commonly Geth.
Behind the Scenes: How Geth Calculates Suggested Gas Price
Alchemy’s documentation hints at differences in gas estimation behavior across clients. A key issue was raised in the Geth repository:
🔗 GitHub Issue #15825 – eth_gasPrice returns unexpectedly high values
The discussion confirms that eth_gasPrice is implemented natively within Geth, and not influenced by third-party analytics or market predictions.
Further investigation leads to the pull request that refined this logic:
🔗 PR #15828 – Improve gas price suggestion algorithm
By examining the current Geth source code:
🔗 api.go#L64 – eth_gasPrice handler
🔗 gasprice.go#L149 – Gas price oracle implementation
We uncover the core mechanism:
Geth calculates the recommended gas price by analyzing the last 20 blocks and selecting the transaction gas price at the 60th percentile.
This means it looks at all transactions included in recent blocks, sorts them by gas price, and picks a value high enough to outbid 60% of recent transactions—striking a balance between cost-efficiency and confirmation speed.
For developers, this explains why Alchemy's suggested price may differ from MetaMask’s “fast” or “average” estimates: it's based purely on on-chain transaction data analyzed by Geth, rather than off-chain analytics or user-defined speed tiers.
Additional context can be found here:
🔗 Stack Overflow: How do geth estimateGas and suggest gas price work?
Key Differences in Gas Pricing Models
| Source | Methodology | Output Type |
|---|---|---|
| MetaMask | Uses external APIs (e.g., Eth Gas Station), offers low/medium/high options | Multi-tier pricing |
| Alchemy | Relies on underlying node (usually Geth) via eth_gasPrice | Single suggested value |
| Geth (Core) | Analyzes last 20 blocks, takes 60th percentile of gas prices | On-chain statistical model |
This distinction is critical when building automated systems for NFT minting, token transfers, or smart contract interactions. Relying solely on eth_gasPrice might result in overpaying during volatile periods—or underpaying if network congestion spikes unexpectedly.
Frequently Asked Questions
Q: Does Alchemy calculate its own gas price recommendations?
No. Alchemy does not generate gas price suggestions independently. It forwards the eth_gasPrice RPC call to the connected Ethereum node (typically Geth), which computes the value using its internal gas price oracle.
Q: Why does Geth use the 60th percentile of recent transaction prices?
The 60th percentile balances speed and cost. Transactions priced at this level are likely to be included in one of the next few blocks without overbidding unnecessarily. It avoids both extreme frugality (which leads to delays) and excessive spending (which inflates costs).
Q: Is eth_gasPrice reliable for EIP-1559 transactions?
Not directly. The eth_gasPrice field returns a legacy gas price. For EIP-1559 transactions (type: 0x2), you should instead use:
maxFeePerGas: Total maximum you’re willing to pay per gas.maxPriorityFeePerGas: Tip to incentivize miners.
You can derive these using Alchemy’s enhanced APIs or by querying eth_feeHistory.
👉 Learn how modern blockchain tools adapt to EIP-1559 and dynamic fee markets.
Q: Can I customize Geth’s gas price calculation?
Yes. Geth allows configuration via command-line flags:
--miner.gastarget=8000000
--miner.gaslimit=8000000
--miner.gasprice=20000000000You can adjust the default minimum accepted gas price, though the 60th percentile suggestion algorithm remains unchanged unless modified in source.
Q: How often does the suggested gas price update?
The suggestion updates dynamically with each new block. Since Geth samples the last 20 blocks, the recommended price adjusts every block interval (~12 seconds on Ethereum), reflecting recent network activity.
Q: Should I trust eth_gasPrice in production?
Use it with caution. While useful for simple applications, production-grade dApps should consider:
- Real-time fee estimation using
eth_feeHistory - Support for EIP-1559
- Custom logic for different user priorities (fast vs. cheap)
Relying solely on eth_gasPrice may lead to suboptimal user experiences during congestion.
Core Keywords
- gas price
- Alchemy
- Geth
- Ethereum
- eth_gasPrice
- transaction fee
- blockchain development
- NFT minting
These keywords reflect both technical depth and search intent, aligning with queries from developers building decentralized applications.
👉 Access advanced blockchain analytics and fee prediction tools to optimize your transaction strategy.
Final Thoughts
Understanding where gas price recommendations originate—from application layer (MetaMask) to infrastructure layer (Geth)—is essential for effective blockchain development. While Alchemy provides powerful access to Ethereum nodes, it acts primarily as a conduit; the real intelligence lies within Geth’s statistical analysis of recent block data.
For developers working on NFT projects, DeFi protocols, or automated trading bots, relying solely on default suggestions may not suffice. Implementing adaptive fee logic using eth_feeHistory, supporting EIP-1559 natively, and monitoring real-time network conditions will lead to better performance, lower costs, and improved user satisfaction.
By peeling back the layers—from frontend wallet to backend node—we gain clarity not just on how gas prices are set, but why they vary across platforms. This knowledge empowers builders to make informed decisions in an increasingly complex ecosystem.