Flash loans for comound

Introduction

Flash loans have been an amazing asset to the whole DeFi ecosystem by making contracts more resistant to whales. Existing protocols like Aave, dYdX, Uniswap, and some others offer this feature and several bots and users use them on a daily basis for liquidations, arbitrages, and so many other things

Compound is one of the biggest protocols in terms of TVL and users of protocol, we would like to expose assets deposited in Compound for flashloans.

Benefits

There are several benefits in doing so:

  • Lot of assets become available to flashloan from which makes DeFi ecosystem safer and more robust
  • Venues for flashloanable assets increase
  • Compound users earn more interest from fees

So it seems that there are benefits both on the supply and demand side. Another thing to note would be that since adding flashloan doesn’t change how compound actually works it has less implementation and security complexity.

Current work

We as a team of 4 (Vaibhav, Thrilok, Kautuk, Snake) implemented an liquidity pool for compound users where they could deposit their CTokens and expose them for flashloans for the EthOnline hackathon.

WebApp - https://suspicious-jepsen-42efa0.netlify.app/

Youtube Demo - https://www.youtube.com/watch?v=hQoPnqTr8Zc&feature=youtu.be

Github: https://github.com/ethonline-xyz/flashbank

We found out that it’s best to work with compound community and add flash loan natively to reduce the gas costs for users and for the sake of better UX.

Questions for the community

  • How to deal with non-upgradable CTokens?
  • How much fees should be charged?
  • If the fee is charged, where it should be collected?
  • Should we cap the amount that can be borrowed via flashloans?
1 Like