Building on Balancer protocol

ETHCC 5 · July 2022 · 15:44

Fernando Martinelli demonstrates building on Balancer with new pool types and an updated SDK as presented at EthCC[5].

Speakers

Topics

From ETHCC 5, hosted by Ethereum France.

Transcript

hey everyone thanks for coming so my name is Fernando I'm the CEO and co-founder of balancer and I'm here today to talk about how to build how why to build on top of balancer so first what is balancer balancer is a protocol for programmable liquidity a lot of people think that balancer is just a flexible amm it's not it's a lot more than that it's a platform for amms to be built on top of I there's one message I could get across to you guys today it is this if

you're building a protocol or smart contracts that hold two or more tokens that at some point need to be swapped for one another or you need to add tokens or remove tokens you should definitely be considering to build on top of balancer why because we have put a lot of effort into building all the parts around s a successful amm for example like you have to have connection to aggregators right if you just build your own amm or your own like solution for swapping in a programmable way tokens aggregators are not going to see uh your your liquidity it's really hard to get 1 in Bear swap uh C Swap and

zerox to look at your liquidity so your liquidity will just be sitting there without any kind of any action another thing is the SDK we have built a very comprehensive F SDK that allows devs to get kind of um yeah to to interface with your liquidity we also take care of all the the lowlevel like accounting of tokens and transfer of tokens in a very gas optimized way that's really hard and we spend a lot of time there so that you don't need to all you need to do is like think about the logic of how the tokens are swapped it can be an amm or it can be like a treasury management solution it can can be lots of things that's why

I say balancer is a platform for programmable liquidity not just amms and last but not least we have a lot of network effects so every project that builds on top of on top of balancer puts their tokens their liquidity in the same Vault I'm going to show you in a more visual way so that builds uh Network effects people using balancer are using the liquidity of all the different projects building on top of it so what is balancer it's it's really a two-sided Market protocol we have on on the one side liquidity right LPs they earn fees they have uh their portfolios rebalanced or they have any sort of

programmable way for tokens to be swapped and that's all embedded in the in their logic that could be smart contracts as well and we have on this side we have Traders like if you don't have Traders interacting with the liquidity you're not going to have your tokens being swapped right so you need aggregators to see your liquidity um and for that we have a smart order router that sees always the best routes using all the liquidity available in balancer and of course Traders it can be um protocols smart contracts or end users so those are the the two sides of of balancer protocol like I said before balancer balancer V1 was just uh like all the

other amm like youis Swap and curve and Etc they were like pools that were their individual smart contct and we improved that with balancer V2 yep that works by having all the tokens being handled by the vault in a very efficient way and then the logic of each of the pools of the different amm that are built on top of balancer that's another smart contract that only handles the logic of how the tokens are going to be swapped so this is very efficient and it it really like lets you focus on what really matters for your application and balancer does the rest so let me go through some pool types that we have and these are growing

by the day those are kind of built by um by balancer labs's team in collaboration with other teams and then I'm going to show you some uh third party teams that build some um cool pools as well weighted pools stable pools meta stable pools lbps anyone here knows uh what it LBP is balancer folks or not don't don't count cool yeah so yeah manage pools are coming soon weighted pools so that's kind of the the origin the origin of balancer the the idea of having a pool that instead of being just a 50/50 um fix feet pool like Unis swap it can handle up to eight tokens and now soon we're going to have up to 20 tokens or

more like you have flexibility of being exposed to the assets you want to the proportion to the percentage you want right we have very popular 8020 pools that allow you allow you to be 80 to 80% exposed to the Token you're you want to belong so it reduces a lot impermanent loss I don't know how many here know what what imper loss permanent loss is but that reduces a lot impermanent loss while still allowing you to have uh like volume to to creating liquidity to create liquidity those are kind of the bread and B balancer stable pools based on curves uh stable pools uh um had tip to them we we implemented their that logic

as well with some improvements and we can have very deep liquidity around price one for tokens that are like like kind like different types of Bitcoin different types of eth or whatever you can think of so all of that is built already so you don't need to care like you just can use uh those pool types boosted pools those are uh very interesting I'm very excited and proud of those so while you while you have a lot of assets tokens um sitting idle on balancer vault in in the vault you can actually put most of those tokens to be kind of creating yield elsewhere we uh use a but there's other pools that use

Ur or compound but the idea is that most of the tokens are you uh you're earning some you while a small buffer is there involved to allow for trades to happen right because most of the assets that you have in an amm are not used for the day-to-day swaps right so we created this very interesting idea to while still enabling fast and cheap swaps we have most of the of the tokens uh earning some year elsewhere meta stable pools those are nothing but stable pools that adapt to a rate a price that's changing uh who here knows what uh rap R stake teeth is State teeth rap stake

