Error: [ethjs-query] while formatting outputs from RPC (transaction underpriced error)

The information in this article is applicable to Ethereum mainnet and other networks, such as BSC and Polygon. 

If the gas price has been set too low when attempting to carry out a transaction, this sort of error can occur:

"Transaction <your transaction # here> failed! Error: [ethjs-query] while formatting outputs from RPC '{"value": {"code":-32000,"message":"transaction underpriced"}}'"

This can happen when attempting to make a swap via a DEX (decentralized exchange) or simply when sending tokens to an address.

In order to successfully complete the transaction, you should issue a new transaction whilst raising the amount of gas you pay. However, before you do so, check on the relevant block explorer (e.g. Etherscan, BscScan, Polygonscan etc.) to make sure you are not generating an increasingly longer queue of pending transactions. 

To do this:

Extension Mobile
  1. Start a new transaction, using the same recipient details and token amount as the original (assuming you want them to remain the same) and hit 'Next'.

  2. Click on the 'Market' icon located above your gas details, and then hit 'Advanced':

    MetaMask find advanced gas controls extension

  3. You'll now be presented with a set of fields you can adjust, resembling the below:

    MetaMask advanced gas fee settings

    Here you should:

    • Input a comparable or slightly higher gas limit than you did for the transaction that failed
    • Raise the max priority fee at least 10% higher (in gwei) than the gas fee of the failed transaction 
    • Set your max fee at least 30% higher than that of the failed transaction.

If you are trying to cancel that pending transaction altogether, you need to send 0 ETH (or equivalent currency) to your own address with the same nonce as the pending transaction. See our article on cancelling transactions for more guidance.

For more information on gas, see our user guide.

Was this article helpful?
77 out of 619 found this helpful

Articles in this section

See more