What is Sandwich Attack? Types of attack and how to avoid Sandwich Attack

avatar
Coin68
12-29
This article is machine translated
Show original

Blockchain technology was known for its high security, decentralization and transparency because data on the network cannot be changed. However, blockchain gradually became the target of hacker attacks and users' crypto assets worth tens or hundreds of millions of dollars were stolen. A popular form of attack in the crypto market is the Sandwich Attack. So what is Sandwich Attack? Let's learn about the form and how to avoid Sandwich Attack with Coin68 through the article below!


What is Sandwich Attack? Types of attack and how to avoid Sandwich Attack

What is Sandwich Attack?

Sandwich Attack is a form of attack derived from MEV (Miner Extractable Value - value that can be withdrawn from a transaction), in which an attacker affects a trading pair by influencing surrounding market conditions, thereby earn profits.

To perform a Sandwich Attack, it is first necessary to execute a front-run transaction to influence the market price of the asset before the victim's order executes, and then immediately execute a back-run order to sell the asset. The asset is trading back on the market at the newly changed price.


What is Sandwich Attack?

Depending on the blockchain and platform you use, a Sandwich Attack can affect your transactions by large or small amounts because it relies on the impact on available liquidation . If liquidation is low, the price impact of a front-run trade with a small buy order is enough to force you to execute the buy order at a higher price. Conversely, in a high- liquidation environment, Sandwich Attack requires more Capital to influence prices.

Sandwich Attacks account for about 80% of all MEVs, making up the majority of MEV methods according to EigenPhi.

How does Sandwich Attack work?

Basically, Sandwich Attack is developed from an arbitrage trading model with a front-run/back-run method performed at the same time, and these attacks mainly focus on DeFi users.

During a Sandwich Attack, the attacker searches for transactions with pending orders on the network.

For example : On Ethereum, the attack takes place through placing 1 order immediately before the transaction and 1 order immediately after. In other words, the attacker executes both the front-run and the back-run at the same time with the original pending transaction lying between them.


How Sandwich Attack works

The goal of placing 2 orders to block pending transactions is to control the price of the asset in a very short time. Specifically, the process of implementing Sandwich Attack is as follows:

- Step 1 - Buy assets at high prices (Front-run) : The attacker starts by buying the asset the user is looking to trade.

For example : When the victim uses USDT to swap into ETH, the attacker will buy ETH at a high price to make the victim have to buy at a higher price.

- Step 2 - Sell ETH at a low price (Back-run): When the victim makes that transaction, the attacker will sell ETH at the new price , taking advantage of the increased price from the victim's transaction and making a profit. profit.

- Principle: Placed transactions affect the amount of ETH that the user will receive. The attacker Vai as a false liquidation provider for the victim and eats the price difference.

- Results - Fake pump of ETH: This chain of actions causes the price of ETH to increase, creating an extremely sophisticated fake pump situation for the attacker to gain profits through front-running and back-running a degen trader.

Harmful effects of Sandwich Attack


Sandwich Attack data on Eigenphi on December 28, 2024.

Sandwich Attack may not reduce the value of your assets immediately like Rug Pull . Instead, they can be XEM as a tax on inexperienced traders who do not realize that their trades are being manipulated.

In the last 30 days, someone made a profit of up to $1.7 million from sandwich attacks on about 70,000 wallets on Ethereum, with an Medium profit of $10 per transaction.

Causes of Sandwich Attack

In fact, it can be said that the Sandwich Attack method (as explained above) is quite easy to implement. Even if the profits are small, bad actors can use this method continuously without any consequences.

Most of the time when using the Sandwich Attack method, the attacker will often choose to do it through AMM DEX (automated market maker) , because the pricing algorithm of AMM DEXs requires stable liquidation and possible transactions. perform continuously. Besides, it is impossible to ignore the problem of price slippage that occurs when the volume and liquidation of an asset changes.

Because of the many types of fees, users often do not pay attention to the small fees from Sandwich Attacks.

Although the benefits of the Sandwich Attack method are quite attractive, these attacks are not always profitable. Executing trades that attempt to interrupt and front-run/back-run other traders often faces high fees, which go beyond the profits that the attacker can gain, especially when Use Ethereum .

When trading through AMM DEXs, there are risks for users of these services because Sandwich Attacks can occur at any time. As the DeFi market attracts a growing number of users, there are more opportunities for bad actors looking to attack and profit from users.

Ways to avoid Sandwich Attacks

- Limit transactions during peak hours: Avoid making large value transactions during peak hours, especially when the market fluctuates strongly.

- Use support tools: Traders should use slippage detection and protection tools. DeFi platforms are actively integrating anti-front-running strategies such as Flashbots trading to directly connect traders with trusted validators to execute transactions.

- Double check before trading: Users need to carefully check every aspect of the transaction, including Gas Price, exchange rate and amount before making the transaction.

- Do not use an insecure network: An insecure network should never be used when interacting with a liquidation pool.

- Use an order splitting strategy to reduce risk: Some liquidation offer an "order splitting" feature, or users can Chia orders as a risk mitigation strategy, as replacing a large order with Many small orders will limit high-value Sandwich Attacks.

Sandwich Attack Prevention Tool

Flashbots: This is an organization that researches and develops solutions to help minimize the impact of MEV. In particular, Flashbots Protect is a product designed to protect users from front-run transactions and sandwich attacks.

Use AMMs with advanced mechanisms: Some protocols have implemented new AMM mechanisms to prevent sandwich attacks, ensure limited price deviations (usually within 0.1%) and limit Token price manipulation.

Chainlink FSS : This is an oracle solution that helps determine the order of on-chain transactions. Chainlink helps minimize the impact of Sandwich Attacks through the FCFS (First-Come-First-Served) mechanism.

EIP-1559 : This is an update to the Ethereum network, creating a base fee for every transaction. Users can raise gas fees to prioritize their transactions. EIP-1559 helps speed up the authentication process, reducing latency.

MEVBlocker: This software cooperates with Balancer , 1INCH and many other DEX projects, as a software that protects users from MEV attacks. Once installed, MEVBlocker can warn and protect users against front-run and back-run transactions.

summary

Blockchain is being continuously improved and developed to prevent attacks in the form of Sandwich Attacks. However, with current technology, hackers attacking the blockchain in the form of Sandwich Attacks can still occur and this requires stricter security measures to ensure the safety of the network.

Through this article, you must have partly grasped the concept, forms of attack and how to avoid Sandwich Attack. Coin68 wishes you success and earn a lot of profit from this potential market.

Source
Disclaimer: The content above is only the author's opinion which does not represent any position of Followin, and is not intended as, and shall not be understood or construed as, investment advice from Followin.
Like
Add to Favorites
Comments