3

In Ethereum one can get the gas price using web3.eth.gasPrice.

In Tezos, does any RPC provide the gas price, or is there a formula to calculate the gas price?

2 Answers 2

4

In Tezos, gas does not have a monetary translation. It does not "cost" you anything to execute a contract with 10 gas vs 1M gas. Gas is simply an internal limitation to prevent contracts from running amok.

https://forum.tezosagora.org/t/psa-do-not-quote-gas-cost-in-tez/1618

0
3

After asking, there is no equivalent of a gas price in Tezos. You pay a transaction fee, and this fee should include everything. Doing some stats on the fees you may get an upper-bound on the gas price.

2
  • How do you actually find this price through either an API call to a block explorer or an RPC call to a Tezos node? Sep 4, 2020 at 7:49
  • tzstats provides an API that will give you statistics on created blocks. They provide for example an average gas price which is just total_paid_fees_in_the_block / total_used_gas_in_the_block. This means that this average gas price depends on what people proposed as fees what bakers accepted.
    – J.M. Kenny
    Sep 29, 2020 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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