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

Loading player…

Aave 101 Intro for Devs - Hadrien Charlanes

Ethereum DenverSat, Oct 9, 2021, 12:00 AM

This talk is from ETHDenver & ColoradoJam , the world’s largest Web3 BUIDLathon and Community Gathering. ETHDenver’s content is crypto and blockchain focused. Learn more: ethdenver.com Subscribe to our channel to learn more + connect on Twitter: https://twitter.com/EthereumDenver. Speaker: Hadrien Charlanes, AAVE This talk was recorded Saturday, February 6th 2021. ETHDenver 2021’s content themes included DeFi & Money Legos, NFTs & the Creator Economy, ColoradoJam & the Next Frontier of Statehood, Protocols & Interoperability, Open Source & Public Goods, The Ownership Economy & Digital Orgs, Usability Design & Adoption and Legal, Privacy & Identity. Industry experts also weighed in on topics like decentralization, privacy, identity, non-fungible tokens, scaling, governance, diversity, and arts and culture in blockchain technology. The 2021 event was February 5-12 and hosted virtually in 2021 with 5000+ blockchain enthusiasts, developers and community members from 80 countries and 50 U.S. states. 🔴 SUBSCRIBE ETHDenver’s YouTube https://www.youtube.com/channel/UCgz9NU06t_FkT0Py1Vadczw 💡 LEARN ETHDenver’s Official Website https://www.ethdenver.com/ 👋 CONNECT ETHDenver Twitter https://twitter.com/EthereumDenver 📖 READ ETHDenver News on Medium https://medium.com/ethdenver 🛍️ SHOP ETHDenver Official Merchandise bufficorn.com 💬 CHAT Telegram https://t.me/Ethdenver Discord https://discord.gg/AxFmNdCVnU 📱 FOLLOW LinkedIn https://www.linkedin.com/company/ethdenver Instagram https://www.instagram.com/ethdenver/ Facebook https://www.facebook.com/ETHDenver/

Transcript

