PSA: Watch your slippage when swapping on DeFi to avoid snipebots frontrunning your trades!


My general advice for everyone dealing with Liquidity Pools, especially when you are new to it, is to set your slippage to 0.1%. If your slippage is higher and the pools liquidity is rather low, there are plenty of bots watching out to front run your trade, drawing liquidity from he pool and leave you with a much higher price paid for your tokens than you expected.

Before explaining how these bots ‘snipe’ your trades, here are a few examples from our LP:

Read these trades from down to top. The first is a snipebot frontrunning, the second is the actual trade of the user buying and the third is the snipe bot selling at a profit. in these examples you can clearly see that the buyer paid a higher price due to the snipe bot frontrunning (pushing the price up), then dumping right after the user bought again with a profit on his trade.

The second buyer had half the slippage of the first, so the bot bought up only by half the value (because else the users trade would fail due to exceeding the accepted slippage).

While the examples above still seem kind of okay (but avoidable), the next one had such a high slippage set that the bot pushed the price up with 21x the capital the user used to buy. (the orders are a bit mixed up since all the trade have the same timestamp/block).

The second trade is the bot buying and pumping the price up, the first(from bottom) is the user buying and the third is the bot getting away with $100 of liquidity. The buyer bought at a MUCH higher level than he was supposed to:

How to avoid this:

a) check the liquidity of the token you want to buy

b) set your slippage to 0.1%

c) buy in smaller chunks

With slippage set to 0.1% and buying max $500 at a time, all these buyer wouldn’t have been frontrun or only with minor amounts.

submitted by /u/citystates
[link] [comments]