Balancer is revolutionising the AMM landscape, but what makes it so special & why should you be paying attention?
Let’s continue to dive into the epicness of Balancer V2 in the second part of our serenade.
Mega Thread 🧵 Part 2
For a high level summary, the core qualities that make Balancer so innovative are flexibility, efficiency & security.
Balancer has been designed to be modular, innovative & efficient. It blends these qualities into a versatile platform primed for optimal liquidity provision.
In Part 1 we introduced the Vault & outlined some of the reasons why it plays a fundamental role in the foundations for the flexibility of Balancer V2.
In this thread, we will take a look at how the Vault adds towards the efficiency of the platform & talk about the SOR.
Gas efficiency
The vault promotes a gas efficient environment by reducing the number of unnecessary token transfers that need to occur between swaps.
In most cases, each pool on a DEX is an individual smart contract that holds and accounts for all its own tokens.
This means that if a user wants to trade between multiple pools, the tokens need to be transferred from pool to pool at every step.
Multi-hop trading can become costly as tokens need to be transferred at each step of the process increasing gas costs along the way.
The Vault solves this issue by storing all of the pool tokens within a single contract.
This simple yet powerful difference reduces the gas cost for multi-hop trades and allows for far greater swap efficiency.
Instead of transferring tokens at each step of a multi-hop trade, The Vault keeps an internal record of pool balances throughout the life cycle of the batch swap execution.
Only the final amount of tokens are transferred to and from the vault resulting in a significantly more gas efficient, cost effective process.
From the flexibility of customisable AMM logic to the efficiency in gas costs, we should now start to have a good idea for how the Vault is pieced together and how its innovation facilitates so much of the functionality on Balancer V2.
Smart Order Router
We can’t talk about efficiency however, without bringing our attention to another core feature - The Smart Order Router (SOR).
Given that the main goal for a DEX is to facilitate swaps for traders, the SOR becomes an important piece to the puzzle as it lies at the heart of how trade efficiency is achieved on the protocol.
The SOR finds the optimal path for a trade to take place, whether that is a direct swap in one pool, or a combination of trades hopping through multiple pools.
Essentially, the SOR determines if a swap makes economic sense or not and comes up with the best possible path to execute.
By finding the most optimal path for a given swap, the SOR ensures that users are receiving the best value for money when it comes to trades.
We can think about how the SOR works in the following steps:
1. The SOR first sources all the possible candidate pathways available on the protocol for a given trade.
2. The SOR then prioritises these pathways to account for the trade routes that pass through the liquidity pools on the protocols with the deepest liquidity.
3. The SOR will then employ an optimisation mechanism across all the selected pools to find the most optimal trade route resulting in the best overall execution of price. This step takes into account swap fees, pool slippage and gas costs.
4. Finally the SOR sends the optimised swap steps to the Vault as a batch swap where it will be executed.
Consistent with the theme of flexibility, the SOR is designed to adapt with the growth of the protocol. As the number of pools on the protocol expands so too does the SOR.
This ensures that all of the pools on the protocol are integrated with the SOR path finding algorithm, and as such can benefit from the collective liquidity on the protocol.
A great example of this in action would be during the launch of a new token in a Liquidity Bootstrapping Pool.
As the Vault has consolidated, connected liquidity it is possible for users to buy a new token on the platform with a variety of other tokens hosted on the protocol.
It's in the efficiency of the SOR combined with the flexibility of the Vault that we start to see why the Balancer V2 tech stack is so innovative.
Not only do they provide the foundations for an efficient, interconnected trading environment but they also provide the backbone for a platform that is safe, secure and constantly evolving to meet the needs / demands of the market.
We believe @BalancerLabs Labs and the technology behind Balancer V2 are pushing the boundaries for what is possible in DeFi and we are confident in their ability to create and sustain a platform that will not only stand the test of time but excel into the future.
Hopefully you now have a solid understanding of how the core components of the Balancer V2 tech are working together to provide an efficient, secure, customisable platform for decentralised exchange and liquidity provision.
In the next part of this series we will take a look at the different pool types that can be configured on Balancer V2 and their individual use cases / benefits.
In the meantime check in with our growing community over on Discord and get connected: discord.gg/beethovenx
We hope you found this thread useful and informative.
Balancer V2 is truly a masterpiece and it has been an absolute pleasure to work with such innovative technology and a forward thinking team.