๐ฏ DeFi: Understanding Slippage
๐ Slippage in DeFi refers to the difference between the expected price of a trade and the price at which the trade is executed. It's a concept that exists in both centralized and decentralized trading, but in the context of DeFi and automated market makers (AMMs) like Uniswap or Sushiswap, slippage plays a significant role due to the way these platforms determine asset prices.
๐ Unlike traditional exchanges that use an order book to determine prices based on buy and sell orders, Automated Market Makers (AMMs) use liquidity pools and mathematical formulas to determine the price of assets.
๐ The price of an asset in an AMM is derived from the ratio of the assets in the liquidity pool. For instance, if you were to buy a large amount of Token A using Token B in a specific liquidity pool, you would be adding more of Token B and removing some of Token A from the pool. This changes the ratio of the two tokens in the pool and thus the price of Token A in terms of Token B.
๐ When a large trade is made relative to the size of a liquidity pool, it can significantly shift the price. The greater the trade's size, the more substantial this price shift can be. This phenomenon, which often results in slippage, is referred to as "price impact."
๐ When you execute a trade on an AMM platform, you'll typically see an estimated price. However, if there's a large trade or if the network is congested and your transaction takes time to process, the actual execution price can differ from the initial estimate, resulting in slippage.
๐ To combat the risks of excessive slippage, many DeFi platforms allow users to set a "slippage tolerance". If the slippage exceeds this set percentage, the transaction will fail and not be executed.
โฝ It's important to note that failed transactions due to slippage still consume gas fees on networks like Ethereum, so users must be cautious when setting their slippage tolerance.
๐ก In conclusion, slippage in DeFi is the difference between the expected and actual price of a trade, primarily resulting from the unique price determination mechanisms of AMMs and the liquidity available in pools. Users should be aware of potential slippage, especially when making large trades or trading in less liquid pools.
Image by macrovector on Freepik


