EigenPhi

Posted on Feb 28, 2022Read on Mirror.xyz

Introducing Sandwich Arbitrages Discovering on EigenPhi

Photo by Mae Mu on Unsplash

In 2018, Vitalik Buterin, the founder of Ethereum, warned the crypto world about a specific arbitrage: Sandwich. The arbitrage would have significant consequences, such as marketing manipulation. You can find a more elaborate explanation here.

Traditionally, sandwich arbitrages are challenging to monitor and detect due to their complex nature.

Thanks to the flashbots project and its team’s great endeavour, sandwich arbitrage has walked out of the dark forest and become more transparent and fairer. As a result, increasingly, more searchers gain access to MEV Revenue and redistribute it.

Using its unique auction mechanism, flashbots elucidates the unspoken acts and sets up a new system with open and unambiguous rules, thus mitigating the negative externalities of MEV like EigenPhi’s mission.

To help investors identify such transactions, applying our in-house algorithms, EigenPhi released the Sandwich transactions discovering feature.

Open EigenPhi’s website, you can examine the Arbitrage Transaction Profit Leader Board. The Type column indicates what kind of transaction the row of data is.

Arbitrage Transaction Profit Leader Board with sandwich arbitrage type marked.

Arbitrage Transaction(Real-Time Stream) shows Sandwich arbitrages as well.

Arbitrage Transaction(Real-Time Stream) with sandwich arbitrage type marked

Arbitrage Transaction(Real-Time Stream) with sandwich arbitrage type marked

Click the row marked as Sandwich, and you can open the particular page of the transaction.

Sandwich Arbitrage detail

Flashbots lower searchers’ risk of failure by bundling up the transactions in the right order and putting them in the block.

For the arbitrage above, you can choose any of the three transactions and open its Etherscan page, on which you can find the block number. For this sandwich, it’s 14264561. To locate the bundle, navigate to the last records of the transactions on the block page. You can see the three items at the bottom of the records, which means they are put there as the top 3 transaction records by flashbots, as you can see in the picture below.

Flashbots transaction records in the block

Next, let’s dig into the details of this sandwich arbitrage in the Token Flow Chart section.

As it’s a sandwich arbitrage, the victim’s transaction is between the attackers’. So the green row is the poor guy’s address and his deal. The pink rows belong to the attacker. For the sake of clarity, only the last four digits of the address are used for indication.

we can split the whole process as below:

  1. In the green row, HODLer 0x0ad3 wanted to swap WETH for COPS.
  2. Scanning the mempool, Attacker 0x6b40 detected the victim’s swapping intention.
  3. Attacker 0x6b40 sold 26.770108 WETH to the liquidity pool 9314 for 159.089221 COPS, which caused the price of COPS to go up.
  4. HODLer 0x0ad3 sold 0.5 WETH for 2.4584 COPS to the LP, although he or she could have got more providing no Sandwich arbitrage.
  5. Attacker 0x6b40 swapped 159.089221 COPS for 26.791703 WETH in the LP. The process is over.
  6. In conclusion, Attacker 0x6b40 netted 0.021594 WETH, which is $69.002826 considering the price of WETH at the time. Deducted the cost of the arbitrage including gas and transaction fees, the profit is $5.094312 which can be found in the overview part.

In the long run, equivalent to the goal of the flashbots, EigenPhi aims at unveiling the new structures and behaviours of arbitrage/MEV/attacking in the existing and emerging DeFi protocols. Discovering the wisdom of DeFi is EigenPhi’s mission.

To find out how we achieve the goal, please feel free to follow us on Discord, Medium, Revue, Substack, and Twitter.

Interested in receiving the latest MEV alert? Follow EigenPhi MEV🤖 Alert.