Crypto AMA with Aave (1.29.20)

Guest:

  • Stani Kulechov

Moderator:

  • Spencer Noon


Moderator:

Everyone, please give a warm welcome to Stani Kulechov of Aave!

As a reminder for everyone participating — please keep the discussion respectful at all times.

Stani — could you start off by giving us a brief bio on your background as well as how you got started in crypto? And then a short overview of Aave and a brief update on your progress to date?

We’ll then be off to the races with questions.

Stani:

Hey all, lucky to be here with you today 👋 Just a brief background infromation, got into crypto actually when I discovered Ethereum back in 2016 (did not get burn by theDAO tho), mainly was interested in Smart Contracts and the immutability. Wanted to create financial transaction with smart contract and ended up creating the first overcollateralized lending protocol ETHLend (yes the very OG-one), now pivoted to Aave Protocol that was launched couple of weeks ago and we managed have already 7 mm USD worth market-size 🎉

Last year was pretty much on product dev so happy for the launch 🙂

Interesting part of Aave is that it includes some nice features, which amongst is the ability to take Flash Loans from the Aave Protocol and also aTokens (aDai, aLEND etc) that increases interest straight in your address balance

Guest:

Why is aDai better than cDai?

Stani:

Example of aDai 🙂

Guest:

thanks @Stani - let's dive into questions starting with eli

Stani:

it's actually not better or worse, it's different. aDai increase straight in your balance whereas cDai increases in value and uses exchange rate that you apply when you exchange your cDai to Dai. In terms of aDai, when you deposit 100 Dai into Aave, you'll get your 100 aDai to your wallet and that aDai will increase there, which makes it quite easy to see how much you are earning interest.

Guest:

Is this streaming being done on L2?

Stani:

nope, its straight view from Trust wallet

Guest:

Gotcha. Wouldn't gas costs make that capital inefficient?

Guest:

Curious to learn more about your interest rate swap.

Guest:

What is being swapped? MKR stability fee for a fixed rate?

Stani:

In practice what happens is that tokens usually represent balance sheets, so when for example you are sending a token from one address to another, what actually happens is that you are making a transaction to update the balance sheets. In some cases you don't need to do a transaction to update a balance sheet if you have math in the smart contract that applies logic which changes the accounts. In aTokens case there is interest rate formula dependend on the Aave Protocol which is used to update the balances of aToken holders similarly as BalanceOf is called. What wallets are doing is they are constantly calling balanceOf to see if the user is receiving new tokens and that is how MetaMask or TrustWallet etc wallet providers are streaming your interest and you see your balance growing 🙂

Stani:

you mean the stable interest rate right?

Stani:

in this case, there is no gas consumption as there is no need for transaction (whoa!)

Guest:

> 7 mm USD worth market-size

What exactly is this in reference to, assets locked up?

Can you provide a breakdown of the different products you have (e.g. flash loans, stable interest rate) and what % they are of your current market size?

Stani:

in case of the stable rate, it's in practice a fixed rate that is offered for the borrowers. Techically there is an oracle that pushes a rate into the smart contracts from other lending protocols and we calculate a sufficient margin to offer interest rate stability without reducing too much of the possibility for the whole pool to earn less.

Guest:

Hey Stani - thanks for joining us today, also enjoyed your conversation on David's podcast. On Flash Loans, nice job on how you named it. Could you pls give us another illustration with a use case where flash loans would be useful?

Guest:

On mechanics of flash loans, how long do users have to return the funds plus the fee required before the transaction is reverted? Is there a penalty for users when a loan transaction is reverted? Is this an all or nothing revert action so if not enough funds are returned, is the loan reverted entirely or proportionally?

Stani:

https://aavewatch.now.sh/ total market-size (came slightly down from the morning) 6,699,809.58 USD, from which is Available: 5,011,194.45 USD (74.8%) and Borrowed: 1,688,615.13 USD (25.2%). This is an awesome tool that one of our community members created to track our progress (if you want to contribute to our community: aave.com/discord or t.me/aavesome which ever format your prefer. In terms of smart contract locked assets I recommend to follow the Aave LendingPoolCore smart contract: https://etherscan.io/address/0x3dfd23A6c5E8BbcFc9581d2E864a68feb6a076d3 which totals now around 5 mm USD worth locked assets.

