Bitcoin Forum
December 15, 2024, 05:47:40 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I don't understand how to calculate the gas fee for ETH, need help.  (Read 174 times)
Didz (OP)
Member
**
Offline Offline

Activity: 192
Merit: 11


View Profile
April 03, 2021, 07:03:34 PM
 #1

Hi Bitcointalk community,

I understand that 1 GWEI = 0.000000001 ETHER or we can say 1 GWEI = 1 X 10-9 ETHER

When I look at the Ethereum Gas Tracker: https://etherscan.io/gastracker#gassender
I see that in date of April 3, 3:01 pm Eastern Time, the average is 130 GWEI.
With the Ethereum price at USD$ 2,061.74 I do this calculation:

130 GWEI = 130 * 10-9 Ether = 0.00000013 ETHER
Then I do 0.00000013 ETHER x USD$ 2,061.74 = USD$ 0.000268

How come for 130 GWEI it is display $5.63 on https://etherscan.io/gastracker#gassender

I am asking because I sent some ETH from my AirGap Wallet to my exchange wallet and because I didn't selected enough gas fee my transaction is pending for more than 24 hours. Now, I try to understand how to set the good amount of gas fee to be sure my transaction get accepted.

Thank you for your times.

Viva Ethereum Blockchain Revolution...What About Helium Network?
hosseinimr93
Legendary
*
Offline Offline

Activity: 2618
Merit: 5743



View Profile
April 03, 2021, 07:24:49 PM
 #2

Ethereum transaction fee is calculated as follows.
Fee = gas price * used gas

The 130 Gwei you are referring to is the price of one unit of gas, not the total fee.

In a simple ethereum transaction (I mean a transaction in which no token is involved), 21,000 unit of gas is needed.
Assuming the gas price is 130 Gwei, you have to pay 130 * 10-9 * 21,000  = 0.00273 ETH.

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
bakasabo
Legendary
*
Offline Offline

Activity: 2534
Merit: 1220



View Profile
April 03, 2021, 07:30:45 PM
 #3

Ethereum Transaction fee is calculated as follows.
Fee = gas price * used gas

Could you please explain how to calculate the price for sending tokens? And why this price differs when sending same token, same amount via metamask and myetherwallet for example? (sending via metamask is a bit more expensive)

 
█▄
R


▀▀██████▄▄
████████████████
▀█████▀▀▀█████
████████▌███▐████
▄█████▄▄▄█████
████████████████
▄▄██████▀▀
LLBIT▀█ 
  TH#1 SOLANA CASINO  
████████████▄
▀▀██████▀▀███
██▄▄▀▀▄▄████
████████████
██████████
███▀████████
▄▄█████████
████████████
████████████
████████████
████████████
█████████████
████████████▀
████████████▄
▀▀▀▀▀▀▀██████
████████████
███████████
██▄█████████
████▄███████
████████████
█░▀▀████████
▀▀██████████
█████▄█████
████▀▄▀████
▄▄▄▄▄▄▄██████
████████████▀
........5,000+........
GAMES
 
......INSTANT......
WITHDRAWALS
..........HUGE..........
REWARDS
 
............VIP............
PROGRAM
 .
   PLAY NOW    
hosseinimr93
Legendary
*
Offline Offline

Activity: 2618
Merit: 5743



View Profile
April 03, 2021, 07:41:48 PM
 #4

Could you please explain how to calculate the price for sending tokens? And why this price differs when sending same token, same amount via metamask and myetherwallet for example? (sending via metamask is a bit more expensive)
You have to pay more fee for sending tokens because you have to spend more gas.
The used gas is something like transaction size in bitcoin transactions.
When you send tokens, your transaction includes some extra data and when it comes to transaction size, it's larger than a simple ethereum transaction.

The exact fee you have to pay depends on the token you send.
Since every token has its own contract, the size of data you broadcast to network differs from token to token.

The fee you pay for a transaction depends on gas price as well. The gas price depends on network state and changes over time. That's why you have to pay different amount of fee for a same token in different times.
Note that the gas price doesn't depend on the token you send.

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
roosbit
Member
**
Offline Offline

Activity: 893
Merit: 43

Random coins :)


View Profile
April 03, 2021, 07:58:58 PM
 #5

Hi Bitcointalk community,

I understand that 1 GWEI = 0.000000001 ETHER or we can say 1 GWEI = 1 X 10-9 ETHER

