eth_sendUserOperation

Sends a user operation to the given EVM network.

Network Support

ChainMainnetTestnet
Ethereum:white-check-mark::white-check-mark:
Polygon:white-check-mark::white-check-mark:
Arbitrum:white-check-mark::white-check-mark:
Optimism:white-check-mark::white-check-mark:
Base:white-check-mark::white-check-mark:

Replacement Underpriced Error

You might get a "Replacement Underpriced Error" when using eth_sendUserOperation. This error occurs when a user already has an existing operation in the mempool. User operations can become "stuck" in the mempool if their gas fee limits are too low to be included in a bundle.

To resolve this, the user must increase both maxFeePerGas and maxPriorityFeePerGas by at least 10%.

📘

maxFeePerGas vs. maxPriorityFeePerGas

The maxFeePerGas is the sum of the baseFeePerGas and maxPriorityFeePerGas. Learn the differences between maxFeePerGas vs. maxPriorityFeePerGas in our comparative article.

How to Resolve a Replacement Underpriced Error

  1. Re-estimate gas fees: Re-estimate the gas fees required for your operation. This can be done in various ways which are mentioned below:

    1. eth_maxPriorityFeePerGas: maxPriorityFeePerGas can be obtained using this method.
    2. getFeeData: This method on Alchemy SDK returns both the current maxPriorityFeePerGas and maxFeePerGas. This method is also available on web3 libraries like ethers.js and can be accessed through the provider as provider.getFeeData().
  2. Choose the suitable increase values: Once you have the re-estimated gas fees, choose the maximum of a 10% increase or the re-estimated values. This ensures that your new gas fee is competitively priced to be included in a block.

  3. Account for Rundler's service tip: Rundler requires a small tip for its services via maxPriorityFeePerGas. Detailed information about this can be found on the Bundler API Fee Logic page but in summary:

    • On Ethereum, Polygon, and Optimism mainnets, the tip should be at least 25% higher than the estimated priority fee on the network.

    • On Arbitrum / Optimism mainnet, the tip is set to a minimum 5% of the estimated network base fee when the bundle is mined.

    • No tip is required on testnets.

Now, send your userOperation again using the calculated values and it should go through successfully.

Language
URL
Click Try It! to start a request and see the response here!
ReadMe