Stani:

the whole market size is mostly deposit and borrowing against assets, there has been a frist developer that builded upon Flash Loans functionality, which is called ArbitrageDAO that has done some Flash Loans and many others to come with different use-cases.

Stani:

Here is an interesting post about how much small batch of Flash Loans could affect the APR:

Stani:

the cool part about Flash Loans is that it allows Aave depositors to earn yield from activity that happens in other protocols such as Compound, MakerDao and dydx. For example if there is a liquidation happening on Compound with Aave Flash Loans, that would provide yield to the protocol similarly as refinancing from dydx to Compound etc.

Stani:

We're on early stage, however the use-cases are quite solid

Guest:

+1 on this, I know it's probably painstaking, but I think a lot of people in this chat (including me) would appreciate a step by step walkthru example of opening / closing a flash loan

Stani:

The first use-case I saw was the above arbitrage example, where you borrow flash loan from Aave, buy asset at lower price in exchange 1 and sell asset at higher price in exchange 2, return the loan and keep the profit. An example arbitrage opportunity with SAI/DAI pairs:

Stani:

just to give some background, the flash loan allows you to take any available liquidity from Aave without a collateral, the only condition is to return the loan with the same transaction, otherwise the transaction fails.

Stani:

Hence you could do all kinds of atomic transaction (so called nested transactions) with the borrowed liquidity

Stani:

Another quite interesting use-case is to use Flash Loans for the liquidations. The collateral value of the borrow might have reduced to the extent that there is a liquidation event such as in protocols as Maker/Compound etc. In such case the borrower looses up to 13% of the collateral value for the liquidators that are incentived to keep the protocols solvent. Normally a liquidator needs to keep the invetory of the borrowed asset to be able to bite the collateral and sell it in a secondary market. With flash loans, that inventory is not needed. Hence you could take a Dai flash loan from Aave, close the CDP/Vault, take the collateral ETH for example, Sell it in Kyber/Uniswap for Dai and returning the Flash Loan to Aave (quite a circuit of composability).

Stani:

Even better is that a dev can create a service where borrowers can self liquidate, hence saving that 13% or whatever is the liquidation discount.

Third, cool use case is refinancing. Imagine that Compound offers 7.89% apr for borrow and dydx 6.25% or less on Dai. You have a borrow but your Dai is already spent or in use somewhere so you can't return the loan atm. What you could do is to take a Flash loan to close that Compound loan and open dydx Dai loan with lower apr and return that Dai flash borrow to Aave

Guest:

It's basically insurance for your CDP becoming undercollateralized

Stani:

it takes the liquidations proceeds from the liquidatiors back to the pocket of borrowers as well

Guest:

Has someone turned that into a product? How much would borrowers stand to save would you say by your estimates?

Guest:

Thanks Stani. I have follow-up questions but I'll wait for you to answer my other question.

Stani:

You could even go completely mind-blowing by adding to the above interest rate swap scenario (refinance) a currency swap (either periodical or for the whole loan period). Let's say that actually dydx is offering even lower rate of USDC, so instead of opening a Dai loan in dydx, you would instead borrow USDC, sell it on UniSwap/Kyber for Dai and return the flash loan to Aave. What is the result is that the borrower spend or is using Dai but has lowest market rate (add more flavour by even making this algoritmic) of all stablecoins (you could add function on top that when the user returns the Dai it gets converted back to USDC and dydx loan closed) 👈 someone needs to build this, it's mind blowing

Guest:

Is it possible to have a botched flash loan? i.e. something breaks down on one of the protocols (e.g. Kyber) and the flash loaner is left holding the bag

Stani:

