Ethereum Gas Fees for Dummies | Hacker Noon

image

Crypto Badger Hacker Noon profile picture

@cryptobadgerCrypto Badger

Not an actual badger 😉 Dedicated to helping people learn about the world of crypto.

In this article, I will cover Ethereum gas fees in detail. For those of you who are new to crypto, I’ve also included a practical example of how to adjust gas fees in MetaMask.

What is Gas?

(Ethereum) Gas is the fee paid for executing transactions on the Ethereum blockchain. Want to move ETH between different addresses? That transaction requires gas. Want to mint some NFTs? That requires gas too. What about exchanging ETH for different tokens? You guessed it, more gas!

Anything involving ERC-20 tokens (Ethereum-based tokens) requires spending small amounts of ETH for gas. In other words, even if you don’t want to hold any ETH, for example, because you only want to trade smaller-cap altcoins, you still need to have ETH in your wallet at all times to cover future gas fees. Forgetting about it can cost you a lot of money! I remember when I was selling my UMX tokens (the price had gone up nicely), I went to my wallet only to find that I didn’t have any ETH to ‘fuel’ the transaction. By the time I got some ETH, the price of UMX already dipped quite noticeably. It wasn’t a huge amount but enough to cost me a few hundred dollars.

Why is There a Gas Fee?

Each transaction on the Ethereum blockchain requires a certain amount of computational power and gas is the fee paid to miners for providing that computational power.

Gas fees also help keep the Ethereum network secure. Attaching cost to every transaction prevents spamming or accidental infinity loops.

How is Gas Calculated?

Below is the old method of calculating gas fees. Since the London hard fork and implementation of EIP-1559 in early August 2021, there is a new method, which I will describe later, but apparently only 1% of all transactions on the Ethereum network currently use it.

The price of gas is denoted in gwei (giga wei). Wei is the smallest fraction of an ether, i.e. 1 ether equals 1,000,000,000,000,000,000 wei, so 1 gwei is 1,000,000,000 (1 billion) wei or 0.000000001 ETH. This doesn’t sound too bad right? So why are people complaining about the cost of gas fees?

There are two elements that impact the cost of any given transaction:

  • gas price at the time of transaction, and
  • gas required for a particular transaction.

Etherum gas prices change constantly and there are a number of websites where you can check the current price. CoinGecko is one of them, but the price isn’t always accurate, so I prefer to use ETH Gas Station or Gas Now (my favourite), which you can also install as a browser extension.

At various points in time, I’ve seen gas prices as low as 6 gwei and as high as 2,000 gwei. Why can they change so much? It simply depends on how busy the Ethereum network is at a particular moment in time. The busier the network, the higher the prices.

When checking the price of gas, you’ll often see 3 or 4 different prices based on transaction speed: rapid, fast, standard, and slow (or other similar names). Unsurprisingly, the faster the transaction, the more you will pay and the price difference can be quite substantial. Generally speaking, when buying or selling tokens you want to use the fastest option, especially when their price is moving quickly. On the other hand, if you’re only moving tokens between wallets, or buying tokens when the market is quiet, you can go for standard or slow speed as it doesn’t really matter if the transaction takes a bit longer to go through.

The second factor is the amount of gas required for any given transaction. The minimum amount needed for the simplest transaction on the Ethereum network, for example moving ETH between two addresses, is 21,000 units. More complex transactions involving smart contracts such as buying other tokens or staking your tokens require a lot more gas.

It’s also worth mentioning that some transactions require multiple steps and each of those steps will require a certain amount of gas. For example: exchanging Tether (USDT) for Chainlink (LINK), actually requires two transactions: USDT > ETH and ETH > LINK. If you want to process a transaction like this on (say) Uniswap, you will only see an estimated gas fee for the first ‘step’ (USDT to ETH in this example), so don’t be surprised by the added cost of the second ‘step’.

Gas Limit

Gas limit is the maximum amount of gas you are willing to use on any given transaction. If the actual amount of gas used turns out to be lower than the limit you specified, the remaining gas will be returned to you. But if your limit is too low, you either won’t be able to process the transaction or the transaction will fail and you will lose that gas. This is especially dangerous when you’re trying to purchase a token at the time the network is busy and the price is changing rapidly (e.g. when the price is pumping immediately after an influencer posted a video about the token you’re trying to buy).

Examples

The explanation above may be a bit confusing so let’s look at how this works through an example of a simple transaction of moving ETH between two addresses.

  • We know that this transaction requires 21,000 units.
  • The gas fee for standard speed at the moment of writing is 40 gwei.
  • Gas units (limit) * Gas price per unit (in gwei) = Gas fee
  • 21,000 * 40 = 840,000 gwei
  • 840,000 gwei is 0.00084 ETH, which is at the current prices 2.67 USD (1 ETH = $3179).

That’s not bad, right? So why are people freaking out about gas prices? Well, let’s have a look at the same simple transaction but this time let’s imagine we’re trying to do it when the network is completely congested. There was a large flash crash on 19th May 2021 and I remember gas prices hovering around 1,500-2,000 gwei. So….

21,000 * 2,000 = 42,000,000 gwei

That’s 0.042 ETH, which at this moment in time is 133.5 USD… all that just to move your ETH, we’re not doing anything fancy here.

Now imagine a more complex transaction, which requires say 100,000 units of gas… suddenly we’re looking at around around 500 USD. This is a fair chunk of money to burn in fees.

Do the London Hard Fork and EIP-1559 Solve the High Gas Fees Issue?

Well, not really. I will not go into the details of the EIP-1559 update in this article (I recommend watching this video or visiting the Ethereum website) but here are a few things to be aware of.

In the old system, gas fees are essentially using a blind auction model – if you want to make sure your transaction goes through quickly when the network is busy, you have to pay much more than you would during the quiet time, because you simply don’t know how much gas other people are paying.

The new model is more complex but it aims to be more transparent and fair.

The first element of the new model is the base fee, which can go up or down depending on how busy the network is at a particular point in time. This base fee is always burned, which can make ETH a deflationary asset as time passes on. Although ETH has infinite supply, when the network is busy, more tokens are burned than mined and therefore the amount of ETH in circulation can decrease. You can check out this website or this one to see how much ETH is being burned.

The second part of the fee is a tip that goes to the miner. It can be adjusted if the sender wants to process the transaction faster, so in a way, it works similar to the sender choosing the transaction speed in the old system.

EIP-1559 also allows doubling the block size when the network is getting congested to make fees more predictable.

The most important takeaway is this: the new gas fee system is NOT designed to lower gas fees but to make them more transparent and predictable.

The gas prices will be less volatile and there should be less sudden spikes than before, but they will not necessarily be lower. For gas fees to go down, we will have to wait for Ethereum 2.0 or Layer 2 scaling solutions (e.g. Polygon).

Practical example using a MetaMask wallet

In this example, I’m swapping some ETH for SuperFarm token SUPER. Although I’m using a MetaMask wallet, the same principle will apply for other wallets.

Now I can see the quote, which shows the Estimated Network Fee ($27.35) and Max Network Fee ($30.08). I then click Edit (in blue text next to the Max Network Fee).

image

This takes me to a new window with Average and Fast transaction options. I can select one of these options or go to the Advanced tab at the top.

image

In the Advanced tab, I can see Gas Price in GWEI and Gas Limit. The latter is auto-populated based on the type of transaction. To check the exact current gas prices I can go to a website such as Gas Now and adjust my gas price accordingly. I then click Save and process the transaction.

image
image

I hope you found this article useful. If you’re interested in crypto tutorials and more crypto market commentaries, please check out my YouTube channel and follow me on Twitter.

Disclaimer

The content covered in this article is NOT to be considered investment advice.

I’m NOT a financial adviser. These are only my own speculative opinions, ideas, and theories.

Do NOT trade or invest based purely upon the information presented in this article.

Always do your own research and due diligence before investing or trading. I’ll never tell you what to do with your capital, trades or investments. I’ll also never recommend for you to buy, sell, long or short any asset, commodity, security, derivative or cryptocurrency related instrument as it’s extremely HIGH RISK!

You should always consult with a professional/licensed financial adviser before trading or investing in any cryptocurrency related product.

Also Featured In

Loading…

Tags

Join Hacker Noon