Transactions sit in a public queue before they are confirmed, and whoever orders the block can profit from what they see coming: sandwich your swap between their buy and sell, front-run your liquidation, extract the arbitrage before you do. It is not a hack — it is the protocol working as designed, with the profits going to the fastest.
Mitigation exists at two levels: user-side (slippage limits, private transaction relays that hide your order until it lands) and protocol-side (fair ordering, MEV redistribution). Anyone building or trading on-chain should assume the mempool is being watched — because it is.
Related terms
DeFi
Decentralized finance — lending, trading and yield run by smart contracts instead of institutions, open to anyone with a wallet.
On-chain
Recorded on the blockchain itself — permanent, public, verifiable by anyone — as opposed to off-chain data in someone's database.
Smart contract
A program deployed to a blockchain that runs exactly as written, that anyone can call, and that usually cannot be changed afterwards.
The bench this belongs to
BlockchainSolidity on Ethereum, Polygon, Base and Arbitrum. Anchor programs on Solana. Written with tests first, because a redeploy is not a hotfix once value is on the line.
