apply_execution_buffer

Documentation for eth_defi.gmx.execution_buffer.apply_execution_buffer function.

apply_execution_buffer(base_fee, execution_buffer, validate=True)

Apply the execution buffer multiplier to a base execution fee.

Multiplies the base fee by the given buffer to produce a fee that is high enough for GMX keepers to execute profitably. Any excess is refunded by the GMX contracts.

Example:

base_fee = gas_limits["total"] * gas_price
execution_fee = apply_execution_buffer(base_fee, execution_buffer=2.2)
Parameters
  • base_fee (int) – Raw execution fee in wei, typically gas_limit * gas_price.

  • execution_buffer (float) – Multiplier to apply. See DEFAULT_EXECUTION_BUFFER for the recommended default.

  • validate (bool) – If True (default), call validate_execution_buffer() before applying. Set to False to skip validation (e.g. when the buffer has already been validated earlier in the call chain).

Returns

The buffered execution fee in wei.

Return type

int