Slippage
What is Slippage?
Slippage refers to the difference between the expected price of a trade and the actual price at which the trade is executed. It is common in trading, particularly in volatile markets, and can impact a trade’s profitability.
Higher slippage can occur when the market has low , meaning fewer buyers and sellers can match orders. This can result in larger price movements when executing trades, leading to slippage.
Bots and corrupt validators can also manipulate an asset’s price, causing slippage. This can be detrimental to traders looking to execute trades at specific prices. Due to the public nature of blockchain transactions, malicious actors can monitor the market and exploit price discrepancies to their advantage. When combined with low liquidity, this can result in significant slippage.
Lower slippage is generally preferred by traders, as it allows them to execute trades closer to the expected price. Trading platforms often configure the maximum acceptable slippage, allowing users to set limits on how much price deviation they are willing to accept.
Slippage - Key Concepts
- Price Impact: The difference between the expected price and the actual execution price of a trade.
- Liquidity: The availability of buyers and sellers in the market to match orders.
- Market Manipulation: The intentional distortion of asset prices to exploit price discrepancies.
- MEV Bots: Bots that exploit price discrepancies in blockchain transactions to maximize profits.
- Front-Running: Executing trades ahead of other users to capture price differences.
- Sandwich Attacks: An attack where bots insert transactions between a user’s trade to maximize profits at the user’s expense.
Slippage Calculation
Slippage is calculated as the difference between the expected price and the actual execution price of a trade. The formula for slippage is as follows:
Where:
- Expected Price is the price at which the trade was expected to be executed.
- Actual Price is the price at which the trade was executed.
- Slippage is the percentage difference between the expected and actual price.
For example, if a trader expects to buy an asset at $100 but the trade is executed at $105, the slippage would be calculated as follows:
In this case, the slippage is 5%, meaning that the trade was executed at a price 5% higher than expected.
Liquidity Impact on Slippage
Most automated market makers (AMMs) use liquidity pools to facilitate trades. Liquidity providers fill these pools with assets and earn fees based on the trading volume. The liquidity is determined by the total value locked (TVL) in the contract. The larger the liquidity pool, the lower the slippage, as trades can be executed closer to the expected price.
If the pool has lower liquidity, obtaining the desired amount of an asset can result in significant slippage. The asset’s price can move significantly as the trade is executed, leading to a higher price impact.
Maximum Extractable Value (MEV) Bots
Maximum Extractable Value (MEV) bots are a type of bot that exploits price discrepancies in blockchain transactions to maximize their profits. These bots monitor the network memory pool for pending transactions and prioritize those that offer the highest profit potential. If the bot detects a profitable trade, it will front-run the transaction, execute it before the original user, and capture the price difference.
When colluding with validators, bots can manipulate the order of transactions in a block to their advantage, increasing the likelihood of successful front-running. This can result in significant slippage for traders, as their trades are executed at unfavorable prices due to the actions of MEV bots. Toxic MEV is currently a hot topic in the blockchain space, as it’s a highly debated issue that affects the fairness and integrity of decentralized trading.
Sandwich Attacks
While the public nature of blockchain transactions provides transparency, it also exposes user transactions before they are confirmed. This allows bots to insert transactions between a user’s trade, causing slippage. This practice, known as sandwich attacks, can be used to maximize profits at the user’s expense.
In a sandwich attack, a bot monitors the network for pending transactions. If it detects a profitable trade, it inserts its transaction before and after the user’s trade, capturing the price difference. This can result in significant price differences for the user, as their trade is executed at unfavorable prices due to the bot’s actions.
Multiple ways exist to mitigate the impact of sandwich attacks, such as using privacy-preserving techniques to hide the user’s trade from bots. However, these solutions depend on the underlying blockchain technology and may not be universally applicable.
Validator Corruption
Block validators are responsible for confirming transactions and adding them to the blockchain. While validators are expected to act in the network’s best interest, malicious actors can corrupt them to manipulate the order of transactions in a block. Since they are also rewarded with transaction fees, they can prioritize transactions with the highest profit potential.
This is the most dangerous form of MEV, as it’s impossible to detect or prevent it without a secure consensus mechanism. It causes significant losses for users, as their transactions are ordered to maximize the profits of the corrupt validators.
Neo X MEV Protection
Protection against toxic MEV is a key feature of the Neo X blockchain. Neo X uses transaction envelopes to ensure that transaction results are not revealed until confirmed, preventing bots from front-running trades. This is an important feature for traders, as the MEV problem has caused over a billion dollars in losses for users.
Configuring Slippage Tolerance
Most decentralized exchanges (DEXs) and trading platforms allow users to configure slippage tolerance when executing trades. This setting determines the maximum price deviation a user is willing to accept. If the slippage exceeds the configured tolerance, the trade will be rejected, preventing users from executing trades at unfavorable prices. This feature is particularly useful in volatile markets, where price movements can be significant.
Using low slippage tolerance when executing trades is recommended, as it minimizes risks and ensures that trades are executed closer to the expected price. However, setting the tolerance too low can result in failed trades, as the price may move beyond the configured limit before the trade is executed. In this case, the cost of an asset may continue to move in the opposite direction, resulting in missed opportunities for traders. Therefore, balancing slippage tolerance with market conditions is essential to maximize profits and minimize risks.
Consider using values between 0.1% and 1% for high liquidity assets and up to 5% for low liquidity assets. This will help you to execute trades at favorable prices while minimizing the risk of slippage.
Trading platforms and DEXs often provide slippage tolerance settings in their user interfaces. Users should look for these settings when executing trades.