Sandwich Attacks: Stealing or Just Playing the DeFi Game?

Sandwich attacks are eating up hapless traders’ lunch money

article-image

FotosDo/Shutterstock modified by Blockworks

share

DeFi trading is fraught with monetary dangers, borne from its freewheeling and volatile environment. And as if the wild west of crypto trading wasn’t already risky enough, highly effective bots have emerged to gobble up value from unwary traders in recent weeks.

These predatory robots are constantly on the lookout for new victims in Ethereum’s public mempool, hunting for opportunities to seize upon vulnerable orders. 

Technically, one could argue they’re not “stealing” anything, per se. The bots are really just extracting the maximum value, or MEV, in the most effective way possible under the given conditions.

Ostensibly, they’re just playing by the rules — and finding loopholes — better than everybody else. Their actions just happen to also be at the expense of everybody else. In the traditional finance world, this activity would likely be a clear-cut case of illegal behavior, but legalities are not as well-defined in decentralized finance. Not yet, anyway.

On a recent Bell Curve podcast, host Mike Ippolito spoke to Blockworks about the tweeted observations of a recent MEV exploit from steward and product lead at Flashbots, Robert Miller. This particular bot, going by the dubious moniker, jaredfromsubway.eth, has been highly successful with a technique referred to as a “sandwich attack.”

A sandwich attack consists of two rapid swaps surrounding a victim’s trade. It begins with an innocent trader sending their order to the public mempool, at which point the bot — always searching — spots its opportunity. 

The attack begins with a frontrun, followed up by an attack on the backend of the selected trade, hence the term “sandwich.” In an example posted by Miller, the bot exploits pepe (PEPE) trades with ether (ETH). 

The frontrun, Miller explains, sells the attacker’s pepe for ether. This causes the price of ether to climb immediately before the targeted trade is initiated. The victim then swaps their pepe for ether, receiving less than they should expect due to the price hike caused by the bot. 

Following this, the bot promptly sells ether back for the memecoin, which is now cheaper because of the victim’s sell order. 

In this particular example of a brief moment of exploitation, the bot gains 0.04 ETH and 300 memecoins, unbeknownst to the hapless victim. It might not sound like much, but it’s happening constantly, netting the bot millions of dollars over the past few weeks.

Extremely good at sniping

Ippolito says this particular bot is highly effective because it “takes a very different approach.” It starts with a large supply of a token — in this case, pepe — so “there’s just much less competition.” 

“The reason why more bots don’t do that is just because warehousing becomes very difficult,” he says.

“You don’t really want to hold a whole bunch of your assets in something that’s as volatile as something like pepe, because any profits that you get from the sandwiching could be offset by declines from the memecoin basically failing.”

“But I guess jaredfromsubway is extremely good at sniping.”

Indeed, the bot is especially effective at “sniping,” suspiciously snapping up a large supply of pepe within ten minutes of it being deployed. This lucrative acquisition allowed it to have the required inventory for its MEV strategy.

One way to avoid becoming a victim of attacks of this nature is to change a wallet’s RPC (remote procedure call) to Flashbots’ Protect RPC solution. The tool diverts transaction orders from the public to a protected mempool. From there, it privately transmits transactions, rendering them invisible to bots, thus eliminating the possibility of such attacks.

On a positive note, co-founder of Framework Ventures, Vance Spencer, suggests the recent ramp-up in MEV activity is a good sign for the market, noting that “MEV is turning back on.”

Michael Anderson of Framework Ventures agrees, noting that the level of engagement on pepe indicates “green shoots” out of the bear market and the possibility of finally “moving past it.”

For good or bad, “MEV is gonna be a benefactor for all of that.”


Start your day with top crypto insights from David Canellis and Katherine Ross. Subscribe to the Empire newsletter.

Explore the growing intersection between crypto, macroeconomics, policy and finance with Ben Strack, Casey Wagner and Felix Jauvin. Subscribe to the On the Margin newsletter.

The Lightspeed newsletter is all things Solana, in your inbox, every day. Subscribe to daily Solana news from Jack Kubinec and Jeff Albus.

Tags

Upcoming Events

Salt Lake City, UT

MON - TUES, OCT. 7 - 8, 2024

Blockworks and Bankless in collaboration with buidlbox are excited to announce the second installment of the Permissionless Hackathon – taking place October 7-8 in Salt Lake City, Utah. We’ve partnered with buidlbox to bring together the brightest minds in crypto for […]

Salt Lake City, UT

WED - FRI, OCTOBER 9 - 11, 2024

Permissionless is a conference for founders, application developers, and users. Come meet the next generation of people building and using crypto.

recent research

Research Report Templates (1).png

Research

Solana Mobile is a highly ambitious foray into the mobile consumer hardware market, seeking to open up a crypto-native distribution channel for mobile-first applications. The market for Solana Mobile devices has demonstrated a phenomenon whereby external market actors (e.g. Solana-native projects) continuously underwrite subsidies to Mobile consumers. The value of these subsidies, coming in the form of airdrops, trial programs, and exclusive NFT mints, have consistently covered the cost of the phone and generated positive returns for consumers. Given this trend in subsidies, the unit economics in the market for Mobile devices, and the initial growth rate and trajectory of sales, it should be expected that Solana mobile can clear 1M to 10M units over the coming years. As more devices circulate amongst users, Solana Mobile presents a promising venue for the emergence of killer-applications uniquely enabled by this mobile-first, crypto-native distribution channel.

article-image

Analysts are looking ahead to August, a historically volatile month made more interesting this year by the US presidential election

article-image

Plus, a look into Lighting Labs’ newest feature

article-image

Crypto’s Wild West era is over — it’s time to embrace regulation to secure the future of digital assets

article-image

Plus, Solana has now surpassed Ethereum in trailing 30-day decentralized exchange volume

article-image

Polymarket betters say Kamala Harris has better odds than Biden of winning against Trump