How Does Front-Running Occur in the Context of Smart Contracts?
Front-running in smart contracts occurs when a user, often a miner, observes a pending transaction and submits their own transaction with a higher gas fee to have it processed first. This allows them to profit from the information in the pending transaction.
For example, a front-runner could see a large buy order for a token and buy the token themselves at a lower price, only to sell it to the original buyer at a higher price.