estimate_gas_fees
Documentation for eth_defi.gas.estimate_gas_fees function.
- estimate_gas_fees(web3, method=None, gas_price_buffer_multiplier=1.12, min_priority_fee=None)
Get a good gas price for a transaction.
Applies a safety buffer to
maxFeePerGasto absorb base fee fluctuations between estimation and transaction submission. SeeGAS_PRICE_BUFFER_MULTIPLIERfor details.On EIP-1559 chains, the RPC suggested priority fee is floored to a per-chain minimum so transactions do not get stuck in the mempool with an effectively zero tip. See
MIN_PRIORITY_FEE_PER_CHAINfor details.- Parameters
web3 (web3.main.Web3) – Web3 instance connected to a node.
method – Force a specific gas pricing method. If
None, auto-detect based on whether the chain supports EIP-1559.gas_price_buffer_multiplier (float) – Multiplier applied to
maxFeePerGasto absorb base fee fluctuations. Defaults toGAS_PRICE_BUFFER_MULTIPLIER(1.12 = 12% buffer). Set to1.0to disable the buffer.min_priority_fee (Optional[int]) –
Minimum
maxPriorityFeePerGasin wei for EIP-1559 chains.The RPC suggested priority fee is raised to at least this value. If
None, the per-chain default fromMIN_PRIORITY_FEE_PER_CHAINis used, with no floor applied for chains not listed there. Set to0to always use the raw RPC suggestion.
- Return type