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

Loading player…

DeFi Composability with Aave Flash Loans, with Ernesto Boado

ETHGlobalFri, Oct 9, 2020, 12:00 AM

Speaker

Ernesto Boado gives a talk entitled "DeFi Composability with Aave flash Loans" at ETHLondonUK on Saturday, February 29, 2020. ETHLondonUK was an Ethereum focused hackathon that took place Feb. 28 through Mar. 01, 2020 at 8 Northumberland in London. ETHLondonUK was organized by ETHGlobal and a team of hackers, developers and enthusiasts interested in building and creating in the Ethereum ecosystem. For more information visit https://ethglobal.co Video produced in collaboration with @Pillar Project

Transcript

so hello everybody I am next well I'm a blockchain developer for for rabbit and yet today they I'm gonna make a presentation about the flash loans that is featuring our protocol and their composability in the fight and yeah we did yesterday another one a bit more technical but this one is gonna be a more high-level picture of what are the flash loans how is the ecosystem around the flash loans use cases and applications that's it so first of all so a quick introduction I suppose a lot of you already know what are the flash loans since the last two weeks that they become like really mainstream in the Indian micro system so but to start like the flash loans are a under collateralized and collateralized loans board and repeat in the same transaction so it means that you don't need to deposit any collateral but you still can borrow in opposition to all the five almost all the five protocols out there that you need to have depositor collateral then and then borrow from them so this is enabled by the by the property of the of the hill block chain itself that is the atomicity it means that everything that happens within the context of execution of one transaction if it goes through it goes through but if it fails at some point it everything gets Roberta know so a god this means for for for the file for the Co system for the rest of the platform's is that the this this brings a lot of composability and a lot of possibilities of interaction between one protocol and the other so is it can be understood as a building block for the file because it allows to build applications tools and whatever you can imagine around what Santina is really important also on the flash laws is that potentially it allows like something like high frequency a movement for movement of capital between the fire and the nice applications like like you unlike some other current cases of movement of capital that they depend on multi blog and overtime getting getting yield with flash loans this can be drawn in every transaction potential even in multiple transactions even on the same block so this some good comparison would be like the high frequency trading in the in the traditional banking of course with the limitations of the if you in blockchain another another thing of the flash looms is that the the kind of democrat democratize the access to capital this means that the at the end of the day you only need to execute a function in a cantata that has a funds so the only the only resource necessary in advance is the knowledge of what to do with that capital if you if you have a really good knowledge of how all the products are interconnected which are the the opportunities out there joining me to to implement about or do a direct transaction and get get the profit and everything this before got it at least doing especially in this context of a hackathon is that is a huge boost for for builders of the fire plication because now you know that you don't need to have any capital so you can only spend time of understand it really well the co system having a really good idea of an application and from there just getting profit so use cases of the flash clones like the one of the first applications that implemented this flash rom feature winning with real usage is hours away and so this is still growing and is really early to say these are the use cases there will be a lot of more but for example a one of the first is that these flash mobs can be considered like a stress test or security of the the FICO system because at the end of the day you can kind of try to attack multiple platforms a for free or really cheaply so it brings like a lot of stress test without meeting any any capital you can do liquidations from uber collateral systems that is one of the main use case that we thought about when we try to introduce like for example you see that along is under collateralize is about to be under collateralizing compound so you flash long from run away and you liquidate the long own compound without having the capital in advance so there are multiple advantage for that it can be used also for a lot of platforms that don't have a like ours for example don't have leverage in a native way and because we are not trading platform but with these flash loans you can actually do leverage because you can fly as long and accumulate and doing multiple transactions you make the accumulation of capital a another one that is quite the honor is the swap of currencies and positions between platoons positions will be like you can move a CD piece or the sport ring in one sitting vaulting maker down from one currency to another potentially you can move up a long position from one to five platform to another and etcetera even long as changes that are a huge potential here and of course the arbitrage the arbitrage is the the one that looks the most simple of all is like you you just look for opportunities exchanging in multiple steps between the centralized changes and then you take the capital and you combine multiple stepping at the profit yeah and like I said this is just the beginning so way way more will appear for sure so yeah one of the objectives of the talk is like presenting from our experience and from our internal analysis which which are the models that works best for the pros and cons of each model of applications implementing a flash non-fictional so they starting for the most pure one let's say is like imagine a standalone pool like a pool of funds that is built exclusively for a to do in flash loan so people are cumulative as mark entred their funds in whatever as your multiple currencies and the only objective of those funds is that there will be some operator or some Dao or there are multiple models that will will try to execute the transaction with those funds and give Gill to the to the to the people that depositing in that final process of this of this approach this is the general idea and even people came with this idea one year ago but there are the cons were quite quite high pros still there are is like the the simplicity of the code is noticeable because at the end of the day is just a screw screw at the fan single contract and then define some some rules that need to be respected but the movement of capital is whatever the operators decide there is always liquid available to withdraw because at the end of the day these funds are executed are moved in one transaction but at the end of the transaction they are in the pool so you just put your funds there and then you can we do it at any point that is quite important actually this is a bit more obscure but there is a like an alignment of interests between the parties involved this means that I am depositing in the pool for to do flash loans nothing else it's like we really trust in the operators so there is no no subjectivity here about the core the cones that they actually were the ones that didn't allow for people to develop this idea further before is the main the main problem is this particular problem on liquidity that is basically that you need liquidity to to get advantage of opportunities in the market but how you attract that liquidity because at the beginning people will need to deposit a good amount in a fund and they will not have any revenue until there is an arbitrage opportunity liquidation or whatever this can be a problem and in our case we know it quite well because we have a board win platform that was p2p and one of the the main problems is that when you create when you offer to lend out funds what you need to deposit the funds and while the fans are waiting they are not any revenue so you could have use the fancy another way so the pool model is a bit better in that sense so that is the main Kong of exclusive fun for this the other is that the frequency of income is irregular because you depend on different market opportunities liquidations arbitrage whatever for now at least there is nothing like a continuous revenue something that you can do block by block you depend on multiple and complex values and there is an order that is moderated with the coordination and is who decides which which opportunities to take or which is the business model of this standalone a fine for flash loans this boils down to make other or name boils down to have some certain kind of centralization so is we could define it as a cone maybe as a profit is subjective or so this is the the purist model but back in the days we also thought about about some some some problem like this but it was not not so worth it but we realized that the the actually powerful model is when the flash loans are on top of money markets what this means is that you build you will define a protocol that has an underlying economic model like cows' that is based on a borrowing and lending and lending capital in a pool way and then the profits are our share for for all the depositors and the Platinum is just an extra on top so it's like a boost for giving profit to the to those those depositors in a different way because it doesn't follow the same model as the borrowing lending model of interest rate for example no that is the big advantage a pro another plaw I mean deploy is that you have a basic income for people that wants to do flash loans because at the same time they are depositing and those funds are they are being borrowed and the liquidity doesn't come for the flash loans the liquidity most probably comes from the possible that I allowed to borrow a money and flat rooms are just a consequence artists from another feature of the system like nothing else the cons of this is for sure there is more complexity on the system and we know it quite well since the last two in two weeks because one you want to include this feature in a set of smart contracts the interconnection between the functions of those smart contracts become way way more dangerous because there is like a arbitrary release of capital different movement like you could interact with multiple functions of the protocol at the same time so it's even true so complexity that you need to evaluate and development gets a bit more difficult could because that is there is an added risk on the because of the flash loans themselves because even if you borrow out the money and in the same transaction you validate that you received the funds back at the end of the day the funds are going up so it could be argued that it boils down to some problem in DBM endo in some particular cases could be problematic no so there is a bit of added risk even if in practice is serum less is more less zero and another common Pro is the biggest one is that the there is constraint the liquidity available because a lot of funds are are are balled out so the defense funds that you can use are the ones available they are not borrowed and at this point so for example this is our platinum and wadding will be submitted to to flash long is like in this case in my if you know there is like for me looming assets right now and borrowed out there are like almost 200k so what you can flash in this case is is the difference between the the total liquidity and the borrowed out so it would be four million in the case of etherium is not a big deal because if you use more more more as collateral to them borrowed for example stable coins but if you check for example died you have one point one in total borrow is almost everything so you only have 200k to borrow that so if you compare with a model like that is pure istic like the use one for sure is not you cannot flash a so much in proportion if they try to borrow em the problem is that them if nothing can happen at the same time like if you try to borrow I try to work what it means is that yeah we should meet the transaction and one will go after the other so the funds will be returned in the middle so yeah about our particular implementation of the flash loans there are some specific it is is that well like I said before anybody can flash borrow the available funds so the difference between the total liquidity - the the world assets they in our case the flash rooms are available to are unable to tall the assets in the protocol so is not only here it's not only the eyes like every every listed currency can be borrowed depending on the constraints of the liquidity then we chose a kind of simple approach in the implementation really constrained and in the sense that our implementation is basically we borrow out the money and at the end of the of the function that executed this transaction we check that the balance of the of the cons at storing the defense is the same as it was at the beginning plus plus depositors yield that and that is the next point this depository is basically that from evil every flash long there is a percentage that the person that did the flash loan is to return back to the pool and that the the biggest part of that will go to the to the depositors as an extra income and this is what I mentioned before of the of the boost of incoming the depositors that they are born we money they are getting interest from that but apart from that every time there is a flash law the pool receive some income that gas also is spread between the between the depositors yeah yeah something interesting with real numbers and how powerful could that be is like imagine that you have here like the nd here you know how formulas are available to boil the interest that the the depositors end is really small like zero six percent but this is because it's based the the interest is always based in the utility safe like the difference in the available and the world but if you start doing a flash loans of four millions that are available imagine that you do a flash loan that day that gets a profit of one percent for example or imagine a stream case in liquidation that can be potentially imagine 10 percent with ten percent you will get four hundred K in one transaction and for the four hundred K and you will get seventy percent for the depositors to split between the depositors this will mean that in one transaction maybe you are generating a I interest twelve twenty percent one transaction income that is a stream case because it's a ten percent and it's not a realistic but if you put a zero point five percent still is quite being amount so this is really powerful when you have it on top of a money market because the boost potentially could be even more important that the interest coming from borrowers so just to give a bit of overview with ya and that you can also boil down to the liquidity available it's important it's important to have likely a very poor ssin of liquidity available and less a optimized to less optimal utilization rate or it's important to optimize to more utilization rate them and better interest for the world is so good quest but yeah one thing about the the flash looms and probably this is the most know thing is that the interest rate of the flash long the this depository is hard-coded in the protocol in hard coded it can it can be changed and right now for example is the zero point zero nine percent of the bay flash loan amount so from there a still the 70% of the percent seventy percent goes to to the depositors and the thirty percent goes to a protocol fees that then gets burned for the token that is behind and that again is 0.09 percent and of that 70 percent who have depositors redirection not is the is the the borrowed amount initially like it doesn't matter what you do in the middle in the middle if you get like the doable you need to dare and get the serious you know nine of what you borrow we just remember but you don't know yeah no no no it's not it's completely dependent on that number saga no [Music] but in terms of prediction is NAC is not so easy like yeah but the other actually even the more when you cannot predict [Music] going on with the this thing is like as you know in the this grant went mainstream like two to three weeks ago and because these flash loans are have like a dark side no and this dark side is like it looks more like this actually not like not bid and for me is not so dark side let's be honest but it's considered as as that n is the how some protocols can be are subjected to exploits because of the flash loans now it's like protocols that before were safe because no attack back to had a so much flexibility as the flash loan where the liquidity comes instantaneous and it changed a bit of a a bit of the rules but now with real fans and with the feature of lines loss on top stuff like that is is it's allowed that basically a deployed was that somebody borrowed a took a flash loan from from a platform then they they make an operation the compound of his money market then they trade they create a trade position another platform BC X then they didn't crash a price in you know the centralized exchange and from all this combination they got a huge profit because at the end the same time there was a small back in BC X in this case and and another another transaction they just returned the flash law and they got like I think it was 350 K in profit it was 350 K without spending more than the gas cost of calling the function so it was like in which emissions limit our yeah yeah I think the the solution for that is not putting the is not on the flash loan side because the flash loan is is not our problem per se the problem or am putting a limitation of how much you can flash loan is not a problem the limitation should be if you want to put the limitation and it could be eat in some cases I might even evaluate more about that okay sorry yeah that could that that could be a solution if you'll be a bit risky for him because maybe she'll not be able to go out because it will be working on some exchanges at you walk with Nexus still deposit which one [Music] can we can we discuss matters because we have a bit constrained I will finish this and then we discuss so yeah just to wrap around like a future cases of flies blown this is important and it's like future of the flash mobs in themselves oh and the fire use cases are gonna grow for sure they are growing like day by day people is coming with ideas everywhere and because now there is the perception that the barrier to capital and to do interesting stuff and and getting protein in the Middle East is really low so people just just entering more developers are attracted to the system just because of that that is really good the thing of the dark side at the end what the main consequence is that there is more focus and that we need to be more focused on security in the fight protocol to protect about this and for example the end the development of the efficient automated tools like bots to to get better arbitrage etc and this is not only limited to loans because here the most powerful feature is actually the atomicity way that allow the flash loans and there are multiple ideas it's way more experimental because it depends on some other economics but for example people is coming with this idea of flash me interval tokens that is like here see 20 tokens that can be minted randomly for arbitrarily from one transaction this system quite experimental I am idubbbz on it but it's really you know or displacement and depositors that is something that we are actually checking internally that is about minting our a tokens that represent the deposit to send to some some place and then return them back and then they those a tokens that you actually mean they have a value at the end of the transaction but they didn't have a day at the beginning like bit of time travel off of value but we this is still experimental and a lot of stuff that needs to come and what this the validations at the end of the transaction the atomicity is actually the main powerful thing of the the flash loans are basin and the a lot of develop developments are gonna come from from that so yeah we can do questions but I think is already finished you have them this Court is a dot-com and a slice this court and in our telegram so just join their as the question so we will be around to if you want to have any talk so thanks [Applause]

Automatic transcript — names and jargon may be misspelled.