Trading bots monitor pending public blockchain transactions to execute frontrunning and sandwich attacks ahead of user trades.