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

Loading player…

'Swaps & Liquidity Providers' - Arjun Bhuptani

ETHGlobalSat, Oct 9, 2021, 12:00 AM

Speaker

Arjun Bhuptani

Arjun Bhuptani, cofounder and CEO of Connext, explains how swaps & liquidity providers work using Connext.

Transcript

so up next we have arjun bhuttani uh the ceo of connex uh really excited to hear more about what connex has been doing and you know another little fair market tidbit uh canex has been around you know for several years doing state channel research uh started off by receiving a grant from the ethereum foundation for some uh state channel work with spank chain um and now pivoting to vector payments really excited to see the progress you guys have made awesome yeah thanks so much ava um i guess let me start by sharing cool um this talk is called uh cross chain swaps and liquidity providers i've missed the providers here um uh but the idea behind this is that we've uh i i want to cover kind of a little bit about like the the the ideas behind why connext exists and what it means for as we go into like this this layer two ecosystem of this new layer two world um and uh go to give a little bit of an overview of how connects works and then also where we're where we're planning to go so um i think the the first kind of core thesis that we started with was that ethereum layer 2's need interoperability um this means a lot of things so like uh of course there's like uh layer two exits of fast layer two eggs just fast optimism exits uh that bartek just talked about um but then we're we're also seeing that there's there's a big need for just like broader l2 to l2 communications um and the the core idea behind this is that like um especially with ethereum gas fees increasing kind of exponentially over the course of the last few months we we've seen that users kind of want to treat each layer one as uh as like lava like if they can avoid having to go through ethereum layer one at all then that that ends up being like a tennis experience for them um and uh and not having access to that so it kind of brings brings about the same sort of um you know like minimum uh liquidity or minimum value requirements that currently exist on on ethereum layer one itself so for instance um you know pricing out like users who are not who don't have tens of thousands or hundreds of thousands of dollars in order to uh to like make large and expensive trades on unit swap um those those same users now end up uh having to deal with the same problem around even if they're even if they're like on a on a solution like polygon and trying to get to another solution like arbitrary they have to deal with the same problems unless you have like native layer two to layer two in our ability and we're seeing that this is like becoming ever more necessary so like when we when we started talking about layer two interoperability last year um it was a really controversial topic um i think the the philosophy at the time was that people would be moving to a single their their two ecosystem and that that there wouldn't be this like plurality of of different solutions out there on the market and and even if there were like over time everyone would just like aggregate to one thing what we're seeing though is that that's not really the case like we we have a diverse set of of service writers uh providing different layer two uh solutions and then also uh d5 projects and other other kind of like key players in the ecosystem going to different solutions as time goes on so we've we've seen in the last like two months every single d5 project that's out there has is pretty much every single d5 project has announced some sort of like multi-chain strategy um and this begs the question of like how do you deal with cases where users have funds on one system and want to get to another system um and ideally do that again in a way where they're not having to deal with like uh you know significant layer one gas fees and the one week exit window um so there's a bunch that's out there on on interoperability and on like ethereum fast unlikely or two fast exits um and so here i'm just gonna try to give like uh the highest and broadest little overview around like what it means to communicate between between different blockchains um so there's there's three general approaches that people have seen so far there's uh and everything that's out there kind of falls into one of these three approaches um there's native cross-chain invalidation made basically like uh the idea here is that like the virtual machine of one chain natively validates the virtual machine of another chain um this is hard to do because like it typically either requires you to have custom chain implementations um or it's extremely expensive so like for instance roll-ups fall into this category where like you have uh ethereum validating a lot of the roll-up state um and either that's happening to fraud proofs or validity proofs um with ck roll-ups and uh and the the native validation aspect of this is kind of what keeps rolex trustless so like um in a mental model for a rollup is that it's also just kind of like a poa sidechain uh but it has a trustless bridge um and i think that's a that's a key part of it because like fundamentally when you think about it that way that means that the entirety of this layer two problem really comes down to how can you build trustless bridges um now what does it mean to have this kind of validation so um though luckily native crossteen validation is trustless it's entirely trusted and it's about as trustless and generalized as you could possibly get um and that's what makes like roll-ups so powerful and that's also what makes makes things like ibc so powerful um however um uh there's there's sort of this like trade-off space then around around like uh the amount of time that it takes to make updates and the amount of amount that it costs so like um if you have you know purpose-built chains that are designed to be communicating with each other this way or at least one of the two systems is purpose-built like with the roll-up um then the cost is not super high i mean it's still somewhat high in the sense that you have to keep publishing roll up blocks because you need data availability but um it's not like you're paying like thousands or millions of dollars in order to like uh submit transactions between chains which is unfortunately what ends up happening in the case of things like the near rainbow bridge um however on the flip side of that you also have like uh you also have like exit windows for for things like optimistic roll-ups um and so uh in those cases you have this like one-week exit where you have to we could do things like you know like figured out suggested where you provide liquidity for the exit um or uh you have cases like ck uh zk roll ups where you can do that in a single block um now the other the other two approaches are a little bit different because they're they're kind of like exist in a slightly different paradigm where where you're not having to have these like native systems that are built uh purpose built to be interrupted or interoperating with each other instead pos and 101 swaps are both mechanisms that can be used against existing chains so things like side chains um even even other ethereum or even other non-ethereum layer ones so examples of pos and fpc bridges are thoracene ren as you just talked as bartek just talked about like maker dao's optimism exits um kind of fall under this broader category um and like the polygon pos bridge and the idea the core idea behind this is that there's like some third-party validator set and it act that acts as an oracle and um and that third-party validator set has some mechanism to keep them trust minimized so there's there's some like economic bonding mechanism that reduces the trust on this party on this set of party now um of course the idea is like if you're going for maximal trust minimization where like uh you are defaulting to ethereum's trust trust model which basically means that therian's economic security um having a pos npc model means that you are diluting that uh that that economic security um you you do have a secondary mechanism like a secondary economic back stuff and in the case of maker it's it's basically the mkr token that is used as like the oracle backstop in the case of thor chain it's roon uh et cetera et cetera et cetera now depending on the mechanisms uh the the amount of cost the cost is like usually low to medium um and it's usually some anywhere between solar fast and there's like a lot of variety here because there's a lot this is sort of like the broadest category where you can have a lot of variability in how people implement solution um and then the last approach is is is a one-to-one swap model so the core idea here is like take this like n party consensus system or this end party oracle problem and turn it into a one-to-one system uh and the cool thing with one-to-one systems is that like both people have skin in the game and because both people have skin in the game you could kind of expect them to always behave in a way that's like economically rational for them they're not ever going to like behave in a way where they're losing their own funds and if they do then that it's just it's only their funds that are on the line um and this includes constructions like atomic swaps uh it includes what we're doing it connects with channels um but the idea here is like uh it is it is sort of it is trust minimized in the same way that like native prostitution validation validations trust minimize because it just inherits the core properties of the base chain now of course there are there are like downsides to this as well and i'll kind of talk about those as we go on so how does connects work um at the highest possible level what we are is is a state is just a regular old state channel network um and with any kind of regular stage network you have a set of liquidity providers these are these are state channel nodes uh we call them routers um that provide uh that basically front the liquidity in a receiving side channel in order to get get a payment in a setting inside channel and all we do is we extend this model across chains so basically if alice wants to send uh funds from arbitram to optimism um so say she wants to send if it eats from arbitrary to optimism um which what she would do is like uh send a payment in a state channel in eth to a liquidity provider to a connect router and the connects router would send a corresponding payment in a state channel to to back to alice um because we're using channels here we can make sure that those two interactions are atomic um and that that enforces the fact that there's no way for the the router to kind of like steal alice's funds and there's no way for this this whole uh cycle to to not complete once the router has actually initiated the process of like completing this transfer um now there's there's definitely a lot of nuance to this uh this is like again the highest possible overview the highest level possible level overview i could give but um there's definitely there's there's a few key design principles that we've baked into this that we that we feel really strongly about um as part of our part of our core assumptions so first of all we think it's really important to utilize the security of the underlying chain and the reason that this is important is because we don't quite know what mechanisms are going to be used for ethereum layer 2 solutions in the future right now we see rollups as like the most dominant mechanism for um for uh uh for securing like for a a very secure model for for layer two but we there's also downsides to roll-ups that people like that i think are not really discussed often enough um and those downsides are are things that i think people will start to see once we start to get roll-ups live around around like the actual app like the absolute scalability of a roll-up model versus other models that don't necessarily post constantly to chain um and this is this is kind of like the uh the core idea behind like zk rolex versus zk porter um that i think alex from zk sync is talking about and either he might have already talked about or he's talking about today um and so the so our goal is just to say okay well we don't necessarily know what mechanisms are going to be used to bridge between these different chains on the on the base layer quote unquote but we do know that uh that whatever mechanism is used you we do you do always need this this ability to allow for fast cheap swaps between different assets um and kind of going back to this model uh the good thing about that philosophy is that that means we can work in tandem with like existing pos mpc bridges and existing native clustering validation models because a fundamental assumption with with our one to one swot model is that an asset already exists for us to swap into right there's no there's no way for us to do what we're doing with connects unless you already have uh liquidity on the receiver side uh second this is kind of building off of the same core idea don't create lots and lots of representatives so bartek was talking about how uh there's this there's this problem with like that that is going to show up with with optimism and so we've already started to see with like xdi where if every single new person that builds a mint and burn bridge intox die or into another another chain ends up creating new new representative assets which are not really fungible against one another and you can trade them against one another but this just increases the complexity of these assets massively um i had this problem myself yesterday when i was trying to swap uh where like i ended up giving liquidity for ave on polygon uh and i ended up with like am usdc and i tried to swap it for something else on on quick swap and it turned out that quick swap only has liquidity for m a usdc which turned which is actually uh the liquidity that you put into ave on in usdc on ethereum and then bridge to matic rather than the other way around bridge somatic and then put into ave so there's just like a huge user experience mess there that we are currently barreling towards that that i think folks really have not been aware enough of yet um and then the last idea is kind of one one that i've i've touched on already which is don't incur those layer one costs between moving assets from layer 2 to layer 2. um we've had a number of users come up to us and say hey uh i had you know forty dollars or fifty dollars on this chain that i had pretty much just given up on in dust as as dust um but it because like i didn't think that there was any way for me to get it out of you know xdi or polygon or whatever and get it into another system um and uh and that's that's unreasonable like 50 is is a lot of money for a lot of people in the world uh and we shouldn't be pricing people out in that way um so is it working um uh yes uh in the we've we've seen that this like this model doesn't just work it's uh it actually scales pretty well um uh the id it's incredibly capital efficient because like um we don't we're actually netting off liquidity going in like different directions and like uh so you can have like swaps that are going from uh you know like a lot of this is like bsc to polygon uh interactions we have a lot of stops that are going for bc to polygon because people are onboarding the polygon and then a lot of stuff's going in the direction because people are trying to exit in to fiat and and all of this 4.3 million dollars in volume is actually happening on about um i think about 4 million of this volume is happening on about 250k in liquidity uh which is insane that's an incredible capital efficiency and you can also see very clearly the point where like the d5 apes discovered uh that this was a model that works and it's incredibly cheap because that's where we went from like that's where we like adaxed our payment volume um now this this doesn't have this this model doesn't really exist without its own drawbacks um and there's there's a couple of things that we're working on uh in the in the kind of like short to medium term that we think really really need to happen in order for us to keep scaling this up because if we keep going up in this direction we're going to keep running into problems um the first thing is automating router rebalancing so the biggest kind of like user experience hurdle that we're dealing with right now is that like um you know you have you have these routers holding the qwerty pools on each chain and uh and then uh a user you know similar to what bartek was talking about with where like users come and do like larger transfers a user comes and does a larger transfer puts all pushes all of the query to one side and now nobody else can do transfers um a part of that is solved by just having deeper like more liquidity depth but uh ideally what we want to do is like create an incentive for people to come and rebalance this thing for us and that way we're not we or whatever whoever the router operator is isn't actually having to do this themselves all the time because that's expensive and it's a pain um and then second of all uh there's decentralizing scaling up liquidity itself um so like how can we have more routers in the system and aggregate liquidity across all these routers um so something that we're starting to explore now is the concept called virtual mm so we all kind of understand the amm model which is uh let's take let's take the price between two different assets or perhaps even like potentially many different assets uh in liquidity pools and set bond that to a pricing curve um for units about that pricing curve is like a constant product function um for like stable swap is this more complex equation that optimizes for stable one to one one to one assets and things like that and the core idea behind this and what makes this really powerful is that like the price between these assets moves as a function of the available liquidity within the system and because this this price moves you now have this incentive that gets created for other people to come and arbitrage this thing if that price doesn't actually reflect the true price of the asset in the market so for instance if i go and i swap uh you know one each for uh one maker on on um on uh uh sorry not one easy for one maker but if i go and swap uh some ether maker on unispot um and i push the e i basically end up creating putting more liquidity of eath into the east pool and i reduce some of the liquidity in the maker pool that will change the price between ethan picker on unispot now if i if uh you know say bob is a is a is a person who is watching this interaction and has liquidity in maker um and he sees that he you know the coinbase price of maker is actually uh is actually lower or higher than the price that he that is available in this uh uh that is available on unispot he now has the ability to go and arbitration and i think this is one of the things that makes unisport so powerful is that it's just so easy to art um uh i think we can take the same kind of concept and apply it to these routers um and we're calling this virtual amms because it's not like this these are like actual ammo and contracts on chain it's just that we are bonding the swap rates that the router provides between uh between you know assets in this chain or like assets uh on arbitrary for assets on optimism and we're bonding that to operate to a again another uh uh uh amm curve um now the cool thing is here we're we're doing the same thing that we're doing with union software over time as you continue sending like ethan arbitram to ethan optimism this actually changes the price between these two assets and that difference in price reflects the available liquidity on those on those systems um which again incentivizes somebody to come and push liquidity in the opposite direction the cool thing is that because we are not actually taking we're not actually taking control of the rebalancing mechanism ourselves we're just incentivizing that somebody comes and rebalances this thing um that means the the ways that we have to rebound this thing the ways that other people can come and rebound this thing are are dependent upon um not just the existing bridging mechanisms like roll-up exits and entries but also on other liquidity that you can find through otc trades through swapping through fiat um and i think the idea behind this is that like even if in the case of something like you know finance chain where like the the binance bridge ends up being taken down there is actually a really interesting mechanism where people can still continue doing virtually unsensible swaps between in and out of binance chain because they can continue arbing through the binance exchange or through otc now of course the swap rate might be awful but hypothetically this ends up being a lot harder to censor um the second aspect of this and this is this kind of gets into like how do we scale this thing up and and make it available to a lot more people a lot more quickly is um is uh is aggregating liquidity across a bunch of different routers and we call this route auctions um so the core idea behind this is that like when alice wants to send liquidity from uh you know from arbitrary to optimism in east she doesn't really care that much which router she's routed over or sometimes which several routers she's routed over all she really needs to do is broadcast the network saying that this is the entry liquidity that she wants and this is and this is the exit liquidity that she wants um and the cool thing is that over time what we can do is have many many different routers providing this kind of liquidity uh in the same way that you have many different liquidity providers on unit swap or on any other amm system um and if and and alice can be routed over one or many of them concurrently um if we put this together with the with the like the virtual amm model um what's really interesting about this is that alice has an incentive once she kind of hears back from all of these routers who are willing to supply the security she has an incentive to always pick the cheapest one and that's always going to be the router that is the most unbalanced so you end up creating this really interesting economic flywheel where over time through the combination of these route auctions where alice is broadcasting to the entire network saying hey i want to get i want you know to swap x for y um and router is returning saying okay i'm willing to provide that liquidity for x amount of dollars um and uh the combination of that and then also the fact that these routers are pricing their liquidity based on an mm curve means that alice is always going to end up in a position where she is actually de facto rebalancing somebody else's liquidity um so you have this really cool flywheel where the where the network sort of starts to rebalance itself over time now of course there's still space for arbitrage um and there's there's still that's still an important role within the network but uh there the idea is that over time you can end up with a system where like you don't really need so much arb anymore you just have this very very efficient mechanism for targeting where the liquidity is most needed um there's still a lot of really interesting stuff here it's a big open space for that we're exploring uh we absolutely would love for to to get people involved in building on top of us so um if you're interested in getting involved build uh you can build on us by like checking out our hacker kit um it's at connect.networks scaling eth and then you can also hit us up on discord in order to start participating in some of these open research questions that we have around like virtual mms penalizing this behavior route auctions and a lot of other things that we're working on in the future that we think can help make this into like a very very interesting mechanism for communicating directly between different layer two ecosystems and also to layer to layer one um like our our mental model for connects is sort of like this cross-chain clearing house that sits on top of uh on top of any any of uh any of the the chains within the ethereum layer two ecosystem and allows you to kind of net off volume between them cool thank you all for for coming to my talk and i hope you all have a good rest of your scaling ethereum awesome thank you so much arjun uh it looks like we might have a few minutes uh do you have a minute to maybe answer a few questions yeah absolutely awesome the first one i have is how are you thinking about connects and vector payments uh in regards to eth2 and the transition yeah um so there's there's obviously like a lot of uh open design questions around each two right now where like you know the uh i think the current model of v2 is that like shards are basically going to be like data availability layers for um and in that model like the idea of having many different roll-ups actually only becomes more more powerful um so what our philosophy is is that with ease 2 we're only going to see like a dramatic acceleration of the trends that we're already seeing where people are moving to a bunch of different ecosystems and you're going to be fragmenting across these decisions um it kind of sucks because like you know people you know obviously fragmentation means for user experience but also like that's also that is sort of the definition of decentralization right um like decentralization isn't always going to be the easiest path yeah for sure and one last question maybe what are you most excited about now that we're finally at this place several years after doing so much research now the d5 apps nft apps can actually start using these l2 solutions so what are you most excited about as we move into production yeah that's a really good question um i think like i'm sure a lot of the other l2 researchers will like i'm sure they feel the same way but it feels it sort of feels like a catharsis moment where like there's like we've there's been so much uncertainty for so many years around like what their two will look like and how it will work and we've gone through so many iterations on like that have just not worked um and like that's both within channels also with like things like plasma and and now roll ups and um and of course there's there's still a lot of open questions that will have to be solved especially once users start using this stuff because like as we've seen with channels like users end up just breaking your all the time and there's nothing that you could do about it um and like that's just that's just how user testing works um uh but i i think like um i think what i'm most excited about is to like hit kind of get to this next step where we have we actually have like some of these things that we've been talking about for years actually start to come to reality and and we we can we can think about what comes afterwards because uh we've been stuck on these problems for so long that we haven't been able to progress them yet right yeah looking forward to it and what scaled ethereum will look like yeah hopefully we can have a scaled ethereum global conscience yeah exactly awesome thank you so much for joining us arjun awesome thank you so much for having me yeah

Automatic transcript — names and jargon may be misspelled.