Swappers can exchange assets – either an external asset for the native asset like Binance Coin for Rune or 2 external assets like BNB for Bitcoin. Swaps are made across liquidity pools. The larger the value of the liquidity pools, the lower the slippage cost to Swappers.
You can swap between—
Swaps happen between assets in liquidity pools.
Swappers may experience a loss of value during a swap – that is, the assets the receive may be worth less than the value they sent. This is called Slippage.
We're going to swap using a pool that has $2.5m worth of BNB and $2.5m worth of RUNE. When we swap, we take RUNE out from the pool, and add BNB into the pool.
We're going to swap 500 BNB. For that, we'll receive 93.3k RUNE.
At the time of writing, 1 BNB is worth $15.01. So the value of the BNB we're swapping is 500 x $15.01 = $7,505. On the other hand, 1 RUNE is currently worth $0.08. So the value of the RUNE we'll receive is 93.3k x $0.08 = $7,461.
So you swap in $7,505 of BNB and receive $7,461 of RUNE. Why do we receive less than we put in? This is called Slippage and is a by-product of the system. When you swap assets, it causes the price to change.
Here you can see Slippage as a proportion of BNB/RUNE swap value.
As we increase swap value, the Slippage increases.
Slippage is affected by the proportion of Swap Value to Total Pool Value.
If Swap Value is high relative to Total Pool Value, Slippage will be high.
If Swap Value is low relative to Total Pool Value, Slippage will be low.
This is why it is important to have a lot of value in liquidity pools.
This is also why it's important that THORChain gives rewards to Liquidity Providers. Otherwise it would be difficult to create high value – "deep" – pools. If pools didn't have a lot of value, slippage would be high and THORChain wouldn't be an attractive place to swap assets.
THORChain also enables users to swap between external assets. For example, to swap BNB for BTC.
Whereas swapping between external assets and RUNE only requires 1 pool, swapping between 2 external assets requires 2 pools. This is because RUNE acts as an 'settlement' asset in the middle. To swap from BNB to BTC, you first swap between BNB and RUNE in the first pool and then RUNE and BTC in the second pool.
Let's run through another example.
We're going to swap 500 BNB. For that, we'll receive 1 BTC. Note these numbers are based on the exchange rate at time of writing, April 2020.
1 BNB is worth $15.01. So the value of the BNB we're swapping is 500 x $15.01 = $7,100. On the other hand, 1 BTC is currently worth $7,001. So the value of the BTC we'll receive is 1 x $7,001 = $7,001.
So you swap in $7,100 of BNB and receive $7,001 of BTC. As with the BNB to RUNE swap in the previous example, there is a Slippage of about $99.
This Slippage also depends on the amount of BNB being swapped in relation to the total size of the swap pools.
If BNB Swap Value is high relative to Total Pools Value, Slippage will be high.
If BNB Swap Value is low relative to Total Pools Value, Slippage will be low.