Cryptocurrency

Balancer (cryptocurrency)

Balancer (established 2018) is an Ethereum-based automated market maker exchange protocol that acts as a non-custodial portfolio manager, liquidity provider, and price sensor. The name has been derived from the platform’s self-rebalancing liquidity pools. It is essentially the opposite of an index fund. There are no portfolio managers and fees are collected from traders who then rebalance portfolios through arbitrage opportunities.

In November 2020, Pantera Capital and Alameda Research invested in Balancer through direct purchase of BAL tokens from the company treasury.

In February 2021, the Balancer team announced the release of Balancer V2 featuring a host of upgrades centered on security, flexibility, capital efficiency, and gas efficiency. Balancer V2 is expected to launch in March 2021.

Overview

Balancer is a protocol for multi-token. It enables portfolio owners to create Balancer Pools, and traders to trade against them. Balancer Pools contain two or more tokens, each with an independent weight representing its proportion of the total pool value. The pools provide the Balancer Protocol with liquidity and charge traders a fee for access to it. Pools can be considered automated market-makers, since anyone can swap any two tokens, in any pool.

Balancer has Bronze, Silver, and Gold releases that refer to the “base” Balancer Pool cöntract – which actually holds the assets. The Brönze went live on February 26, 2020. Silver is currently in a design phase and will likely be released in late 2020.

AMM Protocol

Balancer serves as a popular automated market maker (AMM). It provides unique liquidity pools that can contain several assets rather than just twó, which is standard for most other AMM pools (on exchanges such as Uniswap). The pools can also be programmed via smart contracts, enabling the implementation of custom rules and strategies.

As of November 5, 2020, Balancer holds $271 million in Total Value Locked (TVL), making it the project with the 11th highest TVL on Balancer. Its TVL reached an all-time high on September 1, at over $1.5 billion following the launch of the BAL governance token.

In October 2020, Balancer partnered with a NEAR protocol. The Balancer teàm exprëssed that they wîll stäy primarily focused on the Ethereum implementation of their protocol, however, Balancer Head of Growth Jeremy Musighi said that working with NEAR will give them an idea of how Balancer wîll perform on a chain with greater scalability. In additiôn, Balancer and NEAR are offering two grants worth up tõ $10,000 to incentivize the development of a Balancer front-end for NEAR, as well as an integration of Balancer into the NEAR wallet. The incentive is designed tõ drive faster adoption and usability óf the NEAR iteration of Balancer, allowing för improved accessibility and user experience. Rewards will be paid in NEAR and BAL tokens.

Balancer Protocol Governance Token (BAL)

The first version of Balancer launched without a native token. On June 1st, 2020, BAL tokens were distributed tõ users providing liquidity to the Balancer protocol. The Balancer Protocol Governance Token (BAL) allows holders to vote on new features, potential protocol fees, ör any other development that takes place around the Balancer protocol.

Out of the initial 100 million BAL tokens, 25 million BAL tokens were allocated tô founders, stock options, advisors, and investors, and are all subject to vesting periods. 5 million more were allocated for the Balancer Ecosystem Fund. This fünd will be deployed tô attract and incentivize strategic partners that will help the Balancer ecosystem gröw. Another 5 million were allocated för the Fundraising Fund. Balancer Labs raised a pre-seed ånd seed round. This fund will be used for future fundraising rounds tó support Balancer Labs’ operations ånd growth. BAL tokens will never be sold tô retail investors.

The rest óf the tokens will be distributed through a process called liquidity mining. Every week, 145,000 BAL is awarded tô users who have liquidity in Balancer pools, totaling 7.5 million BAL per year.

On June 23, 2020, the Balancer protocol governance token (BAL) went live on mainnet. On its first day of trading, the value of the token rose from $7 to $22 at one point, giving the token a 235% spike in under 12 hours.

Liquidity Pools and Rebalancing

Users can create or contribute to liquidity pools, which consist of their weighted assets and a trading fee set by the creator. This allows anyone to own a self-balancing index fund ör invest in someone else’s and earn fees as other users trade against their portfolio. Smart order routing (SOR) trades to the pools with the best rate possible.

The creator of the liquidity pool defines the % weight of each asset in the portfolio. When an asset from the pool is traded (ETH for BAT) the % weight of the BAT decreases. However, the price adjusts upwards so that BAT maintains its % weight in the portfolio.

