TFM Aggregator — the most advanced trading platform across the Cosmos - By TFM Team

TFM is a trading DEX aggregator in Cosmos on Terra, Terra Clasic, and Juno.

TFM Aggregator — the most advanced trading platform across the Cosmos - By TFM Team

Disclaimer - This is part of our outside perspective series. Curious Cosmonaut Research is not the author we are simply highlighting some good threads and perspectives on the Cosmos ecosystem with their permission. We also, therefore, do not guarantee their accuracy.


Author:  TFM Team

Source: Blog

Date: July 7, 2022

TFM’s pro-trading DEX aggregator is now live on Terra 2.0, Terra Classic and the Juno network. It is the first comprehensive aggregator offering unparalleled trading features and experience across the whole Cosmos ecosystem. In this article, we would like to focus on multi-hop and volume splitting, two of the most advanced features that TFM has built to the benefit of the traders, the liquidity providers, and the network as a whole.

Multi-hop

Multi-hop means that the TFM DEX Aggregator will search for all liquidity pools via any possible routes to achieve the best price. This means that the trade could go through multiple intermediary tokens before landing with the final target token to be swapped. These intermediary tokens could be on the same DEX, or on different DEX.

This also means that any pair of tokens can be swapped, even those with no native liquidity pools.

Let’s look at a couple of examples to illustrate this.

Example 1. LUNA -> USDT

In this example, we are swapping LUNA -> USDT. We can see that comparison is made between the three DEX that can facilitate such a trade, and it turns out that TerraSwap produces the best rate, which is what TFM decides to use. As the example shows, doing so with TerraSwap saves 0.224% compared to the next best route.

Example 2. Astro -> LunaX

In this example, we are swapping Astro -> LunaX.

Astro/LunaX is a non-direct pair, which means there are no native liquidities on any DEX. What TFM does is to explore all possible routes which would involve one or more intermediary tokens. In this case, Astro is first converted to LUNA on Astroport, and then LUNA converted to LunaX on TerraSwap. This trade saves 0.328% compared to doing it on Astroport only.

Note that for this trade, even if it were done on Astroport only, it would need to undergo an intermediary token (on Astroport), because Astro/LunaX is not a direct pair.

Example 3. LUNA -> USDT (2nd example)

In this example, we are revisiting LUNA -> USDT swap.

Because the various liquidity pools are constantly changing, the route that offers the best price at one moment may not be the case at the next moment.

In this case, to achieve the best price, LUNA is first converted to USDC on Astroport, and then USDC converted to USDT on Phoenix.

As illustrated above, the multi-hop feature is a powerful tool to ensure any tokens can be swapped with the best rate achievable.

Volume splitting

Another important feature of the TFM DEX aggregator is volume splitting. Sometimes when it is a large trade, the price impact it has on liquidities is not to be neglected. To reduce slippage and help achieve a better price, TFM would split the trade into two or more mini-trades, with each going through its own route which utilises liquidities on different DEX simultaneously. In this way, liquidity pools for the same token pair across different DEX are used in a single trade. This achieves the best swap price and also helps with the utilisation of liquidities on all the DEX.

Example 4. LUNA -> STEAK

In this example, we are swapping 100 LUNA -> STEAK. TFM is using volume splitting to allocate 60% of the trade through TerraSwap and 40% through Astroport. For both allocations we are using the liquidities of the same token pair, namely LUNA/STEAK. As can be seen from the real-time data, volume splitting would save 0.708% as compared to doing 100% on TerraSwap, and save 1.117% as compared to 100% on Astroport.

Example 5. JUNO -> RAW

Let’s take a look at the Juno network and swap 10,000 JUNO -> RAW.

There is only one working DEX on Juno, namely JunoSwap. Even here TFM can give the user the best price by splitting the route into multiple tranches: for example 5% going through JUNO — OSMO — RAW and the other 95% taking the direct swap with JUNO — RAW. The result is that TFM can achieve a better price than the single underlying DEX it is using, which is truly value adding and significant.

Closing remarks

In reality, TFM would use a combination of these features for any trade. The beauty is that the users do not necessarily need to fully understand how these mechanisms work, but can rest assured that they can always have the best swap rate on TFM as compared to any single DEX, or combined use of multiple DEX manually.

Research and trade with confidence, for the best price achievable!

Learn more. Stay updated. Connect with us on social media:

Website: https://tfm.com/

Telegram Channel: https://t.me/tfmofficial

Telegram Community: https://t.me/tfmofficialchat

Twitter: https://twitter.com/tfm_com

Medium: https://medium.com/@tfm.com