When I look at the Ethereum Gas Tracker: https://etherscan.io/gastracker#gassender
I see that in date of April 3, 3:01 pm Eastern Time, the average is 130 GWEI.
With the Ethereum price at USD$ 2,061.74 I do this calculation:

130 GWEI = 130 * 10-9 Ether = 0.00000013 ETHER
Then I do 0.00000013 ETHER x USD$ 2,061.74 = USD$ 0.000268

How come for 130 GWEI it is display $5.63 on
Calculations are very correct, just incomplete

If you multiply USD$ 0.000268 X 21000 units to fill up the tank this gives you  $5.63 has shown by the gastracker

If you like 21000 units of gas * 130gwei= 0.00273eth
In USD value 0.00273eth * USD$ 2,061.74 = $5.6285502
Round this off to the nearest 100th = ~$5.63


The total cost of a transaction =Gas Limit * Gas Price.

Typically, if someone just says “Gas”, they are talking about the “Gas Limit”.

Analogy:

You can think of the Gas Limit like the amount of liters/gallons/units of gas for a car. You can think of the Gas Price as the cost of that liter/gallon/unit of gas.
With a car, it’s $2.50 (price) per gallon (unit).
With Ethereum, it’s 20 GWEI (price) per gas (unit).
To fill up your “tank”, it takes…
10 gallons at $2.50 = $25
21000 units of gas at 20 GWEI = 0.00042 ETH.

Therefore, the total TX fee will be 0.00042 Ether.
Sending tokens will typically take ~50000 gas to ~100000 gas, so the total TX fee increases to 0.001 ETH - 0.002 ETH.

Source : https://arunrajeevan.medium.com/tokens-gas-and-gas-limit-in-ethereum-f07790f56d8f
zasad@
Legendary
*
Offline Offline

Activity: 1974
Merit: 4690



View Profile WWW
April 03, 2021, 09:09:15 PM
 #6

https://www.gasnow.org/
The best Ethereum statistics with calculations of transaction amounts for many well-known projects
If you send Ethereum coins, then nothing terrible will happen if you specify a small amount of commission. This can always be fixed.
Increasing fees and canceling transactions in the MyCrypto wallet
https://bitcointalk.org/index.php?topic=5315007
If you specify a small amount of commission when sending tokens, then there may not be enough gas to interact with the smart contract, the transaction will be canceled and you will lose part of the commission amount.

...AoBT...
▄▄█████████████████▄▄
███████████████████████
█████████████████████████
███████████████████████
██████████████████████
█████████████████████
███████████████████████
██████████████████████
█████████████████████
█████████████████████
█████████████████████████
███████████████████████
█████████████████
The Alliance
of Bitcointalk
Translators
▄▄▄███████▄▄▄
▄███████████████▄
▄███
████████████████▄
▄██
███████████████████▄
▄█
██████████████████████▄
████████████████████████
█████████████████████
████████████████████████
▀███████████████████████▀
▀███████████████████
▀███████████████████▀
███████████████▀
▀▀▀███████▀▀▀
.
..JOIN US..

▄███████████████████████▄
█████████████████████████
█████▀▀██████▀▀██▀▀▀▀████
████████▀██████████
████▄▄▄▄▀███████
███████▄▀▄█▀▀███████
█████████████████████████
█████████████████████████
████████████▀████████████
▀███████████████████████▀
█████

██████████
.
..HIRE US..
Didz (OP)
Member
**
Offline Offline

Activity: 192
Merit: 11


View Profile
April 03, 2021, 11:55:15 PM
 #7

Thank you so much hosseinimr93, zasad@ and roosbit for all the information, this is why I like so much Bitcointalk, so many people ready to help newbies like me.

Actually zasad@, I received some ETH in my AirGap Wallet and then I tried to send it to my exchange wallet. The problem is when I set up the transaction I selected slow & cheap for the Fee (ETH) without knowing that I had to check the congestion status of the network before to be sure that the gas fee would be enough.

Now it's been more than 24 hours and my transaction is still pending.
I have been searching online to know how to solve that and apparently I can cancel the pending transaction by sending to myself 0 ETH with the same nonce used on the pending transaction.
The problem I have is that I am not able to find a way to add a nonce on the transaction on AirGap Wallet.

Apparently, some wallets' interfaces provide an advanced setting where I can change the transaction nonce. I sent an email and message on GitHub to AirGap wallet, no answer yet. I think I will try a different software wallet.

Viva Ethereum Blockchain Revolution...What About Helium Network?
Didz (OP)
Member
**
Offline Offline

