Skip to main content
← DeFi glossary

Glossary · G

Gas Limit

The maximum amount of gas units you are willing to consume for a transaction. Gas units measure computational work — complex operations (like a multi-hop DEX trade) use more gas than simple transfers. If your gas limit is set too low and the transaction runs out of gas mid-execution, it fails (reverts) and you lose the gas spent up to that point. Wallets estimate gas limits automatically, but you can adjust them manually.

Last updated

How Gas Limit works in practice

The gas limit is the maximum computation you authorise a transaction to consume. Setting it too low causes the transaction to run out of gas and revert; setting it high is safe, because unused gas is refunded.

Worked example

A wallet estimates 180,000 gas for a swap and sets a limit slightly above it. If the transaction actually needs 200,000, it reverts out of gas — and the gas consumed up to that point is still charged.

Figures are illustrative and chosen to be checkable, not live market data.

The mistake that costs people money

Lowering the limit to save money does not work. You are only charged for gas used, so a low limit risks a failed transaction that costs money and achieves nothing.

Gas Limit: common questions

What is Gas Limit?
The maximum amount of gas units you are willing to consume for a transaction. Gas units measure computational work — complex operations (like a multi-hop DEX trade) use more gas than simple transfers. If your gas limit is set too low and the transaction runs out of gas mid-execution, it fails (reverts) and you lose the gas spent up to that point. Wallets estimate gas limits automatically, but you can adjust them manually.
How does Gas Limit work in practice?
The gas limit is the maximum computation you authorise a transaction to consume. Setting it too low causes the transaction to run out of gas and revert; setting it high is safe, because unused gas is refunded.
Can you give an example of Gas Limit?
A wallet estimates 180,000 gas for a swap and sets a limit slightly above it. If the transaction actually needs 200,000, it reverts out of gas — and the gas consumed up to that point is still charged.
What do people get wrong about Gas Limit?
Lowering the limit to save money does not work. You are only charged for gas used, so a low limit risks a failed transaction that costs money and achieves nothing.

Related terms (G)