One Big Pool: Balancer’s New Version Cuts Down Transactions and Gas Fees

elena-mozhvilo-OEQR9JO04Hs-unsplash
2 February 2021

It doesn’t take a software engineer to understand why the new version of Balancer marks a cool innovation in on-chain trading for Ethereum tokens.

Balancer, a non-custodial portfolio manager, is releasing version 2.0, which puts all the assets entrusted to it in one big vault. This should dramatically reduce gas fees for decentralized finance (DeFi) trades because users can swap as much as they want, only paying gas for going into and out of Balancer.

The team had considered building it this way from the start but decided initially to be conservative and separate out each pool for added security, CEO Fernando Martinelli told CoinDesk.

“We are today … comfortable enough with having a big vault that holds a lot of money. We put a lot of effort into making this as safe as if the assets were siloed,” he wrote in an email. “Many other protocols (not AMMs) already do this: lending protocols, collateral in MakerDAO, etc.”

Balancer works much like (and can serve the function of) an automated market maker (AMM) like Uniswap or Curve but it allows users to create pools of multiple tokens, weighted as they see fit. The pools automatically rebalance as needed in order to stay in line with the market.

This requires making a lot of transactions, which in turn require a lot of Ethereum gas fees. That is not capital-efficient for traders nor for liquidity pool providers, especially as gas prices tick upward.

In this new version, the accounting for those pools will just be done in smart contracts separate from the big custody pool. 

One big pool

With Balancer v2, no matter how complex a trade or trades, “only the final net token amounts are transferred from and to the vault, saving a significant amount of gas in the process,” Martinelli wrote in an announcement post. Balancer can keep track of all of the assets entrusted to it in one vault and just move allocations around on people’s accounts.

“Now, token management and 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,” the team wrote.

In fact, the new version will even take it a step further. Active traders can set up an individual account so they can make lots of trades. Then they will only be charged gas fees when they want to withdraw.

Of course, that may sound more like a centralized exchange to some traders, which is somewhat fair. The key difference here is it’s all being kept on smart contracts that can be reviewed by the public; and, as an Ethereum project, its functionality can be easily integrated into others.

It does raise a security concern. To oversimplify it, think of it this way: If someone had a large treasure of gold, it would be trickier to steal it all if it were locked away in multiple vaults in different places rather than one big vault.

Martinelli does not dispute this, but he also notes that the more-complex logic in Balancer doesn’t touch the assets, which should be reassuring.

“Since the operations the vault will be doing are very low-level (add to a user balance, remove from a pool the user traded with), we will make everything (including formal verification) to make sure the vault is safe and sound,” Martinelli said via email.

Other developments

Balancer is adding some other features in version 2.0 that may be of interest to more advanced users. Crucially, it wants to make it easier to experiment with composition pools.

“Balancer v2 pioneers customizable AMM logic: [I]t effectively creates a launch pad for teams to innovate with different AMM strategies without having to worry about low level token transfers, balance accounting, security checks [and] smart order routing,” the announcement says.

It will go live with the familiar weighted pools that Balancer users know already. It will also have stable pools that work more as Curve does, so big trades on stablecoins can see very little slippage. Soon, Balancer will launch smart pools, whose logic can change on the fly.

Balancer will also introduce asset managers, external smart contracts that can be used to put some of a liquidity pools’ underlying value to work elsewhere in DeFi. This should be good for liquidity providers, because as the team notes, “in normal trading conditions, most of the assets in an AMM are not actually used.”

Balancer will also introduce trading fees that can be controlled by holders of its BAL token. It will offer fees on trades, withdrawals and flash loans. Only the final fee will be active at the start of version 2.0, however. BAL holders can use the fees either to pay for further development, for a dividend or some combination of both.

Balancer was one of the earliest projects to join the liquidity mining craze this summer, launching BAL distributions to users shortly after COMP distributions went live. Like on Compound, BAL liquidity mining has never stopped.

“We are currently discussing with the community some interesting updates to BAL liquidity mining. It will certainly continue though: it’s our main way to make sure we have a diverse and engaged governance,” Martinelli noted.

Balancer version 2.0 is under audit now. The team currently projects a March launch.

Disclosure
The leader in blockchain news, CoinDesk is a media outlet that strives for the highest journalistic standards and abides by a strict set of editorial policies. CoinDesk is an independent operating subsidiary of Digital Currency Group, which invests in cryptocurrencies and blockchain startups.