πŸ‘ˆEthtools

Create and issue a flashbots bundle πŸ€– ⚑️ (Experimental)

This page uses a special Flashbots RPC endpoint because Metamask does not allow to sign a transaction without actually sending it to an RPC endpoint. So we sign them, send them to be cached privately by flashbots and finaly, fetch them. The raw signed transcations are processed by the Flashbots Bundle library and sent directly to the Flashbots private relay. All this is done on the browser and the only backend that is used is the flashbots cache/RPC endpoint.

The source file is very simple and I invite you to take a look and verify it for yourself.

Read the Instructions

  1. Add the following RPC endpoint to Metamask, with Chain ID = 1 and Symbol = ETH:
  2. If you are not sure how to do (1), watch this video. Note that you will have to add a new network with every refresh of this page, as every bundle id(bundle=...) is tied to a unique bundle. Metamask does not allow to edit the RPC endpoint of an existing network, apparently.🀷
  3. Add transactions and populate the fields according to the examples below
  4. You can change the Max Base Gas fee for every transaction. The number you see is a multiple to the MAX gas that flashbots expect to be required for the base fee. The larder the multiple, the larger the max fee you allow to pay and thus higher chances that your transaction will be included in the block. If you set a low multiple (e.g 1x) and the base gas fee is higher for that block, the bundle will not be included.
  5. Populate the "Blocks in the Future" and "Priority Fee" fields and click on "Set Global Variables". This is required to sign the transactions, are these fields are used in the transactions themselves.
  6. You can reset the Global Variables at any time, by simply clicking on the "Reset Global Variables" button. You will need to sign all the transactions again.
  7. Click on "Sign Transaction" to sign the transaction. Make sure you switch Metamask to the account you want to sign the transaction with.
  8. After you are finished, click on "Send Bundle!"
  9. The transactions will be sent to flashbots as a bundle to be executed all in the same block. The bundle will be submitted to flashbots on every block to be included in blocks in the future.
  10. An alert window will pop up to inform you on the success or failure of the submission. The receipt will be printed Bundle Receipt at the end of the page.
  11. πŸ“ IMPORTANT After You are done with the website, go to metamask and reset the accounts that you used to send/sign transactions. Metamask will attempt to resend the transactions as soon as you switch networks. As the transactions are not issued on the blockchain, but simply cached to the Flashbots endpoint and then brought back to be submitted via a bundle, Metamask assumes that the transactions failed and sends them again.
  12. πŸ“ If the receipt shows BlocMinedWithoutInclusion, that's OK. You will get this message until the bundle is included. To increase the chance of inclusion, you might want to increase the Priority Fee.
  13. πŸ“ If the receipt shows nonce too low, tx X state Y, that means that metamask has messed up the tx nonces. Send the Bundle again and manually set the nonce of the appropriate transaction to the number Y shown in the error message. Alternatively, you can reset your metamask Accounts, clearing the tx queue and fixing the nonces.
  14. πŸ“ Currently, to offer a better UX, we set the default maxBaseFee that you are willing to pay to 3 times the maxBaseFee that Flashbts predicts for the block that will include your Bundle. The block number is computed as: currentBlockNumber + blocksInTheFuture. This is an UPPER BOUND of the baseFee and not what you will actually pay. This is done so that there is a margin for error to the calculated maxBaseFee and you don't have to sign the transactions again every time the actual baseFee is higher than the predicted maxBaseFee. This means that you will need to send more ETH to an account in order to potentially cover the higher maxBaseFee. You can read more about this on GitHub.
  15. πŸ“ If you want to change something to the Bundle, you can make the change and click on Send The Bundle!

      Fields Reference

      Blocks in the Future: The number of blocks in the future in which the bundle should be mined (e.g next block = 1 block in the future)

      Gas Fee: How much do you want to pay the miners to include your bundle? This amount will be paid for each transaction in the bundle.

      Target Address: 0x7EeF591A6CC0403b9652E98E88476fe1bF31dDeb

      Function Signature: safeTransferFrom(address, address, uint256, uint256, bytes)

      Function Arguments: 0x8DbD1b711DC621e1404633da156FcC779e1c6f3E 0xD9f3c9CC99548bF3b44a43E0A2D07399EB918ADc 42 1 0x

      Transaction Value: 0.002

      Gas Limit: 100000



      Network



      Bundle Receipt