Flash loans are a new form of unsecured loans where borrowing and repayment of the loan must occur in the same transaction. Flash loans require zero collateral to take out the loan and only includes a small protocol fee to execute the transaction. If the loan is unable to be repaid in the same block, the transaction automatically gets reverted. Any fees collected from a successfully repaid loan are added to the liquidity pool for further lending.
While on the surface flash loans may seem somewhat useless (why would anyone ever need to take out a loan and repay it in the same transaction?), they actually have a significant amount of potential – especially for arbitrage opportunities across DeFi platforms and exchanges.
Importantly, flash loans establish a new block of Ethereum composability, enabling new creative ideas to come to life within the DeFi ecosystem.
Some examples of novel creations using flash loans can be seen in something like ArbitrageDAO, a decentralized autonomous organization with the goal of executing arbitrage opportunities by leveraging flash loans or the Maker Vault collateral swapper, allowing users to seamlessly swap their Vault collateral in a single transaction.
For those who’ve heard of flash loans before, Aave is one of the primary lending platforms pioneering this effort. Aave is an open source, non-custodial lending protocol allowing DeFi users to earn interest on deposits and borrow a range of assets with variable or stable interest rates.
Flash Loans – What Are They And How Do They Work?
In short, there’s three core use cases with flash loans that we’ve seen to date.
- Collateral Swaps
Arbitrage is by far the biggest use case for flash loans today. For those unfamiliar, arbitrage is the strategy of taking advantage of price differences between different markets in order to generate a profit. These types of opportunities are fairly common in nascent, immature markets like DeFi and crypto. Arbitrage opportunities tend to diminish as liquidity increases and the market matures (becomes more efficient).
Decentralized exchanges (DEXs) have historically offered frequent arbitrage opportunities for keen investors. However, to yield any significant amount of profit, arbitrage generally requires a good-deal of capital to make it happen.
Flash loans democratize arbitrage opportunities as there’s no capital required to get started. We’ve seen this implemented with the ArbitrageDAO, where they leverage flash loans and Aave’s liquidity to take advantage of a wide-range of currency pairs and liquidation opportunities.
Flash loans are highly beneficial to the DeFi ecosystem in this sense that they lower the barriers-to-entry for arbitrage opportunities. The more arbitrage going on, the lower the amount of outstanding opportunities, which decreases the spread across different platforms, ultimately making the market more efficient.
In platforms like Maker, where all loans issued are backed by collateral, a change in the collateral type used would require the borrower to pay back the opened loan, swap collateral, and then reopen the loan. This process can be fairly tedious, especially for less-experienced users, as it requires multiple transactions to close out the debt and re-open the new one. Flash loans completely streamline this process into one single, easy transaction. To highlight an example of this is action:
- User borrows ETH on Aave without any collateral
- Swaps for BAT via Uniswap Exchange
- Deposits BAT collateral via Maker
- Withdraw ETH collateral via Maker
- Payback ETH loan through Aave
While this seems like a fairly complex procedure today, it’s likely that this complexity will be abstracted away over time, allowing users to simply click a button to achieve the same outcome. We’ve seen seamless collateral swaps leveraging flash loans implemented by David Truong on MakerDAO and it can be expected that these types of collateral swaps will be available in a multitude of other DeFi protocols in the future.
Liquidations have historically cost investors a fair amount of money during volatile times. Liquidation penalties for loans generally range between 3 to 15% depending on the platform, which can become extremely costly for users with six or seven figure holdings. A prime example is CDP 3228, a $6.9M DAI debt that was liquidated, costing its owner over $183,000 in liquidation costs.
By leveraging flash loans, services allowing for self-liquidation can be built. If there’s an open position and the owner is not near their device to adjust their liquidation price, they can utilize a simple script to self-liquidate their position using a flash loan and their own deposit to pay it back. While this doesn’t completely eliminate the costs associated, it does reduce it by a far amount.
Paying 0.09% for a flash loan versus upwards of 15% on a liquidation can save CDP owners a fair amount of capital in the future.
Flash Loans – What Are They And How Do They Work?
Many community members fear the looming threat of flash loans to the broader DeFi ecosystem. As seen with the bZx exploit in February 2020, flash loans can leave poorly built DeFi platforms vulnerable to sophisticated arbitrage exploits and governance manipulation. However, flash loans will ultimately play a positive role for the proliferation of open finance. By having flash loans accessible to a wide audience, it will force developers to build more robust platforms that are defensible for these types of attacks, maturing the ecosystem as a whole in the long-term.
With that, there are plenty of use cases that will benefit the DeFi users of today and tomorrow. Users will be able to leverage the accessibility of flash loans to capitalize on arbitrage opportunities across DEXs, protect themselves from costly liquidations, and seamlessly swap collateral types in a single transaction. While these are the current use cases, the possibilities for these types of unsecured loans are endless.
In the coming future, it will be interesting to see what types of products and tools are built with this new money-lego in the Ethereum ecosystem.