Price Impact & Slippage
While interacting with Diffusion, it is important to understand Slippage & Price Impact.
Imagine you want to swap 10 USDC for $EVMOS. The info button next to the exchange rate between $EVMOS and USDC gives us additional insight into the swap. Right now, we expect 3.56006 $EVMOS in return, but a minimum of 3.54234 $EVMOS. We see a Price Impact of 0.00% and a Slippage Tolerance of 0.5%.
AMMs do not update their prices like a usual centralized exchange. The pool's prices of the tokens moves as the ratio of the tokens in it changes based on the latest swaps. Arbitrageurs benefit from balancing the pool when the token prices in it diverge from global prices.
Thus, swaps have a direct impact on a liquidity pool by changing the amounts of tokens in the pool. This effect is called Price Impact. The extent of the impact on the pool depends on two factors: Order size & pool type (see AMM Design)
You can envision your interaction with the pool like this. If you sell a token every subsequent token sold will cost slightly less than the previous one. Thus, the bigger the trade, the more significant the effect will be on the price.
While this sounds like the so-called Slippage, it is the true Price Impact. Some say that when you perform the swap, the price of the token your sell "slips" in the pool. However, Slippage is actually the difference between the quoted exchange rate & the actual exchange rate your swap executes at. Most commonly, the difference between the quoted and the execution rates are caused by other swaps being fulfilled between the time of your swap submission and the time your swap transaction is confirmed.
The size of your order compared to the pool size will have a specific price impact. The Diffusion swap pace will do its best to predict the minimum amount of tokens you will receive for each swap. To make sure you receive a number of tokens that are as close as possible to the quoted amount on the UI, you should adjust your Slippage Tolerance to a value you're comfortable with. Slippage Tolerance will ensure that your swap will only go through if the token prices in the pool have not shifted more than the tolerance (by the time your transaction goes through).
Price Impact is the effect of your trade on the pool
Slippage is the difference between the quoted exchange rate & the actual exchange rate your swap executes at