How Do You Fix a Replacement Transaction Underpriced Error on RPC?
The "replacement transaction underpriced" error means the node you submitted a replacement transaction to rejected it because the new transaction’s gas price (or effective tip) was not high enough to replace the original pending one. You fix it by sending a replacement that pays a higher fee - specifically, the new transaction must have a gas price at least 10% higher than the original, and a nonce that matches the stuck transaction’s nonce.
What causes this error
When you send a transaction with a nonce that matches a transaction already pending in the mempool, the network treats the new one as a replacement. Ethereum nodes enforce a minimum fee increase rule to prevent spam and race conditions. If your new transaction’s maxPriorityFeePerGas (tip) or maxFeePerGas is not sufficiently above the original, the node responds with "replacement transaction underpriced."
The exact minimum increase varies by node client, but the commonly accepted standard is that the total gas price (base fee + priority fee) must be at least 10% higher than the original. Some nodes, particularly those running Geth, enforce a stricter rule: the new priority fee must exceed the old one by at least 10% and the new total fee must also be higher.
Step-by-Step Fix
1. Confirm the Original Transaction Is Still Pending
Before replacing, verify the stuck transaction is still in the mempool and has not already been mined or dropped. Use a block explorer like Etherscan or your wallet’s transaction history. If it shows "Pending," you can replace it. If it shows "Dropped" or "Replaced," the original is gone and you need a fresh transaction.
2. Record the Nonce
The replacement must use the exact same nonce as the pending transaction. Most wallets display the nonce in advanced transaction settings. If you cannot see it, use an RPC call:
eth_getTransactionCount
with the address and the block parameter set to "pending". This returns the number of transactions sent from that address, including the pending one. The nonce you need is that count minus one.
3. Calculate a 10%+ Fee Increase
Take the original transaction’s gas parameters. If you have the maxPriorityFeePerGas and maxFeePerGas values, multiply each by at least 1.1 (10% higher). If the original used a legacy gasPrice, multiply that by 1.1.
For safety, increase by 15 - 20% to account for node-to-node variation. Tools like Etherscan’s gas tracker or a wallet’s "speed up" feature often do this automatically, but if you are sending raw RPC calls, calculate manually.
4. Resubmit the Transaction
Send a new signed transaction with the same nonce, the same to address, the same value (or a different amount if you prefer), and the new higher fees. The data field can remain the same or be changed - replacement transactions do not require identical data.
If your wallet has a "Speed Up" or "Cancel" feature, use it. It handles the nonce and fee calculation. If you are using a script or direct RPC, call:
eth_sendRawTransaction
with your new signed transaction.
5. Wait and Monitor
The replacement should propagate to the mempool and, if fees are competitive, be mined within a few blocks. If the error persists, increase the fee further. Some nodes may require a 20 - 30% bump to accept the replacement, especially during network congestion.
Why It Might Fail Even After a 10% Increase
- Node-specific rules: Some public RPC endpoints (like Infura or Alchemy) enforce their own minimum increase, sometimes higher than 10%. If you are using a free tier or a rate-limited provider, the node may reject a replacement that would be accepted elsewhere.
- Fee volatility: If the base fee rises sharply between your original and replacement, your new
maxFeePerGasmight still be too low relative to the original’s total cost. The node compares the total fee, not just the priority fee. - Stale mempool: The original transaction may have already been dropped by the node you are using, but the node still sees your new nonce as a replacement for a transaction it no longer tracks. In that case, switch to a different RPC endpoint or wait for the original to expire (typically 60 - 120 seconds on most nodes, but can be longer).
Preventing This Error
- Always set a reasonable fee cushion. Use gas estimation tools that return a 10 - 20% buffer above the current network average. Many wallets offer "fast" or "priority" options - use them for time-sensitive transactions.
- Avoid sending multiple transactions with the same nonce manually. Wallets handle replacements with proper fee bumps, but raw RPC calls require you to do the math.
- If you need to cancel a stuck transaction, send a replacement with the same nonce, a
toaddress of your own wallet, avalueof 0, and a significantly higher fee (often 20 - 30% above the original). This is effectively the same fix, just with an empty transfer.
When to switch RPC providers
If you consistently get this error from a particular public RPC endpoint, the provider may have custom fee rules or aggressive rate limiting. Try a different endpoint - many free providers like Infura, Alchemy, or public nodes (e.g., cloudflare-eth.com) accept standard 10% bumps. If the error persists across multiple providers, the issue is your fee calculation, not the node.
For self-hosted nodes, check your node client’s configuration. Geth’s default minimum replacement fee is 10% of the priority fee. You can adjust this in Geth’s --rpc.txfeecap or related settings, but doing so lowers spam protection. Most users should leave defaults and bump fees instead.
Not financial advice. starname.me publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.
Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.