SKIP TO CONTENT
Blockchain

Gas Limit

The maximum amount of gas units a user is willing to spend on a transaction.

What is Gas Limit?

Gas limit represents the maximum number of gas units you authorize a transaction to consume. It serves as a safety mechanism preventing runaway transactions from draining your wallet and ensures you maintain control over maximum transaction costs. If a transaction requires more gas than the limit allows, it fails and reverts. Though you still pay for the gas consumed up to that point. Setting appropriate gas limits is essential for successful transaction execution.

Transaction Gas Limits

When sending a transaction, you specify a gas limit based on the expected computational requirements. Simple ETH transfers require exactly 21,000 gas, while complex DeFi interactions might need 200,000 to 500,000 gas or more. Multi-hop swaps, liquidations, and vault strategies can require even higher limits. Setting the limit too low causes transaction failure; setting it too high has no additional cost since unused gas is refunded.

Wallet applications typically estimate appropriate gas limits by simulating transactions before submission. However, estimates can be inaccurate for transactions with dynamic behavior, such as those depending on current blockchain state or involving multiple conditional paths. Experienced users sometimes add a buffer (10-20%) above estimates to ensure completion, especially for time-sensitive operations where failure would be costly.

Block Gas Limits

Beyond individual transactions, each Ethereum block has a total gas limit constraining how many transactions it can include. This block gas limit currently stands around 30 million gas, meaning a block can contain roughly 1,400 simple transfers or fewer complex transactions. Validators can vote to adjust this limit gradually over time based on network capacity and decentralization considerations.

Block gas limits create a natural market for block space. During high-demand periods, transactions compete for limited block capacity, driving up gas prices as users bid for inclusion. Understanding this relationship helps users time transactions for cost efficiency and explains why gas prices spike during popular NFT mints or market volatility.

Layer 2 Considerations

Layer 2 solutions use gas limits differently. While L2 transactions have their own gas limits, the underlying costs are substantially lower because L2s batch transactions and post compressed data to Ethereum mainnet. L2 gas limits often allow higher computation per transaction since the L2 itself has more capacity than Ethereum mainnet.

Examples

  • A simple ETH transfer requires a gas limit of 21,000, while a complex DeFi swap might need 300,000

Theory meets practice. See current rates across DeFi.

Track live yields, compare protocols, and build your DeFi portfolio with Fensory.

GET EARLY ACCESSArrow right