EigenPhi

Posted on May 25, 2022Read on Mirror.xyz

How To Recognize Cross-Transaction Arbitrage Like Sandwich

Photo by Sara Cervera on Unsplash

We have explained in our last post how we identify atomic arbitrages like Spatial, Triangular, and Combination. This time, we will lead you through our methodology regarding Sandwich arbitrage.

You might want to first review some of the core concepts, such as CombinedTransferTable and Trade, for a better understanding.

The cross-transaction structural analysis is an extension of the intra-transaction analysis approach.

A Sandwich arbitrage has characters as below.

  • In the same Block, the Attacker’s Transactions contain a Start Transaction, an End Transaction, and one or more Victim Transactions in between.
  • The combination of Attacker and Victim needs to satisfy an essential condition: the From Address is not the same.

The pattern of Sandwich has the combination of (Attacker Start Transaction, Victim Transaction, and Attacker End Transaction). The CombinedTransferTable of each transaction contains the same Address processing the Trade. Combining the Attacker’s Start Transaction and End Transaction, we get the CombinedTransferTable of this arbitrage having the final net surplus.

Let’s look at this one.

Transaction list on BlockNumber: 14762460

Attacker Start Transaction CombinedTransferTable

The Attacker bought WETH at the following price: 1996 USDT.

Victim Transaction CombinedTransferTable

The Victim bought WETH at the following price: 2031.8 USDT.

Attacker End Transaction CombinedTransferTable

The Attacker sold WETH at the following price: 2005.4 USDT, higher than the buying price.

Signal for Arbitrage Recognition

All three transactions had Trade happened on Address: Uniswap V2: USDT 0x0d4…f1852.

Attacker’s Final Net Profit

Attacker’s Start / End Transaction Combined:

In this Sandwich arbitrage, Attacker MEV Bot: 0x000…e7D’s revenue was 2920.4 USDT before deducting costs like gas fees.

That’s it. Next time, we will discuss why you should find out the transaction structures on DeFi. To put it simply: understanding the underlying structures of DeFi MEV transactions is essential to navigate through the maze built on Smart Contract and establish the new frontier for the new world of DeFi.


Follow us via these to dig more hidden wisdom of DeFi: