exchange.IO("gasMultiplier", ...)
Sets the gas limit multiplier: a transaction's gasLimit is the node's gas estimate times this value.
exchange.IO(k)
exchange.IO(k, x)Examples
Set the gas limit multiplier.
javascript
function main() {
exchange.IO("gasMultiplier", 1.5)
Log("gas multiplier:", exchange.IO("gasMultiplier"))
}Returns
| Type | Description |
number | Returns the current multiplier. |
Arguments
| Name | Type | Required | Description |
k | string | Yes | Always |
x | number | No | The multiplier, from 1 to 5. The default is 1.2. A transaction's gasLimit is the node's gas estimate times this multiplier. If you leave this parameter out, the call returns the current multiplier. |
See Also
Uniswap / PancakeSwap Aerodrome / Velodrome KyberSwap 1inch exchange.IO exchange.IO("deadline") exchange.IO("simulate") exchange.IO("slippage")
Remarks
gasLimit is only a cap. The actual fee is charged on the gas the transaction uses, so a higher multiplier does not raise what you pay. However, the wallet balance must be enough to cover the fee at the full gasLimit.
Some LP transactions settle fees that an existing position has earned: increasing liquidity, decreasing liquidity, collecting fees and removing liquidity. On Aerodrome and Velodrome this also includes staking, unstaking and claiming rewards. For these transactions, gasLimit is the larger of "estimate × multiplier" and "estimate + buffer". The buffer is 50000 per position, plus 40000 for each fee (or reward) transfer. This is needed because a position may have no fees yet when gas is estimated, but earn fees before the transaction is confirmed on-chain, and then execution needs extra accounting and token transfers. For exchange.IO("bridge.send", ...), gasLimit is never lower than the gasLimit given in the LI.FI quote.