Activity: 192
Merit: 11


View Profile
April 04, 2021, 04:55:05 PM
 #8

I have received an answer from AirGap which I copy-pasted here for those who encountered the same issue I had:

"AirGap always selects the last nonce that has been included in a block + 1. So if you now create a new transaction while your old one is still pending, it should have the same nonce as the one you sent previously. To confirm this, you can create your new 0 ETH transaction and give it to the Vault for signing. On the signing screen, you can toggle the "extra details" button, which will show you the nonce. (The nonce in that screen is in hex format. You can convert it to decimal by entering the part after "0x" here: https://www.binaryhexconverter.com/hex-to-decimal-converter)"

Viva Ethereum Blockchain Revolution...What About Helium Network?
fia_naila
Sr. Member
****
Offline Offline

Activity: 770
Merit: 258


The Standart Protocol - Solving Inflation


View Profile
April 05, 2021, 02:07:03 PM
 #9

Its not so hard and you dont need yo calculate it. Just googling eth gas tracker and they will gives you live updated ethereum gas tracker, information you hot such as : gas for sending ethereum, gas for token transfer, gas for trading on uniswap,etc...

Decentralized
Asset-Backed Banking

  ▄▄██████████████████
 █████████████████████
█████▀▀
████▀    ████
████     ████
████     ████
         ████     ████
         ████    ▄████
               ▄▄█████
█████████████████████
██████████████████▀▀ 
TheStandard.io█▀▀▀











█▄▄▄
▀▀▀█











▄▄▄█
████████████████████████████
████████████████████████████
████████████████████████████
█████████████████▀▀  ███████
█████████████▀▀      ███████
█████████▀▀   ▄▄     ███████
█████▀▀    ▄█▀▀     ████████
█████████ █▀        ████████
█████████ █ ▄███▄   ████████
██████████████████▄▄████████
████████████████████████████
████████████████████████████
████████████████████████████
Didz (OP)
Member
**
Offline Offline

Activity: 192
Merit: 11


View Profile
April 06, 2021, 04:43:31 PM
 #10

Why your interested to know the calculation the gas fee for ETH?
I've been here for a couple of years and yet, it never come into my mind to know this thing,
because I know it is part of the transaction fee and every we made a transactions. So, its not a big deal for me
about this matter anyway.

martina14 it's because knowing the gas fee by monitoring the Ethereum Gas Tracker allows you to select the gas price you want to pay for the estimated transaction duration. First time I sent some ETH from my AirGap wallet to Newton, I selected so low Gas Fee that my transaction was pending for more than 48 hours.

So it's all about the time you are ready to wait before the transaction get through. Faster is more expensive and slower is cheaper. If you have business with expenses to cover it's important to know.

Viva Ethereum Blockchain Revolution...What About Helium Network?
Didz (OP)
Member
**
Offline Offline

Activity: 192
Merit: 11


View Profile
April 06, 2021, 05:00:18 PM
 #11

Its not so hard and you dont need yo calculate it. Just googling eth gas tracker and they will gives you live updated ethereum gas tracker, information you hot such as : gas for sending ethereum, gas for token transfer, gas for trading on uniswap,etc...

If I am not wrong, the gas fee you find is in GWEI so you have to convert it into ETHER. On AirGap wallet you can enter manually the gas fee you want to add to the transaction and it's in ETHER.

Viva Ethereum Blockchain Revolution...What About Helium Network?
Fivestar4everMVP
Legendary
*
Offline Offline

Activity: 2478
Merit: 1090


Leading Crypto Sports Betting & Casino Platform


View Profile
April 06, 2021, 06:19:21 PM
 #12

Lol, I didn't even know that there was a way to calculate this, those who say we learn everyday aren't wrong cus I've learnt this one today, personally, I wouldn't even bother knowing how to calculate this cus the wallet I use already does the calculations automatically, but I guess it's still good to know incase a time comes when you feel the wallet aren't doing the right calculations, one can easily recalculate to avoid paying access gas fees for a transaction a smaller amount would have passed.
Thumbs up for the poster for posting an interesting topic.

