Flash Loans: Use Cases, Challenges, and Opportunities (2024)

Written by Anderson Lo and Aidan O’Brien

Flash Loans: Use Cases, Challenges, and Opportunities (2)

When people try to borrow money, it is usually collateralized. For example, if someone wants to borrow money from the bank, they may put their car or house up as collateral. Therefore, if they are not able to pay back the loan, the bank can take the borrower’s assets and liquidate them to get their money back.

However, now with the rise of decentralized finance (DeFi), a new way of loaning money is being brought into the spotlight. In 2020, flash loans were popularized by Aave, an open-source liquidity protocol. Unfortunately, since this technology allows users to borrow large amounts of capital in a short period of time, there have been many bad actors that have exploited flash loans to their advantage.

For instance, an attacker utilized a flash loan to increase their voting power significantly and pass a malicious proposal. This proposal allowed the hacker to steal assets from the Beanstalk Protocol, resulting in an $80 million profit. Nevertheless, many people are quick to defend flash loans from becoming the scapegoat of these attacks. Instead, flash loan attacks are only possible due to vulnerabilities within the protocols themselves.

Context

In 2018, the Marble Protocol released an article that described their “open-source bank on the Ethereum blockchain.” Marble’s most significant innovation was the concept of a flash loan, a risk-free, uncollateralized loan where users can borrow and return large amounts of funds within the same blockchain transaction.

Max Wolff, one of the co-founders of the protocol, wrote, “Flash lending lets anyone borrow Ether and ERC20 tokens to take advantage of arbitrage opportunities on Ethereum.” Marble’s founders hoped that the effects of arbitrage, creating “liquidity and improv[ing] price discovery,” would promote decentralized exchanges by making them “more usable.”

In addition, flash loans became largely popularized by Aave after its official launch in January 2020. According to aave.com, “Aave is a decentralized non-custodial liquidity market protocol where users can participate as suppliers or borrowers.” Thus, people can put their capital into a liquidity pool and earn passive income on their money, or they can utilize some of Aave’s technologies, like flash loans, to take advantage of the large liquidity pool to make a large amount of profit through arbitrage or other avenues.

Infrastructure

To complete a flash loan transaction, two entities, lenders and borrowers, are required. Before requesting a flash loan, a borrower should have their intended operations planned and designed. To approach a lender, a borrower must have a smart contract that complies with lenders’ conditions and access for lenders to receive the payback amount plus premiums. Once a smart contract is developed, the transaction officially begins with the lenders transferring the assets borrowed to the borrower.

The borrower then performs their intended operations via smart contracts with their borrowed assets. After the operation is completed, the borrower either immediately pays back the borrowed assets plus a flash loan fee (0.09% of the borrowed amount if using Aave) or incurs a debt approved by the lender.

Finally, the lender can check if assets are fully paid back and have the right to immediately void the transaction if insufficient funds are received. According to BSC news, the leading platform for Defi news, an average flash loan transaction process in the ETH blockchain takes a mere 16 seconds to complete, which makes it an attractive option for borrowers interested in quick, uncollateralized loans.

Flash Loans: Use Cases, Challenges, and Opportunities (3)

Flash Loans

Flash loans are important because they solve the issues involved in both centralized and decentralized lending. Within most centralized lending systems, borrowers provide collateral and may have to wait from a couple of weeks to months to get approved for a loan. Thus, flash loans were created to make borrowing money fast and accessible.

In addition, flash loans remove risk for traditional lenders. For instance, if a traditional borrower defaults on their loan, the lender will have to spend money to try to recollect the loan (i.e., through a debt collection agency). The lender may also decide to cut their losses and stop trying to recollect the money that was loaned out. Another risk that lenders face is illiquidity. If a lender lends out too much money or does not receive payments from their borrowers in time, they could become illiquid and not be able to pay their current liabilities.

Flash loans have risen in an environment where technology and finance are working together more than ever before. The financial barriers that have been built up for decades by traditional finance institutions are being broken due to innovations in DeFi.

Santiago Palladino, author of Ethereum for Web Developers, explained the significance of flash loans in a Twitter thread from February 2020. Palladino wrote, “[F]or the first time ever, you don’t need money to make more money… anyone can become a whale (owning a large number of crypto assets) for an instant…” Flash loans enable people to take on an enormous amount of capital for a fraction of what they are borrowing.

There are also entire communities forming around the DeFi innovation. For example, a group of people have gathered together to create a decentralized autonomous organization, known as ArbitrageDAO. They can utilize flash loans to take advantage of arbitrage opportunities.

While flash loans have created opportunities for people to make more money than ever before, they also create unethical opportunities for hackers to exploit systems and profit quickly and easily

