Gas price

This document describes the rules for the gas price calculation for the projects using Coreum.

Fee model

The Coreum chain uses the Coreum Fee Model for the min gas price calculation. If the sent transaction's gas price is lower than the min gas price the transaction will be rejected. The minimum gas price is a dynamic value and can be changed after each block.

How to calculate the min gas price for the next block

There are three ways how it can be done:

RecommendedGasPrice endpoint returns a quite accurate gas price prediction for future blocks. It will return low, med and high values to determine the possible range of gas price changes. You can use med value with a decent certainty that your transaction will go through, but to be almost 100% sure, you can use the high value.

Use optimized gas price calculation

For the optimized gas price calculation you can use the MinGasPrice Query to get the current min gas price. It is recalculated after each block, so it is recommended to use a multiplier.

Waiting timeMultiplier
1s1.1
30s1.3
60s1.5
> 60sinitial gas price

The table above shows the correlation of the waiting time - the time from the MinGasPrice Query until the transaction submission, and the recommended multiplier to use for the gas price in the result.

Min Gas Price Chart

In the picture, you can see how it's changing over time, and explains the values in the tables.

For example, you can use 1.1 as a multiplier if you send the tx right after querying MinGasPrice.

Use non-optimized initial gas price

The initial gas price is the gas price used in the Coreum Fee Model as initial. That value is a parameter, which is set initially in the genesis and can be updated by the governance. This value can be used as a gas price, for cases when the tools you use don't support additional queries. To get that value automatically you can use: Params Query and ModelParams.initial_gas_price in the result. Or you can get it manually on the explorer params page (Fee Model section) Using that value the transactions will pass with most of the cases, except the cases with high chain load, in that case the gas price might go above the initial gas price.

Also be aware that if you hardcode gas price instead of querying and the value is increased by governance voting, txs might start failing, so it is recommended to query it