Also you could even add more sugar on top buy allowing to do collateral swap, so basically when you have a CDP/Vault open with BAT and you are spending that borrow, but for some reason would like to be long on ETH instead with your collateral, you could basically take a flash loan to close the vault and sell the collateral in exchange and reopen the vault with ETH collateral. Nice money lego application from oldFi. Imagine if the tokenization goes further with synths and you could swap your collateral from NYC house price index to Hong Kong house price index etc just like that at the same time while unleasing liquidity form your collateral in stablecoins. 😍

Stani:

I know that there are few developers racing to build one, that would save quite a lot of liquidation fees, interesting to see how it will change the mechanics of the liquidation models these lending protocols have now. If anyone else is interesting building some of these kind of stuff with flash loans, jump into our discord to talk with Marc Zeller for grants and docs help (developers.aave.com)

Stani:

Please do ask 🙂

Guest:

Hi Stani, thanks for great answers.

Aave sounds like a great addition to defi ecosystem. The refinancing example is great. I’m trying to put it together in my head, so correct me if I’m wrong.

The idea is basically that the only way the platform can be in full control of risk given no collateral is to control the environment where that loan is deployed, and what class of trades it is deployed on (i.e. riskless arb). The point about reverting transactions if the platform is not made whole, which implies you are in control of the loan's destination environment.

It seems like platforms like Aave will ultimately move towards real time quantification of risk, based on which they can provide most competitive rates.

How do you manage credit / counterparts risk?

Stani:

I can't happens since the transactions complety fails to execute since the condition of the transaction (return the funds) is not met.

Guest:

Hey @Stani! Thanks for the time and thanks to @spenceer as always for organizing.

Guest:

What are the token economics of Aave protocol?

Stani:

Interesting perspective. I would say tha the risk is controlled by the function-level, i.e. you could use the flash loans with any other protocol or smart contract hence it does not need to be within the Aave smart contracts system rather any transaction that in short does not fulfill the condition will not get executed. You can do as many nested transactions in the Ethereum transaction as you will, only limited by the Ethereum blocksize

Stani:

in other words, there is no counter party risk as the flash loan is settled in the same transaction and there is no option for the user not to settle due to the atomic nature of the transaction

Guest:

Thanks Stani! Can you speak to the relationship between block times and use cases for flash loans? i.e. would shorter block times make flash loans unusuable? is there an optimal block time for flash loans?

Guest:

Does a user then have to return the funds borrowed + the fee within one block?

Stani:

Hey Cole, the Aave Protocol itself is open source (really open source, not just published copyrighted prop code) the protocol needs to be governed by the community. To govern the protocol we are using the LEND token, which means that in essence the token is governance token. Besides beind able to control the protocol with the token, our aim is to use LEND token as a insurance for the protocol whereas it provides risk/reward mechanics to the token holders. We are releasing very soon the Aave Governance paper, which presents the model. Moreover, our current Governance Smart Contracts are being audited and will be deployed within few weeks and in that case the admin keys from the team are transferred to the governance protocol (yeey!).

Stani:

Good question, block time per se does not affect the use cases for flash loans as block time is the time quantity of when a new block is confirmed. Each block has what I like to call "seats", in other words included transactions, so what ever you are doing with your transaction (and the nested transactions within this transactions) just needs to get inside of a block (which is determined by the pricing of the blocks i.e. how much you pay gas to get the the seat). Hence you might just have a block with one Ethereum transaction which consumes all the blocksize with it's nested transactions if your transaction operations are something that consumers a lot of gas.

Stani:

hence there is no need for optimal block time, the important thing is that when you are consuming flash loans for your use-case you need to simply calculate your operations gas costs etc and ensure that you have enough margin to make profit on whatever you are going to do (arb, refi, collateral swap, currency swap etc)

Stani:

yup, the actual concept is within one Ethereum transaction, thats how we are able to do undercollateralized loans on Ethereum by taking advantage of the atomicity of the blockchain

Guest:

WDYM by insurance for the protocol?

Stani:

