What is a Flash Loan?
|— 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, but 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 is used to take 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 fulfilment 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) but 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.
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.
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 – and 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 possibly 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 on the lookout 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 but for now, they’re a pretty notorious drawback of the flash loan.
Flash loans: a glimpse of the future
The flash loan is an exciting, but still nascent DeFi innovation that unites olf-fashioned arbitrage with the speed and digital sovereignty of blockchain technology. They may be a bit complex for the average trader, but their underlying premise demonstrates the incredible potential of smart contracts for those who are literate in their programming language.
And 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.