Skip to main content

Savings

GasHawk helps you save gas fees. But what does that actually mean?

Fee model

When a transaction following EIP-1559 is created, it includes a max_fee_per_gas field. This corresponds to the blocks base_fee_per_gas price. This base fee varies with demand and determines whether a transaction can be included in a block.

To ensure inclusion, Metamask suggests a max_fee_per_gas setting that is higher than the last observed block's base_fee_per_gas. You can observe the current base fees here.

Calculation of savings

After a transaction has been sent through GasHawk and mined, GasHawk provides an estimation of the savings achieved. These are derived as follows:

fee_saved = fee_reference - fee_paid

where:

  • fee_reference = (base_fee_reference + prio_fee) * gas_used
  • base_fee_reference: base_fee_per_gas of the first block that has been mined after the transaction had been handed to GasHawk
  • prio_fee: the miner tip, which GasHawk has no influence on
  • fee_paid = (base_fee_paid + prio_fee) * gas_used
  • base_fee_paid: base_fee_per_gas of the block that includes the transaction

With this in mind, let's define the relative savings as:

savings = fee_saved/fee_reference = 1 - fee_paid/fee_reference

The GasHawk Dasboard displays fee_reference as "Regular TX cost" and fee_paid as "GasHawk TX cost". Savings are shown as a percentage.

GasHawk performance

GasHawk saves on most transactions, but there are instances where it may lead to higher fees.

How Losses Occur

GasHawk uses a subsystem to predict future fees. If predictions are inaccurate and fees rise above the fee_reference, GasHawk may send the transaction at a less favorable time or once the deadline is reached.

Maximum loss

When preparing and signing the transaction, the wallet includes the max_fee_per_gas field, which informs the user of the highest fee that can be paid when the transaction is mined. GasHawk cannot exceed this fee (see screenshot below). If the max_fee_per_gas is set below the current base fee when GasHawk forwards the transaction to the mempool, the transaction will be delayed until the base fee equals or falls below the max_fee_per_gas. While the transaction could theoretically be dropped from the mempool, this has not been observed in practice.