Interesting hack during SFBW on Aave Flash Loans (on test-net tho back in the days), I recommend to take a look: https://docs.google.com/presentation/d/1uShmPVXMk-pfBwjEnCPL3JeiBAqKflCoXk-7_eh5oQM Ficient wanted to make flash loans easy to use in practice by creating circuits where you could add any transactions in between and it allows you to in take the flash and return the flash, in between you can add any transaction you want that makes sense (profit in terms of defi language 🤓)

Guest:

Thanks. Just to make sure I understand, one block is confirmed every 12.9 seconds or so right now. How long does it take for one Ethereum transaction to be recorded? Trying to make rough parallels to HFT in traditional markets where transactions are measured in micro seconds. This is important obviously time is money in this case.

Stani:

Governance tokens are in practice additionally utilizing a way to provide risk and reward mechanisms with the ability to insure the protocols for certain actions, such as in the case of MKR where there is burning (the deflatory economy) and minting (inflatory) when needed. In similar fashion (plus some innovation that we are going to add) LEND token would be used within the protocol. In other words, normal condition of the protocol creates a cycle of burns/deflatory economy for LEND token and in case of black swan event that LEND token deflatory economy is turned into inflatory economy for the temporary period of time. This creates a risk reward model for the tokens holders besides the ability to govern the protocol. The exact model and it's economics is not yet disclosed completely rather will be described in the Aave Governance Paper that we are releasing soon. Since the protocol and the token will be based on decentralized governance, the token holders are able to vote on how the protocol or the token model will look like in the future as well.

Stani:

Each block confirms set of transactions, in Ethereum, you can made various transactions that are settled with these blocks, the difference with HFT is that every small part of a seconds counds and speed is important. In terms of flash loan you are not actually competing for time speed but seat in the block, i.e. gas/how much you are willing to pay to get your transation confirmed (settled)

Guest:

Thanks, Stani!

Stani:

HFT in DeFi world would be some sort of a front-runner that tries to snatch your transaction, for example you might do super-awesome cool Flash Loan ⚡️with x profit, just to see your transaction fail because someone copied what you were doing executed the transaction with higher gas and getting x - 1 profit and still earning. These are the Flash Boys 3.0 I guess 😄

Guest:

Ha, this is just like eating lunch with my family.

Stani:

just to mention couple of words about the stable rate. So the stable rate is fixed interest rate wth couple of conditions. In practice you are fixing yourself into pre-defined rate (financial control for you) and the only conditions that you are rebalanced by the protocol to a new market stable rate is in case the deposit rate is higher than borrow rate (which is edge case and the limitation is to avoid gaming the protocol by borrowing to deposit), similarly you are rebalance to a new lower stable rate if it's more than 20% lower than the one you are currently sitting on. Hence it works both ways. 🙂

Stani:

hot cupcakes goes fast 😄

Guest:

You're solving for liquidity risk, and counterparty risk by design. Audits should help mitigate smart contract bug risks. What do you think is the greatest risk for this project?

Moderator:

We're up on time! @StaniKulechov please answer any final questions and then end by telling us (1) the best way to stay up-to-date with Aave and (2) the best way for folks to get in touch?

Stani:

I think it's the overall defi risk (systemic risk) that is associated with smart contract systems, we have smart contracts audits done by Trails of Bits and Open Zeppenin and how have two additional audits under way, which one of the is a bigger one. We want to provide as secure protocol as possible. Also regulation on DeFi is still unclear however, I am sure the whole DeFi space is doing enough legal ice breaking atm.

Stani:

Thank you all for letting me here to share my thoughts here and special thanks to @spencer and active members for asking interesting questions. To follow Aave: t.me/aavesome or aave.com/discord Also check aave.com to try our your first deposit 👻 follow us also on Twitter: https://twitter.com/aaveaave since we make damn good memes as well 😎

Guest:

Thanks so much @StaniKulechov! I look forward to reading up on your governance models when that becomes available. Best of luck to you and your team.

Stani:

💖

Moderator:

Good stuff. Thanks @StaniKulechov and thanks everyone for tuning in!