What is Balancer?

Tiempo de lectura: 4 minutos

DeFi, or decentralized finance, is probably the area in cryptocurrencies where most innovation is taking place. Thanks to languages such as solidity, with more expressiveness than Bitcoin Script, smart contracts can be written that enable complex financial derivatives.

Today we are going to talk about Balancer, a DeFi project on Ethereum and Polygon (Matic) that is very popular and has a novel design.

How does Balancer work? Your financial applications

Balancer is a DeFi protocol that manages portfolios of ERC-20 tokens and allows you to exchange them in a decentralized way (it is a DEX), provide liquidity and earn returns on your assets deposited in its liquidity pools.

In addition, it allows the use of liquidity in flash loans, that is, loans that are repaid in the same transaction (generally used to benefit from arbitrage opportunities).

For example, a user may hold 70% ETH and 30% WBTC in a pool. Instead of paying ETF managers to maintain these percentages, traders will rebalance the pools (incentivized by arbitrage opportunities) and pay commissions to liquidity providers.

An arbitrage opportunity consists of a price difference between two pools. Let’s imagine that in pool A, DAI is worth $0.9 and in pool B it is worth $1.00. To take advantage of this situation we can borrow money, buy DAI in pool A, exchange it for DAI in pool B, repay the loan and keep the difference.

For this we can make a flash swap (similar to a flash loan, but built expressly to reduce price disparities in Balancer). To borrow a flash loan, you also have to pay interest.

In addition to commissions for providing liquidity for token exchanges, it is also possible to obtain the Balancer governance token, BAL.

Qué es Balancer

Benefits of Balancer V2

The first version of this protocol, Balancer V1, is now outdated, although it can still be used since the contracts are still on the blockchain.

Balancer V2 implements an architecture aimed at achieving more efficiency in gas spending, allowing more composability and diversity in pool designs or Automated Market Makers (AMM).

The main novel concept is the vault. This is the smart contract that holds and manages all the tokens. By separating the management of the tokens from the swaps and liquidity provisioning logic (AMMs), we make it much easier to develop pools and allow them to be customizable. Currently we can find weighted pools, oracle pools, stable pools, metastable pools and liquidity bootstrapping.

Thanks to the vault, multi-step swaps only pay a commission for the transfer that settles the positions of the pools. In addition to the fact that the vault keeps track of the balances of each pool, it also keeps track of the “internal balance of each wallet“. That is, you can make trades that, instead of being realized as such, are credited to your account.

Let’s make an example, we have 1 ETH, exchange it for 0.1 WBTC and then for 4,000 DAI. These transfers are not made in ERC-20 token contracts, but the vault keeps the balance account of each user. The only time when you will have to pay gas commissions for token transfer will be when depositing money into the vault and withdrawing it.

Finally, having all the liquidity consolidated in the vault makes it possible to offer high-value flash loans, which are risk-free for the lender (in this case all Balancer users).

Asset managers

An optional feature is the use of asset managers. Since more money is generally deposited in liquidity pools than is used in exchanges, a portion of the assets can be used to generate additional profitability. One implementation of this functionality is for loans in Aave.

This can increase the profitability of liquidity providers, but it also entails a risk (e.g. mismanagement). For this reason, it is not an option enabled by default in the pools.

What are Balancer’s commissions?

Each user who trades tokens pays a commission to the liquidity providers. Trading commissions are dynamic and vary depending on market conditions.

We also have protocol commissions, which are currently deactivated except in the case of flash loans. These commissions are directed to the Balancer DAO and will be voted by the BAL governance token holders themselves. They will be calculated as a % of the trading commission, and will be fixed.

Qué es Balancer

Balancer Governance

BAL holders have the right to participate in decision-making on future changes to the protocol. In addition, their tokens collect the protocol commissions.

Voting is done on an off-chain protocol that does not spend gas commissions, called Snapshot and developed by Balancer Labs. Snapshot has been quite successful and is being used by other DAOs besides Balancer.

To leave the voting information recorded on the blockchain, a multi-signature address controlled by different people with influence and reputation in the DeFi and Ethereum ecosystem is used. But the signatories have no influence on the voting, they only record on-chain the voting results.

There are also liquidity mining programs where liquidity providers are rewarded with BAL for early participation in the protocol. Another program is called “Bal for Gas” and consists of rewarding swap users with BAL.

Conclusion

By reading about Balancer one can begin to get an idea about the amount of innovation that is happening at DeFi.

Perhaps the biggest question in the DeFi ecosystem in general is about the security of smart contracts. In fact Balancer already suffered a hack a year ago, funded by a flash loan (as usual). Balancer V2 has 3 code audits and a temporary emergency button (it will only work for the first 3 months).

Most plausibly, in the long run, contracts that have remained operational without hacks for years are extremely secure. However, today DeFi still poses high risks, although it also promises more than ever.


Leave a comment
Your email address will not be published. Required fields are marked *