Flash Loans: Groundbreaking DeFi Phenomenon or Tool for Manipulation?

Flash Loans: Groundbreaking DeFi Phenomenon or Tool for Manipulation?

We all know how traditional loans work. You ask a financial institution to lend you some money; they ask you for collateral; you put up the collateral and agree to the terms; and they issue you the loan.

The crux of it is that the lender sleeps well at night knowing that even if you default on your loan and lose their money, they’ll get the collateral you put up. On top of that, the loan is repaid over time with a fixed or fluctuating rate, giving both sides what they need.

However, an innovative decentralized finance (DeFi) concept called flash loans has emerged over the last two years that challenges the idea of traditional lending and borrowing practices.

Flash loans are like lending on steroids. They require no collateral, are instantaneous, and entail minimal risk to both the lender and the borrower. 

Sound impossible? It almost is, but thanks to relentless innovation in the DeFi space, flash loans are an exciting new financial primitive that can already be used in numerous ways.

Let’s take a closer look at what flash loans are, how they work, and how they can be used.

What Exactly Are Flash Loans?

A flash loan is an experimental financial tool that allows users to borrow in an instant without any upfront collateral whatsoever. For the loan to be valid, it has to be borrowed and also repaid within the same transaction. That’s why they’re called flash loans – they happen in seconds.

Flash loans are powered by smart contracts. Smart contracts are digital agreements that lay out the terms that have to be met in order for something to work. In the case of flash loans, they provide the instructions and perform instant trades on behalf of the borrower.

Flash loans also entail minimal risk, at least in theory. If the borrower fails to repay the loan in the same transaction, then the whole transaction is reverted, including the initial borrow amount and any other subsequently taken actions. 

Defaulting on a flash loan thus is impossible. The only liabilities the borrower is exposed to are gas and service fees (only if the trade is successful).

Flash loans are also called unsecured loans because they require no collateral from the borrower. However, this is a bit of a paradox since, again, the borrower must repay the whole loan instantaneously, otherwise, it fails. The loan never leaves the protocol as it’s always returned in the same transaction.

Flash loans were first introduced by the DeFi lending protocol Aave back in January 2020. Only developers were able to use flash loans in the beginning due to the high-level technical knowledge required to code a flash loan.

However, there have since been DeFi products like DeFi Saver and others that do the dirty work for users. Now let’s talk about how flash loans can be used.

How Can Flash Loans Be Used?

Users take out flash loans mainly to take advantage of arbitrage opportunities. It typically works like this: Take out a flash loan, buy an asset at a lower price on one exchange, sell the asset at a higher price on another exchange, return the loan, and pocket the profit. 

While a 1% difference in value might not seem like much, a large enough loan can yield substantial profits. And, as we said earlier, the trader is exposed only to gas and service fees. With Aave, if a trade is profitable, the trader pays a 0.09% service fee on the gains.

Another way flash loans can be used is to do collateral swaps. This technique involves closing a loan with borrowed funds to open a new loan with a different asset as collateral in an instant. Collateral swaps can help users avoid liquidation and yield higher profits from their trades.

There are many other ways to use flash loans – it’s up to one’s imagination to find a strategy that works best. DeFi Saver offers a feature called Recipe Creator that allows users to create their own flash loan scripts in an easy-to-understand way.

Flash loans offer a variety of positive use cases. But there’s also a dark side to them.

Flash Loan Attacks

Flash loans are valuable for honest arbitrage plays and collateral swaps, but they also have a controversial reputation because they can and have been used to exploit vulnerable DeFi protocols and steal huge sums of money in so-called flash loan attacks.

A flash loan attack can happen in a variety of ways. For example, last year a hacker used a flash loan to exploit Beanstalk Farms, a DeFi platform built on Ethereum, by manipulating the protocol’s governance mechanism and sending funds to a wallet they controlled.

The perpetrator did this by using the borrowed funds to obtain a controlling stake in the protocol and voting in favor of a proposal to send themselves about $182 million.

In a more recent example, a hacker attacked Nereus Finance, an Avalanche-based lending protocol, using a smart contract exploit that utilized a $51 million flash loan from Aave to artificially manipulate the AVAX/USDC Trader Joe LP pool price for a single block.

The attacker was then able to mint 998,000 NXUSD, Nereus’ native token, against $508,000 worth of collateral. Then they swapped the funds via various liquidity pools, returned the loan, and walked away with around $371,000 in profit.

These types of attacks are becoming increasingly common since exploiters don’t need to use their own funds to take out a flash loan, which makes it easier for them to experiment with different hack strategies. 

Blockchain auditing and security company CertiK estimated that a total of $308 million was drained across 27 flash loan attacks in the second quarter of 2022 – up from just $14 million in the first quarter. In the third quarter, DeFi protocols experienced 23 flash loan attacks and $17.3 million stolen.

Parting Thoughts

Flash loans are a nascent technology that presents unique ways to participate in the decentralized finance market. Whether it’s arbitrage plays, collateral swap strategies, or any other not-yet-thought-of use case, flash loans offer a new way of looking at lending and borrowing practices.

While so far the flash loan phenomenon has been associated with exploits, it’s important to remember it’s an experimental innovation in its early days. It can be used both ways – just like any other technology in existence.

However, as decentralized finance evolves and protocols become exploit-resistant, flash loans have the potential to be a valuable – and net positive – tool for both sophisticated and everyday users.

Back to Top
Close Zoom
Don't push your luck