Discover more from Economics Design Newsletter
Price slippage as a financial risk in AMM based DEX
Welcome, subscribers! Thank you for subscribing. What will be shared today and the days ahead are alpha from our Economics Design's researchers. Please keep these mails secret and do not share them with any one because these alpha are confidential. Enjoy your reading.
Disclaimer: This is not financial advice
The term price slippage is nothing new. It has similar definitions in both traditional finance and defi, referring to the percentage difference between expected and actual price of a transaction when it is executed. In general, price slippage poses a relatively greater risk in decentralised transactions than traditional centralised trading due to the different level of trading volume and sources of liquidity. In DEX that use automated market makers (AMM) to execute transactions, price slippage results from changes in liquidity of the relevant assets, which causes a different price to be determined by the algorithm. While price slippage is usually a small percentage, it poses a significant source of financial risk for DEX. A high level of price slippage can increase user’s cost in carrying out a transaction, cause wastage of gas fees and may hinder future trading decisions. These would subsequently affect the protocol in earning fees from providing transactions, and bring instability to the revenue stream.
In this article, we will discuss where does price slippage come from, how it forms as a source of risk for users and protocols, and a simple way of estimating slippage.
Source of price slippage
For DEX that are based on AMM mechanism, price slippage is an inevitable result of how transactions work. In these exchanges, liquidity providers deposit an equal value of two tokens into the liquidity pool to earn rewards, and these assets are used to provide liquidity for transactions in the exchange. The major mode of transaction - swaps between a pair of tokens, is carried out through subtracting the number of tokens in one liquidity pool, and addition of a corresponding number of tokens in another. Prices are determined purely on the number and value of tokens stored in these internal liquidity pools. Thus when the amount of liquidity changes, the AMM is likely to come up with different prices for the same transaction, and this difference is called the price slippage.
In between the time where a transaction price is quoted and actually executed, the token with higher proportion of total liquidity among all pools is likely to be cheaper due to higher supply. Conversely, if the token’s liquidity has decreased within this period of time, it is likely to be assigned a higher price.
With such mechanisms of transaction, we reasonably expect price slippage to be greater when the size of single transaction is larger, as it results in a greater change in ratio of asset proportions, and also when at least one of the assets involved have relatively low liquidity.
Why is price slippage a concern?
The most direct impact of price slippage is that it may make transactions more expensive. This increases user’s cost to execute transactions and may affect their willingness to carry out similar transactions in the future.
On a broader scale, excessively high slippage over a long period of time may result in false fluctuations in price and inflate trading volume, making it an overestimation of the actual market demand. As explained above, price slippage can occur in both directions. In cases where a swap of token A for token B is prone to high slippage, the reverse direction of swapping token B for token A is likely to have low or even negative slippage. This results in potential profits for arbitrageurs who come in for profits, and boosts up transaction volume within a short span of time, even though there may be no increase in the demand for a particular token in the market.
For protocols, high price slippage may also increase the probability of failed transactions. Many DEX today offer slippage mitigation measures to prevent their users from executing transactions that are beyond their worst expected cost. Users are able to indicate a slippage tolerance when submitting orders for transaction. Transaction will only be successfully carried out if the slippage of execution price is within their tolerance, or else the system will resend the transaction during the valid time period until it is executed, or transaction has expired. While this protects users from facing unexpected financial losses, it may cause the protocol to earn less income from transaction fees.
In the long term, prolonged periods of high slippage may also hint that the amount of assets held in liquidity pools are not properly aligned with the actual demand for token. This could be due to an insufficiently attractive reward scheme for liquidity providers, or there could be excessive influence from the macro market on token prices. Hence price slippage can be interpreted as an indicator of other risks relevant to structure of the protocol.
Calculation of price slippage
As stated by its definition, price slippage is simply calculated as the percentage difference between actual executed price and expected price of a transaction.
$Price slippage = (executed price - expected price) / expected price * 100%$%
Formula 1. Calculation of price slippage
Estimation of price slippage
Although the calculation is price slippage for single transaction is simple and straightforward, the exact slippage occurred for each transaction is usually not stored in transaction data that are queried from the blocks. Hence in order to carry out analysis on historical slippage of swap between two tokens, we need historical time series data of transactions, including the direction of swap, quantity of tokens traded, value at time of transaction (simply calculated as the product of quantity and token price).
A potential way to estimate historical slippage is the change in unit price of consecutive transactions of the same token pair in the same direction, where unit price is calculated through dividing value of transaction by quantity of token that is being traded for.
Estimating historical slippage on Sushiswap
Using the method above, we estimated historical price slippage for the top 10 token pairs by liquidity value on Sushiswap for the one month period of May 2022. Below is the result of average slippage per transaction, not accounting for transaction fee and gas fees.
Fig 1. Average slippage for top 10 pairs by liquidity on Sushiswap
Fig 2. Chart of average slippage for top 10 pairs by liquidity on Sushiswap
We observe that average slippage for most of token pairs are negative, meaning that newer transactions have less unit cost than older ones. This is possibly due to the decreasing trend of token prices in the external trading market, which also drives down prices in decentralised exchanges. Comparing with value of liquidity pool and transaction volume, we also see that average slippage is generally higher when volume is lower.
Fig 3. Liquidity and volume of top token pairs by liquidity on Sushiswap
Price slippage is a complex yet important source of financial risk exposure for DEX that are based on AMM. The unique way of transaction that is supported by deposits in liquidity pools and automated determination of prices make price slippage an inevitable risk for both users and protocols. Although slippage mitigation measures can help to protect users from excessively high cost of transactions, it does not solve the problem if slippage is due to imbalances within the protocol’s design and macro-market factors. This article serves as a simple introduction to price slippage and how it is a form of risk, and we see there are still many areas to expand into, such as more accurate estimation models that account for quantity of transaction and transaction fees, and the long term impact of high slippage to protocols.