..Stake.com..   ▄████████████████████████████████████▄
   ██ ▄▄▄▄▄▄▄▄▄▄            ▄▄▄▄▄▄▄▄▄▄ ██  ▄████▄
   ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██  ██████
   ██ ██████████ ██      ██ ██████████ ██   ▀██▀
   ██ ██      ██ ██████  ██ ██      ██ ██    ██
   ██ ██████  ██ █████  ███ ██████  ██ ████▄ ██
   ██ █████  ███ ████  ████ █████  ███ ████████
   ██ ████  ████ ██████████ ████  ████ ████▀
   ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██
   ██            ▀▀▀▀▀▀▀▀▀▀            ██ 
   ▀█████████▀ ▄████████████▄ ▀█████████▀
  ▄▄▄▄▄▄▄▄▄▄▄▄███  ██  ██  ███▄▄▄▄▄▄▄▄▄▄▄▄
 ██████████████████████████████████████████
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█  ▄▀▄             █▀▀█▀▄▄
█  █▀█             █  ▐  ▐▌
█       ▄██▄       █  ▌  █
█     ▄██████▄     █  ▌ ▐▌
█    ██████████    █ ▐  █
█   ▐██████████▌   █ ▐ ▐▌
█    ▀▀██████▀▀    █ ▌ █
█     ▄▄▄██▄▄▄     █ ▌▐▌
█                  █▐ █
█                  █▐▐▌
█                  █▐█
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█
▄▄█████████▄▄
▄██▀▀▀▀█████▀▀▀▀██▄
▄█▀       ▐█▌       ▀█▄
██         ▐█▌         ██
████▄     ▄█████▄     ▄████
████████▄███████████▄████████
███▀    █████████████    ▀███
██       ███████████       ██
▀█▄       █████████       ▄█▀
▀█▄    ▄██▀▀▀▀▀▀▀██▄  ▄▄▄█▀
▀███████         ███████▀
▀█████▄       ▄█████▀
▀▀▀███▄▄▄███▀▀▀
..PLAY NOW..
Didz (OP)
Member
**
Offline Offline

Activity: 192
Merit: 11


View Profile
April 06, 2021, 06:31:43 PM
 #13

Lol, I didn't even know that there was a way to calculate this, those who say we learn everyday aren't wrong cus I've learnt this one today, personally, I wouldn't even bother knowing how to calculate this cus the wallet I use already does the calculations automatically, but I guess it's still good to know incase a time comes when you feel the wallet aren't doing the right calculations, one can easily recalculate to avoid paying access gas fees for a transaction a smaller amount would have passed.
Thumbs up for the poster for posting an interesting topic.

Also if you do a lot of ETH transactions in a year and you are ready to wait long durations for the transactions to be included in the block (cheaper gas fee), you can save hundreds of dollars in gas fee in one year.

Viva Ethereum Blockchain Revolution...What About Helium Network?
Review Master
Sr. Member
****
Offline Offline

Activity: 1456
Merit: 280


BitByte Crypto: https://link3.to/bitbytecrypto


View Profile WWW
April 06, 2021, 07:10:17 PM
 #14

Its not so hard and you dont need yo calculate it. Just googling eth gas tracker and they will gives you live updated ethereum gas tracker, information you hot such as : gas for sending ethereum, gas for token transfer, gas for trading on uniswap,etc...

Actually we don't even need to search that type of things as etherscan team already added that section into the Gas Tracker section. Just visit Gas Tracker where we'll get a table of erc20 transfer or uniswap swap or  add/remove LP on uniswap with 3 categories like slow, average and high fee types. BTW, IDO hype is on another level and anytime gas fee is skyrocketing whenever any new projects are going to have their ido.

▄▄ BITBYTE CRYPTO ▄▄
Be A Crypto Veteran Together
▄▄▄▄▄▄▄   TWITTER | TG GROUP | TG CHANNEL | YOUTUBE  ▄▄▄▄▄▄▄ 
semobo
Full Member
***
Offline Offline

Activity: 1498
Merit: 146


View Profile
April 06, 2021, 07:28:01 PM
 #15

I have received an answer from AirGap which I copy-pasted here for those who encountered the same issue I had:

"AirGap always selects the last nonce that has been included in a block + 1. So if you now create a new transaction while your old one is still pending, it should have the same nonce as the one you sent previously. To confirm this, you can create your new 0 ETH transaction and give it to the Vault for signing. On the signing screen, you can toggle the "extra details" button, which will show you the nonce. (The nonce in that screen is in hex format. You can convert it to decimal by entering the part after "0x" here: https://www.binaryhexconverter.com/hex-to-decimal-converter)"

Yes, if your transaction stuck due to the low gas fee used then you can replace the same transaction with much higher gas fee to replace the old one, so using the same nonce with 0ETH will do this for you.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!