Risk and Limitations

Although flash loans are meant to make borrowing more accessible by removing the need for collateral, they still require a smart contract to be developed. To create a smart contract, developers need to be proficient in Solidity and its inheritance techniques.

Furthermore, even though the barrier to borrowing money may be lower, it is arguable that the technical knowledge required (i.e., smart contracts) is an even greater barrier than the previous. Since there is no current real-world analogy to flash loans, it is a concept that requires an understanding of Ethereum, smart contracts, and programming background to execute.

Flash Loan also provides an opportunity for people with bad intentions to borrow large amounts of assets with no collateral and is commonly used as a tool for launching attacks. The most common method of attack using flash loans is to abuse smart contract security by borrowing a large number of funds. Such attacks allow users to modify and prevent transactions within the network, as well as manipulate the cryptocurrency market in general.

In the next section, we will be highlighting some key flash loan events and attacks, and how the crypto and DeFi markets are affected.

Effects on the Crypto Market

On March 13th, 2023, Euler Finance, an Ethuerum-based lending protocol similar to Aave, suffered a loss of approximately 197 million from a series of flash loan attacks initiated by a hacker. The event signifies the biggest known instance of a flash loan attack and the blockchain was able to record a comprehensive overview of the losses from the attack.

The attacker was able to utilize flash loans to borrow around 30 million worth of DAI from Aave after creating a smart contract. 20 million of those DAI was then used as a deposit to exchange for 19.6 million eDAI tokens on Euler. Since Eular allowed depositors to borrow up to 10 times their deposit, the attacker mined approximately 195.7 million eDAI tokens.

The attacker later repaid the initial remainder of 10 million DAI to clear parts of the acquired debt (dDAI) and minted even more eDAI tokens. Exploiting the inconsistencies in the exchange rate between DAI and eDAI, the attacker was able to profit approximately 8.9 million. To get a more comprehensive overview of the attack, feel free to read this article written by Cointelegraph.

Flash Loans: Use Cases, Challenges, and Opportunities (4)

The same process was then used for many other stablecoins, resulting in a whopping 197 million acquired. As seen from the breakdown, the attacker targeted various types of stablecoins ranging from USDC (US Dollar Coin), WBTC (Wrapped Bitcoin), and stETH (Stacked Ether).

Flash Loans: Use Cases, Challenges, and Opportunities (5)

Following the original attack on March 13, Euler initially offered a bounty of 1 million for anyone who was able to provide information that would help identify and eventually arrest the attacker. In a surprising turn of events, the attacker, who self-identifies as Jacob, sent a message through an Ethereum address linked to Euler a week after the attack, offering to negotiate with the platform.

In April, Jacob eventually took to blockchain public messages to apologize to Euler and the community affected, promising to return all assets acquired through the attack. Jacob eventually returned all recoverable funds to Euler Finance on April 3rd through 8 different transactions, following successful negotiations with Euler. As a result, Euler commented that the attacker did the right thing by returning all assets and would no longer accept new information from their 1 million bounty campaign that would lead to an arrest.

Flash Loans: Use Cases, Challenges, and Opportunities (6)

bZx Flash Loans attack

In February 2020, BzX, the 8th largest DeFi project at the time, suffered two flash loans in one weekend, resulting in a loss of around $1 million worth of Ethereum. The first attack exploited the price of Uniswap, a wrapped bitcoin (WBTC) by tripling up the conversion rate between WBTC and ETH by using flash loans and borrowing 10,000 ETH. The attacker was able to profit roughly $355,880 through the attack after repaying their loans. The second attack took advantage of the pricing system of DeFi networks by targeting Synthetix USD (sUSD) and borrowing 7,500 ETH.

Utilizing the common pump and dump scheme through Kyber, a decentralized crypto exchange that bZx bases their pricing data on, the attacker was able to manipulate the ETH/sUSD price to 2.5 times the average exchange rate. The attack then exchanged the rest of their ETH with a synthetic depot contract, which ensures a fair ETH/sUSD exchange rate. The attacker finally borrowed ETH using the inflated sUSD price and was able to come out with roughly $665,840 in profit after repaying their loans.

Even though a total of around $1 million loss may seem low in the cryptocurrency world. The bZx attacks were one of the earliest known instances of flash loan attacks, which happened around 1 month after flash loans were first launched by Aave. The two attacks highlight the problem of how flash loans can exploit the bad programming and pricing data of DeFi projects and would eventually bring the concept of flash loan attacks to the attention of market manipulators and thieves.

Flash Loans: Use Cases, Challenges, and Opportunities (7)

