Fees & Slippage
Multiple scenarios can incur different fees, depending on starting chain, final chain, market depth and staking status. While we aim to make the interface as informative as possible, this page is dedicated at explaining some technical limitations and design choices.
Let's start with a real-world screenshot to introduce what can affect the outcome of your trade.
- 1: The amount of sellAsset to swap. UNI Tokens.
- 2: USD value of the sellAsset at the moment of the quote.
- 3: The amount of buyAsset returned by the quote. In this case, the already amount accounts for nominal slippage and exchange fees, but excludes network fees. More details on #9.
- 4: USD value of the buyAsset at the moment of the quote.
- 5: The exchange rate between sellAsset/buyAsset followed by the value of 1 sellAsset, in this case 1 UNI token.
- 6: Total fees you will pay to execute this trade, excluding any slippage.
- 7: The expected amount of buyAsset we expect you to receive in your destination wallet.
- 8: The minimum you are expected to receive if the worst case slippage for this quote occur. By default and in this case, it is set to 1%.
- 9: The sum of the network fees. In this case, the network fee would be paid aside from the trade, in Ether. More details in the swapIn scenario below.
- 10: THORSwap takes a 0.3% fee on trades. 75% of this fee is then used to buy back $THOR tokens from the market and distribute them to the $vTHOR pool. The remaining 25% funds THORSwap's operation. Staking $THOR for $vTHOR currently waives this fee.
- 11: The expected amount of buyAsset we expect you to receive in your destination wallet.
- 12: The excess costs/impact, including transaction fees, of this trade over the slected 1% slippage limit.
- 13: The USD value of the expected outcome of this trade.
Safely transacting accross chains requires data to be written on all chains, resulting in multiple fees. For more details how fees are used on THORChain, please refer to this page. When using the aggregator to swapIn ERC20s to a native asset other than Ether, you will also pay a small network fee to use one of our aggregator contracts.
THORSwap takes a 0.3% fee on trades. 75% of this fee is then used to buy back $THOR tokens from the market and distribute them to the $vTHOR pool. The remaining 25% funds THORSwap's operation. Staking $THOR for $vTHOR currently waives this fee. You can read more about $THOR & $vTHOR here.
Slippage details and limitations
Trading between assets on AMMs often result in slippage. There are several safeguards in place to protect the trades of our users as well as technical limitations in some scenarios. In all cases, the user has final control over the slippage value and may execute trades over the set limit, with a visual warning. The default slippage is 1%.
Let's start with a swapIn from ETH.UNI -> BTC.BTC with a 2% max slippage set by the user. While everything happens with a single signature, this swap would require two legs:
- ETH.UNI -> ETH.ETH (on a an AMM like UniswapV3)
- ETH.ETH -> THOR.RUNE -> BTC.BTC (doubleSwap can be expressed as a single leg for this discussion)
The 2% slippage limit is for the entire trade and not only for a single leg. We calculate a ETH.UNI - ETH.ETH rate from the data our providers send us and use Migard's pools information to get a exchange rate for ETH to BTC. This allows us the calculate the nominal result from ETH.UNI -> BTC.BTC and then set our memo with so that the trade may only complete if it yields the
minAmountOut for this trade.
Let's now explore the opposite trade from BTC.BTC -> ETH.UNI. While the data available is the same, THORSwap's aggregator contracts may not revert a transaction that happened on THORChain. The transaction on the Bitcoin network will take time to be confirmed multiple times and picked up by Thornodes. Significant price changes may occur between ETH and UNI, with no way for THORSwap to stop the incoming BTC transaction. In case the amount of UNI tokens that would be received by the user is lower than the amount set in the
minAmountOut property set in the memo, the user would then receive Ether to their address. Reference: Thornode PR
In order to quickly understand how to make an exchange using the protocol, we suggest you take a quick course: Quick start