What is Balancer? BAL Explained with Animations

whiteboard crypto logo
Published by:
Whiteboard Crypto
on

To put it simply, Balancer is an Ethereum-based application (EVM compatible)—specifically a decentralized exchange—that utilizes a special trading algorithm called an automated market maker that allows traders to swap their crypto tokens in an efficient way. If that sounded like a bunch of mumbo jumbo, don’t worry, I’ll explain it all throughout the rest of this article.

In this article we are going to explain what Balancer is, how it works, and what their automated portfolio manager, or as I call it, a ‘create-your-own-index-fund’ idea is.

What is a liquidity pool and how does it work?

In the world of DeFi and cryptocurrency, we don’t use the old method of making trades. This old method is called an order book model, where a buyer and seller write down what trade they want to trade and then it gets added to a huge list of everyone else’s trades. Essentially, you pick what price you want to buy or sell at, but you can’t be guaranteed when the trade will happen, if at all, because you have to wait around for someone to match with your trade. If you don’t want to wait around, you can look at anyone else’s trade offer and accept it. This way the other person gets to trade at the price they want, and you get to trade at the time you want. Either way, you get to select either the price or the time of the trade, not both. 

There is a newer solution that is much better which doesn’t rely on humans, but algorithms. This method is called an automated market maker. It’ll never run out of assets to sell you. The way an automated market maker works is very complicated, but we’ll try to simplify it for you. First, a pool of money must be created. This pool of money contains two or more assets that someone supplies willingly so that other people can use the pool to trade with. The way the trading happens is all automatic with an algorithm. The algorithm is very simple, and it follows this equation: x*y=K. Without getting too much into the math of it, the way this algorithm works is actually quite simple. As you buy more of one asset, the algorithm automatically charges you more and more for it. Even if you have a trillion dollars to trade with, the pool will never run out of either asset. 

Another way to think about it, and this way is probably better, is that you approach the pool with what you want to sell, and it will tell you how much it can give you based on it’s algorithm. For this example, let’s use a pool of ethereum and USDC. If you go to it and say you want to buy $1 worth of ethereum, it might sell you some ethereum at an average price of $4000. However, if you go to it and want to buy $10 worth of ethereum, it will charge you a higher average price of $4008. Once more, if you go to the pool with $100, it may charge you an average price of $4100 per ethereum, and finally if you approach the pool with $1,000,000, it may charge you an infinitely high amount of USDC to buy ethereum, but the trick here is that the pool will NEVER run out of ethereum. 

Since you interacted with the pool and raised the price, other people may want to come along and sell their ethereum to the pool at the higher price, giving the pool more ethereum, but leaving it with less USDC. Liquidity pools and automated market makers are quite complicated when you’re first understanding them, so I highly recommend watching our specific videos on those topics if you haven’t already, but this chart is a game changer. 

See this curve? It’s the x*y=K formula. You can think about any purchase using the liquidity pool with this curve.

If you give the pool this much of asset A, it will return you this much of asset B.

The same goes for if you give it this much of asset A, it will give you barely any asset B, and finally if you give it a ton of asset A, even if there’s plenty of asset B in the normal curve range, it won’t give you much. 

We’ve gotten this far into the video about Balancer and haven’t even talked about it yet! In fact, everything I’ve talked about and explained is applicable to how many popular decentralized exchanges work, including Uniswap, Pancakeswap, and Sushiswap. So, what makes Balancer better? 

Multi-asset pools

Well, with Uniswap, Pancakeswap, and Sushiswap, you can ONLY deposit 2 assets. In the very beginning of this technology, each of these pools had to contain ethereum. So you could have a USDC/ETH pool and a BAL/ETH pool, and to get from USDC to BAL, you’d have to make 2 swaps. Eventually the developers got fancy and realized they could allow users to set up any pool they want, so something like a USDC/BAL pool was possible. Even more so, they realized they could hook up a ton of pools together automatically so anyone can trade from one token in a pool to any other token in any pool at ease, and this is called routing. 

