Skip to main content
All CollectionsFAQExchange
What are Flashbot transactions, and how do they work on 1inch?
What are Flashbot transactions, and how do they work on 1inch?

Use 1inch Flashbots to prevent front-running and sandwich attacks

Matt avatar
Written by Matt
Updated over a week ago

*** For metamask users, please check RabbitHole

Flashbots:

Flashbot transactions are now available to all 1inch users! You can now exchange assets safely, without the worry of potential loss from front-running and "sandwich attacks".

Just as in legacy finance, front-running is an acute issue for blockchain-based decentralized exchanges. In a nutshell, a front-running is an attack where the third party attempts to intercept a large transaction. By reordering the way transactions are meant to be mined on the blockchain, a front-runner steps precisely in front of a transaction in an effort to influence the market price and profit from it, respectively.

Upon signing, all transactions are broadcast to the mempool where they remain pending until miners pick them and add to the block. This mempool of pending transactions is a great source of information about transferred values and respective gas prices. Typically, the logic of ordering transactions in a block is that the highest gas price will be picked up first, and the cheapest one will be picked up last. By monitoring broadcast transactions in the mempool, a front-runner can easily set the gas price higher than that of a targeted transaction and secure priority execution of his/her transaction.

From now on, through the 1inch exchange interface, any user can choose the Flashbot as the type for his/her transaction, which means that it will not be seen by the third party in the mempool, as it will not be broadcast there.

This feature is possible due to a direct connection between 1inch and miners who provide this service. As soon as a transaction is mined, it is added to the block and becomes visible to anyone.

As a result, you can be sure that your transaction will not get front-run and will be executed at a target price.

How to set a Flashbot transaction?

To take advantage of the Flashbot feature:

Please note: At this time, Flashbot transactions do not work with MetaMask (1inch iOS Wallet, Ledger, Trezor, and MEW are compatible)

  • fill the ‘you pay’ and ‘you receive’ fields;

  • unlock your tokens for a swap, if needed;

  • hit the ‘swap token’ button;

  • in the verification window, select the option ‘Sign & send as Flashbot transaction’;

  • confirm the transaction in your wallet;

  • wait for the banner informing you that the transaction has been mined.

Flashbot Transaction Fee:

The fee mechanism for a Flashbot transaction (paying rewards to miners) is different from a traditional transaction. The transaction fee for a Flashbot transaction will always be zero, since the commission amount will be included in the Ether value.

You can see this in Etherscan after the transaction has been mined:

Note:

If you exchange ETH for any other token, then the Ether value will contain the amount you want to exchange in addition to the cost of the fee.

Set the gas price for the fee amount

For Flashbot transactions, you can set the gas price manually from the confirmation window.

By default, the Flashbot gas prices are set to the current ‘instant’ gas price. The minimum possible value is the current ‘fast’ gas price, the maximum possible value is the current ‘instant’ gas price, multiplied by three.

Note:

If the gas price is too low, the transaction may wait too long in the mempool.

Therefore, a restriction is in place that invalidates the transaction after 5 minutes from the moment of creation OR if more than 35 blocks have been created since the transaction was created.

Also, in order to avoid nonce collisions, all 1inch Dapp operations will remain disabled as long as there is at least one pending Flashbot transaction in the queue.

If you try to make any transaction while at least one Flashbot transaction is pending, you will see the following notification:

Questions, comments, concerns? Please contact us using the live support chat, and we will be happy to help!

Did this answer your question?