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. Make sure you have 'Advanced gas controls' turned on. This can be found in Settings > Advanced. 

    Screenshot_2022-02-08_at_08.26.53.png

  2. Start a new transaction, using the same recipient details and token amount as the original (assuming you want them to remain the same).

    When sending a transaction, hit 'Edit':

    Screenshot_2022-02-11_at_16.27.21.png

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

    Screenshot_2022-02-11_at_16.27.54.png

    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?
17 out of 159 found this helpful

Articles in this section

See more
MetaMask Support on Twitter
Beware of scam Twitter accounts. Never give anyone your Secret Recovery Phrase!
MetaMask YouTube
Fow how-to and support videos please visit our channel