Balancer, though, takes this further one more step. Instead of just letting you deposit 2 assets into a pool, they let you add up to 8 assets into a pool. The math behind these multi-asset pools is called Weighted Math and it is designed to allow for swaps between any assets whether or not they have any price correlation. Prices are determined by the pool balances, pool weights, and amounts of the tokens that are being swapped. Balancer’s Weighted Math equation is a generalization of the x∗y=k constant product formula, but accounting for cases with more than 2 tokens as well as weightings that are not an even 50/50 split.

Portfolio manager and crypto index funds

One of the most interesting things this allows us to do is create a synthetic index fund of crypto tokens that will automatically manage itself and rebalance itself as needed. So you can easily create your very own pool of 4 or 5 assets that you want to hold long term, and let people use that pool to trade with. 

There are two things I forgot to mention about how automated market makers work earlier. The first is that simply by letting traders use your funds to make swaps with, you earn money. How? Well, when you set up the initial pool of assets, you decide on what fee the traders should pay, because hey… they’re using your money! This fee is usually very low, but when a TON of traders use a TON of money every day for a year, it can add up. So your portfolio will earn somewhat of a dividend as other traders use it to rebalance the prices.

The other thing I forgot to mention is a scary term for new investors called “Impermanent Loss.” I don’t have time to explain impermanent loss, and I already have a video explaining it that’s been really helpful to many beginners.

Different ratios

Another feature of Balancer that is unique is they allow you to create pools with customized weights. All Uniswap, Pancakeswap, and Sushiswap pools are 50/50, weighted half and half. Even the aTriCrypto pool that’s found on Curve Finance, used by thousands of people has 3 assets, but is divided into equal thirds. Balancer lets you create your own pools with custom ratios, so I could set up an 80-20 one, or a 10-10-10-70 one, or even 95-5. This allows even more customization when it comes to setting up your own little index fund pool.

Regarding Impermanent loss, pools with strong assets having a higher percentage usually result in less impermanent loss. Here’s a nice chart where you can see how common ratios affect impermanent loss: 

The trade off of this impermanent loss is usually a higher slippage amount for traders, essentially the result of less liquidity for the tokens with less weight.  

Liquidity Bootstrapping Pools

Another really cool thing that Balancer allows, is automatic rebalancing of certain assets. Usually, all assets are 50/50 or 25/25/25/25, or any of the custom ratios I talked about earlier, however Balancer has another pool type called Liquidity Bootstrapping Pool (LBP), which is a pool primarily used for newly created tokens or projects. The idea is that they generally start a pool with 90% of a highly liquid or trusted coin and 10% of the new project’s coin. This way most of the pool contains trusted funds to start with. The project will also select an ending weight, typically 50/50. One of the last primary steps is to set a specific time frame to run the LBP, could be days, weeks, or even months. Once the LBP begins the ratio of assets will change over the specified time period. The price of the project’s new coin starts high and will drop until there are buyers. This allows the market to find the appropriate price and seeks to weed out frontrunning and allow for a more fair pricing model. Again, the math behind this and impermanent loss calculations are quite complicated, but what it means for you is that you can more efficiently purchase new tokens with a lower overall risk and a more fair opportunity for all investors. This is actually one of the most successful—if not the most successful—way to launch a new token.  

BAL token 

Balancer has recently moved to a few different networks than just Ethereum. Balancer V2 contracts were first launched on Mainnet on April 20, 2021 and the UI was launched on May 11th, Polygon on July 1 and then Arbitrum on August 31. There’s even a fork of v2 on Fantom already.  

Distribution: the maximum supply of BAL tokens is 100 Million. Around 35 million (35,435,000) BAL was minted at token launch. The remaining ~65 Million can be distributed to liquidity providers, however the ultimate amount distributed is up to BAL holders by proposing suggestions and voting on them in a DAO style.

The BAL token was one of the very first governance tokens in the whole world of DeFi, and right now that’s exactly what they’re for—governance; native staking contracts are being worked on. Until then, you can deposit BAL in a few pools across different chains to earn more BAL. 

BAL Grants

The Balancer Team also has a grants program where developers can apply for funds to further their project’s goals. 

whiteboard crypto logo

WhiteboardCrypto is the #1 online resource for crypto education that explains topics of the cryptocurrency world using analogies, stories, and examples so that anyone can easily understand them. Growing to over 870,000 Youtube subscribers, the content has been shared around the world, played in public conferences and universities, and even in Congress.