Multiple Chains, One Protocol: Potential and Challenges Building Cross-Aave

ETHCC 4 · July 2021 · 41:22

Ernesto Boado surveys cross-chain developments around Aave, focusing on the potential and challenges of extending one lending protocol across multiple chains.

Speakers

Topics

From ETHCC 4, hosted by Ethereum France.

Transcript

i see quite fresh faces after the party of yesterday so it's good still mine is not so good maybe fine so yeah i'm i'm ernesto vado i'm the cto at and yeah i'm gonna do a small presentation about uh centering in like how howing abbe we managed to to deploy on different chains apart from ethereum from where like where we start and where we have actually the focus uh like a bit of like internal insights of of things that are maybe not so clear sometimes and i hope it will be interesting and then maybe some

more speculative ideas of what what can come next some alpha leaks means so yeah basically this is the the result the visible result on on on ave of uh of of cross chain of like multiple deployments on multiple multiple blockchains uh but to to arrive to this to this visual component like there is quite a lot of work in in the background like a lot of economic work and and pretty good tech work that is the one that i know the most so i i have quite strong opinion about

certain things so like don't be so so so scared like about nothing so i hope it's it's fine uh yeah i will start a bit giving a bit of overview of uh how how the deployment of an upper market works like probably almost all of you are familiar with the with the v2 of avid that is deployed on mainnet is the biggest our market but we also have the polygon uh that is also quite big and and some other and the amm market that is also in here on one that that has a bit of different assets but

uh well all of them like share quite quite a lot of the analysis that needs to be done like before the deployment and and even the even the tech so i will just go a bit off through all the points that needs to be checked quite quite in details first of all like uh how how abby or like the avid community decides where to deploy a market that is the the the first question when to deploy a market and which one to choose right so there are plenty plenty of options out there like and every time there is more and more uh but especially at the moment not like maybe three years ago two years ago like there are really good solid

solutions that actually are let's say production ready for a morning market or like a pool liquidity pool in like avenue so you are you have polygon you have now arbitrary optimism like you have some other things like solana and plenty of others probably i mean i forgot a lot for sure so what is the the first thing that needs to be checked so the first thing is like what i say that now there are like technologies that are ready for production so when i say ready for production is that the change security that is the most based layer of of a chain so with with that i refer to the consensus mechanism that needs to be solid enough like right now like there is pretty good things

out there like not only theory even if more or less everybody shares same concepts the bridging because without connection with uh with ethereum at the moment we kind of realized that almost nothing works well so is is pretty important like how how solid is the bridge solution both in in terms of of implementation and then in terms of ux for for the people that is doing the bridging of the of the assets or anything else i will go a bit further afterwards then the like the the million dollar question always is like is it evm compatible or like fully compatible or not fully compatible like

when when a chain is evaluated so this this means quite a lot of the the difference is that even if initially like people was uh like not so convinced about this being always cvm compatible like because they say okay then the technology is just superior so why we should actually bend to ethereum to a virtual machine that is a bit old and and so on but the reality is that the most scarce resource at the moment in in ethereum but in the blockchain development is is actually people that knows how to do things so and and the evm is actually that it's not only a virtual machine not a technical implementation but it's more like uh even a tool of coordination of

developers like there is plenty of developers out there like that they already know how the vm works already know how to work with solidity with viper and and there is plenty of tooling like still improving but at the moment like plenty of tooling that the more or less people is familiar with and they are comfortable to implement things in a solid way you know so yeah that is the that that is the one of the main questions like in from my perspective i am i'm a hard believer on on like on the ethereum technology so always like i'm quite biased and says like if something is not evm we will check like also but i'm already a bit skeptical to start with

uh then what i what i call the chain ux which is not not only the visuals and then the website where you interact with that chain but it's everything around so like there needs to be a for example support of meta transactions is a cool feature because it allows the developers to do like interesting things there uh obviously the speed of the chain maybe it's not so important in some cases uh i mean at least not critical but but this is a good point uh the cost of the of the transactions like in previous dollars for example it was one of the main points on governance coordination technologies

