Trail of Bits Certora OpenZeppelin +1 Consensys Diligence
Trail of Bits Certora OpenZeppelin Consensys Diligence
Price Market cap.
Last updated: Nov 23, 2022
Balancer is an open-source platform, an automated portfolio manager, liquidity provider, and price sensor. As a DEX, the protocol facilitates trades between users while also offering some innovative ways to manage liquidity and earnings.
The story of Balancer began in early 2018. It all started as a research project established by Fernando Martinelli and Mike McDonald at BlockScience, the US-based software consulting firm. This initiative later evolved in Balancer Labs. The protocol’s whitepaper was published in October 2019, and the long-awaited at the time Balancer mainnet finally saw its launch in March 2020, right after the project had successfully secured $3 million in funding from prominent blockchain investors. In February 2021, Balancer v2 went live introducing some additional innovations, such as trading arbitrage opportunities with zero tokens.
Balancer Protocol is a platform where users can trade tokens, create liquidity pools, and provide liquidity to existing pools while earning fees from trades.
Each Balancer pool is continuously rebalancing, finding the best trade routes in order to bring better yield to assets owners. Balancer operates with a wide range of ERC-20 tokens. And while its competitors mostly offer token pairs to provide liquidity, Balancer stands out as an AMM that allows users to create liquidity pools combined from up to eight different tokens in any convenient ratio.
This model may be compared to that of a weighted index fund, except on Balancer all fees go to the pool’s creators and participants, making the project non-custodial and excluding any intermediaries from the formula.
In order to achieve the best prices for traders, Balancer uses a system called Smart Order Routing (SOR), which searches for the best rates across pools taking into account the pool slippage, fees, and gas costs.
The pools on Balancer may be public and open for everyone to add their assets. This option is mostly used by small investors who seek to earn fees from most liquid and popular pools. For users with big portfolios, Balancer offers its private pools option, which lets them earn fees on their specific assets without any outside influence on the initial liquidity. And there are so-called smart pools, which are private and managed by smart contracts that allow a certain flexibility in control. A smart pool owner can pre-set pool parameters such as allowed tokens, assets weights, swap fees, or limit LPs who can add liquidity to the pool.
Some of the pools are preset for specific purposes, such as stablecoins pools or Liquidity Bootstrapping Pools (LBPs), aiming to help new tokens to gain liquidity.
Balancer v2 upgrade introduced the Balancer Vault concept. It lets all the assets added by all Balancer pools be held and controlled by a single contract. According to the developers, the vault separates AMM logic from management and accounting, and while AMM logic may vary from pool to pool, all management and accounting is done by the vault to help users get the best trade routing options. Balancer Vault also helps users to save gas on their trades because the gas fee is paid only for the final net token amounts that are transferred from and to the vault.
Balancer v2 opened the DeFi door wider bringing additional tools and services to the platform. For instance, it has introduced a Flash Swaps feature for arbitrageurs that allows them to balance pools claiming the difference as profit. Arbitrageurs have no need to own pool tokens, and since the actual trades in such deals conclude only the profit - the transactions are significantly easier on gas fees.
As the first step to start using the Balancer app, it is required to connect a wallet and have some ETH to cover the gas fees. Balancer wallet support includes Metamask, Wallet connect, Tally, Coinbase, and Portis.
The main page starts with the list of available liquidity pools along with their APR. Pools can be filtered by tokens, symbols, or addresses. If a user wishes to provide liquidity, this page will be the starting point. The user needs to tap on the selected pool, enter the desired amount of tokens to be deposited and confirm the operation by clicking the ‘Invest’ button and paying the gas fee.
As soon as the LP tokens are received, users can immediately stake them on Balancer to qualify for bonus rewards by simply clicking the Staking incentives button.
For token exchange, the user needs to head over to the Trade section from the main page, select both tokens to be swapped from one to another from the dropdown list, or enter the token’s name, address, or symbol, enter the amount and confirm the operation by clicking the ‘Swap’ button.
Developers wishing to build their own Balancer apps can do so using the detailed step-by-step guide, which can be found here.
BAL is Balancer’s native token. The maximum supply for BAL is capped to 100,000,000 tokens with weekly distribution for liquidity mining programs of 145,000 BAL per week or 7.5M per year.
The current token distribution model expects up to 65 million BAL to be issued to liquidity providers before reaching the 100M cap. 25 million were secured for founders, options, advisors, and investors. The Ecosystem Fund and Fundraising Fund received 5 million BAL each to spend on the further development of the platform and on future investment rounds held by Balancer.
Before March 2022, BAL used to be a governance token, which gave its holders the power to reshape the protocol by adding new assets or functionalities, changing parameters of the network, or leveling the protocol’s fees.
Balancer has recently replicated Curve Finance's tokenomics model and introduced veBAL as the main token to vote on future proposals and collect Protocol’s fees. The goal of such transformation was promoting long-term token-holder alignment, decentralizing Liquidity Mining allocation, and facilitating fair protocol revenue distribution.
From now on, users wishing to participate in the governance of the project and benefit from the protocol revenue distribution must lock their BAL tokens to get veBal or provide liquidity to the BAL/WETH pool and stake the corresponding LP tokens into veBAl.
Users can lock up their LP Tokens for a period from one week to one year. The longer the period, the more veBAL is received. In addition to 75% of the protocol revenues, veBAL holders will also get 10% of all BAL minted weekly. The other 25% of the fees will be kept by the DAO treasury as a reserve.
There are currently over 25 employees on the Balancer team, overseeing the ongoing development and further decentralization of the platform. Balancer Labs is expected to dissolve when its goals are fulfilled, leaving the project in the hands of its community.
To emphasize the team’s commitment towards the decentralized future of the protocol, it is worth mentioning that Balancer Labs also created Snapshot.org an open-source and easy-to-use governance tool, widely used among all kinds of DAOs.
In the middle of 2020, Balancer was exploited due to a flaw in the way the protocol handled deflationary ERC20 tokens. The Balancer hack resulted in a $500,000 loss and started with the attacker borrowing a flash loan of 104,331 WETH from dYdX. These tokens were used in a flurry of swaps, that were calculated to last as much as possible and deplete almost all STA tokens owned by the Balancer pool. STA, being a deflationary token charges 1% on every token transfer and its total depletion left 1e-18 STA in the pool (1e-18 equals to 0.000000000000000001). This particular number being so close to zero-priced STA is extremely high relative to other assets. Essentially, at this point, anyone could swap 1 STA for a huge amount of other tokens.
The attacker then sent 1e-18 STA to Balancer’s BPool resulting in a 30,347 WETH swapped instantly. Balancer’s internal book-keeping records were automatically increased by 1 before the BPool smart contract could actually collect the corresponding STA tokens. However, since STA is a deflationary token charging 1% on every token transfer, due to the fee’s cut the Balancer pool got 0 STA tokens. At this point, there was a mismatch between the actual STA balance of BPool and the protocol’s internal records.
The malicious party’s next step was to exploit another function of the smart contract’s code resetting the internal records of the protocol, tricking it to maintain a state of balance of only 1e-18 STA in the BPool. Repeating these steps allowed the hacker to drain all assets present in the pool, resulting in the $500,000 theft, with the assistance of the extremely valuable 1e-18 STA.
In March 2020, Balancer acquired $3 million in an investment round led by Accomplice and Placeholder with the participation of CoinFund and Inflection. In May 2021, this initial pack of investors had grown significantly after the $24.25 million token sale round led by Alameda Research and Pantera Capital alongside Blockchain Capital, Fintech Collective, LongHash Ventures, Fenbushi Capital, Continue Capital, and Synthetix’s founder Kain Warwick.
Basically, any Ethereum-based project can join Balancer and participate in some of its pools. One of such partnerships involved Aave, the popular lending and borrowing platform which helped to build the first Balancer V2 Asset Manager. Another instance was liquid staking protocol Lido which joined during the launch of Metastable pools on Balancer.
Balancer AMM technology was used to launch Ocean Market, an open-source community marketplace and a first Initial Data Offering (IDO) launchpad, created in collaboration with Ocean Protocol.
In August 2021, the Balancer community voted to establish The Balancer Grant DAO which oversees the grants issued to small teams of developers who wish to build their projects on Balancer thus expanding the protocol’s ecosystem. The first five projects to receive support from the program were Indexed Finance, dHEDGE, Tempus, HaloDAO, Rabbithole, and GovBot.
Some of the grants were awarded to teams developing on Near and Algorand, but Balancer Labs since claimed that the protocol is 100% focused on Ethereum and has no plans to expand on those networks.
However, Balancer went live on some Ethereum L2 solutions in 2021. In July, the protocol integrated with Polygon, and in August was deployed on Arbitrum. Both networks are Ethereum-native and help users to save on gas fees and time required for transactions.
One of the biggest goals lying ahead of Balancer is the future decentralization of the protocol. Currently, the community uses a forum for discussions and proposals and a Snapshot service for voting.
The other long-standing goal is the further growth of the Balancer ecosystem. In this regard, the Balancer Grant DAO was created, issuing BAL rewards from the Ecosystem fund for the developers who are building atop of Balancer.
Balancer Labs developers also made clear their intentions to grow the support for the platform among DeFi users from the Asia Pacific region.
Fenix Games secures $150 million in a funding round
Casper launches a new funding program worth $25 million