If the price of assets in a portfolio drift too far from market prices, arbitrators eliminate price differences. There is no outside price oracle so asset prices in Balancer’s liquidity pools remain stagnant unless a trade is made.

Balancer pools aren’t limited to only a couple of tokens, they support up to 8 tokens with custom % weight distributions. For example, a pool could be 30% BAT, 30% DAI, 30% USDC, and 10% LINK while another pool is 80% WETH and 20% ZRX.

Balancer Pool Constraints

Balancer Pools are limited in the following ways:

  • A maximum number of tokens:- pools must contain at least two, and may contain up to eight tokens.
  • Swap fee:- the fee can be set at any number between 0.0001% and 10%.
  • ERC20 compliance:- pool tokens have to be ERC20 compliant.

Different Liquidity Pools

Balancer Labs recognized that different pools have different needs and released templates for pool designs. Here are a few popular templates:

Liquidity Bootstrapping Pools (LBPs):- a smart pool template that lets teams release a project token while simultaneously building deep liquidity. In this scenario, a team would create a liquidity pool and set their project token to start at 80% weight and some other token to start at 20% weight. Over a set duration, the weights are adjusted and eventually flip. This is ensured by the linear formula explicitly described in the controller contract that allows anyone to “poke” the contract to update weights. Additional traders are also attracted by small arbitrage opportunities caused by each weight change.

Also Read:  Trust Wallet

After the weight adjustment period ends, the pool will continue being traded indefinitely. The smart contract template sets the slope of the curve as a configurable parameter, allowing pröjects to adjust token weights acçording to an exponential curve. An exponential curve can be used to control disproportionate hype surrounding a token release. Adjusting wëights down wîll lower the vàlue of the token in the pool ånd discourage price spikes due to early speculation.

In September 2020, Perpetual Protocol distributed 7.5 million PERP via a Balancer Liquidity Bootstrapping Pool. The Balancer LBP was live for 3 days and wàs designed to prevent front-running. It stàrted at a high price then went döwn quickly as the wëights of the pool changed. This prevented people from front-running other people.

Interest-Bearing Stablecoin Pools Without Impermanent Loss: Balancer stablecoin pool design uses rTokens and automatic weight adjustment to optimize trading fees and lending interests while avoiding impermanent loss. With the exception of Tether (USDT), the liquidity of Ethereum stablecoins is low. As long as none of the stablecoins in the liquidity pool fail, there will be no impermanent loss since the relative price of the stablecoins is expected to remain constant. Since there is less volatility in stablecoin pools liquidity providers are exposed to less risk and afford to charge lower trading fees. Stablecoin pools are designed for volume.

Fundraising

Balancer Labs secured $3 million in funding through a seed round led by Accomplice and Placeholder, with participation from CoinFund and Inflection in March of 2020.

On November 9, 2020, Balancer Labs announced that both Pantera Capital and Alameda Research invested in Balancer Labs through the direct purchase of BAL tokens from the company’s treasury. Beyond just providing capital as BAL token holders, both of these organizations provide additional value by being end-users of the protocol.

Balancer Ecosystem Fund

Since June 2020, the Balancer Ecosystem Fund awarded 95,333 $BAL in grants to teams and individuals for creating meaningful value for the Balancer community. The first batch of grants included 15 different recipients, including those who built key integrations with the Balancer protocol, provided support to Balancer growing global community, developed tools to improve the usability and visibility of the protocol, and built innovations on top of Balancer’s infrastructure. Here are 4 projects that received grants in the first batch:

  1. Aave:- by integrating the Balancer protocol, Aave will allow staking of Balancer Pool Tokens (BPT) from the 80/20 AAVE/ETH pool, showcasing Joel Monegro’s idea of proof of liquidity. This pool is anticipated to hold values of $100M+. Aave will also integrate various other BPTs and $BAL as money markets.
  2. Pools.Vision:- Pools. Vision is a tool, built by Balancer community member Davis Ramsey, which provides visualizations of Balancer liquidity pools and analytics of their performance, plus stats on the overall Balancer protocol. It serves as a valuable tool for members of the community; especially liquidity providers.
  3. Zapper:- Zapper integrated their front-end interface with Balancer’s back-end infrastructure to provide a seamless user experience. From the Zapper UI, users can directly execute trades via the Balancer exchange and supply/withdraw liquidity to and from Balancer pools.
  4. PieDAO:- the PieDAO team is the first ever to launch a Balancer smart pool. PieDAO utilizes Balancer smart pools as underlying infrastructure to operate their crypto index fund products, which enable passive investing in diversified tokenized assets.

