Front-Running and Sandwich Attacks · 1/2
Front-running: seeing your trade and beating it to the block
Front-running happens when someone spots your pending transaction in the mempool, realizes it will move the price favorably for them, and submits their own transaction with a higher fee so it gets processed first, profiting from the price movement your transaction was about to cause.
This is directly analogous to a stock trader illegally acting on advance knowledge of a large incoming order, except in public blockchains, seeing the 'advance knowledge' isn't illegal, it's just publicly visible mempool data anyone can watch.