okay up next is ave so hadrian's gonna give us there he is adrian you ready for um our introduction to uh for developers to obey you're on you go ahead and unmute yourself hey yeah just having a quick issue with the screen sharing it seems so hope to be here really quickly no problem at all thank you time this is where i do a little dance or i like yes please do something like that i'll just remind everybody about poker tonight go to the cryptovoxels metaverse check out the art auctions support you know support the community support support the art community this is you know this is really important stuff i mean we're doing a giant experiment here and creating denver virtually but so far i mean as much as i would love to be in front of everybody which is priority and preference like the ability to like connect with people the way that we've done this has really been pretty cool we were on uh minecraft last night chatting with people we were doing all sorts of interesting things um in just different components of the gamer type space we had a couple icebreakers yesterday we actually watched teams form so this was it's it's been a good time so far i'm enjoying myself as a poker hacker grabbed me for tv yeah probably did yeah yeah you don't want to probably come play against me tonight yeah don't come you'll lose i'm going to win you guys are you ready now yep okay all right take it away let's go um so hi uh i'm from ave i'll try to give an overview for devs of the protocol itself and give you a good idea of what's possible with the protocol um so have you really quickly it's a liquidity protocol you have people or entities that can deposit assets into the protocol and they earn interest on it and you have on the other side people that can borrow these assets for that they need to have collateral deposited also and and yeah that's the the core value of so as of today we have more than 5 billion dollars worth of assets inside the protocol we are pumped about this but this is only the beginning and so here are the main features you can deposit that gives you access to to interest you can borrow and with this yeah um increase some of your position or you you can do whatever you want with this and we have introduced new capabilities in the credit delegation and we have flash loans v2 that are very interesting and our governance that we think is one of the best out there that we upgraded really lately in v2 what's new it's the the possibility to make batch flash loans so you can flash loans on several assets at the same time you can interact with the the protocol itself while doing a platform that was not possible in d1 and the depths are tokenized so when you borrow an asset you have a tokenized depth we have the credit dedication we will talk about that the governance v2 again that has many delegation capabilities and that separate the voting and the proposition powers we have made some efficiency better efficiency in the gas reserves we have access to wrap ether inside the protocol and and we have the permits of eip-2612 that allows for single approval and transfer so now the the first thing the most simple uh the earn uh you let basically people borrow your money and you earn interest on it and we we tokenize this asset so in the form of a token so let's say you deposit die you get a die and uh when a dies is always equals is always equals to and redeemable to one die but your amount of edi will always accrue thanks to interest so as soon as you deposit die you get a die and this amount is increasing so now for devs it's it's pretty simple i won't spend too much time on this but here we are going to deposit some dye so here it's the address you want to deposit a hundred of die and so first you need to approve the lending pool of avid first just i'm gonna give you an idea but we have documentations that are that we try to keep updates and that that should give more information i give you a mental idea of everything that's possible so we approve the die and then we can deposit that here you can see that there is a on behalf of so here we are depositing for ourselves but it's possible to deposit die and that somebody else gets the a die so here we deposit some die now the amount of a die that we have is always increasing every second it's increasing due to interest and when you want you can withdraw them so here it's how we do it it's just calling the lending pool it's it's our core contract in v2 and you withdraw the asset through once here it's i and so you get uh here we we we chosen the maximum the u winds minus one that is the max of greens and that means that you're going to withdraw everything so all your diet plus interests so on the other side you can borrow so basically you will need money you can borrow but you need you need to have deposited before like uh yeah actually with credit division it's it's a bit different but uh let's say that some sometimes you can borrow sometimes you cannot if you have collateral you can borrow a certain amount and if somebody has delegated credit to you you can also borrow without control but we'll get to that later so basically before we we deposited die so we have a die and against this this we can borrow tokens so um let's say that you have deposited ether you get a heater and you can borrow die to do whatever you want to form to do something so yeah so let's see how it goes here we're gonna borrow some dive so here we can choose actually between uh the so we'll have to pay interest on on on this this loan so we can choose the interest rate mode that is or stable or variable um and so here that's that's what we do we are borrowing die with a stable debt mode that means that we know in advance what the interest rates api will be and so that's it here we borrow a set on behalf of ourselves here message.sender so that means that we need to have collaterals before we need to have a heat or something else to be able to borrow die so here we borrow a die we'll get to that later but if somebody has delegated credit to you given you access to his collateral their collateral you can borrow on behalf of them so at any time you can swap between your the the stable depth model or the variable depth so stable interest rate or variable interest rate just know that when you move from variable depth verbal interest rate to stable one you'll have the latest uh stable rate so that means that sometimes you don't want to do that because maybe you you secured a good stable rate before and you don't want to update it just for you to know so now you're borrowed and so now you can repay you can repay with the interest so here you need to to approve again the so here we're going to repay the die debt that we just contracted we're going to approve the landing pool for a die and again we're going to repay on behalf of ourselves and sorry and this will uh yeah you repay the bet and so let's say that you had deposited it or before now you can withdraw your ether so now credit delegation this is really interesting this is what we we've been developing for p2 uh basically you have collateral you you want other to borrow against this you can do that you can delegate credit to someone else so that's it uh you you give your credit line to somebody else and and the i think it's really interesting and and there's so much potential to to to develop around that um it should you you could create a smart contract on top of this to create your own loan mechanism or even off-chain contracts so let's say you have you you you can borrow 100 die you give this borrowing capabilities to someone else and in the real life or of chain or in any protocol you create another contract with this person and what's great is that for for the the guy for the for the person you delegated your credit for he's contracting contracting underclass loan so that's really interesting so here how it happens so here we fetch uh i think that this is not the real function it's more get reserved data or something but you you fetch the the stable depth token and the variable depth token of a certain asset let's say here it's die so you're gonna here you get you fetch the address of stable bit of die and variable depth of die and what you will do is that you will here on the two last lines you approve a borrower to to to increase your debt your stable debt or variable depth of diet so let's say that i deposited some ether and i didn't use my credit line i will say to someone else hey now you can borrow die against my collaterals so that that's what happens here and so now the borrower he has now my credit line he can now borrow from me he can broad die from microlaterals and what he will have to do is that he will do as we done before he was he will call the landing pool and the borrow function and this time he will say on behalf of me and that way his borrowing died but it's myself that get a debt and so if he that's why we need another contract somewhere else he wants to and if he doesn't it's going to be up to me to repeat it that because this depth of die that you contracted is linked to my accounts um yeah uh again uh the i delegated credit to to someone else you can also let's say that he borrowed from me some dice using my collateral some guys he can then repay my debt and and by doing this here it's because he's repaying and on behalf of myself so that's how you can think that you can also create smart contract on top of this and there are so many interesting things that you can do i i love the ideas around delegated credits to together let's say a community each member delegate credits to to a pool and from this pool we will do some some loans to to support our community i think that's that's really interesting and we've already seen great projects uh having fun with this now flash loans this is also a capability that that was well well known this summer especially it allows you to to borrow from our pool of assets and unlimited amounts and you have then you will pay a low interest rate on this the the condition is that in the same transaction you will have to pay back the amount you you you borrowed and actually uh so it's really interesting if you want to do arbitrage or if you want to swap collaterals between maker and ave or if you want to do some kind of migrations and in v2 what we introduced is the ability to not actually repay so you you borrow an amount in a transaction and you or you can repay it in the same transaction or at the end it will settle as a depth if you have enough collateral of course but we'll see that a bit more um so flashlight really simply how it works is that you have here on top of the purple line you have someone that wants to to call a flashlight so he calls the ave protocol again it's the same contract the landing pool and you call the function flash loan and you say i want you to to get dice and then you do whatever you want with die the only condition is that at the end you you give back the the dive to to the protocol and actually it's between the protocol itself that will get them from from you anyway so what you could do is that for instance you can swap the collaterals in the maker vault so you can um uh flash you can flash from sunday repeat some some depths then get back the collaterals uh and trump and swap these collaterals for another assets and put them in another maker vault and then uh again die and and that's it repay the flashlights so it's really nice to do usually migrations when you have some collaterals and and depth that's really interesting you can do also of course arbitrage let's say that you've seen an opportunity to protocols that are that that are creating the same kind of of uh assets but where the price differs you can borrow die to make arbitrage between these two platforms um and in v2 you can borrow flash borrow several assets at the same time and yeah i think that that's really interesting um so here concrete like effectively how it works here we're gonna create a contract that will do two things first here we call the flashlight function from the protocol asking for here two assets so here asset 1 asset 2 just 2 seconds i'm not sure okay that's good sir yeah so so you here you this is your contract and you you want to to flashbang splash borrow two assets and so you're gonna call the lending pool of ave and you're gonna call the function flashlight and here this contract will also so so the flashlight how it works really is that you ask the the protocol of ave protocol hey please give me some assets and what he what the protocol will do is that he it will give you the assets and it will call a callback function and we will see hits here it's the execute operation so here when you call the flash loan function the receiver address should be a contract that implements this function the execute operation because this is the function that the flash the the protocol will call so here we say that we want to get these two assets and and we want to get them back in the reserve address in that case the receiver is the contract itself because this contract as you see has two functions the first one to call the flashlight and it has also implemented the execute operation function from the yeah that will be called by the protocol once you call the the flashlight function so just a difference between v1 and v2 in v1 you had to at the end of the transaction you have to repay what you borrowed in the same you have to repay what you borrowed and in that case it's the the protocol that will uh pull your assets at the end so here you need in this function to approve the landing pool of your assets okay because yeah again it's the the pool that will pull your your your assets at the end just a quick note i as i said before here you have the the modes so for the asset one and asset two you can set different modes and if you said that the the the mode you are using for this asset is zero that means that um you need to repay the assets at the end of the transaction like if you borrowed 800 die you need to pay back within the same transaction 800 plus interest if you choose the mode number one at the end and and of course it will rev if the transaction will revert if you didn't pay back the 800 die in the case of of mod 0. in the case of mod 1 if you don't if you didn't repay the borrowed amount it will create a stable depth for you and that means that of course you need to have enough collateral but if you have enough collateral it will create a stable debt so you can make a flashlight and not repay everything and that's really interesting against against if you want to do some margin position or stuff like that where where you borrow an amount of dye and and and you just repay some of it uh because you want in the end to have some die debt so here again the the the three modes the moderator is the classic one where you need to repay um the the token otherwise the transaction will revert and one and two whether you want to have stable debt or variable debt in case you didn't repay in the same transaction i think that's it for the the flashlight v2 of ave now let's talk about also the governance uh we've done a great a good amount of work on this um and i think that we have a really nice um model of governance so the goal is that we at at aviginess team we don't own the protocol we we can't do anything without the votes of everyone so really the the the owners of avi protocol are the ave token holders and anyone that have ava tokens can vote can create proposals to change the the protocol and so that's that's i think that's really interesting and yeah that's that's a really good part of what we are doing is seeing the the the proposals came from anywhere and and be discussed in the public and then voted by stakeholders so the v2 features multiple tokens for governance so that means that our framework and you could build on top of it i think that we've seen kyber that recently used our governance framework to allow multiple different tokens to vote on proposals so that's one of the features you can think also about let's say you have two tokens you have vested tokens and tokens you can have those two tokens to to govern in the case of ave we have the ave token and the staked away token that are covered in token and soon we will maybe have another one and for that you have to look at the current proposals now another feature is the separation between proposition and voting power meaning that you have a token you can from having these tokens you have two powers you have the proposition power so creating a new proposal and the voting power and since on v2 you can delegate this power one or both it's really interesting so let's say you want to delegate the proposition capability of your tokens to an entity you can do that without giving them the voting so if you want to yeah let them propose but then in the end you want to watch yourself or they get to someone else you can it's really interesting so this is a an overview of how it works uh again we have the ave and the state ave tokens that vote on proposals and here on on the very top we have the governance contracts and people create proposals and vote proposals of these contracts and and yeah on the right we have the governance strategy contract and it is in this contract that we say okay uh for our governance the strategy is that we have ave and stacktave as tokens but you could update this governance strategy to add another token or another one change the ratios that that's that's how it works and in the case of ave whereas we have two executors of proposals so two processes two of proposals one data one process that is short so you yeah you make proposals that that vote for three days and that can be executed after one delay one day of delay this is for the upgrades of of of the protocols that are not critical and we have a long time log so this this time it's a long process where the voting is higher seven days and you have some some time some higher time lock this is when we change things about the governance itself that that is really important so to give you a concrete idea of how it works and we have a forum where we should where people that want to propose new stuff should submit some arc requests for comments have a request for comments and and so on the forum we discuss about this and then we create an aip on the aip the aip should correspond to a proposal the proposal is the unchain implementation of this proposal and so then we create the proposal for that we need that the creator has enough proposition power whether it's it's it's its own power or the one that he got from delegation and then uh the voter then the proposal is voted on and there's two conditions there needs to be enough yes votes to reach a quorum and the the yes votes needs to be higher than the nodes higher and then the proposal is queued and executed so here for instance are the we've we've done a lot of uh aip already in the first quarter of of 2021 and we recently added balancer for instance on navi you can deposit them and borrow them and here we are we are the ap9 is the first step of adding a new tech token in the safety model i'll talk about this later but yeah the ava balance of pool tokens will soon be available for staking so again for the code it's really simple you can uh here you can use the function of the rv tokens and the have a token there is a function delegate that will that will delegate both your power the the proposition and the voting power there is another function that is called delegate by type and with this function you can delegate only your proposition power or your voting power then this the the other governance contract this is where you trade you create proposals and you submit votes note that we also support off-chain voting meaning that um you can let voters vote off-chain just sign a sign a message and then we can put them on chain and it doesn't need to be them um now the staking this is also something that is really interesting we think that security is is is sexy as marx zelda would say and so people can stake tokens on ave for now it's heavy the token that you can send is rv and you get state ave and soon you'll have the the balancer pool tokens and this allows us the so basically the the stakers uh put value into securing the the the protocol even more and they earn some rewards but and the goal of that is that in case even though we had five audits and we think that it's really secure in case of there is an issue the protocol is is it has has capabilities to to to repay some debts that could appear or some malfunction months so yeah this is also part of the governance and yeah basically just take and then you get rewards and you'll have to wait 10 days if you want to understate them and i guess that so here you can here it's the if you want to stake your other tokens you need to call the function stake of the state rv token and first of course you need to approve your rv and by calling the functions take this tech token will will take some of your rv and stack them in the contracts um i think that's that's that's it my time must be up but yeah we've got so many projects building on our flashlights and and our protocol is so exciting and we can't wait to see new use or capabilities cool adrian thank you thank you so much for the presentation

Automatic transcript — names and jargon may be misspelled.