teeth is the version of State teeth that grows not in Balance but in in value so the the the rate between one rep 6th and one 16th grows over time and uh so the price is not going to be stick like sticking to one it grows and we have like this um like logic to account for that growth while we still have most of the liquidity around the price that grows lbps liquidity boot wrapping pools so those are have been very popular are still popular what they do is they allow projects to launch tokens on top of balancer in a very friendly way with a price discovery that allows anyone to if

they buy a token for a given price and then the price goes up they can resell it so it's not really like just an auction where you if you buy it you're you're done while the LBP is live you can trade back and forth so this is only possible with balancer because how it works is weights start uh at 820 for example or 98 to and then over time the weight of your pro prodical token goes down which means it gets cheaper and uh and and the the the weight of die or whatever you you're selling it for goes up so it goes down the price goes down unless people start buying it so as the price goes down the price of the market is kind of uh found and and then like

the price like keeps stable or goes up so it's it's really a very fair price Discovery good thing here is that early Bots Get Wrecked because the price always starts very high like 10 times higher than the team expects the the token to be worth so it's a it's a very popular um way of raising um yeah launching your token and the cool thing about balancer is again other teams building cool protocols and products on top of us not us directly we we don't have an interface for lbps copper and other teams like Prime did that just so you know like how successful these are we had almost 300 already over 990,000

different people participating or Bots or unique addresses um $2.4 billion do in volume like to me it's uh really mind-blowing manage BS so those are something we're very excited about coming soon extreme flexibility it's like lbps but you can like sell in One Direction and then buy in the other direction it's more more or less the programmable liquidity idea that I just uh laid out but we're kind of building most of the infrastructure you need so you can kind of create a controller that controls the manage tool very excited about this you can have more than like two tokens so it's very useful for treasury management you can add new

tokens you can remove tokens in a very kind of uh safe and automated way so our SD team has been tirelessly working on improving um our SD and the way people devs can interact with balancer balancer is complex it's like by Nature complex so we're working on making it easier for other people to build on top of it so that's also something you get um off the shelf if you build on top of balancer you're like part of our SDK so it's easy for others to interact with your solution your amm because they already connected to our SDK we have uh an s in uh JavaScript and

then um bpy for those who like python to create pools the S so smart Auto router so those are just uh for your reference um they're all on our GitHub uh account balancer Labs yeah very simple you just like instantiate it you call it you set your um your INF infura um Environ environment yeah uh variable and and that's it very easy to use the S allows you to to do swaps so very easy you can say token in token out what is the best route and then the S so which is embedded in the SDK finds the best paths and gives you the best

returns um coming soon you're going to be able to add liquidity remove liquidity do uh fetch pool data see apy aprs and uh a lot of stuff so it's really work in progress but getting to a very nice State already some a PO types that we're very proud about um other projects building on top of balancer which is I like to say the success of balancer is the success of other teams building on top of us we're just infrastructure so yeah there is fixed rate produ protocols like Al Tempa sense um so they have a special invariant or amm because the tokens over

time they tend to price one that's the idea behind uh fixed interest tokens so you have like a optimize amm for that you have gyroscope and and other uh teams also building stable coins St a balancer so these guys are like Oxford phds like big brains they came up with uh elliptic uh liquidity pool elliptical pools like it's it's something that's hard to understand but it works it's very um interesting they are soon going to launch and they use balancer for everything we're also excited about t-s t-s is a very nice idea by Paradigm anyone here knows what t-s

are yeah that's cool uh so time weighted uh average market makers basically if you have a very large trade you don't want to like do the a trade of a hundred million dollars to e in one go with amm you're gonna have a very large price impact so you can split that into a 100 different trades that costs a lot uh of gas and also it's like a hassle so you just say that I want to do a T1 for a month of 100 million dollars for E there are two teams actually that are building that on top of balancer close to launching and there's a lot more um manageable simulator generalized boosted pools lots of teams building their own stable coin liquidity with our stable

pools uh boosted pools as well and we do want you to build on top of balancer we want to pay you we know how like valuable your time is so you should apply for a grant you should come talk to us if you're not convinced by all the reasons I gave you to use balancer instead of creating Your Own Thing uh please come to us and talk to our team I I'll hopefully convince you or our team there's grants there's bounties there's a lot of things you we can help you out with thank you so much and thank you Fernando do we have questions five minutes for questions I want to hear some questions

no oh two minutes for questions any questions out there your brainstorming the parameter you say it's going to last five days the price is going to change from $10 to 10 cents if no one buys and that's it then you withdraw the liquidity afterwards amazing yeah very simple I mean we like the most popular things the best things are the simplest ones and that's our main challenge to to make things simple and I think lbps are very very simple well if anybody has questions I think Fernando will be available after this talk out there to to chat with you thank you all thanks again Fernando

thank you