Skip to content

Commit 36067fb

Browse files
authored
Merge pull request #1146 from multiversx/add-gas-estimation-docs-for-mxpy
add docs for estimating gas limit within mxpy
2 parents b047eb9 + aa8bb62 commit 36067fb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/sdk-and-tools/mxpy/mxpy-cli.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,26 @@ We can remove an address from the config using the alias of the address and the
305305
mxpy config-wallet remove --alias alice
306306
```
307307

308+
## Estimating the Gas Limit for transactions
309+
310+
mxpy (version 11.1.0 and later) can automatically estimate the required gas limit for transactions when a proxy URL is provided. The estimation works by simulating the transaction before sending it.
311+
312+
While the estimation is generally accurate, it's recommended to add a safety margin to account for potential state changes. This can be done in two ways:
313+
314+
1. Per transaction, using the `--gas-limit-multiplier` flag:
315+
316+
```sh
317+
mxpy tx new --gas-limit-multiplier 1.1 ...
318+
```
319+
320+
2. As a global default setting in the config:
321+
322+
```sh
323+
mxpy config set gas_limit_multiplier 1.1
324+
```
325+
326+
A multiplier of 1.1 (10% increase) is typically sufficient for most transactions.
327+
308328
[comment]: # (mx-context-auto)
309329

310330
## Creating wallets

0 commit comments

Comments
 (0)