Gas causing my transaction to fail

Error: Internal JSON-RPC error.
{
  "code": -32000,
  "message": "insufficient funds for gas * price + value:  have 9764330700000000 want 10000000000000000",
  "cause": null
}

I understand its informing me I do not have enough funds to pay for the transaction however this is on arbitrum and the transaction works at times and doesn’t at others. I have $36 in eth which is equal to the error above stating I have 97… and it wants 1000… on the arbitrum network and when the tx works it doesn’t cost more than a dollar. This is very confusing for me.

    const gasPrice = await web3.eth.getGasPrice()
    const initiatorNonce = await web3.eth.getTransactionCount(initiator)

    const transferData = await contract.methods.deploy(bytecode, newSalt).encodeABI()
    const estimateGas = await contract.methods.deploy(bytecode, newSalt).estimateGas({ from: initiator })
    // console.log(estimateGas)
    const transferTX = {
      from: initiator,
      to: arbc2,
      nonce: web3.utils.toHex(initiatorNonce), // don't forget to increment initiator's nonce
      gasLimit: web3.utils.toHex(Math.round(gasPrice)),
      gasPrice: web3.utils.toHex(Math.round(gasPrice)),
      data: transferData,
      value: "0x"
    }
    const signedTransferTX = await web3.eth.accounts.signTransaction(transferTX, initiatorPK)
    const complete = await web3.eth.sendSignedTransaction(signedTransferTX.rawTransaction)
  

Just an added note - I have tried increasing the gasPrice however this simply gives the same error and increases the want figure.

it seems as though web3 is estimating gas cost for ethereum and not arbitrum

sometimes you can get a high gas price estimation when the transaction is expected to fail

gasLimit and gasPrice cannot be the same. you can try to hard code the has limit

the problem is the gas estimation is close to $30 and the actual gas is $0.3 dollars. I have gotten the transaction to work numerous times when i have the estimated gas in my wallet and it only costs 0.3 however as soon as I have less than the $30 the tx fails.