Your pending transaction is public before it is final, and your slippage tolerance tells anyone watching exactly how much they are allowed to take from you.
Last verified 13 September 2026 · written by the DexLadder team
The mechanism, in order
You submit a swap. It enters a public mempool, where its size, the pool it targets and its slippage tolerance are all readable.
A bot computes how far it can push the pool price and still leave your swap executable inside your tolerance.
It buys ahead of you, paying for priority in the block.
Your swap fills at the worse price you authorised.
It sells immediately after, into the impact you just created. The profit is bounded by your tolerance.
Nothing here is a bug. It follows from public ordering and from the fact that block space is auctioned.
What actually reduces it
Compute the impact first, then set tolerance just above it. Use the price impact calculator with the real reserves. If honest impact is 0.4%, a 5% tolerance is a 4.6% invitation.
Trade deep pools. Attack profit scales with impact, and impact scales inversely with depth. The same swap in a pool ten times deeper is often not worth attacking.
Split the order. Several smaller swaps produce less impact each and are individually less profitable to attack — at the cost of more gas.
Use a private transaction route where available. Submitting through a private relay keeps the transaction out of the public mempool until inclusion, which removes the easiest form of the attack.
Avoid the obvious moments. Launch minutes, unlock events and post-listing volatility are when bots are most attentive and pools are thinnest.
What does not help
Raising gas alone does not protect you — the attacker is bidding in the same auction with better information and better latency. Nor does an extremely tight tolerance on a volatile pool: the swap simply reverts, and you pay gas for nothing. The working setting is the one derived from actual pool arithmetic, not a default and not a guess.
Practise it without paying for the lesson
In DexLadder's pool desk you can size a swap against real pool reserves and watch impact, fee and final fill before anything is submitted. Run the same trade at ten times the size and the curve becomes obvious in a way no explanation achieves.
Slightly above the computed price impact for your size in that specific pool — not a habitual 1% or 5%. Compute it per trade; a fixed default is either too tight to execute or too wide to be safe.
Does a private relay guarantee safety?
It removes public mempool exposure, which eliminates the easiest attack. It does not remove every form of ordering advantage.
Why did my swap revert and still cost gas?
Execution is attempted on-chain. If the price moved beyond your tolerance the transaction fails, and you still pay for the computation attempted.