The Notorious Jaredfromsubway.eth's Sandwich Attack
Last updated
Last updated
With sophisticated strategies, Jaredfromsubway attacked 5 users who were swapping on Uniswap V2 in a single sandwich attack.
Frontrun steps 3,4: buy RG using 1.7380 WETH. As RG is not a popular token, this buying process raises the price of RG by about 1.2%. So later, the victim has to buy RG at a more expensive price, and the price difference is the profit of the sandwich attack.
Victim step 5,0: buy 0.24 ETH's RG with a higher price unknown that he has been front-ran.
Backrun steps 3,4: sell the exact same amount of RG (4845530.2049 RG) the attacker bought in the frontrun. The gross profit is 0.022 ETH (~$41) with a principle of 1.7380 ETH.
There are 4 more victims corresponding to the remaining swaps in frontrun and backrun. Please check this EigenPhi link for a feeling of how sophisticated Jaredfromsubway.eth is.
Uniswap V2: Uniswap is the largest DEX at that time and up to now.
The oval marked as to in frontrun and backrun is the attacker's bot (contract) address.
The pentagon marked as from in the victim transaction is the victim's EOA address.
The solid oval with UNI-V2 in it is the UniswapV2 DEX address. Users interact with these addresses to swap tokens.
Solid ovals with different colors denote different pools. The pool colors are consistent from frontrun transactions to victim transactions to backrun transactions.
WETH, WSB, RG, JUAN, NOPE
Frontrun step 0: the attacker sent to his bot a “password” “365” by a small amount of ETH transaction to initiate the attack.
Frontrun steps 3,4: buy RG using WETH. Prepare for the attack against the RG buyer.
Fromrun steps 1,2: buy WSB using WETH. Prepare for the attack against the WSB buyers (there are two of them).
Frontrun steps 5,6,7,8: buy JUAN, NOPE using WETH. Prepare to attack JUAN, NOPE buyer.
Victim step 0: send 0.24 ETH to Uniswap Router, aiming to buy RG.
Victim steps 1,2: the Uniswap Router transforms ETH to WETH.
Victim step 3: this is an extra transaction written in UniswapV2's contract for the simplicity and robustness of the contract.
Victim steps 4,5: send the 0.24 WETH to the Uniswap aggregator and give the RG back to the user.
There are 4 more victims with a similar transaction topology. Please check EigenPhi's webpage for more details.
Backrun step 0: send the bot a password "374" to start the backrun.
Backrun steps 3,4: swap the RG got in frontrun back to WETH.
Backrun steps 1,2,5,6,7,8: swap the WSB, JUAN, and NOPE got from the frontrun back to WETH.
Jaredfromsubway.eth is 2023's biggest winner. It can make $1.16 million daily. In this sandwich attack example, he gained 0.0872 ETH with 3.8 ETH's principle. This video also explains the same attack.
Sandwich attack, Jaredfromsubway, frontrun, backrun