March 6, 2024

How much will I pay for a transaction? - Introducing Gas Fee Calculator

Paying too much for Ethereum transactions? This article demystifies gas fees & Artiffine real-time Gas Fee Calculator shows you how much you will pay. A beginner's guide to gas fees on Ethereum and Polygon.

Vojtech Rychnovsky

Co-founder, CTO

Blockchains as decentralized networks come with a cost - each time you make a transaction, you have to pay a small fee to nodes in the network. This fee serves as an incentive for nodes to process your transaction. Sounds simple right? What if I tell you that the fee can swing up and down, based on the network usage? And the type of your transaction? And the blockchain you are interacting with? So one day you can send a few tokens for cents on Polygon, but the next day you can pay hundreds of dollars for a simple NFT mint on Ethereum. Why is that? Let’s dig into it and help you and your project save on gas fees.

Before we jump into it just bear in mind that this article is a beginner's guide into the problem and the gas fees are in technical detail a bit more complicated. Also, only the “EVM” network type, arguably the most popular blockchain type, is covered in this article. 

Introducing Gas Fee Calculator

Looking for quick answers? Do you just want to know how much a transaction costs at this moment? 
Check out this online Gas Fee Calculator - a real-time tool developed by Artiffine that compares gas fees and transaction costs between Polygon and Ethereum. 

Features:

  • Select one of the supported networks (so you can compare the cost of transition on Ethereum vs Polygon)
  • See the price of 1 unit of gas in real-time (see how this price is changing all the time)
  • See the price of deployment of a general NFT contract, you have to do this only when launching a new collection
  • See the price of an NFT airdrop
  • See how much you have to pay for minting (eg. buying) 1, 2, or 20 tokens at once
  • See how more gas-optimized standards, such as ERC-721A can mint tens of tokens at a fraction of the cost

Rules of gas fees

Let's uncover the factors that influence the final price of your transaction. 

Rule 1 - the more the network is used at a moment, the more expensive transactions are

Block space is limited. This means that a limited number of transactions can fit into one block, while the speed of production of new blocks is steady. To avoid congestion, the blockchain introduced a simple rule - the more the network is used, the more expensive it is to submit a transaction.

It makes so much sense if you take a look from a node operator perspective - if there are people waiting in a line to submit transactions through your node, but you can pick only some of them, who do you pick? Obviously, the ones that are willing to pay you the most. 

These spikes in prices usually happen when a large number of people want to submit a transaction at the same time - for example, when a mint of a super-hyped collection is happening, many people want to write on the chain at the same time and are willing to pay a lot for that.

The good news for you is that after a few hours, the prices usually go back to normal.

Gas fees on Ethereum in the last year

Rule 2 - The more data you submit on the chain, the more you pay

Generally, the more data you submit in a transaction, the more you have to pay. An example of a simple transaction can be a token transfer - it is a simple process, the balance of one user decreases, and the balance of the second user increases. On the other hand, you can imagine a complex transaction as a contract deployment (you literally submit an entire computer program on the chain), or minting of 20 NFTs at once. 

How can the price change based on the transaction type?

  • Minting of 1 NFT: $10 - $20
  • A contract deployment: $500+

Rule 3 - Unoptimized contracts are bad

If your smart contract is not written correctly, to do a particular task, it does more operations than it has to do. And the more operations you do, the more you have to pay. 

You can imagine it as two people solving the following problems, both returning the same result, but one of them doing unnecessary steps. You can guess who has to spend more energy to calculate the result: 

  • 1 + 1 = N
  • 12/2 - 2^2 = N

Yep, you're right, the first one is more simple! And the same principle applies also to the contracts on the chain, the problems are just a bit more complex. 

How to save on gas fees?

As a blockchain user: 

  1. If your transaction is not time-sensitive, just wait a few hours, the price might drop a lot. Check out tools like Artiffine Gas Calculator or Blocknative Gas Estimator to see how much your transaction costs in comparison to average prices. 
  2. For advanced users: explore topics such as transaction batching

As a crypto project owner:

  1. Launch your project on the right chain. Consider if you should use Polygon or Ethereum. For help, reach out to us or check out our Gas fees on Ethereum vs. Polygon article.
  2. Consider using L2 solutions 

As a web3 developer:

  1. Optimize your contracts. Make sure your developers know their job well and can write efficient code. This can make a big difference for both you and your users.

Gas Fee Glossary:

  • Gas used = Each transaction has a fixed amount of gas, it needs to be completed.
    It is the same as going with a car from point A to point B, you always use the same amount of gas.
  • Gas price = Cost of a unit of gas. Determined by the traffic load on the blockchain at the given moment of computation. Higher traffic = higher gas price. It is shown in “gwei” units. 
  • Gwei = Fraction of ETH. Usually, the cost of 1 unit of gas is usually between 10 to 150 gwei. 
  • Gas Fee Calculator = A tool showing in real-time how much gas you need to do specific tasks on the chain. Try it yourself: Artiffine Gas Calculator

Advanced topics:

  • EIP-1559 upgrade of Ethereum's gas fee calculation, introducing the concept of base fees and tips for miners.
  • Layer 2 scaling solutions (e.g., Optimistic Rollups, ZK-Rollups)
  • Transaction Batching eg. grouping transactions before broadcasting them to the network

We are here for your project

If you want a trusted partner and professional to help you optimize your gas usage and save thousands of dollars for both you and your customers, our engineering team can help. Get in touch, and we’ll be happy to help you along on your journey.

Vojtech Rychnovsky

Co-founder, CTO

March 6, 2024

Do not miss new articles. Follow us on:

Show all articles

Share your Web3 vision and get a quote

We’d love to hear about your idea. Book a free initial consultation to discuss your concept and strategy and to look into ways we can help you build.

Contact us

FREE consultations

Schedule FREE 30 minutes consultation of your Web3 project