that is quite quite basic that you have cheap transactions in that case so like roll ups and other chains like they try to solve that more or less successful and we will see how it will be in the future but at least is right now is one of the reasons for example in in the case of the of the polygon market was one of the main points of success of the market because it gave access to people that was a bit left out by the by the gas facing ethereum access to to exactly the same technology just with a bit uh or not only a bit but underlying a underlying different like coordination of the chain as well so

and a like part of what i mentioned before with evm like the the main point is is developers no so like it's quite important that like these chains have uh really good tooling really good documentation and and if possible people that is already building some other things out there because end of the day like the other market yeah it's cool by itself but if you will not have everything else that is a above like on top of of avid like i will not be so big or so successful or however you want to to to determine so yeah developers end of the day is probably the most the most important of all of this now

going a bit a bit more into details those are more like general points and there are certain aspects that are really key in in in the case of of avenue first of all is the the oracles so a liquidity protocol like cabe obviously is everything about prices like you have over over collateralization you have depth you have a like a lot of points where prices is fundamental so liquidation needs to be solid because end of the data is what makes the protocol resilient and and like the pricing the pricing of interest rates for utilization so also oracles are one of the most fundamental parts of of any other market so what is important in oracle's obviously

in this case i'm quite biased because like we are using chain link as probably knows since since the beginning since it's the version one of the protocol and mainly because of the first point like chaining just works like then there can be some some discussions about like how it's done or not but it just works like for example uh the market never had any any real problem with with updates so for accounts even in in terms of high congestion and so on so it just works and works well then uh how the centralized are the oracles then is when things start to get a bit more polemic in the case of jailing is is a decentralized network so

is also uh like a pro on that but in some other cases maybe it's a bit less but you know it depends like if it's if it's suitable or not then a the third point is the most frequent like source of like headaches for for a lot of people out there especially maybe finances marching and so on uh so that is is really important that the oracle even if not mandatory and even in in some of the markets so fab is not the case but it's important that there is completely a sync in the sense that you cannot use capital mainly source in a lot of cases from flash

loans to to manipulate the price and and and basically screw like some in the market itself so is it's quite important not always it's not always the case because with some tokens it's not so easy to do data sync but but it should be and then yeah i mean battle tested is part of the of the first point like obviously right now if chain link was maintaining a market for two or three years or some other solutions like i don't know like maker dao with their oracle they are just technology that works and is proved in in in the in the history than then it does then um liquidity so

the liquidity protocol is is really fine to have the technology but if you don't have the assets or you don't have a good amount of assets uh like that it doesn't work so it's really really important that you have especially for liquidations that there is a liquid market connected with the chain uh before doing any deployment to to be assumed to be sure that there will be no problem when people try to get rid of the collateral and repay the debt cell and and those those kind of operations so it's completely fundamental i in the case i put the example of polygon but since the beginning the like a lot of other platforms were were deployed there like the the countries like well you have sushi

you have the you have cool you have para swap and and with programs like off of incentives that that made those metals those amms to grow quite quite fast and and basically felt uh it helped avid to to be resilient on when prices went down and so on so it's it's pretty fundamental then uh yeah about the chain infrastructure is with this i i refer to everything that is in the background of the chain that is maybe not so fancy as the consensus algorithm but in the day-to-day of developers is actually what what we see so it's really important that you have uh a swollen infrastructure of nodes for

example to query the data that you don't have like um technologies interesting technologies like like the graph they work well in the in the chain and and so on like then explorers is also some really important point because even if it looks that and and it is the case that the chain will just work without explorers like uh end of the day there will be some problems and people will need to actually go to the explorer maybe do some operation and especially for for visibility of smart contracts that right now basically is a standard that if you don't have the smart contrast validated on the explorer and completely public

well probably you should not trust to to to to use the platform so it's quite fundamental in the in this case obviously like etherscan is is like like a really bonus point of anything because they have a really good product that everybody knows and yeah a part of the of what i mentioned before is like yeah if there are robust providers that already like have speed and some other chains well better image so like alchemy for a block video and polygon so like people that is working on this like for for already a long time and they know what they are doing then uh the acid bridge so yeah as i said before the liquidity is