BAYC Flash Loans attack

In March of 2022, Yuga Labs, the creators of Bored Ape Yacht Club (BAYC) and Mutant Ape Yacht Club (MAYC) NFTs, airdropped (free tokens provided to community members) their newly released ApeCoin, a token that aims to support the development of web3, and gain token holders access to the ApeCoin DAO (Decentralized Autonomous Organization). The token airdrop is originally reserved for BAYC and MAYC holders only, which could range from $80,000 to $200,000 USD in value. However, someone who initially did not own the NFTs was able to claim $1.1 million worth of ApeCoin airdrops with the help of flash loans.

How it works: Instead of tracking ownership of BAYC and MAYC holders and handing out airdrops, ApeCoin is claimable for holders with ownership of the tokens at the time of the airdrop. The individual took advantage of unclaimed Ape Coins and initialized flash loans that allowed them to purchase 5 BAYC tokens that haven’t claimed ownership to their ApeCoins airdrop, claimed a total of 60,564 ApeCoins, returned the asset to the lender, then sold the Ape Coins for a total of 399 ETH ($1.1 million). By utilizing flash loans, the individual was able to complete the whole process under one transaction.

The event sparked a huge debate in flash loans within the Defi space on whether such transactions are classified as fair arbitrage trading or an attack, as the transaction that the user abides with their smart contracts and returns the asset to the lender. However, according to blockchain security firm BlockSec, the incident has been classified as an attack due to the user understanding the potential vulnerability of a token airdrop, thus taking advantage of the loophole.

Flash Loans: Use Cases, Challenges, and Opportunities (8)

Beanstalk Attack

In April of 2022, Beanstalk, an Ethereum DeFi platform, lost $182 million due to a flash loan attack, which marked the largest theft attack for a DeFi platform in history at the time. The attacker was able to utilize flash loans to borrow large amounts of stalk, Beanstalk’s main governance token through Aave. Since stalk token holders are granted voting powers, the attacker can now pass through a governance proposal that grants all funds within the platform to their personal Ethereum wallet due to Beanstalk’s governance system being a majority vote. After the attack, the attacker was able to profit from $80 million worth of crypto funds, and the total value lost was up to $182 million due to the drastic price drop of Beanstalk’s stablecoin Bean. The total attack process was estimated to be completed in 13 seconds.

The funds are now unlikely to be traced and returned due to the attacker transporting funds through Tornado Cash, a cryptocurrency tumbler service that is commonly used to disrupt the traceability of funds. As a result, the event has not only led to many Beanstalk project investors claiming to lose tens of thousands of dollars but also Publius, the backer for Bean, announcing that the project would be ending due to a lack of VC funding. The Beanstalk attack highlights the issue of Defi platforms struggling to defend against flash loans due to its majority vote structure and proof of state security measures.

Flash Loans: Use Cases, Challenges, and Opportunities (9)

Implications: The Future of Flash Loans

While flash loans currently offer accessibility to quick capital, efficiency in transaction time, and the potential to eliminate risks associated with traditional lending, it is evident that the current state of flash loans has its shortcomings. The occurrences of events like the ApeCoin airdrop and the Euler attack highlight the existing issues and vulnerabilities within flash loans. Flash loan attacks will continue to remain a potential concern until decentralized platforms universally adopt stricter security measures.

Nevertheless, as a concept that is still in its early stages of development, the potential of flash loans continues to excite people within the DeFi space. If utilized properly, these decentralized loans could offer benefits such as improved transaction speed, no traditional collateral, and higher transaction volume, making flash loans a tool worth considering for traditional banking.

With the evolution of flash loans over time, more security protocols will hopefully be implemented to not only reduce the risk of flash loan attacks but to make flash loans and DeFi the gold standard for financially secured transactions.

Works Cited:

https://www.moonpay.com/blog/defi-flash-loans-explained

https://docs.aave.com/developers/guides/flash-loans

https://www.bsc.news/post/cryptonomics-flash-loans-explained

https://shardeum.org/blog/what-is-a-flash-loan-attack/#:~:text=A%20flash%20loan%20attack%20is,quickly%20selling%20it%20on%20another.

https://learn.bybit.com/defi/what-is-a-flash-loan-attack/

https://docs.aave.com/developers/v/1.0/tutorials/performing-a-flash-loan

https://docs.aave.com/developers/v/1.0/tutorials/performing-a-flash-loan/...-in-your-project

https://peckshield.medium.com/bzx-hack-full-disclosure-with-detailed-profit-analysis-e6b1fa9b18fc

https://peckshield.medium.com/bzx-hack-ii-full-disclosure-with-detailed-profit-analysis-8126eecc1360

