Front running in crypto occurs when someone uses knowledge of another pending trade or transaction to place an earlier transaction for their own advantage. On blockchains, the order of transactions can affect prices or who receives an opportunity. It is often discussed as a form of maximal extractable value (MEV).
Suppose a trader submits a large swap in a liquidity pool. A third party may exploit the anticipated price movement by arranging a trade before it. In a sandwich attack, another trade follows the user's swap, leaving the user with worse execution within the transaction's allowed price limits.
Not every blockchain uses a public mempool, and transaction ordering is not always determined by fees alone. MEV also includes activities other than front running.
Review expected output and slippage tolerance before confirming an automated liquidity protocol swap. Some interfaces offer protected routing, but the protection and trust model differ. A tight tolerance may cause a trade to fail; it does not prevent all forms of harmful ordering.