really important but uh how you do the breeding of the liquidities is probably even even more important than that so um first of all there should be another let's say official solution for bridges like on the chains which is developed by the team that is behind the development of of of the network at least initially because this gives this gives assurance that they will not basically leave you like in the in the sidewalk if something happens then a there are some other models also like the two size liquidity that usually is by other teams looking for for some kind of profit in the in the middle liquidity providers uh but this is also quite quite important

to have these alternative models because if it assures you that if there is any problem with the type of technology of the of the official breach like you will have some alternatives that are quite different actually in the workings and so is is not so so easy to happen to something but to happen both at the same time and then uh yeah there is still quite a lot of room to improve in in this topic of the asset bridges because in terms of user experience because sometimes like the mapping of the tokens is not is not so so clear like some tokens in that in ethereum are basically the same underlying then they they get translated to different

tokens or like even the implementation of here c20 is not the same so those kind of details are also quite fundamental when we're gonna doing a uh robust analysis of of the breaching of the chain so what what's next uh for abby well mainly it will be a bit on the community like but the the talks that are around is uh obviously quite center on the on the topic of of of roll-ups of ultimate optimistic roll-ups especially so arbitrary optimism but some other side chains are like are also doing quite good work so probably there could be opportunities to see

to see the upper markets there yeah uh this was more on the like first phase of of a deployment which usually is quite center on the on the technicalities on the economics so liquidity so implementation and so on but a usually you reach a point where like okay but the other market by definition is decentralized or it tends to be as decentralized as possible right so what do you do with the governance as you can imagine in the case of uh of and any other projects like maker tao

for example is is kind of in the same situation like you have a really robust uh like inflow of governance on ethereum one like is battle tested like everybody knows how to use it and so on but if you want to reproduce in the in the in in the other chain is it becomes a bit more more tricky mainly because maybe you need to do uh some other type of of development to breach or or or things like that or you will need to split the the governance power between like the between the l1 to control l1 and then some other token to control l2 so it becomes a bit more challenging so um in our case like we

we as probably a lot of people knows and there was some polemic like when the polygon market was deployed and until now actually like there is there is a multisig control in the in the market but it was mainly for a technical reason because it's not not so simple and there was nothing ready actually to to make that proper breach of the governance from from l1 to to to polygon so what we what we were working on to propose and now to to governance is a solution that is like breaching the the power of of of the other holders on l1 to take decisions on on polygon uh yeah basically there was nothing

like so so developing that direction so we did that and we call it like the the cross chain governance breaches i will go a bit more in details now so now it's by the way it's like it's public since the morning in our github you can take a look but basically the the architecture is this one so the idea is that you have the governance from l1 and as you probably know like it can do whatever it to execute whatever payload is needed after the the decision is taken to do in yes no uh so what we did is like a specific breach that what what it does

is that it receives some some kind of message from the governance arbitrary message can be whatever calling whatever type of function uh and then this bridge like has a like uh the part of the bridge in polygon that takes this message and actually that that part of the bridge controls in the other market on polygon what this means is that in practice like the the governance of l1 has factual permissions on the on the ave marketing in volume so it's quite convenient uh i will not go so much in the details this is this is public on the github repo but yeah the idea is that there is those two parts of the bridge

like the the fx route in the case of polygon and fx child and it's just like uh just using the the message breaching of of capabilities of polio obviously here like the avid governance loses a bit of control because it boils down like to to the security of polygon itself of the bridging but still is the like is the only solution because end of the day like everything will boil down to the to the same security of the polygon network so in this case like it gets quite obstructed like in the solution the good part of of this this strategy is that is

applicable also to to arbitrary for example and we hope it will be applicable to almost all the types of deployments because it's a really generic solution so as you can see in the like the the picture is quite similar in the case of arbitrary just some naming details change uh because of of how they how they manage their their bridging but it's exactly the same idea so have a governance um there is some proposal on the other governance if the if the yes is the is the outcome of the vote there is some some some function called uh in this inbox that is the in the side of the the ethereum side of the bridge and then on the arbitrary this message is received by the

