Updated on 2023-12-15 GMT+08:00

Optimizing Gas Fees

These APIs save your gas fees without affecting the transaction success rate and confirmation rate.

These APIs are supported only in the dedicated edition.

Procedure

You can send a group of raw transactions with different gas fees to the node and call APIs. These APIs will:

  1. Sort transactions in an ascending order based on their gas fees.
  2. Submit the transaction with the lowest gas fees.
  3. Check whether the transaction has been confirmed by the block.
  4. Submit another transaction with higher gas fees if the previous one is not confirmed in four seconds. This operation repeats until the submitted transaction is confirmed.

Precautions

  1. These APIs can save gas fees for EIP-1559 and typical transactions.
    • EIP-1559 transactions: the parameters of a group of raw transactions should be the same except maxPriorityFeePerGas.
    • Typical transactions: the parameters of a group of raw transactions should be the same except gasPrice.
  2. EIP-1559 and typical transactions cannot be in a same group.
  3. These APIs can be used by blockchains that support the eth_sendRawTransactionAPI API, including Ethereum, Arbitrum, Polygon, and BSC.