0

This is a simple call to https://ethgasstation.info/json/ethgasAPI.json

{
  "fast": 111,
  "fastest": 180,
  "safeLow": 55,
  "average": 80,
  "block_time": 14.761904761904763,
  "blockNum": 9819011,
  "speed": 0.9302273514361274,
  "safeLowWait": 18,
  "avgWait": 2.8,
  "fastWait": 0.5,
  "fastestWait": 0.5,
  "gasPriceRange": {
    "4": 246,
    "6": 246,
    "8": 246,
    "10": 246,
    "20": 246,
    "30": 246,
    "40": 246,
    "50": 21.4,
    "55": 18,
    "60": 10,
    "70": 7.7,
    "80": 2.8,
    "90": 1.8,
    "100": 0.8,
    "110": 0.6,
    "111": 0.5,
    "120": 0.5,
    "130": 0.5,
    "140": 0.5,
    "150": 0.5,
    "160": 0.5,
    "170": 0.5,
    "180": 0.5
  }
}

From the guide I read

fast: Recommended fast(expected to be mined in < 2 minutes) gas price in x10 Gwei(divite by 10 to convert it to gwei)

This is the param I need, fast.

So in this call, fast is 111, so 11.1gwei.

This is a gas price, right?

My call consume 68988 unit of gas. It's a fixed length hash, so it's every time identical, I hope.

So totale gas paid is 11.1 * 68988 = 765766.8 giga wei.

Is this calculation right?

How can I determine the money cost of this transaction?

  • Do you pass any funds in your transaction (i.e., value > 0)? – goodvibration Apr 7 at 11:03
  • No, I simply pass a string, and it is fixed length – realtebo Apr 7 at 13:00
  • Adjusted the question title as ETH is real money. – Mikko Ohtamaa Jun 30 at 7:17
  • @MikkoOhtamaa:; you adjustment is WRONG. I am doing a money -> money conversion.... – realtebo Jul 1 at 12:14
  • 1
    Just joking :) You made it sound like ETH is not money. – Mikko Ohtamaa Jul 1 at 20:11
2

Your calculations are correct.

  • gasUsed = 68988
  • gasPrice = 11.1 gwei
  • totalCost = gasUsed x gasPrice = 765,766.8 gwei

Considering that 1 ether is 1,000,000,000 gwei and as of 2020-04-12 22:40 UTC 1 ether = 162 USD, then we have

  • 1,000,000,000 gwei are valued 162 USD
  • 765,766.8 gwei are valued 162 USD * 765,766.8 gwei / (1,000,000,000 gwei) = 0.1240542216 USD.
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.