What Specific Smart Contract Functions Are Most Susceptible to Sandwich Attacks?
Smart contract functions that involve token swaps on Automated Market Makers (AMMs) are the most susceptible. Specifically, functions like swapExactTokensForTokens or swapTokensForExactTokens on protocols like Uniswap are targeted.
These functions read the current price, execute the trade, and then write the new price. The price change caused by the victim's trade is what the front-runner exploits by placing trades around it.