potential of the market and and and executed whatever it needs to be changing for example parameters on the pool listing new assets it can be whatever so uh obviously this was designed for for for for abba for the ecosystem but actually it's a quite generic solution so uh maybe you know but like um in the governance side we have uh like a time lock it is based on a time load that is quite generic uh and and again you can execute any kind of logic so uh and the bridge in the middle that is basically what what was built is it doesn't doesn't even

care if it's a governance calling or even if it's a wallet or if it's a multi-sig or whatever type of smart contract you can imagine so basically everybody can can use it um [Music] it has typical capabilities of this kind of uh of a smart contract that is that you can use call delegate calls in in the site in this case it will be on the side of of polygon itself so is completely generic and it should work for for everybody and obviously like is not limited to any type of time lock is yes any smart contract can can use well how to use it basically fork in the

rep that now now is public in our in our github and of course like even if the technology can be reused like the configuration is not the same so like depending on the type of project that you are running uh like probably you need to to change i mean the configuration of who has the permissions on on the polygon side on the ethereum side and so on but it's pretty like pretty plugable on anything and well then deploy it so this was about the markets itself like some technicalities like how how to set up everything but what is really interesting is like what this cross-chain communication allows to do

no uh not only in terms of in technical terms but also in in terms of doing new models of new models of markets new economic models and so on so first of all well my my my colleague emilio put this this idea some days ago that is like well abby has a lot of liquidity like it has liquidity on l1 it has liquid importing you know and in the future it will have liquid in some other place so why not using this liquidity as as also uh a way of breaching assets like because if you end of the day like when bridging like you care about the security of the bridge ave is kind of battle tested that is

secure you care about like having liquid into sights abbey has liquid in the two sides so why not building something like this and it also has the advantage of the a tokens in the sense that there could be some models that is even accumulate accumulating yield on l1 or in l2 at the same time that that you are doing the in the actual breach so there is nothing developed yet so it's not so so alpha leak in that sense but it is a cool idea so obviously anybody anybody can can can contribute and and take ownership of these two so then uh something quite quite quite

important and is that right now even if governances work like they don't have so much participation still and it's an ongoing challenge that everybody is suffering like how you make yeah i mean there is a token there is like really big like pull really good platform behind but how you engage people to pay gas like high gas usually to to participate and to say yes or no what usually happens is that people is not so so excited about that so uh i i believe that this is something that needs to change radically if we if we want like a decentralized governance to to really scale no for anybody

so uh something that that that that could help on this is actually the the idea of the roll-ups or or or other side chains to ethereum because there could be some model where like actually you do the computation i think in the previous story it was one of them like you do the computation on the roll-up of of the the boating and so on uh where is cheap uh you still have the security on maintenance and then the only thing is that you need to find a way of actually affecting the running system on ethereum that is not exactly like that uh and and include those those boats there so like there is plenty of room it's not only on the on

the roll-ups it could be like ck technology there is quite promising a research on that direction too that maybe are a bit more invasive because of how the tokens are are working right now in terms of delegation and so but it could be really really promising and well i mean site change is kind of the same so and then this one that is i personally think that is the most powerful but is not so much talked about is that when you have a avenger one and you have a polygon you create like a like a trusted ecosystem of of two like different animals let's see but with the same

technology and that is why i'm from where the trust appears no in the sense that you list the different assets in in ethereum you have different assets on on polygon in this case and it could be completely different market in terms of assets because at the moment they are kind of the same kind of the same nature but what could be done is like having privilege between the two different markets right now the markets are completely independent so like technically there is no relation with them apart that governance like will control them but they are completely independent but what will happen if for example like you give certain permissions to the breach of the po of polygon to maybe like

mean certain tokens or mere and me or mean certain tokens on polygon to to do cool stuff usually that is quite powerful it's quite dangerous at the same time because uh some some projects are trying to do the same but i will say that the big advantage of doing this within the same protocol is that you know that uh at least there will be no adversarial parties like doing trying to do weird stuff and also because coordination is is difficult like even if if you have good partnerships like between projects i can i can think about for example the idea of ironbank no is never so easy to actually really having everybody understanding the potential risks of interconnecting

