The core principles of Balancer v2 are safety, flexibility, capital efficiency and gas efficiency.
Original title: “Introduction | Balancer V2: Generalized Automatic Market Maker”
Written by: Fernando Martinelli
Translation & Proofreading: Min Min & A Jian
The performance of Balancer v1 exceeded our expectations. It not only improves the liquidity supply, but also builds a strong and active community. Now, with pride, we want to share Balancer v2 with you. This upgrade will bring us closer to Balancer’s vision: to become the main source of DeFi liquidity.
The core principles of Balancer v2 are safety , flexibility , capital efficiency and gas efficiency . The highlights are as follows:
Agreement vault that manages all Balancer funds pool assets
Improved gas efficiency
License-free and customizable automatic market maker logic
Improve capital efficiency through asset manager
Low gas cost and anti-attack information input mechanism
Agreement fees determined through community governance
Protocol Vault
The main structural change between Balancer v1 and v2 is the use of a single protocol vault to hold and manage all Balancer funds pool assets .
Balancer v2 separates automatic market maker logic from token management and accounting. Token management/accounting is done by the agreement vault, and the automatic market maker logic differs depending on the fund pool.
Since the fund pool is an external contract independent of the vault, they can implement customized automatic market maker logic.
Balancer v2 separates automatic market maker logic from token management and accounting
Gas efficiency
In Balancer v1 (and all automated market makers we know), there is a gas inefficiency problem with two or more fund pools, because users must send and receive ERC20 tokens from these fund pools separately.
With Balancer’s newly launched protocol vault, even if users perform batch transactions involving different fund pools, only the final net token amount will be transferred in or out from the vault. This process saves a lot of gas .
Since only the final net token amount will be transferred, arbitrage trading will also become easier. Assuming that someone who does not hold any tokens finds that there is a price asymmetry between the Balancer fund pool, he can use DAI to buy MKR in the No. 1 fund pool, then use MKR to buy BAL in the No. 2 fund pool, and then to the 3 The capital pool uses BAL to buy DAI and uses the price difference to earn more DAI.
Balancer v2 can execute multiple transactions at once, and finally settled by the agreement vault
Balancer v2 allows users to hold the token balance in the pool. This is simply a boon for high-frequency traders.
For example, if you use token A to buy token B, and know that you will use token A to buy back token B in a few hours, you do not need to withdraw token B after the first transaction is completed. Balancer will save these two tokens in the vault to execute the next transaction, thus eliminating the gas fee for a withdrawal transaction. We expect that aggregators will appear in the future to use Balancer’s pool balance to provide users with low gas cost transaction services.
Customizable automatic market maker logic
We are currently in the early stages of development of automated market makers, and we hope to become the platform of choice for developers, traders and liquidity providers. A large number of automated market makers for specific use cases have emerged in 2020. In order to achieve different goals, they have made different trade-offs. This trend is likely to increase further in 2021.
Balancer v2 also created a precedent for customizable automatic market makers. Teams can use the starter provided by Balancer v2 to formulate different automated market-making strategies without worrying about token transfer, balance accounting, security checks, and smart order routing. With Balancer v2, everything works out of the box .
When it goes live, Balancer v2 will provide a weighted capital pool (similar to Balancer v1 with a constant weight, index fund-type capital pool) and a stable capital pool (applicable to tokens that are softly anchored to each other, inspired by Curve). After going online, Balancer v2 will soon launch smart fund pools ( supporting users to constantly change parameters ), as well as other types of fund pools built by partners. With the help of smart order routers, all fund pools can provide transaction liquidity.
Asset manager
In 2020, automated market makers have achieved great success. However, due to the lack of capital efficiency, most of the assets in automated market makers are not really functioning. Balancer v2 introduces a simple and powerful function that not only solves this problem, but also revolutionizes the design of automatic market makers. This function is: Asset Manager .
The resource manager is an external smart contract designated by the fund pool, which can fully control all the tokens deposited in the fund pool in the vault.
The resource manager can lend tokens to the lending agreement to increase the revenue of the fund pool. Please note that the vault will guarantee to meet the needs of the buffer mechanism, otherwise the transaction will fail: the vault can only sell tokens from the fund pool. In a few weeks, we will publish an article to introduce the asset manager in detail.
The asset manager helps to improve the capital efficiency of the Balancer v2 fund pool
Low gas cost and anti-attack information input mechanism
Balance v2 will include an information input mechanism that uses accumulators to resist sandwich attacks (the first to use accumulators is Uniswap v2). In addition, dApps can query prices at the lowest gas cost, and there is no need to store past accumulator states. We plan to provide two types of prices, both of which can be queried with extremely low gas costs.
The choice of price type varies by use case. For example, the loan agreement is more suitable for choosing the price of resistance, and the forecast market can choose the immediate price.
Governance-based agreement fees
With the transition of Balancer to a community-driven protocol, Balancer v2 implements three protocol-level fees that can be regulated by governance (BAL token holders):
Transaction fee : the proportional fee paid by the trader to the liquidity provider of the fund pool.
Withdrawal fee : A proportional fee (paid with the withdrawn assets) charged to the user when the user withdraws from the Balancer agreement vault (excluding transactions). This fee is not required to transfer liquidity between Balancer fund pools.
Lightning loan fee : the proportional fee that the user needs to pay when using the lightning loan (paid with the assets used).
Balancer v2 does not charge transaction fees and withdrawal fees at the initial stage of its launch, but will charge a small flash loan fee to ensure that the flash loan on Balancer has a cost. In the initial stage, all protocol fees will be deposited in the vault, and the holders of the governance tokens of Balancer decide whether and how to use these fees.
Overview of Balancer v2
We are very happy to launch Balancer v2. In the future, we will continue to work hard to promote the automatic market maker industry to become more:
Security-Care must be taken to ensure that the treasury structure can isolate internal balances from different fund pools. The core contract will undergo formal verification.
Simple-all interactions with Balancer v2 will be done through a single access point (Vault). When making a transaction or injecting liquidity into the Balancer fund pool, the user only needs to approve the token permission once.
High gas efficiency-users only need to pay a transaction fee of slightly more than 100,000 gas when using standard fund pool and stable fund pool transactions, which is equivalent to Uniswap v2. If internal balances are used, transaction costs will be lower. Using multiple fund pool transactions at the same time will only slightly increase the gas cost.
High capital efficiency-the fund pool can fully control the tokens they add to the vault. This opens up design space for use cases such as improving capital efficiency and token voting.
Flexible-Balancer welcomes other teams to carry out innovative activities on v2 to build a thriving ecosystem and network effects. Contributors who successfully create a new funding pool will receive grants and rewards.
Future plan
Balancer v2 is undergoing internal audit and is expected to be launched in March this year.
Since the v2 code has almost been finalized, some projects have expressed interest in building on the platform before v2 is officially launched.
We hope to work with more quality teams to help Balancer v2 attract more users. If you think Balancer v2 is suitable for your project, please contact us and join our v2 online partner program. Our partners can access our code base and documentation in advance, and build on Balancer v2 as soon as possible.
After this launch, Balancer will take a big step towards the vision of becoming the largest DeFi liquidity provider.
As the industry environment continues to change, Balancer aims to become a core component of all DeFi projects regardless of their design and liquidity requirements. If you want to learn about the dynamics of Balancer v2 and join the growing community of BAL holders, come join our Balancer Discord channel, or follow our governance forum!
We look forward to turning DeFi composability into the biggest craze in 2021!
Source link: medium.com
Disclaimer: As a blockchain information platform, the articles published on this site only represent the author’s personal views, and have nothing to do with ChainNews’ position. The information, opinions, etc. in the article are for reference only and are not intended as or regarded as actual investment advice.