Skip to main content
Simulation executes the transaction against the current chain state without broadcasting it. The chain returns how much gas the transaction would consume.

Using simulate Directly

simulate returns the gas used as a number. You can then add a buffer and compute the fee:

How "auto" Uses Simulation

When you pass "auto" or a number, the client calls simulate internally:
  1. The transaction is built with an empty signature and sent to the chain’s Simulate endpoint
  2. The chain executes it in a read-only context and returns gasUsed
  3. The client multiplies by the gas multiplier (default 1.4x, or the value you passed)
  4. calculateFee converts the gas limit to a StdFee using the configured gas price
The 1.4x default was chosen because Cosmos SDK 0.47+ sometimes uses significantly more gas than simulation predicts. Earlier versions used 1.3x.

Caveats

  • Simulation is an estimate. Actual gas can differ if chain state changes between simulation and execution.
  • The multiplier buffer protects against this, but extremely volatile state (e.g. many concurrent transactions) may still cause out-of-gas errors.
  • Simulation requires an RPC connection. Offline clients cannot simulate.