uh two protocols and for example in that case taking other collateralized loans based on protocol revenue or whatever so the big advantage of five in this case is that you know that is the same tech so you can still do mistakes but at least like the like the space of problems is way more reduced than in the other case so that will be and that would be this kind of of idea obviously it's not it can be applied for a lot of things uh the first thing that comes to my mind is that under collateralized landing maybe between the the two different pools but there could be a lot of cool stuff up here and yeah that's it

[Music] the as i said like today we made public the the first uh the first repo and we have pretty good documentation there like explaining how to deploy how it works more or less what i what i say but quite a quite better and then yeah the rest discord documentation and the governance forum which is where actually all the all the activity happens so i think it's better now that if we have some some questions that is the interesting part usually hello um i'm wondering if so for question bridges would you also do cross chain

moving from collateral so for example let's say i use polygon i've got my collateral there i'm borrowing i do all my stuff in there with ave and let's say you launch on an avalanche and i want to move that back to avalanche would that be possible or even l1 or arbitrary whatever all my my deposits in my landing move them in one transaction like a flashlight you mean moving the collaterals or only or borrowing the collateral processor onboarding so i don't have to liquidate a position to pay it back to then move it to another chain yeah yeah and that is one of the points for example of the of the last idea of having more interconnection between between the the markets because potentially one idea could be that you have the collateral in one chain and and you can play

with minting like actually borrowing in another chain if the protocol somehow knows that there is like this like depth between between different pools on that so for sure like it could be a and for example let's say i've got stuff today on polygon and i'd like to move it off polygon because i use polygon because it's um low gas fees but it's looking like it's going to fast quickly move to something that's not scalable at least from what i'm seeing because i go pull up the gas every day to the transaction so i'm stressed out about this and tomorrow you guys will brought the bridges can i move my whole collateral my whole boring because you tell me um put the character in one chain and borrow another one but i'd like to move everything out

without doing any like so doing a migration of the decision completely yeah it could be an option obviously that there needs to happen something related with flashlights most probably but it will be a matter of like having the bridge understanding like that doing what the flash loan that you can do at the moment but like from one place to the other and like the the the challenging part on those kind of ideas is that is still a sink the bridge that is the when you analyze those kind of problems that is the route because the bridge has some kind of delay it doesn't matter if it's like one hour or if he's seven days or if he's 40 seconds so at that point you cannot use flash loans actually so easily so you need to do assumptions so on liquidity on both sides and it

becomes a bit more tricky but but potentially could be possible i'm more bullish in in the sense of that the protocol on one side will kind of give along or something like that to the bridge and the other protocol will take it and doing doing those kind of combinations you could close one position and open the other position like using the tokens so yeah it is possible yeah okay cool thank you hey so aren't you worried that uh stuff like this on relapse optimistic relapse will require additional oracles and so on for

the to speed up async messages like you know uh you know the messages from the roll up to layer one they are like delayed for seven days or whatever so um yeah you could use some kind of oracles to to speed up this process but then this is like as i don't know security assumption or whatever yeah i think like people is not thinking so much in that direction in terms of oracle's like i know that there is like a maker is doing some research on on that i'm working on yeah yeah yeah but [Music] but it's mandatory like the issue is that it is kind of an economic issue because

even if you have imagine like the maker oracles or even chainlink submitting like checking the chain on one side when he's breaching and submitting the message to the other faster than actually the chain itself end of the day like why there is the delay is because of security reasons like maybe something happens with the chain maybe there is a challenge on optimism and and and it doesn't go too properly too so who is gonna take that risk it could be it could be the case that the like the chilling for example build something like a economic incentive to to to cover that kind of risk it could be also like in the protocols themselves like saying that okay we are using this kind of technology so we can

use a mechanism like the safety model to to cover potential risk of this so i mean it's possible but obviously it's quite challenging because you will boil down to security of of a blockchain so yeah let's see i i think it will take some some time hi thanks for the talk so from what i understand um what's happening now is the governance infrastructure is essentially replicated on every network rv is going to be and if you have avi token on that network say polygon you're eventually going to be able to vote resource token in the governance

