How to stop getting rugged by DeFi Sandwich Attacks with these tools

Stakingbits
Stakingbits
Published in
8 min readOct 10, 2021

--

If you have used a decentralised exchange like Uniswap, Pancakeswap or Sushiswap, chances are, you might have been front-run by a bot, causing you to pay a higher price for your trade than you’d have expected.

What is a sandwich attack?

When swapping tokens (or sending tokens) on the blockchain, there is small period of time between the timing of the transaction information being broadcast to the network and when it is actually processed, or mined into a block.

During this time, the transaction information is publicly visible to everyone in a place called the mempool.

While the transaction is publicly visible, bots can take advantage of this information and perform arbitrage trades and profit at your expense.

A sandwich attack is an attack where a bot or malicious actor looks for a pending transaction queue in the mempool, places an order right before the trade and one more after the trade, so that the original transaction is sandwiched in between, altering the transaction sequence.

By doing this, it causes the trader’s original transaction to be front-run and back-run by the bot, causing him to suffer higher slippage and worse execution on the trade.

--

--

Stakingbits
Stakingbits

Staking bits and bytes. DeFi’s fastest growing content platform helping investors navigate DeFi’s wild forest.