What Is Slippage and How To Avoid Slippage On DeFi Exchanges

Jul 31, 2021

What Is Slippage? How To Avoid Slippage On DeFi Exchanges

Decentralized exchanges are flat-out amazing.

Every day, billions of dollars worth of crypto trade hands without intermediaries, authorities, or centralized exchanges. If that isnt revolutionary, what is?

But despite the massive upsides of decentralization, DEXtrading has shortcomings that havent been ironed out yet. Slippage is one of them. In a nutshell, slippage is the price difference that occurs between a cryptocurrencys quote price and paid cost.

Slippage on Uniswap and other popular DEXes is a pain, but it doesnt have to be.

This guide to understanding slippage and avoiding it on DeFi exchanges like Uniswap & PancakeSwaphas everything you should know.

What is slippage?

Slippage is the price difference between when you submit a transaction and when the transaction is confirmed on the blockchain. Two scenarios create slippage when trading on a DEX, so lets cover them.

Price slippage caused by high trading volume

To use a concrete example, think of swapping ETH for UNI on Uniswap.

When you connect to the Uniswap app and populate the fields with your trade, the swap interface tells you how many UNI tokens youll receive for the amount in ETH.

In the screenshot above, you can expect roughly ~122 UNI tokens for 1 ETH if you swap right away. Now, why is this last point in bold? Because of slippage.

You see, decentralized exchanges are all hosted on blockchains like Ethereum, Binance Smart Chain, and Solana. So unlike centralized exchanges, a DEX trade doesnt process instantly.

The point is there’s a lag time between when you confirm the transaction and when the blockchain confirms the transaction. Between those two confirmations, the price of the asset can change a little or a lot.

Most of the time, slippage has a tiny impact on price. Taking the Uniswap example above, perhaps the app quotes you ~122 UNI tokens, but you end up with 121 UNI, or if youre lucky, more than the quoted swap.

But when the market for a particular cryptocurrency is hot, or theres tons of trading action (i.e., during a bull market), slippage becomes more pronounced. Instead of receiving 122 UNI tokens, you might get 118.

Price slippage caused by low liquidity

Decentralized exchanges are really just protocols that crowdsource liquidity and provide smart contracts that enable users to trade with that liquidity.

The liquidity indecentralized exchanges is held in liquidity pools. Each pool has a 50/50 split of two crypto-assets (except Balancer multi-asset pools).

When you trade on a DEX, youre effectively depositing one token in the pool and withdrawing another. The larger your trade, or the more overall trading volume with the pool, the more the liquidity in the pool becomes imbalanced and creates price slippage. For instance, if you want to swap 10,000 ETH for UNI, the price per UNI token will rise relative to the quoted price, depending on how much liquidity the pool holds. The less liquid in the pool, the more your trade will be impacted by slippage.

Slippage can be really annoying. No one likes to get fewer tokens than they expected.

How can you avoid slippage when trading on Uniswap or the other major decentralized exchanges? Well share a few strategies for preventing slippage below.

How to avoid decentralized exchange slippage

Remember that price slippage happens in the moments between when you confirm a transaction and when said transaction confirms on the blockchain. If the blockchain is backed up with tons of transactions, miners prioritize and process the transactions paying the most gas. From this simple fact follow a few remarkably effective ways to reduce slippage.

Use more gas

Getting hit with slippage is common when block space is scarce, and everyone is trying to get their transaction processed. If you use low or standard amounts of gas during times like these, your Uniswap trade might be stuck in pending for hours. The longer your transaction is stuck in processing mode, the more prices can change, potentially leaving you with fewer tokens in return. To avoid scenarios like these, bump up the gas on your transaction.

You dont have to overdo it and double the high gas amount, but it doesnt hurt to at least match the current fast gas fee. Two invaluable resources when trying to figure out how much gas to pay are:

  • Etherscan Gas Tracker

  • ETH Gas Station

Using a fast gas payment means your transaction gets settled right away, leaving less wiggle room for slippage to impact your trade.

Trade on a Layer 2 solution

If youre getting the feeling that price slippage has a lot to do with how fast your transaction gets confirmed, youre spot on. The previous tip suggests you pay more gas which, while helpful, also makes your trade more expensive overall.

Because of the rise of Layer 2 scaling solutions, you dont have to pay more to get a fast transaction. Layer 2s have the opposite effect of making your transaction far cheaper than on Ethereum.

What Layer 2 does is it rolls up bunches of Ethereum transactions away from the main Ethereum chain, then submits them in a big batch later. This way, everyone splits the big transaction’s cost, making the individual transactions themselves very cheap.

The other upshot to L2 solutions is they process transactions instantly. By taking microtransactions off the main Ethereum chain, L2s dont rely on Ethereums processing speeds.

Polygon, Arbitrum, and Optimism are examples of popular Layer 2 rollups integrating with your favourite decentralized exchanges. Uniswap V3 has already committed to using Optimism, while Polygon-based Quickswap is another solid option for minimizing slippage on all but the largest trades.

Adjust slippage tolerance levels

Most decentralized exchanges give you the option to adjust slippage tolerance. You can increase or decrease your slippage tolerance percentage for different situations to make sure your transaction gets picked up.

Uniswap lets you easily adjust your slippage by clicking the settings symbol on the swap interface.

If youre trading during the peak time for a given market, expect slippage % to swing fairly dramatically. If you set your slippage tolerance too low, your transaction wont get confirmed because it keeps hitting outside your mark.

On the other hand, setting your slippage tolerance too high might leave you susceptible to paying more per token than you intended. The amount of slippage tolerance thats right for you is highly personal and depends on your larger strategy.

Something to keep in mind is if your slippage is set too low, it can cause repeated failed transactions that still eat your gas. So be mindful of ensuring your transaction works the first time — especially if the exchange is busy.

Bonus tip: Break up large buys into smaller chunks

If youre trading with size, slippage can cost you quite a chunk of cash. In some cases, the difference in slippage when trading 1 ETH vs 100 ETH can be as much as 10%.

Some crypto traders have had success breaking large buys up into several smaller transactions. Youll pay more in gas doing multiple transactions versus a single one but might come out ahead after factoring in savings from avoiding slippage.

To maximize the effectiveness of this approach, trade during off-peak hours when gas prices are low or use a Layer 2-based decentralized exchange with decent liquidity.

Articles authored by brugu softwaresolutions

Published: Aug 7, 2021

Published: Jul 27, 2021

Published: Jul 22, 2021

Published: Jul 13, 2021

Published: Jul 1, 2021

Published: May 26, 2021

Published: May 24, 2021

Published: May 19, 2021