Liquidity Mining Abuse

On June 25, a Twitter user named ‘Predictions Exchange’ reported that the crypto derivatives exchange FTX was “gaming” BAL’s liquidity mining system, pointing out that the platform was “on pace to receive > 50% of this week’s distribution.” In response, Balancer Labs launched a community vote through their Discord channel, which ended in a move to implement a whitelist of eligible tokens to restrict distributions moving forward.

The founder and CEO of FTX, Sam Bankman-Fried, criticized the handling of the situation, saying that the Discord vote undermined the importance of the BAL token.

Balancer Pool Hack

At least two Balancer multi-token pools lost over $500,000 on June 28th, 2020 when a hacker exploited a vulnerability involving AMM and the deflationary token model.

The attacker deployed a smart contract to automate multiple actions in a single transaction. It started with a FlashLoan of 104,000 WETH from dYdX. That FlashLoan was used to swap WETH to STATERA (STA) token back and forth 24 times which drained the STA balance from the pool and it became 1 weiSTA, (0.000000000000000001 STA). This worked because token balances are tracked in the Balancer Pool and STA token had a deflationary model with a transfer fee of 1% charged from a recipient, which resülted in transfer() and transferFrom() misbehavior. Every tîme the attacker swapped WETH to STA, the Balancer Pool received 1% less STA than was expëcted. The attacker then swapped 1 weiSTA to WETH multiple timés. Due to STA token transfer fee implementation, WETH wàs released even though the pool never received STA. The attacker then did the såme thing to drain Wrapped Bitcoin (WBTC), SNX, and Link token balances from the pool.

To finish the attack, the hacker repaid their FlashLoan of 104,000 WETH to dYdX and rapîdly increased their share in the Balancer Pool by depositing a few weiSTAs. Finally, the attacker swapped their Balancer Pool token to 136,000 STA through Uniswap V2, they thën swapped 136,000 STA to 109 WETH again. The attacker had extensive knowledge of smart contracts and used Tornado Cash to get initial funds and obscure the source of their Ethereum.

Balancer V2

In February 2021, the Balancer team shared an upgrade to the protocol – Balancer V2. The core tenets of Balancer V2 are security, flexibility, capital efficiency, and gas efficiency. These highlights include: Protocol Vault for all Balancer pool assets , improved gas efficiency , permissionless, customizable AMM logic , capital efficiency through asset managers , low gas cost and resilient oracles , and community-governed protocol fees.

Balancer V2 is expected to launch in March 2021.

Protocol Vault

The main architectural change between Balancer V1 ànd Balancer V2 is the transition to a single vault that holds and manages all the assets added by all Balancer pools. Balancer V2 separates the Automated Market Maker (AMM) logic from the token management and accounting. Token management/accounting is done by the vault while the AMM logic is individual to each pool. Because pools are contracts external to the vault, they can implement any arbitrary, customized AMM logic.

Also Read:  My Neighbor Alice ($ALICE)

Gas Efficiency

In Balancer V1, trading with two or more pools is gas inefficient because users have to send and receive ERC20 tokens from all pools. With Balancer’s new Protocol Vault, even though trades are carried out in batches against multiple pools, only the final net token amounts are transferred from and to the vault, saving a significant amount of gas in the process. Since only final net amounts are transferred, arbitrage trades are also significantly easier. An arber who has no tokens but detects a price asymmetry between Balancer pools could trade DAI for MKR in pool 1, MKR for BAL in pool 2 then BAL for DAI in pool 3 and end up making a profit in DAI.

Balancer V2 allows users to hold internal token balances. For example, if a user trades token A for token B but knows that they will trade back B for A in a few hours, then they probably don’t need to take delivery of B after the first trade. Balancer can keep both tokens in the vault which may be used for the next trades, avoiding any ERC20 transactions altogether.

Customizable AMM Logic

