Even the Binance Alpha dog doesn't...

Brush! If the dog doesn't brush, I will! Sorry, sister, I was too foolish before, from now on I'll kneel and brush.

In the past few days, I've just started trading on Binance Alpha and found that many people's losses mainly come from sandwiches. Let's first introduce how sandwiches work, and then think about how to avoid being sandwiched to reduce the losses from trading Alpha.

First, what is the sandwich attack doing:

The English name for the sandwich attack is quite vivid; it uses two trades to sandwich the unsuspecting trader in the middle. So why can sandwiching the unsuspecting trader in the middle lead to profits?

In fact, every buy and sell we make will cause a certain degree of price change; the so-called pump and dump is essentially a large volume of buying and selling. So if we detect a trade about to be bought, buying before it and immediately selling after it, we can profit from the price increase caused by that trade.

So the sandwich is actually a very deterministic quick front-running scheme; it treats each of our trades as a target, buying in front of us and then immediately selling after us. Because it acts first, the trade pushes up the price, leading to an increase in our actual buying costs, which is the source of our loss.

Let's take a look at its workflow:

1. Monitor the memory pool and find trades in the memory pool that have not yet been mined.

2. Calculate the maximum profit that can be squeezed from each trade based on the slippage set for each trade. Therefore, as long as the profit can cover gas fees and bribes, the sandwich will definitely push this trade to execute at the set maximum slippage; this is the evil that the sandwich does.

3. Generate a trade bundle, select this trade, bind it between the two trades of the sandwich, and push the entire bundle to the mev node. The mev node will treat this bundle as a single trade and execute it.

So, how to avoid being sandwiched, two directions:

1. Make the sandwich undetectable:

Find chains without public memory pools to trade, your trades cannot be monitored, which can avoid the vast majority of sandwiches. BSC has a public memory pool, but you can turn on mev protection.

2. Reduce the potential profits from being sandwiched, so that the profit for executing this set of trades is not enough to cover gas fees, and it won't act.

a. Try to find liquidity pools with good liquidity

This way, the price movements caused by your trades are limited, and thus the sandwich's profits are also limited.

b. Lower the slippage

This can reduce the profit margin for the sandwich, but lowering the slippage also requires self-control, because your trade itself will cause slippage. If the pool has poor liquidity and your single trade amount is high, setting the slippage too low can lead to trade failures.

c. Reduce the amount of each trade

To summarize:

Turn on mev protection, trade with small amounts multiple times to find the best liquidity pools, and lower the slippage.

Sometimes you can also reverse-utilize the sandwich by raising the slippage, intentionally giving the sandwich profit, which can allow the sandwich to help you execute trades, so you can act faster than others when they are all trying to grab gas for buying/selling.