What is slippage in liquidity pools?
Asked a year ago
I started doing transactions and trading in decentralized exchanges. However, I was warned that slippage might cause me not to get the initial amount shown. Apparently, this is called slippage. But how does this work?
Thursday, April 14, 2022
The math behind AMM is pretty simple if you know the basic rules of Algebra. On centralized exchanges, the price is set by executing a trade at the closest amount you are willing to buy and the closest amount the seller is willing to sell. So if the seller wants to sell their ETH or Ethereum for $3,000 and you are willing to pay $2989 or more, your trade is executed. The spread is the difference between the bid price of $3,000 and the asking price, of $2,989. The exchange can pocket the $11, which is $3,000 - $2,989 as the profit, and also pay those who provide funds to enable the trade known as market makers.
The situation is different on a DEX. Most AMM pools follow the constant product market maker function, X*Y=K, which you can think about as X^0.5*Y^0.5=K^1. So if the pool where you swap from, for example, is a USDC/ETH pool of $9,000, then 1ETH*3,000USDC = $9,000,0000 where both assets must be the same and K must be equal to X*Y. To buy $500 worth of ETH from this pool, you add 500USDC and take out 0.143ETH. Following X*Y=K, the pool becomes 0.857ETH*3,500USDC = $9,000,000. You can now buy 1ETH for $2,571.43 in this pool, and sell it for $3,000 elsewhere. The difference between the initial price of ETH, $3,000, and the new price of $2,571.43 is $428.57. The slippage is $428.57/3,000 = 14.285%.
Saturday, September 17, 2022
Slippage is the percentage difference between the price you filled the position for and the price of the position execution. Most experienced traders and investors recommend keeping slippage to a minimum, making sure that it's no higher than 1%. In liquidity pools, slippage refers to the same price difference.
However, since crypto is a lot more volatile, you're expected to have higher slippage than with other assets - especially if you're trading at a DEX. Whenever a big position is opened, the price of an asset changes, and the liquidity pool might be a bit late regarding the price change. Centralized exchanges (CEXs) have significantly lower slippage, but their initial prices are also quite higher.
Please follow our Community Guidelines