https://www.coindesk.com/tech/2020/02/19/everything-you-ever-wanted-to-know-about-the-defi-flash-loan-attack/

https://www.coindesk.com/tech/2022/04/17/attacker-drains-182m-from-beanstalk-stablecoin-protocol/

https://www.cpomagazine.com/cyber-security/flash-loan-attack-takes-beanstalk-defi-platform-for-182-million-largest-yet-of-its-type/

https://www.coindesk.com/tech/2022/04/17/attacker-drains-182m-from-beanstalk-stablecoin-protocol/

https://sensoriumxr.com/articles/what-are-flash-loans

https://decrypt.co/resources/what-are-flash-loans-the-defi-lending-phenomenon-explained

https://www.yahoo.com/now/defi-flash-loans-become-standard-232453417.html

https://www.chainalysis.com/blog/euler-finance-flash-loan-attack/

Flash Loans: Use Cases, Challenges, and Opportunities (2024)

FAQs

What are some use cases of flash loans? ›

Flash Loan also provides an opportunity for people with bad intentions to borrow large amounts of assets with no collateral and is commonly used as a tool for launching attacks. The most common method of attack using flash loans is to abuse smart contract security by borrowing a large number of funds.

What are the risks of flash loans? ›

Protocol Risks: Flash loans rely on the stability and security of DeFi protocols. Vulnerabilities or exploits in these protocols can result in significant losses for flash loan users. Slippage: When executing large trades in flash loans, slippage can occur, causing the trade to be less profitable than anticipated.

What is the purpose of a flash loan in the context of? ›

Flash loans are a novel financial tool in the DeFi ecosystem. They allow users to borrow assets from an on-chain liquidity pool without any upfront collateral, provided the borrowed amount, plus a small fee, is returned to the pool within the same transaction.

How to take advantage of flash loans? ›

You apply for a flash loan on a relevant platform (ex. Aave, Uniswap). You create a logic for the loan through coding. This logic shows a series of sub-transactions — such as sales, trades — that will be used to generate a profit.

What happens if a flash loan fails? ›

If the user fails to do so, the entire transaction is reverted, and the lender receives back the original funds without any loss. Profit or Loss: Depending on the success of the executed actions, the user may profit from the borrowed funds.

Which of the following can be done with a flash loan? ›

By borrowing funds through a flash loan, they can execute rapid buy-low, sell-high trades to pocket the price difference. Flash loans facilitate quick swaps of collateral backing a user's loan for a different type of collateral, optimizing the financial position.

What is the largest flash loan? ›

8 Biggest Crypto Flash Loan Attacks of All Time
  • Euler Finance $197M Stolen in 2023.
  • $130M Cream Finance Exploit in 2021.
  • Beanstalk $80M Stolen in 2022.
  • $45M PancakeBunny Exploit in 2021.
  • Alpha Finance $37M Stolen in 2021.
  • $25M Attack on dForce in 2020.
  • Elephant Money $22.2M Exploit in 2022.
Jun 3, 2024

What are flash loan attacks? ›

In flash loan attacks malicious actors use the temporary uncollateralized liquidity provided by flash loans to manipulate the price of a crypto currency,exploit vulnerabilities in a DeFi smart contract, or steal funds from a protocol.

Are flash loans risk free? ›

Flash loans are usually risk-free for lenders as well; if there is no contract executed to return the amount loaned, the initial loan will never be made.

What is an example of a flash loan? ›

The most common use case for a flash loan is to do an arbitrage trade. For example, if Ether is trading for $1,200 in one pool and $1,300 in another DeFi application, it would be desirable to buy the Ether in the first pool and sell it in the second pool for a $100 profit.

How long does a flash loan last? ›

Flash loans are created and paid back instantly - therefore, the borrower never actually takes possession of the borrowed capital. Since the borrow and repay transactions must occur in the same block, there is never actually any period of time during which the borrower needs to “pay back” the loan.

How do you implement a flash loan? ›

How To Create a Flash Loan on Aave
  1. Step 1: Setup the Development Environment. ...
  2. Step 2: Install MetaMask Extension. ...
  3. Step 3: Create a Smart Contract. ...
  4. Step 4: Fund the Wallet. ...
  5. Step 5: Deploy the Contract. ...
  6. Step 6: Fund the Flash Loan. ...
  7. Step 7: Execute Flash Loan Contract.
Jan 22, 2023

What are the use cases of flash loan? ›

The 3 most common uses of flash loans
  • Arbitrage. Arbitrage is the strategy of leveraging price differences for the same asset in different exchanges to make a profit. ...
  • Wash trading. Like any other financial technology, flash loans can also be used to facilitate scams. ...
  • Closing Collateralized Debt Position.