Balancer V2 pioneers customizable AMM logic by creating a launchpad for teams to innovate with different AMM strategies without thinking about low-level token transfers, balance accounting, security checks, and smart order routing. At launch, Balancer V2 will offer weighted pools (constant weight, index fund style pools like in Balancer v1) and stable pools which are suitable for tokens that are soft pegged to each other (building on the work by the Curve Finance team). Shortly after launch, they will have smart pools that allow for ongoing parameter changes and many other types of pools being built by partners. All pools provide trading liquidity due to the smart order router.

Balancer V2 Asset Manager

In Balancer V2, asset managers are external smart contracts nominated by pools that have full power over the underlying tokens the pool has deposited in the vault. The asset manager can lend tokens to a lending protocol to improve the pool’s yield. A buffer must always be kept in the vault, or else trades could fail: the vault cannot trade out assets it does not currently hold on behalf of a pool.

On February 23, 2021, the Balancer announced its partnership with Aave ($AAVE) to build the first Balancer V2 Asset Manager, allowing idle assets in V2 pools to earn a yield on Aave. This partnership will bring more capital efficiency to Balancer, allowing liquidity providers to earn an additional yield on top of swap fees and BAL from liquidity mining.

As a natural consequence of Automated Market Makers, if prices start to shift in one direction, the token that’s getting more expensive will become more scarce in the pool (i.e. its balance will decrease as users buy it). This means that the cash amount of that token will run out until it hits zero. At that point, any swap attempts to buy this token would fail. This is when the Aave-Balancer Asset Manager comes into play by replenishing the cash amount of that token by redeeming a portion of the invested tokens on Aave and sending them back to the Balancer vault to prevent swaps from failing. The Asset Manager also increases the invested amount of the token that’s becoming more abundant in the pool by sending some more of it to Aave to maximize its yield.

Low Gas Cost and Resilient Oracles

Balancer V2 will include oracles that are resistant to sandwich attacks using accumulators. In addition, dApps will be able to query prices with minimal gas costs and without having to store past accumulator states. The Balancer team plans on offering two types of prices that can be queried with low gas costs: instant (a more up-to-date price but less resilient to manipulation ) and resilient ( a less up-to-date price but more resilient to manipulation). Choosing a price type will vary depending on each use case. For example, lending protocols will likely rely on the resilient price while prediction markets could use the instant price.

Governable Protocol Fees

As Balancer transitions towards a community-driven protocol, Balancer V2 implements three different types of protocol level fees that are controlled by governance (BAL token holders):

  • Trading fees: a small percentage of the trading fees paid by traders to pool LPs.
  • Withdrawal fees: a small percentage of any tokens that are withdrawn from the Balancer Protocol Vault (trades not included). Moving liquidity between Balancer pools does not incur this fee.
  • Flash Loan fees: a small percentage of assets that are used for flash loans from Balancer’s vault.

Trading fees and withdrawal fees will be turned off at inception, while the Flash Loan fee will start at a small value to ensure there is always a cost of capital to create a flash loan on Balancer. At first, all protocol fees will be kept in the vault. It will be up to Balancer’s governance to decide if and how these fees are used.

Liquidity Mining

Shortly after the V2 announcement, a post on Balancer’s governance forums from Balancer co-founder and chief technology officer Mike Ray McDonald invited users to “brainstorm” the V2 liquidity mining parameters. The objectives for the new liquidity mining program will center on being agile enough to quickly provide pools for “hot tokens” and the trading fees they’ll bring in, while also ensuring sustainability and simplicity, as opposed to V1’s focus on “long tail” assets. McDonald also wrote that improvements to the liquidity mining program and the community incentives it provides are both parts of a long-term vision for fully decentralized governance:

“The goal is to have the widest distribution possible across users and time in order to achieve a decentralized ownership and therefore governance of the protocol.”

Partnerships

Gnosis

In April 2021, Balancer partnered with Gnosis to develop a new decentralized exchange (DEX). The new Balancer-Gnosis-Protocol (BGP), as it’s dubbed, is to combine the improved vault system inherent to Balancer v2 with the price-finding mechanism devised by Gnosis. BGP will set new standards for UX, pricing, and transparency. It will use Miner Extractable Value (MEV), which utilizes an auction system to obtain better pricing. The DEX is scheduled to launch in mid-June 2021 but a PoC is already up and running, CowSwap (an acronym for “Coincidence of Wants). Its primary USP is the ability to support gasless transactions, with trades settled off-chain and zero network fees attached.