New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Liquidity Pools as DeFi Infrastructure - Jeremy Musighi

ETHGlobalMon, Oct 9, 2023, 12:00 AM

Join Jeremy Musighi from Orb Collective for a talk titled "Liquidity Pools as DeFi Infrastructure". And that wraps up 2022! ETHIndia 2022⎯the biggest Ethereum hackathon to this date with over 459 projects built within 36 hours. 🫂 2000 attendees from 🌆 321 cities that were 🌱 44% new to web3... ...joined forces in Bengaluru to write history. Thank you for taking part in it 🫶🔥 ----------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com

Transcript

foreign [Applause] [Music] thanks for joining us um today I'm going to be talking about how liquidity pools are a really useful tool as defy infrastructure for Builders before we dive into all that exciting stuff I want to start actually just by touching on something that's very important to all of us here uh I think there's one thing that we've learned in in crypto over the last three months it's the value of decentralization transparency immutability uh in finance uh with the billions of dollars that have been lost of consumer funds by exchange like FTX lending platforms like block five Celsius Voyager um the value proposition of defy is has been validated now more than ever um and the people in this room are the people who are really bringing this to fruition so um it's we're not only here to kill build cool Tech we're actually building a safer more fair more transparent um world for all users of financial products and services and I think that the work that we're doing now I think has has always been important and I think it's more clear than ever like how much the world actually needs this so with that said um I'm Jeremy musiki I'm CEO of orb Collective uh orb Collective is a growth team for the balancer Dao uh our mission is to scale uh Global utilization of the balancer protocol and support the resiliency and long-term sustainability of uh balancer as a community and as a technology balancer is defy liquidity infrastructure and balancer is designed as an as a very flexible amm automated Market maker that is highly customizable so the liquidity pools within balancer um serve as this building block as this piece for developers that are that can you know integrate and build on top of this base layer for many different use cases and we'll definitely dive into that um balancer serves today is one of the top uh decentralized exchanges in defy across chains um but balancer really and and this is what balancers I think historically most well known for it's it's our exchange but balancer is actually way more than that so first I want to just kind of lay some like foundational knowledge about what a liquidity pool is so that we're all on the same page so liquidity pool is is like a stockpile of tokens that uh belong to separate individuals or or organizations that are held together in one smart contract and these tokens are pulled together in order to generate some yield by putting those tokens to work utilizing them in some um effective efficient way uh and creating a liquid Market using those tokens so in the case of an amm or automated Market maker these tokens are pulled together in order to create an exchange Market between different pairs of tokens so uh you make it so that a buyer or seller can trade with a liquidity pool basically by providing asset a and getting asset B in return at a given price and that that price is determined by the liquidity pool algorithmically so I'll go through a couple of examples of liquidity pools so first example is a single asset pool and a great example of this is a money market or like a borrow lend protocol such as compound in this case so in a single asset pool there are lenders that are lending a token into the pool and borrowers are borrowing that same token out of that pool lenders are uh earning interest borrowers are paying interest and it's one pool that consists of one token that's being used by both sides of this Market in a dual asset liquidity pool now you open up a different completely different kind of use case so if you look at uniswap for example you have um a pool with two tokens let's say it's eth and die and this pool is maintaining a balance between the two and as a Trader you can um buy eth from this pool by selling it die in exchange or you can uh or vice versa and having this pool containing two different tokens serves as having a a liquid market so that anyone who wants to trade between these two can do so at any time and and you're not this is not like an order book which happens in in traditional financial markets where in order for your trade to be fulfilled another person on the other side needs to want to do the exact opposite of your trade at the same price they want to buy what you're selling and they want to sell what you're buying here uh in an automated Market maker like uniswap or balancer uh that you're trading against a liquidity pool not not another Trader now let's talk about multi-asset liquidity pools so this is a concept that um was originated by balancer but um one of the great examples of it in practice is the curve three pool and uh this is a so first of all multi-asset liquidity pool is a is a pool that holds more than two assets and provides multi-directional liquidity uh between all of the assets that are held in the pool and in the curve three pool you have a liquidy pool that contains the top three stable coins die usdc and usdt and what purpose does this serve it serves any Trader who is holding uh one of these stable coins or two and wants to exchange into a different one there's a very liquid market for them to be able to do that very efficiently uh on the right side of the screen here we have the balancer boosted Ave USD pool or BBA USD for short and this serves a similar purpose to the curve 3 pool in that uh it's a it's a stable coin pool if you have usdt you can trade for usdc or die or any of those uh tokens for each other but if you look at the screen you actually see that this pool contains six assets not three and and the reason is because this pool is actually can it consists of three separate two token pools that are nested together into one pool so you have a uh you have a pool for usdt you have a pool for usdc and you have a pool for dye and I'm gonna go into this specific type of pool soon but for now I'll just mention that um the goal of this pool and the reason why there are six assets instead of three is that these tokens are are also at the same time earning a yield outside of balancer for all of the liquidity providers while also serving as as an exchange between stable coins so we'll go more into that it's a really exciting product called boosted pools all right so what can you build on a liquidity pool like now hopefully you have some sense of what it what a liquidity pool is if you didn't already but now let's go into what can you actually build with this and and how does this work as a as a building block or infrastructural piece for D5 Developers so the first example that we'll look at is Iraqis Finance Iraqis Finance is built on uniswap V3 and Iraqis what it is is um it's an app it's an application that reduces the complexity of uh liquidity provider or LP strategies on uniswap V3 uh by automating them so if you're familiar with uniswap V3 you'd know that from V2 to V3 one thing that that really changed and was very Innovative is is that they offered this concept of concentrated liquidity whereas a liquidity provider in a in a pool you can allocate Capital to specific ranges that are trading between a token pair and uh that offers a lot of opportunity to like fine-tune your strategies and it's and it really opens the door for like highly sophisticated players to use this technology and really like have a competitive advantage over unsophisticated players but the problem then is of course that it's a lot more complex and it's a lot harder to use for your average retail investor who owns tokens and wants to uh generate some yield on them so Iraqis is a solution built on top of the uniswap V3 liquidity pools to make these Vault uh what they call vaults um which are pre-programmed strategies easy to use for anyone another example is uh yearn so urine has a lot of different vaults as well and these vaults um similarly but different to curve are a way to automate uh like yield farming strategies usually so if you each each year in Vault is designed around a certain asset you put the asset into the Vault and then there's a strategy that's designed for that Vault that will take that asset and and use it in the most profitable investment strategy available in D5 and these are not exclusively built on curve you can see here on the screen that there's an Ave Vault there are actually a couple of balancer vaults but there are a lot of curve volts so um this example right here is a um using the the curve three pool that we were looking at previously there's a vault that uses that pool uses the lp token of that pool to invest into the most profitable strategies what this these vaults can do basically is they could use the lp token itself if there are investment strategies that are you know useful there or it can access the underlying liquidity from those tokens and use that and sort of Bring It Back at the end of the day so uh another example here which I think is the most exciting one is Fjord Foundry which is built on balancer now um this I think goes to show sort of how balancer is really in a different category compared to these other amms because of the types of liquidity pools that you can use and you can create on balancer so Fjord uses a primitive a pool type on balancer called a liquidity bootstrapping pool and they use this to create uh the most popular platform for launching a token you want to so when you a project is launching a new token into the market they can use Fjord to uh conduct this sale in the way that in a way that is uh very fair uh uses a um like reverse Dutch auction style price Discovery mechanism to find the right market price and to give all participants an equal chance to buy into the sale it also provides protection against uh Bots that sometimes can like buy up an entire sale before other people get a chance um and also you can use Fjord to conduct a sale that actually raises capital in more than one asset so let's say you want you to you're launching your token and you want to raise a treasury that consists both of each and stable example you could actually have both of those being accepted by the pool so that the end the day you've raised capital in both so let me just talk a little bit about liquidity bootstrapping pools the way that this works and the way that this is possible is that an LBP is a balancer liquidity pool that has the ability to change its weights um over time while it's live so if a tool starts where it's 80 percent eth and 20 percent die uh it can actually change over time and get to a completely different percentage distribution such as like 20 if 80 die if I had a lot of eth that I wanted to sell I could use a liquidity bootstrapping pool to do that while the the weights shift over time it adjusts prices over time and it incentivizes uh traders to trade against that pool and basically to to move it into the balance that I wanted to eventually get to okay um actually why not yeah so you can see here on this graphic from doing analytics that uh we've had 299 lbps on balancer uh so far over 90 000 investors have participated in those and um yeah there's been a lot of money raised and there's been a lot of uh volume uh for those projects um and Fjord is is an awesome place to do that so uh let's now dive into more of these pool Types on balancer um with of course a lens toward understanding how these are useful for developers so we kind of talked about how liquidity bootstrapping pool is useful for Fjord they actually built a whole product based on that pool but there are more so first the weighted pool um this is kind of like one of the more basic foundational liquidity pools on balancer these pools can hold anywhere between two and eight tokens uh they have fixed weights uh the creator of a pool which anyone can create can create one can set those weights um according to their specifications 50 50 80 20 90 10 pretty much anything in between and these can also hold um as I said up to eight assets so one example of something cool that I've seen someone build using this product is uh there was a gaming project and in their game there were these uh in-game assets that players would earn by playing the game now what the developers of this game needed to do was they needed to convert they needed a way for players to be able to convert between one asset and another um while they're playing the game so let's say you earn a certain amount of like a certain in-game asset and once you reach a certain level you actually can level up to this other asset there's a liquidity pool on balancer that's actually working behind the scenes in this game and those tokens are being traded in that way so this weighted pool is sort of the enabling component um of of that functionality in the game so stable pool is another example and this is a pool that holds two to five tokens that uses um a stable swap formula for tokens that contain exact or almost exact value so against this could be dye usdc us usdt but it also can be like wrap Bitcoin derivatives like wbtc Ren BTC uh svtc and you can also you know this could be stake teeth derivatives as well so the advantages of one of these pools is that uh for Traders there are tighter spreads and lower uh slippage for liquidity providers you earn a competitive yield with very little and permanent loss which comes as a result of the the way the formula balances between tokens of the same value boosted pool is something that I was talking about earlier so in a boosted pool what you have is is of Highly Capital efficient liquidity pool that is not only serving it's as an amm where you can exchange any token for the other but at the same time it's lending its assets outside of the protocol into some other yield generating strategy so the first boosted pool is the Ave balancer Ave booster pool and in that pool you have die usdc I'm actually going to go back to that graphic um somewhere around here yeah so you have usdt and ausdt a usdt is the Ave wrapped version of usdt so it has so you can see here that there's a percentage of the Assets in the pool more of the the most of the usdt in this pool is actually deposited into Ave and then the Ave a token is in this pool paired with usdt itself this pool just needs to have enough usdt usdc and die to fulfill the demand from Traders at any given moment and the rest of the pool can be earning yield on Ave so if you're a liquidity provider in this pool you're earning from two different revenue streams uh this is something very unique and Innovative in D5 that really isn't I don't think is possible anywhere else other than on balancer so for an integrator for a developer um boosted pools are interesting because they simplify the path for multiple operations so you can keep everything within balancer and it also enables Advanced applications so out of two like wet weighted or metastable pools that contain like for example USD or the euro you can create a whole Forex application that generates yield and boosted pools you know this first one is built on Ave but we have multiple new ones coming out soon with other partners that are utilizing Assets in balancer pools within their protocols to do really interesting things so a metastable tool is a is a pool that is designed for tokens that uh are highly correlated in value but not uh pegged exactly so a great example of that is rap stake eth and eth itself wrap stick teeth is uh since it's staked it's earning a yield and it has a different value from each it's always going to have a slightly different value from eth um but in a this what this is is a generalized stable pool that can hold for these proportional assets um and another example of that would be like die and see die so you have a predictable schedule of like what the valuation uh exchange rate is going to be between die and C die because you know how on compound the value of uh deposited die is going to appreciate over time in order to account for the the interest that it's going to earn so let's like if we talk about Lido as an example so um when users stake Ethan to eth 2.0 with with Lido they get stake teeth in return and when they and through this pool lydo makes it possible for anyone to get in and out of staked eth very easily by just trading with a balancer pool instead of wrapping and unwrapping or sticking and unstaking so that's really the easiest way to do that um last lastly here in terms of full types is something that we're currently developing right now that's coming out soon it's called a managed tool manage tool is designed to um optimize itself for sophisticated portfolio strategies and have more fine-grained control one of the main products that you might build with a managed pool is an index fund so manage pool can hold up to 20 tokens actually can hold more than 20 tokens and uh it had you can set Dynamic weights you can set Dynamic fees and you have the ability to have an allow list of liquidity providers or um you have a manager of a pool who can Implement a certain strategy for how that pool will invest its assets um and you can change the tokens and the and the allocations um that that pool has at any given time another thing about manageables is that they have a feature called circuit breakers so circuit breakers are designed to protect against like a Black Swan downside uh event so uh you know defy kind of it's in general doesn't really have that but in traditional financial markets when there's like a catastrophic crash they have circuit breakers that can just kind of stop the markets from Trading so in a managed pool a pool cannot uh at any point decide that it needs to stop trading because you know let's say for example one of the tokens in that pool um what got hacked there was some kind of breach there's some kind of um Market catastrophe a rug pull whatever might have happened that pool can actually just stop trading so that the rest of the Assets in the pool are protected so you can also not only can you use these these really interesting pool configurations on balancer but you can also create your own custom uh amm pools and I'll talk about a few examples um of projects that have done this so there's elephant element Finance uh sense protocol and Tempest Finance these are three um really cool projects that uh use balancer to create their own custom amm pools to make fixed rate markets possible gyroscope has built there also their own amm unbalancer which serves to power um a new stable coin that they're releasing soon uh and kind of the point here is not to dive into like all the complexity of how gyroscope works but just to show that on balancer there's a lot of room for building custom Solutions and kind of configuring Things based on the needs of your application as a developer Crown finance and excess Finance are two separate projects that are using balancer to build t-wams which is a Time weighted average Market maker um and the point of of this product it's kind of something that has been discussed in the space for a while but no one really like built it and turned out that balancer was the perfect place to do so so uh the goal of a of a twam is to execute large trade orders over a longer period of time so that slippage remains low you can take trades and you can break them up into smaller pieces so the liquidity required for each of those trades to be executed is less and the slippage is is smaller so this is really important for like large-scale uh investors or Traders um because in defy like slippage is a huge issue when you're moving large amounts of capital so um that's kind of a tour of some of the really interesting things that are being built on balancer now I want to talk a little bit about some of the grants and perks that are available to developer teams so these are a bunch of uh actually some of the projects that I've already mentioned today as you can see these are recipients of Grants they've received grants from balancer to build what they were building and um you know ended up building something really amazing so for any developers that are building in D5 and and need some kind of amm functionality if there's some kind of swap feature involved in your application it's a lot better to use a ready-made solution that works that's secure and that's you know battle tested that you don't have to build from the ground up rather than kind of doing all that yourself so highly recommend checking out our docs and um definitely apply for a grant if that's something that's that you want to do we also have uh this really cool partnership with sertora the guys who are here and are going to be speaking after me I believe which is the balancer Satora security accelerator so um for projects that are building on balancer you get access to two weeks of manual code review by Satora which these guys are awesome um smart contract security firm uh and this is something that is is valuable to like any developer in the space and it's really hard to get audits when you're especially when you're a small team in the space so that's kind of what we wanted to do is make this more accessible um so yeah and through this program you get the two weeks of manual code review you get set up an introduction of of the of satora's formal verification prover B and you get uh ten thousand dollars uh worth of credits for satora's uh formal verification you also get into assistance from the balancer Integrations team on uh your code functionality on business logic so it's really a good time to get involved um I'm gonna quickly just talk a little bit about the SDK because it's been recently revamped and we've been getting really good feedback from developers on that so balancer.js is a JavaScript SDK that provides commonly used utilities for interacting with balancer V2 uh valpai is um these python tools for interacting with bouncer V2 in Python uh balancer Sor Sor stands for smart order router this is a JavaScript off-chain linear optimization of routing orders across liquidity pools to get the best price execution and then we also have two really cool community-led sdks that have been supported by a balancer grants program Delphi which is in delpherium and also rust um so as a as this is an example um of configuring the SDK to use uh mainnet subgraph and contracts so SDK examples and tests can be run against a local Fork it's easy to hack and experiment without using real funds and um the SDK uses this very easy interface the Sor to find best swaps um like across all of the liquidity on balancer which is around a billion dollars and using the SDK you can very easily add liquidity to any pool and you can fetch and pre-calculate pool data which is especially useful for front ends and with that um we can end here if there are any questions I'm happy to take those thank you are we doing Q a okay great so this might be uh slightly vague and feel free to not answer this question but uh when you spoke about uh uh there being a circuit breaker in in a managed pool I I circuit breaker yeah circuit breaker in your managed pool contacts uh who who acts as the circuit breaker who has that Authority and the larger question I guess is sorry who has what I couldn't hear you that well who acts as that circuit breaker is that again a decentralized role or is that like one person or a group of a few people who act as circuit breakers and decide that it's time to shut down the market for the time being and uh I guess the broader question is where do you draw the line uh in the beginning you stressed about the importance of decentralization in finance but uh we know that it's not a very practical thing somewhere we need to have some uh some amount of centralization to get get it to work uh properly so where do you draw the line if if you can articulate a clear question a clear answer to such a big question I'd be good to hear sure so I think the second part of your question to make sure I understand because the the audio is a little tricky uh was that you you're saying that um while decentralization is great like we still need some centralization as well um I agree I think I think decentralization depending on if it's very case specific for each project like when it makes sense to be 100 fully decentralized but I think that when you look at the D5 protocols like the exchanges and the borrowing and lending protocols that have been operating very smoothly throughout all of the insane catastrophes that have happened in the crypto space the last couple months while while you've seen a whole list of centralized platforms blow up and lose billions of dollars I think it's a strong indication that um this the security and I mean the transparency and the uh verifiability of a decentralized system is very Superior to a centralized system it doesn't mean that like there can't be any centralized components like it depends on on the on the project and the system that you know I don't want to give a one-size-fits-all prescription here but to me it's very clear that like defy will eat C5 uh CFI I mean it's these are the same issues that have gone on for so long in the financial industry where there are you know risky lending decisions made or or like unethical decisions with customer funds as what's been alleged in the case of FTX like these are things that are not possible in an immutable decentralized uh protocol um I think that with something as crucial as Finance we we really need to transition and I think that we are eventually going to transition from these human-led systems where there's a lot of room for either error or greed or you know bad decisions or misuse of trust into systems that are fully open fully transparent um yeah I think it's just very clear to me that that's what we need in finance um and we don't need to have these billion dollar sort of catastrophes in the future um I I can talk a little bit about the manageable circuit breakers again these are like currently in development so whatever we might talk about today can still kind of evolve and change and it's it's not a final product right now um but what I can say is that um the idea is to set some like programmatic guard rails to defend or to protect the pool against like a a like a catastrophic situation so for example if you had a liquidity pool that contained um Tara USD and let's say you had Tara USD and you had like a few other stable coins they're all in this pool and then Terra USD um explodes the price is suddenly dropping what would normally happen in an amm is that the amm is programmed that when one token goes down it sells the other tokens and buys more of that token that went that that went down right so in that scenario the every dollar in that pool will be lost if you have a circuit breaker in place you can stop that from happening at some threshold that is like defined by the creator of the pool so that in you know a Black Swan event you can actually protect uh liquidity providers as much as possible yeah I I get the reason for it right yes it can be designed that way um again it's it's a work in progress so um I just wanted to give you a preview of the product it's when it's done I'll definitely have a lot more to share foreign exchanges uh we started seeing problems in the device space Also in decentralized exchanges uh two days ago anchors uh tokens was exploited and they went to pancakes weapon millions of dollars was drained uh do you have those kind of uh safeguards in the balancer so I I couldn't hear everything you said but I think you were talking about um yeah anchor was exploit right on December one yeah December 1st uh and then and then the pandua moved to pancakes are once again uh defy decks and and then it's drained from there yeah so there's always a risk like in an amm that if a token that is held in a liquidity pool gets exploited that you know any liquidity provider that is in that pool even even the one that is providing the token that is kind of trading against that that token that got exploited can lose their funds so um smart contract risks is very real we need teams like Satora to um you know help keep the keep the space safe as much as possible from those risks those are um those are very real um so I think D5 has its risks that are different from the ones in C5 right so in D5 we have more security risk in terms of like code exploits um in C5 we have more like human risk where you have a trusted person who's in charge of potentially billions of dollars in funds that belong to their customers and we have to trust them to be ethical and moral and fair and on honest and like so many times in the past and just just recently that has not worked out well so um what I'm advocating for is uh trusting more in like secure code than in like an individual or even like a charismatic person who who seems very trustworthy logic it looks logical that code will be a bit secure but it also gives uh opportunity to hackers and everybody else who understands that everybody can go and exploit okay uh in the previous case it's like a one person which is not able to do good and we all get suffered because of that but here uh the information is available publicly okay the kind of exploit happened with anchor uh anybody can do who understand better for web3 so yes we can say that we are shifting our security uh measures from Direction a to Direction B but is still saying that okay Define the better or more secure densify seems to be subjective yeah and I would also just mention like in the case of the anchor exploit so anchor got exploited but the amm pancake swap was not exploited right so but the people who provided liquidity and anchor on pancake swap lost their money so I think in defy there are kind of multi-dimensional risks that an investor has to consider so the investor that bought the anchor token and put it in and and decided to be a liquidity provider on amm uh took a risk in the security of that protocol and unfortunately that didn't work out and like I'm not I don't have anything negative to say about anchor at all that's not my point um my point is even if a platform is fully is is very secure and not exploited the assets from all over D5 that can be held on that platform all have their own risks as well so there's like really an exponential Matrix of risks uh that most people I think that you would agree most people who are using these Technologies don't fully understand all of those risks either they either they know that it's risky and they're they're doing it and they're taking the risk like some people like to gamble but I think a lot of people are not fully aware of those risks um and in a decentralized ecosystem it's really hard to provide good protection against those risks because there is no one there really like holding your hand or like stopping you from buying something because it's not safe um it's uh yeah it's it's very tricky sure okay thank you everyone uh uh and uh appreciate all your questions

Automatic transcript — names and jargon may be misspelled.