decision related to the heavy implementation on that network actually this one is not about that like this one is that the same uh the same tokens that can both domain it will control actually polygon then because to to make what you what you say what you need to do is actually probably the reverse way or doing some merging of the of the voting power there which probably is not a good idea okay so essentially everything is still on main net it's just a decision they take has okay yeah mainly why this this this proposal it was done this way it's like if i have assets that vote and you have a system that is

quite based on delegation so people has for example call the storage they gave delegation to another and so on the the least thing that you want to do is actually going to your custodian and moving the assets to polygon where maybe it's not so you don't believe so much but you still want to vote so why not using the security of of ethereum l1 to do that then the problem that you mentioned of like being able to vote with the other tokens on that network is a different completely different story but it's something that also needs to be it needs to be solved because obviously right now like there is quite decent amount of tokens in this case uh on polygon and they are not able to vote uh mainly for a technical reason not because of anything else it

could be perfect if everything everything will be able to vote yeah so like the envision let's say for this cross-chain governance is a bit of a master slave logic let's say where avi token main net votes on everything and have capability on every network but then at the end of the day you'll have say avion polygon token would be able to vote on the decisions pertaining to the polygon market but not no over the other market i mean it i mean going more into the speculation really i believe that if all the chains will will be really really solid with the history of it here because end of the day like it's being battle tested the best situation would be having a like an hybrid like not actually theorem

having the control on on everything else but a bit of like separated system and then some like settlement layer between between all of that the reality at the moment is that ethereum is what really works so it's kind of natural to start with here like and once the others take some control probably the community will say okay let's try to build another system that actually makes more importance on the on the network on polygon or in any roll up or yeah make sense thanks um so basically uh just on that idea that was talked like that could be a big governance on on mainnet um for issues that

are common to any market uh whatever the training is and sub governance is just to control the the market on polygon and the market on on the on the nail tool just for the some parameters and that doesn't need to have action on other on maintenance markets or on other markets that could be like a system where you have the big master for the the like proposal that needs to have an impact on the on your ecosystem of avi and other sub governance just to have like quicker actions on the on delay on the market like right now like the the solution is quite targeted to a particular chain in the sense that if you want to

interact with the take a decision on the polygon market you need to go to the bridge smart controlling ethereum that interacts with the polling side but ideally it should be like most probably one smart contract that and certain type of decisions will just go to that smart control one proposal and they will get spread like redirected to like today today to all the markets the thing is that they are quite isolated like the markets is because they should be that way like why there are multiple markets mainly is because the asset composition is not always the same so like are there so many decisions that affect all the markets at the same time there are some in some cases but usually it's

not so frequent like because the ltb in some market is different or the asset listing is is different on another so it's not so not so common but yeah i really it should be like that in some cases yeah okay and in the same logic there will be like a safety module on each market for on each chain for for the markets i think the approach with the safety model for now should should follow the same as as with the governors like ethereum is like in the case of the safety model is even more more critical like because the fans are stored there so like ethereum is like the main layer and it just will use or will cover the other markets if decided with the fans in that case it's a bit is is quite simple because if there is some slashing

it will be a matter of like moving fans out of the safety module liquidate however it needs to be done in l1 or or in or in l2 the the assets to to cover certain laws and then bridge them to to make the the covering on on the other mark through i think it's not so so complicated actually okay thanks um thanks thanks a lot for

representation i kind of came halfway so i don't know if you covered it but when when you were thinking about sort of the cross-chain pulls to pulls have you also got have you also considered how um these sort of cross-chain communication elements could also interact with other form of protocols um that are on different chains as well or is it just for rv in particular no no no not really it's completely generic you know it's like if if the chain has the capability of emitting like arbitrary messages in evidence usually is what they do like you can basically do whatever you want like it doesn't need to be like the governance of abe could decide to interact with not actually the the market of in in polygon could interact with any other

contract and some other system from l1 could interact with the with the other market or some something else so like this is not not limited to ave at all like anybody can just use okay i suppose that's it thanks you