Start typing to search this publication.
crypto.news
Open menu

Subscribe to crypto.news

Get new posts delivered straight to your inbox.

Gas Limit vs Gas Price: Fix Slow or Failed Swaps

crypto.news
2 min read

Gas limit caps the gas units an EVM transaction may use, while gas price is what you pay per unit; the transaction fee is gas actually used multiplied by the effective gas price.

Gas measures transaction work on an EVM network. A plain ETH transfer uses 21,000 gas; a token swap calls contracts and usually needs more. The gas limit is the work ceiling you authorize. Unused gas below it is not charged.

Gas price puts a cost on each unit. Wallets show it in gwei, a small denomination of ETH. Under EIP-1559, the effective gas price is the block’s base fee plus a priority fee, capped by your max fee per gas. The base fee is burned; the priority fee goes to the validator. Fee = gas used × (base fee + priority fee), subject to that cap.

A Low Limit Fails; a Low Price Waits

A low gas limit cuts off execution when the transaction needs more work than you allowed. The EVM stops the call and reverses its state changes. An out-of-gas failure consumes the entire limit, so you pay for every allowed unit at the effective gas price.

Take an illustrative token swap whose wallet estimates enough gas for several routing steps. You trim the limit because the displayed maximum fee looks steep. The swap reaches that limit before its last step: the tokens stay put, but the entire limit is charged. Raising the gas price would not rescue it; the shortage is gas units, not gwei per unit.

A low price has a different symptom. The transaction sits pending because its max fee is below the current base fee or its priority fee is too small for prompt inclusion. Increasing the gas limit does not make validators include it sooner. Review the max fee and priority fee when speed is the problem; keep the wallet’s estimated gas units when execution is the concern.

What is gwei?

Gwei is the ETH denomination used for gas prices: 1 gwei equals 0.000000001 ETH. Gas used multiplied by gwei per gas gives a fee in gwei; divide by one billion to read it in ETH. A higher gwei quote changes the cost of each used unit, while the limit controls how many units can be used.

How much gas does a token swap use?

A token swap’s gas use depends on the contracts and route it executes. More hops can mean more calls, so the wallet may estimate a higher limit than for a direct route. The estimate gives the transaction room to finish; you pay for gas actually spent.

That routing difference explains why a swap quote can change your wallet’s proposed limit. A Matcha swap can route a token exchange across liquidity sources, so a route with more hops may call for a higher limit. Treat it as execution headroom, then judge the likely fee from estimated gas use and price per unit.

For a pending transaction, adjust the price settings for inclusion; before a swap, preserve enough gas limit for its route to finish.

Subscribe to crypto.news