Swap Router Explained

Written by Martin J. Maddox
Updated 2 years ago

QuipuSwap employs a multi-hop swaps algorithm. This algorithm routes each swap through an arbitrary number of pools in order to find the most lucrative final exchange rate for the user's transaction.

The best exchange route is shown as you fill out the terms of the transaction:

Moreover, the new protocol consumes less gas for token/token swaps. For example, the swap through 4 pools costs ~0.003 TEZ meanwhile in the previous version the swap through 2 pools would cost 2,5 times more.

It is important to mind the price impact when swapping a large amount in a single transaction. Price impact measures the correlation between the incoming trade and the resulting exchange rate change in the pool. The higher the price impact, the worse the exchange rate will be.

Tez/Token pools have hard-coded a limitation that no more than 30% of the pool's liquidity can be swapped in a single transaction. Token/Token pools do not have such a limitation. Thus if the amount of tokens to be swapped is higher than 30% of the corresponding Token/Tez pool, the trade will be routed through Token/Token pools which usually hold less liquidity and offer worse exchange rates. 

As a result, you will see a 100% price impact and almost no tokens in return. 

When the amount of tokens to be exchanged and the number of hops is large enough it becomes increasingly possible to lose a very large chunk of your assets to the price deterioration.

When in need of swapping a large amount of tokens (compared to the corresponding Tez/Token pool size) it is better to swap in several incremental transactions, carefully minding the price impact percentage or you may use our Temple wallet router DEX, that collects data from many exchanges.

Did this answer your question?