When doing Swap transactions, you must have encountered the clamp robot, which is also called MEV robot, sandwich attack robot, which is an automated trading strategy!
It uses price differences to arbitrage by setting orders between buy and sell orders. The principle of the clamp robot is to detect trading pairs and find slippage profits. When a large transaction is detected, the clamp robot will automatically use a higher gas fee to preemptively purchase the order, and then use slippage to sell it to the trader at a higher price to earn the difference.
The clamp robot sold by this product is written in Python/Javascript/Rust source code, which is suitable for almost all programmers. It includes the following functions:
1. Retrieve all historical events (PairCreated) from the blockchain.
2. Create a triangular arbitrage path using all the pools retrieved from above.
3. Perform a multi-call request of the "getReserve" call for all the pools we are trading (retrieving >= 6000 pools takes 1 ~ 3 seconds).
4. Asynchronously transmit new headers, new pending transactions, and events.
5. Offline simulation Uniswap V2 3-hop path.
6. Sign the transaction and create a bundle to send to Flashbots (also supports sending transactions to the mempool).
Of course, once you get the code, you need to make some adjustments to make it work properly (mainly about order size optimization and Gas bidding strategy)
In addition, you need to prepare a server, which is the biggest cost you need to spend.