How THORChain’s Swap Queue Prevents MEV

THORChain logo
THORChain

2026-08-12 — 5 min read

    Guide
THORChain article thumbnail explaining how the Advanced Swap Queue prevents front-running, back-running and sandwich attacks by ordering trades on slip-based fees rather than gas bids.

Maximal extractable value (MEV) is one of the most costly problems facing DEX traders, causing an estimated $60 million in annual losses. Validators and bots can extract value by manipulating the order in which transactions are executed.

THORChain addresses this through an alternative execution model designed to make these attacks unprofitable. Let’s explore how MEV works and how THORChain prevents it.

What Is MEV?

Maximal extractable value (MEV) is the profit that validators, block builders, or bots can make by changing the order in which transactions are processed.

When a trader submits a transaction on a chain like Ethereum, it enters a public waiting area called a mempool. Because pending transactions can be seen before they’re executed, bots can identify large swaps that are likely to move an asset’s price.

Block builders then select which transactions to include and determine their order within the block. This allows bots to pay block builders to position their transactions before or after the trader’s swap and profit from the resulting price movement through strategies such as front-running, back-running, and sandwich attacks.

Front-running occurs when an attacker identifies a pending transaction and submits another transaction with a higher gas fee, ensuring it’s processed first. The attacker aims to benefit from the price movement that the original transaction is expected to create.

Back-running occurs when an attacker places a transaction immediately after a large trade. By anticipating how the first transaction will affect the market price, the attacker can trade on the resulting movement.

A sandwich attack combines both strategies. The bot first buys an asset ahead of the user, pushing its price higher. The user’s swap then adds further buying pressure, inflating the price even more while causing the user to receive fewer tokens than expected. The bot subsequently sells the asset at this higher price and captures the difference between its purchase and sale prices.

For example, suppose a bot buys a token at $10 immediately before a large user swap. The bot’s purchase pushes the price to $10.20, and the user’s trade then raises it further to $10.50. The bot sells at the inflated price, earning a profit of $0.50 per token, while the user receives fewer tokens because their swap executed at a worse price.

The user doesn’t usually see this extraction as a separate fee. Instead, it appears as worse execution and greater slippage. The bot’s profit, therefore, comes directly from the additional price impact imposed on the user.

This activity has been costly for traders. Cointelegraph reported that sandwich attacks on Ethereum have resulted in approximately $60 million in annual losses. The research also found that between November 2024 and October 2025, there were between 60,000 and 90,000 sandwich attacks per month.

Why THORChain Prevents MEV

On THORChain, every swap goes through the Advanced Swap Queue. Nodes can’t choose which swap is executed first. Instead, the protocol automatically orders swaps based on the slip and liquidity fees they generate. Larger trades create more price impact, pay higher fees, and receive greater priority.

This prevents front-running. An attacker can’t place a small trade ahead of a user simply by paying more gas. To move ahead in the queue, the attacker would need to submit a larger trade than the user. That trade would create a substantial price impact and require the attacker to pay a high liquidity fee.

Back-running is also impossible because the attacker can’t guarantee that their second trade will execute immediately after the user’s swap. It must enter the queue and follow the same rules as every other trade. When it executes, the attacker must pay another liquidity fee and absorb more price impact.

For example, an attacker might try to buy an asset before a large user swap and sell it afterward at a higher price. On THORChain, the first trade would be expensive to move ahead of the user, while the second trade couldn’t be guaranteed to execute directly afterward. The fees and price impact on both trades make the strategy unprofitable.

THORChain’s introduction of dynamic minimum fees doesn’t change this protection. The update only adjusts the minimum fee collected while swap priority still depends on the trade’s size relative to the pool and the slip-based fee it generates.

Conclusion

By design, THORChain doesn’t allow nodes to decide the order in which swaps are executed. This removes the opportunity to manipulate transaction ordering, addressing a problem that continues to affect users on other blockchains and for which solutions such as private mempools serve only as a patch.

For users, the consequence is simple: no one can extract value by moving ahead of their trades, and every swap is executed according to the same transparent rules. This creates a fairer trading environment in which users are protected from the hidden costs of MEV.

It’s also important to note that the swap queue doesn’t prevent ordinary arbitrage. Traders can still profit from price differences between THORChain and external markets after a swap, helping to bring prices back into alignment. However, they can’t manipulate the queue to place a smaller trade ahead of a user’s transaction and extract value from it.

Try the World’s Leading Bitcoin DEX

No sign up required. Easy to use.