# Aave 🛠 New Frontiers for DeFi Builders - Andrew Schmidt

- Channel: [ETHGlobal](https://streameth.org/ethglobal)
- Date: 2022-10-09
- Duration: 27:21
- Topics: Science & Technology
- Watch: https://streameth.org/watch/yt-MAPD6WvOw_Y
- YouTube: https://www.youtube.com/watch?v=MAPD6WvOw_Y

## Description

Welcome Andrew Schmidt from Aave for a workshop titled "New Frontiers for DeFi Builders". 

ETHOnline is our biggest event of the year! Collaborate with thousands of developers and creatives from around the world and win over $300k+ in prizes! We're bringing in 30+ of the biggest teams in web3 to give you access like never before. Learn from ecosystem leaders and build your biggest ideas as the merge nears reality. The future of Ethereum is being written right now, and it's time to make your mark.

---------------------------------------------------
Follow us: https://twitter.com/ETHGlobal​
Check us out: https://ethglobal.co​m
Email us at: hello@ethglobal.com

#ethereum #web3 #blockchain

## Transcript

[Applause] [Music] um hello everyone i'm craig from the youth global team i'm super excited to have you here um we have andrew from ave he is going to do his workshop on new frontiers for d5 builders um yeah super stoked to have him here um he's done a few workshops for us in the past and they're all really super good um and yeah i think we will have maybe a short q a session at the end probably like the last five maybe 10 minutes so if you have any questions feel free to just drop them in the chat box um andrew will answer them um towards the end um and then also like you're more than welcome if you think of a question later to just like raise your hand during the q a session as well um but if you're shy like me um and you don't feel like asking a question in front of all these people um the ave discord is always open for you to drop your questions to so all right andrew yeah feel free to take it away amazing thanks for the introduction uh so yeah my name is andrew i'm a full stack developer i'm contributing to the abe protocol i've been there for just about a year and a half um so seen a lot of things and hopefully it can help sort of enlighten you guys about what i see is kind of the next frontiers for for defy and the abbey protocol and um talk about the specific hackathon categories that we're highlighting here um so kind of a brief introduction we're just going to go through building with ave a lot of this will probably be pretty general overview for people that are familiar with the protocol but then also give a lot of helpful tips for places to look if you get stuck on certain things so there'll be a lot of good troubleshooting tips in that first section uh and then the second section will be focused on kind of the new frontiers so these are specific to the abbe protocol but kind of apply to d5 in general so things such as stable coin growth social credit delegation using the lens protocol increasing accessibility to d5 and specifically ave 4x tooling on making more efficient markets and then transaction building enabling people to do things that they've never been able to do before um so jumping right in what is ave so ave is a d5 protocol it was created in 2017 as ethlend and then sort of rebranded to the ave protocol when it relaunched in 2020 and it is a pooled model so essentially there are three users in this system so you have suppliers these are people which are supplying their cryptocurrency to these pools and the pools are allowing them to earn interest and this interest comes from a market determined rate from borrowers so anyone that has supplied liquidity is able to borrow in what's called an over collateralized fashion um so you must always have more collateral on hand than the amount that you were borrowing um and what keeps the system in check is the third actor called the liquidator so if someone has a borrowed position but they do not have the collateral assets they don't have the amount of collateral assets to support this borrow then someone else can come in and repay their borrow position and claim a portion of their collateral plus a small premium and this transaction is called a liquidation and it's what keeps the abe protocol over collateralized so how do you kind of build on top of this well the main entry point to the abe ecosystem is this contract called the pool in v2 this contract is called lending pool and v3 it's just called pool and this contract is where basically all of the core functionality of ave lies so this is where you are calling the function supply borrow repay withdraw liquidate flash loan and all of these different kind of utilities like setting e-mode basically any feature that exists on the abe protocol is most likely facilitated through this contract and if there are exceptions to that throughout the presentation i i will note them but if you understand this contract um and and know the address and are able to interact with it then really you have most of the tools to to interact with the protocol um and then we also have npm packages available um so these first two are contract packages um so these allow you to import the abis and the interfaces of abe contracts directly into your own um so you don't have to worry about importing the apis manually you can just do it with an import statement um and then we also have a very helpful javascript sdk which will allow you to generate this transaction data through javascript um so instead of having to write uh you know a custom smart contract for these things um you could just write one one front end that then is calling the supply function um and the contract helpers is not just for pool functions um this has functions for things like e-mode and credit delegation um and also for formatting data which we'll get to in a little bit um so there really is a lot of functionality here that um if you're trying to integrate ave into any sort of javascript application um i would highly recommend checking out this javascript sdk um and then also one other thing i'll pitch is the ave sandbox um so one really helpful thing in the world of blockchain is testing on what's called a fork network um so this is a clone of uh your production networks like ethereum mainnet or polygon and it lets you interact with them for free so you don't have to pay any gas fees you don't have to worry about having tokens in your wallet or having permissions to call certain functions you can basically turn yourself into a super user and add different assets test different functionality this is just a really helpful tool built on top of hardhat to fork the abbe protocol contracts and sort of test out your own logic and then these next two will be about data so if you want to build an interface which is displaying some data about the protocol obviously you can query the smart contracts directly and format the data yourselves uh but this is quite cumbersome like uh there's no point in reinventing the wheel you know the ave front end already exists these functions are are being used in production so um you know we have all of these available open source available for you to use um and again this is in the avi utilities package um so basically the the two main pieces that comprise the albay front end are these two contracts the ui pool data provider which is basically all of the reserve data and all of the user data for the protocol and then incentives um is it's what it sounds like the incentives of the protocol so if there is a token being emitted say the optimism network is incentivizing liquidity there and they are giving out their op token um this this contract would be able to query and fetch all of the available rewards on that market and also query each user's individual balance that they are able to claim and there's functions for for calling these inside of the sdk and then once you do get this data a lot of times it's helpful to format it data coming from the blockchain is not necessarily the most human readable so if you want to format things with proper decimals and get usd prices for everything we also expose through this sdk of these formatting functions um which are used on the avi interface um to display all of the live data about the protocol um and yeah these two these two functions right here um are all you need to fetch basically all of the data that's displayed on the avi interface um and then when it comes to historical data uh so the main the main method at the moment for accessing historical data is through what's called the protocol subgraphs um so each abbe contract whenever you do a transaction it emits an event and then the subgraphs index these events and then expose a graphql endpoint which you can consume from your applications um so there is a subgraph deployed for every ave v2 and v3 production market um so if you're interested in accessing historical data there that's a way that you can do that uh so that's kind of a brief intro into kind of what the protocol is and like rapid fire how to get started with it um and now i'm kind of diving into the new frontier section um so with ave with this hackathon we really wanted to um sort of change how we are approaching you know encouraging the community to build these different ideas and so we wanted to be very specific this time and give people these actionable ideas that they can run with um and so that they know that if they're building a project in a certain area that this is something worth pursuing that this is something that they can earn a prize for and that it's something that um you know the grant style has seen as a need for the community um so these are the five categories that i mentioned in the intro and for each of these we're offering um three thousand dollars for the first place entry and one thousand dollars to the second place entry um ideally we hope to give out unique prizes for everything but if there is you know a specific application that qualifies for multiple prizes um you know that that could potentially be an option as well um so diving into each category individually um so these these categories are meant to represent kind of the the frontiers that um you know d5 will probably be facing in the next you know five to ten years long time horizons um so stable coins are expected to play a major role in blockchain commerce um you know anytime you think about a transaction generally you're going to price it in a stable coin and so it makes the most sense that if you're going to facilitate payments it's going to happen in these stable points um and so ave allows users to supply these stable coins in a non-custodial manner this means you are not giving your tokens to a centralized entity you are supplying your funds to a contract which is controlled by code uh and has a system of governance in place um to to manage these contracts and handle the risk of the system um so it's very different than um you know your typical the typical way that you would earn interest on assets um it's it's completely permissionless um so any application which involves stable coins um is able to supply them to the ave protocol there is no restrictions there um and so i didn't finish this point but uh stable coins are the most commonly borrowed asset as well because it makes for a very good unit of account if you know you want to track your portfolio balance and stable coins then it makes the most sense to borrow stable coins so that you can um sort of maintain this price stability um and so for this prize category uh the the description was about you know increasing stable coin liquidity in the protocol so this could be basically any way that you are supplying stable coins to the protocol or borrowing stable coins from the protocol or there are a lot of different types of stable coins out there over collateralized and algorithmic and so there's a lot of different use cases you know for one use case you might want to hold one stable coin but for another you might want something different so basically any sort of use case that you can think of that would increase the user experience of of people with stable coins in the abbe ecosystem would definitely be qualified for this frontier um and sort of moving to the next one we have social credit delegation um so credit delegation is a really interesting feature um it allows users who have unused collateral in the abbe protocol so if i've supplied some dye as collateral but i haven't borrowed anything yet with credit delegation i could actually take this unused borrowing power and delegate it to somebody else to borrow on my behalf and what this allows is you could create this system where instead of paying interest you know instead of paying five percent to borrow an asset you could actually flip this around and earn interest on your borrowing power uh by delegating it to someone who will pay the interest on your behalf plus a a premium um and so this could be a really powerful primitive that allows people to earn both on the supply and borrow side of the abe protocol um but the difficulty with this is that it relies on having a trusted counterparty so you have to trust that the entity you are delegating your credit to is eventually going to repay this position um and so you either have to trust the person directly or build some system of smart contracts which handles the trust in some sort of algorithmic fashion um and what we were pitching for this hackathon is the idea of using social data for for this application and this is where the lens protocol comes in um so for those that aren't familiar the lens protocol is a social graph um so this is meant to serve as the back end for um web3 social applications um so instead of having one centralized database that a company like facebook or twitter has complete unilateral control over the lens protocol lets you actually own your posts and your profiles and your followers as nfts inside of your wallet and by storing all of this data on chain it enables this next frontier which called socialfive so this is using social data to create a financial policy so when you have social data on the blockchain and you also have applications that allow financial transactions on the blockchain well you can think of some really interesting use cases of combining these um and the example i gave of earning on your your delegated credit is just one example so you could assess the the reputation of one lens profile or say a group of lens profiles um and then have some interface for for delegating your credit based off of that um so i know this is uh this this might be probably the biggest of all of the uh the frontiers um and so i would say definitely do not focus on building a complete scoped out solution if i were to give a recommendation for this project would be to to smart start small build some aspect either the reputation aspect or the delegation aspect and then tried to build from there i would not recommend trying to build an entire delegation marketplace at once uh that that might be a bit much for a hackathon but as for the technical side of credit delegation since this does not go directly for the pool contract i figured i'd uh kind of go in depth here so there's two main functions for credit delegation there's one called approved delegation which is called on the debt token contract um so if you wanted to delegate uh your a balance of die you would actually call on the variable debt die contract approved delegation um and then you would pass in the address of the user that you want to delegate to um and then once you have access to credit um you can call the borrow function on the pool contract this is the same function that you would use normally the only difference is that you will pass in one extra parameter which is the on behalf of address and that's the address that delegated the credit to you and also the utilities sdk uh exposes this in javascript format as well um so you can use that um and then for help with lens integrations uh you can check out the the lens garden um so the primary interface with the lens protocol is actually the lens api um so lens offers a free api which you can query any of this data for through your applications um so i would definitely check out the lens garden and also there is the lens discord and there's also a lens channel in the eth online discord so lots of opportunities to get help with lens and people available to help you there uh the third frontier which we'll talk about is accessibility so this is definitely the most broad of the frontiers but uh currently you know the total landscape of defy is a very very very small set of the potential users um you know maybe max you know 250 000 users across you know these defy applications on ethereum so there are tons of underserved groups and ways that people could interact with these protocols that aren't currently happening so for this frontier the idea is to sponsor some way for people to create new ways to interact with the protocol uh this could be anything so this could be a new interface uh i gave an example of an interface for non-defy native users so maybe if you don't understand what a wallet is what an rpc is uh you know what a transaction is what gas is these are all things which um are kind of assumed knowledge when you come into this space and really breaking down those barriers to entry is going to be like one of the big challenges of d5 coming forward um and then the other thing i gave was creating an interface uh that just does something novel so the abbe protocol exposes um all of these different functions on the smart contracts you know we've gone through supply and borrow and the credit delegation features you know this is just scraping the service of the contracts and primarily the app.avi.com has served as kind of the primary interface for the protocol but because the protocol is completely decentralized any interface could interact with these contracts um and so kind of with this prize category we're hoping to inspire the sort of developments that go beyond app.avi.com maybe it's something that seems like a super small insignificant feature but it's something that you think would improve your experience as an ave user um you know this is definitely something that could be in the scope of accessibility um and then on the next category is uh specifically on forex markets um so this kind of ties in with like the stable coins category a bit uh but we wanted to sort of specify here is sort of the the trading aspect so with forex markets um well with sorry with the ave protocol you're really able to fine-tune your exposure to these markets um so by having the access to supply and borrow these wide variety of tokens you can really customize your long and short exposure to these assets um and so with this sort of frontier the idea is to sort of expand the potential for users to take advantage of these features um so the three that i gave here were e-mode flash loans and external integrations um to kind of talk about each individually so e-mode um is a feature in ave version three which allows users to borrow up to a higher collateralization ratio so maybe you were only able to borrow up to 80 percent of your collateral value without e-mode with e-mode that might go up to say 97 um so you're able to get far more exposure borrow exposure against your collateral um and this could be extremely useful for forex markets where you want to speculate on the the price action of an asset and then flash loans i'd say the main utility for this with respect to forex would be sort of migration tools so if you want to switch your exposure from one asset to another um you could very easily do that with flash loans without having to unwind your position uh and other defy integrations such as curve so curve.phy is an automated market maker and they offer extremely low slippage trades you know optimized for these stable coins and forex markets so you know sort of combining or utilizing any one of these features to improve the the uh quality of life um for people that want to sort of access these assets uh is sort of the goal of this frontier and then the final one and then i'll open it up for questions after this is transaction building um so this kind of builds on everything that we've talked about before which is creating a routing contract so basically a contract which you're not just calling abe directly you're providing something on top of it so this could be like building a contract that is supplying funds and then borrowing and then resupplying all in the same transaction uh or doing something like uh taking a flash loan to to migrate assets from one market to another um there's lots of different transactions and combinations of transactions that are possible to build with the protocol which just currently there's not great user interfaces for um so the idea with this this frontier is to enable new ways for people to build and use transactions um so again instead of just going to app.ava.com or to ether scan and calling the supply function you could do some really interesting logic that calls this function under the hood and does other things as well um so i would say this one is also very open-ended uh you know i the idea of creating a routing contract and doing this transaction building uh is kind of what the intention is but you know there could be a lot of different projects that i would say would could could potentially fall under transaction building uh you know even things that kind of tie into accessibility so just new ways to to call these transactions um so yeah those are kind of the frontiers that um david grant stow wanted to highlight is things that are needs within the abe community and things that are able to be built on top of the protocol and so we have two more resources here the developer docs are a great place to start for ave these will go through the individual contracts and also give you a bit more resources about uh kind of the the gotchas of different functions so for example if you want to call the supply function you need to approve the tokens beforehand um so these are the types of things that are uh are gone through in detail in the developer docs walking through these specific actions uh and then even if you do not win a hackathon prize absolutely we definitely want to encourage you to keep building these project ideas eth global hackathons are stacked from personal experience i can tell you that the quality of projects at these events is incredible and even if you do not win a prize that does not mean that your project is not good and not worth pursuing so definitely feel free to reach out to the abe grant style and also in the ave discord to get feedback on your ideas and figure out how you can keep building these things and turn them into these polished applications um so yeah with that um that's about all i have today i do apologize if i went through that pretty quick i noticed i i kind of sped through some of those sections but um i have about seven minutes now so i see there are some questions in the chats we got some gms okay so we'll understand the slide deck uh i think i can publish this deck after the talk i'm not sure where i will publish that but uh i guess i i will send a follow-up in the uh eth online discord channel um about those slides uh so where is the debt token contract for ave uh so inside of the ave docs right at the very top of the page you will see a row which is called deployed contracts um and if you click on this each ave market will have the debt tokens listed so for example if you're on the ave v2 like ethereum market if you click on that deployed contracts page um there will be a list of here is all the tokens and then you can click individually on on the debt tokens uh is there a plan for office hours um that's definitely something we can try to do especially given that this hackathon is a bit more extended in length um so yeah we can try to set something up um in the next couple weeks for that and can we qualify for more than one category uh i would say ideally our goal is to you know sponsor as many projects as possible uh so i ideally we'd like to give you know one prize per project but if there is something that stands out uh in multiple categories then certainly that could be eligible hello i heard that there might be a possibility to use nfts as collateral is this a feature being worked on um so this is definitely something being researched both within ave and also in the ecosystem as a whole there were a lot of different approaches to this problem uh it has a very different set of constraints and challenges as opposed to doing it for the standard erc20 tokens which is what abe protocol does uh but there are certainly like ways that you could apply the same structure of the abbe protocol or different you know d5 protocols in general to nfts and i definitely think this is another frontier probably that you'll see like developed um so yeah if that's something that you're interested in looking into um yeah definitely reach out in the abbe discord to you know ping ideas off of i think yeah if you have any last-minute questions feel free to drop them in the chat i think you answered them all though so we should be good um but yeah and if you um think of a question later that you would like to ask andrew or it's from the aubey team um oh i think we have one more actually if we have time so i see uh if i do the social credit use case does get added to the same liquidity pool isolated liquidity uh that's a very good question um so it is supplied to the same liquidity pool um so if you were to supply usdc and then delegate that credit that usdc is still in the same pool as everybody else's usdc um the only difference is that you are now uh giving access to this one address that you've delegated your credit to and saying this particular user is able to borrow on behalf of me on behalf of my liquidity um so it's not actually a segregated pool it's basically just one one function that says um is this user allowed to borrow on behalf of this other user and that's kind of how the the credit delegation works okay awesome thanks everyone for coming um again if you have any more questions feel free to drop them in the ave discord channel um again andrew you're so amazing thanks so much for hosting this workshop and yeah this will be posted to youtube um later in the site so um feel free to re-watch it if you need all right thanks everyone for coming thanks for having me you
