0%
SupportWallet Services
How to Fix "Replacement Underpriced" Errors

How to Fix "Replacement Underpriced" Errors

Written by
Liang
Published on August 2, 20241 min read

Example error:
{"code":-32602,"message":"replacement underpriced","data":{"currentMaxPriorityFee":"0x10c8e0","currentMaxFee":"0x1ba52de"}}


Replacement underpriced
errors occur when you attempt to send another user operation (UO) from the same sender before the pending user operation has been confirmed on-chain (leave the mempool). With an existing UO in the mempool already, other UOs can become "stuck" in the mempool if their gas limits are too low to be included in a bundle. This happens because the chain interprets the new UO, which uses the same nonce, as an attempt to replace the pending one. Replacement UO require at least a 10% increase in fees to be accepted. Otherwise, to avoid this error, it's essential to implement wait and drop-and-replace functionality. You may also want to add multipliers on top of your gas and fees to land UOs quicker.

To drop and replace a UO, you must increase the maxPriorityFeePerGas and maxFeePerGas by at least 10%.

Using the SDK?

Use the dropAndReplaceUserOperation endpoint - this will handle fee increases.

Using APIs?

Check out our best practice guide for implementing User Operation Retries

This error commonly occurs when apps do not wait for UOs to land and attempt to send another before the previous UO has been mined.

To avoid this error, it's essential to implement wait and retry functionality. To reduce impact of this error with APIs, you may follow recommendations here as well.

Was this article helpful?
Share:
Banner background image

Not finding what you need?