HOLIDAY OFFER: Get the gift of up to $70 of Bitcoin. While supplies last!

Shop now

Up your Web3 game

Ledger Academy Quests

  • Test your knowledge
  • Earn POK NFTs
Play now See all quests

What is a Flash Loan?

Read 4 min
Medium
Floating boxes in an open space
KEY TAKEAWAYS:
— Flash loans are uncollateralized loans that are approved, executed and paid back all in one transaction – all done via a self-executing smart contract.

— If the loan cannot be instantly repaid according to the conditions of the smart contract, it won’t be executed.

— Each flash loan is a bespoke set of “if, then” style conditions created for specific circumstances and interactions – meaning they can be tailored to the specific opportunity.

— Flash loans are a perfect example of digital sovereignty, enabling users to programme their own bespoke agreements with DeFi protocols.

DeFi has enabled a wealth of interesting new services and options, but among them, one stands out as just a bit more daring than the rest.

Flash loans are the playboy of DeFi. They combine traditional arbitrage techniques with the unique autonomy offered by self-executing smart contracts, to produce an exciting new option for crypto traders with sufficient know-how.

Oh and did we mention that collateral and paperwork are not required?

If you’re intrigued we can’t blame you. Strap yourself in and get ready, here, we’ll take you on a walk through the wonders of flash loans, how they work, why we use them – and risks to be aware of

What Is a Flash Loan?

A flash loan is an uncollateralized loan (meaning the borrower doesn’t need to put up any personal assets as security) where crypto assets are borrowed and repaid immediately in a single, instantaneous transaction. The functionality was first rolled out in 2020 by DeFi protocol AAVE. It has since been used and developed across the DeFi space. Flash loans are still early to the party so some quirks need to be addressed. But they are nonetheless a very exciting new option native to the crypto industry.

How Do Flash Loans Work?

A Loan Based on Results

A flash loan takes advantage of price discrepancies between crypto protocols.

For example: maybe you see that exchange X is selling a particular token for $100 dollars, while exchange Y is selling the same token for $101. So you buy the token on exchange X and flip it on exchange Y, making yourself a profit of $1.

That one dollar might not seem like a lot – but do that exact same trade on a large scale, by multiplying the trade by 10,000 for example, and you’ll magically make yourself $10,000. The only problem is obtaining the initial, huge upfront capital to purchase the tokens. Who has $100,000 lying around?

That’s where flash loans come in.

A flash loan is a bespoke smart contract that enables anyone to spot an arbitrage opportunity, and create a loan that enables them to take advantage of that opportunity on a large scale. It allows the user to organize an instantaneous loan, that is based on a specific set of trading conditions. If the fulfillment of the contract conditions would not result in the loan being paid back immediately with interest, the agreement simply will not execute.

What’s unique about flash loans is that the loan is not granted on the basis of the borrower’s profile, documents or collateral (as with traditional finance and even some loans in DeFi). Instead, on the borrower’s ability to prove an immediate yield from the transaction, based on the smart contract they’ve created.

Smart contracts: the backbone of flash loans

When we talk about flash loans, what we’re really talking about is a smart contract. Every flash loan is basically a bespoke smart contract that agrees to do X if Y happens. In the context of a flash loan, the smart contract operates as follows: 

If X+10 can be repaid within seconds – something that will depend on the specifics of the arbitrage opportunity itself – then X can be borrowed right now.

Hence, to be able to access and receive a flash loan, you need to spot a price discrepancy and immediately write a contract to fit, before the gap closes. If you are feeling confused, don’t worry, we will revisit this later.

Key Features of Flash Loans

So although flash loans may share some similarities with traditional loans, they also have certain distinct features that make them unique.

Zero collateral

Conventional loan systems usually request for collateral before giving loans. There is no need for any form of collateral with flash loans. The contract simply will not execute unless it can immediately be repaid with interest.

Instantaneous transactions 

Flash loans are executed instantaneously. They are completed and repaid in a matter of seconds in order to take advantage of fast-moving price fluctuations.

Application of smart contracts

In the case of flash loans, smart contracts govern the transaction, and ensure that the loan is paid back before the transaction is concluded. 

Flash Loan Limitations and Risks

If you are already excited at the prospect of creating your first flash loan, there are a few details we should go over first.

Limited to Tech-savvy Traders (for now)

As you now know, flash loans are basically smart contracts created for your own specific circumstances. Since smart contracts are basically code executed on the blockchain. You may want to brush up on your coding skills before you get started. If you are feeling antsy to learn about smart contracts here’s a guide on how to read smart contract data.

A Playground for bots

The autonomy made possible by flash loans is one of the most exciting elements of the technology. You can literally create your very own, bespoke loan contract. But with a process that’s so easy to automate, the space is also fertile ground for bots. Some bots have been designed to parse the DeFi landscape to detect arbitrage opportunities as they arise, seizing the opportunity immediately. Short story? Don’t expect money-making opportunities to flood in. Many are seized up straight away by automated systems, meaning sparse options for regular traders.

A vector for hacks

As with any new technology, opportunists are always looking for ways to manipulate flash loans for their own ends. Flash loans are finding ever more creative ways to exploit vulnerabilities in lending protocols – here are a few of the main scams involving flash loans so far.

Vulnerabilities in protocols are common, and the ability of flash loans to exploit these on grand scale makes them a great vehicle for eagle-eyed hackers. These types of scam will likely diminish as the industry becomes aware of these new attack vectors. For now, they’re a pretty notorious drawback of the flash loan.

Flash Loans: a Glimpse of the Future

The flash loan is exciting. Although it still a nascent DeFi innovation that unites old-fashioned arbitrage with the speed and digital sovereignty of blockchain technology. They may be a bit complex for the average trader and their understanding of crypto arbitrage. Their underlying premise demonstrates the incredible potential of smart contracts for those who are literate in their programming language.

With blockchain technology now accepted as a norm across industries and educational institutions, it seems likely that the next generation of web users will be programming their own loans, contracts and terms of engagement as though they were tying a shoelace. Pretty cool, right?

The takeaway? Keep learning – the power is in the hands of those who understand this fascinating technology.

Knowledge is Power


Stay in touch

Announcements can be found in our blog. Press contact:
[email protected]

Subscribe to our
newsletter

New coins supported, blog updates and exclusive offers directly in your inbox


Your email address will only be used to send you our newsletter, as well as updates and offers. You can unsubscribe at any time using the link included in the newsletter.

Learn more about how we manage your data and your rights.