Jan 28, 2024

Are flash loans good or bad? ›

Advantages of flash loans? They assist in borrowing any quantity or assets without any security, as long as the liquidity is returned to the protocol during the period of a block's transaction. You can borrow an unguaranteed sum with the requirement to repay it promptly in the same block transaction using flash loans.

Are flash loans still profitable? ›

The profitability of flash loan arbitrage bots has become more challenging due to increased competition and market maturity. However, they can still be profitable under the right conditions.

How to make money with flash loans? ›

One way to generate profits with flash loans is through “flash loan arbitrage.” This strategy leverages small price differences between decentralised exchanges (DEXs) to generate substantial gains without any personal capital investment.

What is an example of a flash loan arbitrage? ›

Flash loans represent essentially risk-free arbitrage opportunities; for example, if a cryptocurrency is being traded for $1 on one exchange and for $2 on another, a savvy trader can use smart contracts to take out a flash loan of $100 worth of the cryptocurrency on the first exchange, sell it for $200 on the second ...

What are flash loans for dummies? ›

Flash loans are created and paid back instantly - therefore, the borrower never actually takes possession of the borrowed capital. Since the borrow and repay transactions must occur in the same block, there is never actually any period of time during which the borrower needs to “pay back” the loan.

What are the uses of payday loans? ›

Payday loans are designed to repaid when the borrower's next set of wages come in. In the meantime, they can be used to help pay for a huge variety of costs including bills, household appliances, repairs, and almost any unexpected cost you can think of.

Top Articles
iShares 0-3 Month Treasury Bond ETF | SGOV
Phone Daddy
English Bulldog Puppies For Sale Under 1000 In Florida
Napa Autocare Locator
Mcfarland Usa 123Movies
Flixtor The Meg
When is streaming illegal? What you need to know about pirated content
Tap Tap Run Coupon Codes
Moviesda Dubbed Tamil Movies
biBERK Business Insurance Provides Essential Insights on Liquor Store Risk Management and Insurance Considerations
WK Kellogg Co (KLG) Dividends
Camstreams Download
William Spencer Funeral Home Portland Indiana
Https://Gw.mybeacon.its.state.nc.us/App
Nitti Sanitation Holiday Schedule
Used Sawmill For Sale - Craigslist Near Tennessee
Mflwer
360 Tabc Answers
Boscov's Bus Trips
Used Safari Condo Alto R1723 For Sale
Craigslist Battle Ground Washington
Wkow Weather Radar
Litter Robot 3 RED SOLID LIGHT
Sec Baseball Tournament Score
Construction Management Jumpstart 3Rd Edition Pdf Free Download
Fleet Farm Brainerd Mn Hours
Trivago Myrtle Beach Hotels
Inkwell, pen rests and nib boxes made of pewter, glass and porcelain.
Cpt 90677 Reimbursem*nt 2023
Truvy Back Office Login
Gt7 Roadster Shop Rampage Engine Swap
Pdx Weather Noaa
Persona 4 Golden Taotie Fusion Calculator
Selfservice Bright Lending
Police Academy Butler Tech
Top-ranked Wisconsin beats Marquette in front of record volleyball crowd at Fiserv Forum. What we learned.
Admissions - New York Conservatory for Dramatic Arts
10 games with New Game Plus modes so good you simply have to play them twice
About :: Town Of Saugerties
Rush Copley Swim Lessons
Leland Nc Craigslist
Yourcuteelena
Funkin' on the Heights
Sherwin Source Intranet
Mcoc Black Panther
Walmart Front Door Wreaths
Naomi Soraya Zelda
7 Sites to Identify the Owner of a Phone Number
Unbiased Thrive Cat Food Review In 2024 - Cats.com
Arre St Wv Srj
Famous Dave's BBQ Catering, BBQ Catering Packages, Handcrafted Catering, Famous Dave's | Famous Dave's BBQ Restaurant
Latest Posts
Article information

Author: Zonia Mosciski DO

Last Updated:

Views: 6658

Rating: 4 / 5 (51 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Zonia Mosciski DO

Birthday: 1996-05-16

Address: Suite 228 919 Deana Ford, Lake Meridithberg, NE 60017-4257

Phone: +2613987384138

Job: Chief Retail Officer

Hobby: Tai chi, Dowsing, Poi, Letterboxing, Watching movies, Video gaming, Singing

Introduction: My name is Zonia Mosciski DO, I am a enchanting, joyous, lovely, successful, hilarious, tender, outstanding person who loves writing and wants to share my knowledge and understanding with you.