Jared from subway and blockchain sandwiches

Recently, the algorithmic trading firm Wintermute launched the Alpha Challenge. One of the topics that caught my attention and sparked my interest was a task titled “Jared-from-Subway.“:

You are click trading a newly launched memecoin and notice you are being sandwiched by Jared. You see that Jared made a bunch of money doing this, and you’re interested in checking their profitability.

So, What Exactly Is Sandwiching?

Imagine you’re about to buy some crypto. You’ve researched and found the perfect asset and are now hitting that “buy” button. But before your transaction goes through, there’s a tiny window where it’s just hanging out, waiting to be confirmed by the blockchain. Enter the sandwich attacker.

These savvy (and kind of shady) actors monitor the blockchain’s mempool — a waiting room for transactions that haven’t been processed yet. They spot your juicy trade, and here’s what they do:

First, They Front-Run You: They quickly place a buy order for the same asset right before your transaction gets confirmed. This drives up the price just before your order goes through.

Then, They Back-Run You: After your order is processed at the new, higher price (thanks to their front-running), they sell the asset at this inflated price. They pocket the profit, and you end up paying more than you should have.

Your transaction just got sandwiched — hence the name.

Is it legal?

In traditional finance, sandwiching falls under something called front-running. This is when a trader uses insider knowledge about an upcoming trade to jump ahead and make a profit. Imagine you’re about to buy a big chunk of stock. If a broker sees your order coming and quickly buys the stock for themselves first, knowing your big purchase will drive up the price, that’s front-running. After your order pushes the price up, they sell their shares at a higher price and pocket the difference. Sounds shady, right? That’s because it is.

In the world of traditional finance, front-running is considered market manipulation. It’s a big no-no because it’s unfair and goes against the idea of a level playing field in the markets. Regulations like the Securities Exchange Act in the U.S. and similar laws worldwide make sure this kind of behavior is strictly prohibited. If someone gets caught doing it, they could face serious consequences—think hefty fines, getting banned from trading, or even jail time.

So, Why Is It Allowed in DeFi?

Here’s where things get interesting. In the Wild West of DeFi (Decentralized Finance), sandwiching is technically legal—at least for now. The blockchain world is still pretty new, and there aren’t as many rules and regulations as in traditional finance. Plus, everything on the blockchain is transparent and open, which ironically makes it easier for bad actors to spot opportunities for sandwiching.

Without the same kind of oversight and regulation you find in traditional finance, these kinds of tactics can slip through the cracks. But that doesn’t mean they’re ethical. In fact, as the DeFi space matures, there’s a growing push to find ways to stop this kind of behaviour, either through new regulations or by building better tech that makes it harder to pull off.

Here is an example of a “sandwiched” transaction:

What I really like most about all of this is the name of the bot that creates the sandwiches 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *