Gas Prices

0 81
Avatar for NinjaWingnut
3 years ago
Topics: Crytocurrencies, Gas

In today’s post we are going to take a look at what gas prices are on a network such as Ethereum (ETH). Gas powers the transactions and is how you pay your transaction fees, so it is important to understand them beyond just a couple of numbers that somehow work out to a price, as you can employ strategies to help minimize your costs.

For the usual disclosure, I am not a financial advisor, I don’t even work in finance at all. My day job is as a telecommunications software engineer. Treat everything you read here as some educational resources and not financial advise.

What Is Gas

Gas is a unit of measurement for the amount of computational power that a transaction requires to perform actions on the blockchain. Every operation will cost a certain amount of gas, and every transaction can do multiple operations. For example, on Ethereum (ETH), adding two numbers together costs 3 gas, pulling the balance of an account costs 400 gas, and a simple transfer costs 21,000 gas.

Interacting with a smart contract for some kind of Decentralized Finance (DeFi) transaction, can have many operations involved, and can cost hundreds of thousands of gas in order to be processed.

The amount of gas that is needed for a transaction is multiplied by the gas price, which gives you the fee for the actual transaction. On the Ethereum (ETH) network, the gas price is set in GWEI, which is just the fractional unit of the Ethereum (ETH) crypto.

For example, let’s say the price of Ethereum (ETH) is $2,000. We are sending a simple transfer to another wallet, so the amount of gas we need is 21,000, and the gas price is currently set at 100 GWEI. We would multiple 21,000 by 100, which gives us 2,100,000 GWEI, or 0.0021 ETH, which gives us the final price of $4.20 for this simple transaction.

Gas Limit

Every transaction, as well as every block, has a maximum gas limit value set. For a block, that is currently at 12,500,000 gas, while the maximum gas for a transaction is set by the person submitting it. This is important to pay attention to, because this defines the maximum amount of gas that can be used in a transaction, and if the transaction runs out of gas partway through operation, it will roll back everything it did, the transaction will fail, but the gas price will still be charged.

The reason the gas is still charged, and indeed, the reason a gas limit exists at all, is to prevent code from being able to run forever and halt the entire blockchain. I’m sure you are familiar with the programming term infinite loop, where a bit of code will execute repeatedly forever, until stopped by an external force. If a smart contract were to have one of these, either by mistake, or because someone wanted to cause harm to the blockchain, the thing that prevents that is the gas limit. The code will only keep executing as long as there is sufficient gas, and once that runs out, it’s all done.

Why Does Gas Exist

The main reason that gas exists, and it is not just set in the base currency of the network, is to be able to separate the transaction costs, from the price of the currency. This means that as the price of say Ethereum (ETH) goes up, the transaction cost can remain the same, simply by having a lower gas price.

The gas price itself is generally controlled by the amount of activity going on the network. The more transactions trying to get added to blocks, the more people need to pay to be chosen by the miners to get added sooner, almost like you are in an auction bidding for the slots in the block. Likewise, in times of lower network activity, there is more room to throw lower gas valued transactions into the block, so you can get away with paying lower transaction costs.

Setting Gas Price

Most wallets, such as MetaMask, will let you set custom values for the gas price and gas limits, so it let’s you control how much you are willing to pay for a transaction. MetaMask will also give you the average you can expect to pay for a fast, medium, or slow transaction times, to save you having to do all the math each time you want to do a transaction.

Please keep in mind, that if you set the gas price too low, that your transaction may get stuck out in the pending bucket, and not get added to a block, as miners are always going to pick the most profitable transactions to add to each block. And of course, if you set the gas limit too low for the transaction, it will fail to complete, and still charge you the gas price, so make sure you have enough gas to cover whatever you are doing.

Lowering Gas Costs

With high transaction costs on the Ethereum (ETH), where a simple transaction can costs a few dollars, and a more complex Decentralized Finance (DeFi) transaction can cost up to even $100 per transaction, it’s important to look for ways to minimize the costs. For Ethereum (ETH) specifically, once version 2.0 goes live and bring sharding, this should help bring the costs down.

There are also other blockchains you can use, such as the Binance Smart Chain, or the Polygon network. These tend to have substantially lower gas prices, and can be a lot more appealing to use when you don’t want to take it on the transaction costs.

Conclusions

While gas prices, like their real world counterpart, can be a royal pain to have to pay, especially when they are high, they do serve a purpose. They incentivize the miners to keep the network running, and they help to safeguard them from attack. While I personally tend to stick to the lower cost networks myself, that may change in the future if we see the prices on Ethereum (ETH) get driven downwards.

Socials And Other Links

Find me on social media on TwitterFacebookInstagramTelegram and noise.cash.

If you enjoyed this content, you can check me out every weekday. My posts start at my website, but you can also find them cross posted at Publish0xLeoFinancialHive, and read.cash.

I also post a weekly price update video every Saturday over on my YouTube channel, where I will be discussing the weekly price action for some of the major cryptos. You can also sign up for my newsletter which I send out every Friday with news and whatnot from the crypto space, delivered right to your inbox!

You can also find links to resources such as research and news sites over at this link.

Want some more content right now? Check out some of my previous posts:

Bollinger Bands
Liquidity Pools
Impermanent Loss

A few referral links, in case you are interested in the service, and it also helps me out.

Binance – large centralized exchange – referral link saves you 10% on trading fees
Coinbase – basic crypto exchange – referral link gets you bonus crypto on first deposit
Cointiply – very good crypto faucet and earning site – no bonus for you on this referral unfortunately

Originally Posted On My Website: https://ninjawingnut.xyz/2021/07/01/gas-prices/

1
$ 0.23
$ 0.23 from @TheRandomRewarder
Avatar for NinjaWingnut
3 years ago
Topics: Crytocurrencies, Gas

Comments