Automated Market Makers and Liquidity Pools: Uniswap vs Balancer

by | Mar 1, 2022

In this blog post, we’ll be examining what automated market makers (AMMs) and liquidity pools are and how they work. We’ll also be examining how different decentralized exchanges (DEXes) utilize them in different ways, namely Uniswap and Balancer. If you haven’t read our blog post on what a DEX is (and the difference between a DEX and a CEX) then you might want to read that post first; you can find it here.

What is a liquidity pool?

Liquidity refers to how easily something can be bought and sold. If the market for an asset is liquid, that means that there is a lot of buying and selling of the asset. Naturally, if a market for an asset is illiquid, then it will be harder to buy and sell that asset.

The term ‘liquidity pool’ refers to funds of a pair of assets that have been deposited into a smart contract for the purpose of facilitating the trade of those two assets. For example, an ETH/BTC liquidity pool would contain an amount of Ethereum and Bitcoin, while a MOBX/USDT liquidity pool would contain an amount of MOBIX tokens and USD tether. There can be multiple liquidity pools for an asset, which would enable that asset to be traded for a range of other cryptocurrency assets.  

AMMs (more on those in a second) require liquidity in order to process market transactions on decentralized exchanges. If there isn’t sufficient liquidity then the market can act in irregular ways. This can take the form of ‘slippage’ or, in the worst case, a ‘rug pull’.

Slippage is the difference between the price of an asset when a trade order is placed and the subsequent value of the asset when the order has been fulfilled. Slippage can be both positive or negative (with a buyer receiving more coins than expected, or less). Slippage can occur during periods of strong demand for an asset (during which time many trading orders are being executed which can drive the price up by the time your order is fulfilled) or during times of asset volatility (with the price movement of the asset waxing and waning rapidly before an order is fulfilled).

An example of there being a strong demand for an asset, and subsequent slippage, in a liquidity pool, is if you are buying ETH in an ETH/BTC pool and many other people want to. This would cause the value of ETH in the pool to increase (see below for an explanation) and thus your buy order would purchase less ETH than you initially thought. Exchanges will typically protect users against slippage (although it is worth noting that they cannot control it) by implementing certain functions that allow users to adjust their ‘slippage tolerance’. This setting will prevent an order from being executed if the slippage has increased beyond the user’s wishes- Uniswap utilizes this function and has it set, by default, to a 0.5% tolerance.

A rug pull occurs when all of the liquidity is withdrawn from a liquidity pool, which causes the entire market for that pairing to halt- as the AMM cannot process transactions without liquidity. This is a worst-case scenario and has never happened for reputable cryptocurrency assets. More often than not, a rug pull will occur when a fraudulent cryptocurrency project has sold enough assets, and the individual behind the project, typically the person providing liquidity, ‘pulls the rug’ and withdraws all of the funds they had deposited to facilitate the trading of their asset. Rest assured; it is very unlikely that most cryptocurrency users will ever experience a rug pull unless they are investing in outright fraudulent assets (often created by anonymous founders).

What is an automated market maker?

An AMM is an underlying protocol that enables most DEXes to function- we touched on how an AMM roughly functions in our linked post above, but, predictably, the actual function of the protocol is a touch more complicated than that. As mentioned in the linked post, AMM facilitates the pricing of assets on a DEX platform by automating the process. This makes it considerably harder for whales to manipulate the price of a specific cryptocurrency on a decentralized exchange.

AMMs are smart contracts that connect buyers or sellers of crypto with the liquidity pool of the crypto that they are interacting with. As opposed to the process of market making on a centralized exchange, in which a buyer and a seller are connected via an order book process, AMMs allow their users to buy or sell directly from the liquidity pool that is already locked within a smart contract.

‘So how does the price of the asset fluctuate?’ you may find yourself asking. Well, AMMs are designed to keep a liquidity pool even, so, as an example, if an individual bought MOBIX from a MOBX/USDT liquidity pool then they would’ve added USDT to the liquidity pool in order to receive their MOBX (which would’ve been removed from the pool in exchange). This would cause the price of the remaining MOBX in the pool to increase in order to keep the liquidity pool level- ensuring that assets are priced according to demand!

This can present interesting opportunities for arbitrage traders, as if suddenly a large amount of a token were sold into a liquidity pool (say a significant amount of ETH were sold into an ETH/BTC pool), the AMM would price the asset lower in order to balance the pool. Thus, the price on the DEX could potentially be lower than the wider market price for the asset.

AMMs are also responsible for managing the incentivization of liquidity pools for liquidity providers (as the more liquidity there is, the less slippage and the healthier the market), being the smart contract that rewards LPs. AMMs incentivize users to deposit crypto assets relevant to the pool by sharing a percentage of the fees paid on transactions made using the pool. If a user had invested BTC/ETH into a BTC/ETH liquidity pool and made up 10% of that pool, then they would receive 10% of the transaction fees. AMMs also reward governance tokens to the LPs, so they can vote on decisions that would affect the pool.

More recently, AMMs can also reward LPs with yield farming tokens – if the asset allows. These ‘LP’ tokens can then be staked on an alternative platform, providing the LP with an additional income on their capital.

The difference between Uniswap and Balancer.

When Uniswap first launched, way back in 2018, it was the first DEX that utilized an underlying AMM. Balancer was also launched in 2018… but the platform was only finalized in 2020. Between the two Uniswap is the more popular of the two, but both offer similar base features for their users. Where they differ, however, is how their protocols operate and, as a result, offer additional features.

The key difference between the two platforms is that Uniswap utilizes liquidity pools that contain two assets while Balancer liquidity pools can contain up to 8 different assets at a time. The assets in these pools are assigned a share of the overall pool value. This is revolutionary in DeFi as it can allow people to provide liquidity with up to 8 different kinds of idle tokens, which can, in practice, allow a user to put their entire portfolio to work. Uniswaps LPs work on a 1:1 basis, meaning that if an individual with 8 different cryptocurrencies wanted to provide LP using all their capital in a Uniswap pool, then they would have to reallocate their holdings to just the two assets in that pool.

Balancer also has two different types of pools- shared and private. Shared pools are open to everyone (like Uniswap pools) and, once created, cannot have their parameters changed (to prevent LPs from creator changes). Private pools allow the creator to retain more privileges- almost like an admin. The creator/pool LP has full control over the tokens in the pool, their weighting, the transaction fees, who can provide liquidity to the pool, and can even pause trades. In essence, private pools allow their creators to almost set up their own currency exchange- if they have the capital- which would allow them full control over their (potentially sizeable) crypto holdings and the parameters of the pool in which they are deposited.

Uniswap, on the other hand, has a considerably larger amount of liquidity available within it’s pools, so users will typically see far less slippage when performing trades. Due to the far distribution of uniswap governance tokens, the community arguably has a lot more control over the DEX than the users of Balancer do – particularly those interacting with private pools.

In Closing

The cryptocurrency world is full of acronyms- and it’s our hope that posts such as this one can inform our readership as to the details of some of the more complex crypto concepts behind these acronyms.

Uniswap and Balancer have different forms of appeal. Uniswap is good for traders wanting to have a reliable degree of slippage, while Balancer’s intuitive pools can allow for more complex trading, staking strategies and will likely appeal to crypto whales who can afford to create their own pool.

MOBIX still has some exciting news coming up! Make sure to sign up to our socials- Facebook, Twitter and Telegram to be one of the first to hear…