Replacement Transaction Underpriced

"replacement transaction underpriced" means a pending transaction already uses that nonce; use the next free nonce, or raise both fees by 10% to replace it.

replacement transaction underpriced means the node already has a pending transaction from your address with the same nonce, and your new one doesn't pay enough more to replace it. Send the transaction with the next unused nonce, or, to replace the pending one, raise both fee values by at least 10% (Geth's default threshold).

Symptom

Broadcasting an EVM chain transaction with the Tatum API fails with an error like this one. The errorCode starts with the chain, for example ethereum.broadcast.failed or bsc.broadcast.failed:

{
  "statusCode": 403,
  "errorCode": "###.broadcast.failed",
  "message": "Unable to broadcast transaction.",
  "cause": "replacement transaction underpriced [-32000]"
}

If you broadcast a signed transaction yourself with eth_sendRawTransaction, the node returns the same message as a JSON-RPC error with code -32000.

Cause

The blockchain has flagged your transaction broadcast as an attempt to replace another transaction present in the mempool (unconfirmed). Every transaction from an address has a nonce, and the mempool holds one pending transaction per nonce and sender. A node accepts a second transaction with the same nonce only as a replacement that pays more: on Geth, both the fee cap (maxFeePerGas, or gasPrice on legacy transactions) and the tip (maxPriorityFeePerGas) must be at least 10% higher (--txpool.pricebump, default 10). Other node clients and chains can use a different threshold.

This usually happens in one of two ways:

  • A nonce is reused by accident. If you broadcast EVM transactions in rapid succession (high-volume production environment), Tatum's automatic nonce calculation won't be fast enough. Two transfers get the same nonce, and the second one collides with the first while it's still pending.
  • The fee bump is too small. You resend a pending transaction with the same nonce to speed it up or cancel it, but raise the fee by less than 10%, or raise only one of the two fee values.

Solution

  1. Find the nonces in use. Call eth_getTransactionCount for the sending address, once with latest and once with pending. latest counts mined transactions, so it's the nonce of the next transaction to be mined. If pending is higher, pending transactions use the nonces from latest up to pending minus 1. Replace {ADDRESS} with the sender, and use your chain's gateway URL from its RPC page:

    curl 'https://ethereum-mainnet.gateway.tatum.io' \
      --header 'content-type: application/json' \
      --header 'x-api-key: {YOUR_API_KEY}' \
      --data '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["{ADDRESS}","pending"],"id":1}'

    The result is the count in hex, for example 0x198 (408):

    {"id":1,"jsonrpc":"2.0","result":"0x198"}
  2. To send a new transaction, set the nonce yourself. Keep track of the nonce value per address in your application and add it to your blockchain transfer payloads, instead of relying on the automatic nonce. For example, in the body of POST /v3/ethereum/transaction:

    {
      "to": "{RECIPIENT_ADDRESS}",
      "amount": "0.01",
      "currency": "ETH",
      "fromPrivateKey": "{PRIVATE_KEY}",
      "nonce": 408
    }

    Sending a private key in an API call is for testing only. On mainnet, sign with Tatum KMS and send a signatureId instead.

  3. To replace a pending transaction, raise its fees. Resend it with the same nonce and fees at least 10% higher than the pending transaction's. On EIP-1559 transactions, raise both maxFeePerGas and maxPriorityFeePerGas; on legacy transactions, raise gasPrice. In a Tatum transfer payload, keep the same nonce and set a higher fee.gasPrice (in Gwei) together with fee.gasLimit. For the steps, see Cancel or replace a transaction.

  4. Or wait for the pending transaction. If the pending transaction is the one you want, let it confirm and continue from the next nonce. To check its status, see Transaction unconfirmed, pending, dropped or failed.

📘

For high-volume sending, track the nonce of each address in your own queue. For a production nonce strategy, see Understanding and handling nonce in EVM chains.

FAQ

What's the difference between "transaction underpriced" and "replacement transaction underpriced"?

transaction underpriced means the fee is too low for the node to accept the transaction into its mempool at all; raise the fee. replacement transaction underpriced means the fee is too low to replace a pending transaction that has the same nonce; use a new nonce or raise the fee by at least the replacement threshold.

How much higher must the fee be to replace a transaction?

On Geth nodes, at least 10% on both the fee cap and the tip. Blob transactions need 100% (--blobpool.pricebump). Other clients and chains can set their own threshold, so if 10% isn't enough, raise the fee further.

Still stuck?

Report an issue to support with the transaction hash, the nonce you used and the full error response.


Did this page help you?