All Collections
Crypto Basics
Ethereum 101
What is gas, and why do I need native assets to pay for transaction fees?
What is gas, and why do I need native assets to pay for transaction fees?

Without these tokens, completing any transaction is impossible

Matt avatar
Written by Matt
Updated over a week ago

Topics covered:

What is gas?

Gas is the lifeblood of any Ethereum Virtual Machine (EVM) compatible blockchain network. It is a monetary fee that compensates miners/validators of a blockchain in exchange for their computational effort of mining blocks. Depending on the consensus mechanism, this computational effort can be realized to the miner/validator as an electricity cost (Proof of Work) or financial stake (Proof of Stake).

Like gasoline for a car, blockchain gas fees are what allow a blockchain (ledger) to move forward in time.

***Please note: 1inch Network does not receive any portion of gas fees. 100% of the fee goes to the miner/validator of the blockchain. Also, gas costs for classic mode swaps cannot be refunded.

Gas fees are always paid in the native token of the network that the transaction is taking place on. 1inch has integrated with 12 different networks, each of which have their own native token.

Arbitrum: ETH (Arbitrum version)

Aurora: ETH (Near version)

Base: ETH (Base version)

Klaytn: KLAY

Optimistic Ethereum: ETH (optimistic version)

Polygon: MATIC

ZK Sync Era: ETH (ZK Sync version)

How is Gas Priced?

Gas itself is not priced in Ether directly because Ether's value can be quite high. Instead, gas is priced in a much smaller denomination of Ether called "Gwei" (gigawei), with one Gwei equating to one billionth of an Ether. Gas prices fluctuate and are typically expressed in terms of Gwei per gas unit.

Calculating Transaction Costs

When initiating a transaction, a "gas price," is specified, which is the amount of Ether you are willing to pay per unit of gas. The total cost of the transaction in Ether is then calculated by multiplying the total amount of gas used by the gas price that is set.

For example, if the transaction consumes 100,000 gas and the gas price is 15 Gwei, the total cost in Gwei would be 1,500,000 Gwei. To find out how much this is in Ether, you would divide this number by 10^18 (since there are 1,000,000,000,000,000,000 Wei in an Ether).

Why can't I pay for gas with the tokens I'm swapping?

When swapping through 1inch Classic mode, all transactions require a gas fee. These operations carry significant costs (of both electricity, equipment, or capital) for the miners/stakers, who rely upon the gas fees to continue validating blocks. Since the miners/stakers are providing this service at a cost, they require payment in the native currency of the network that they are putting time, energy, and capital into supporting.

The size of this gas fee is proportional to the amount of computation required to execute an operation (not the amount of tokens swapped). The more complex the operation is, the more gas it requires to execute. Therefore, it is impossible to calculate the exact amount of gas needed before the transaction has been executed. Thankfully, 1inch provides an "Estimated Fee" to help you have an idea of how much gas you will need to pay for.

For example, as the Ethereum network and its market value grows in size, so do the gas fees required for transactions. At times, Ethereum fees can very high and significantly impact the profitability of trades/swaps. These high Ethereum gas costs have led to the evolution of newer, cheaper blockchains, such as BNB Chain, and Polygon.

***You can view current Ethereum gas prices here.

*** Need some gas for your transaction? Check out these instructions on how to top up your balance.

Why don't I have to pay gas fees (and wait for confirmations) when trading on a centralized exchange, like Binance or Coinbase?

Centralized exchanges use "off-chain" order books to facilitate trades, and therefore do not have to rely upon miners of a blockchain to validate transactions. It is essentially an "IOU" system where the user gives the exchange full custody of their funds. Instead of paying a gas fee to trade, the user instead pays a trading fee, which goes to the exchange's wallet as profit. Unfortunately the user then also has to pay a "Withdrawal fee" for moving any funds on the centralized exchange into their own possession.

What is the gas limit?

The gas limit refers to the maximum amount of gas (in gwei) that you are willing to pay for an individual transaction. Most Ethereum transfers require a gas amount of 21,000 gwei; however, swaps (and other interactions with smart contracts such as the 1inch liquidity or staking protocols) can consume significantly higher amounts.

For reference, the gas limit can be seen as: "the distance you are willing to drive a car vs. the distance to your destination".

If the gas amount needed is 21k, and your limit is 22k, the EVM will use what is needed and send the excess gas back to your wallet. However, if you set the gas limit at 20k, the EVM will attempt to complete the transaction, but ultimately fail at the point of reaching 20k.

Most wallets will set the gas limit automatically, so the user does not have to think about it; however, the 1inch iOS Wallet allows for full gas limit customization.

How gas fees changed with EIP 1559

Since Ethereum "London" Hardfork event (EIP 1559), the entire structure of gas fees on Ethereum has changed substantially. Now, gas fees are broken down into a base fee, and a priority fee (miner tip). The base fee only changes incrementally based off of network demand, and the priority fee is a crucial incentive for miners to remain profitable for including transactions into blocks. The base fee and the priority tip combined together create the "Max fee", as seen in the 1inch user interface and mobile wallets.

You can find more details on EIP1559 and how it works here.

To customize gas fees within the 1inch iOS Wallet, please see this guide.

Options for reducing swap gas costs

To reduce gas costs, there are several options:

  • Fusion mode: For these swaps, the resolver pays for 100% of the gas fees when taking your swap order.

  • Limit orders: For these types of swaps, the "taker" pays for 100% of the gas fees, allowing the "maker" to place and order and have it execute with zero outstanding cost.

  • Wait for the gas prices to decrease, typically during slower periods on the Ethereum Network.

Questions, comments, concerns? Feel free to reach out to us in the live support chat!

Did this answer your question?