What are Flash Loans?

Table of Contents

A flash loan, simply put, is a loan without collateral where the loan and repayment take place within the same transaction block. Anyone, in theory, can access large amounts of tokens and make transactions, even if only for a few seconds.

How does a flash loan work?

Remember, a full flash loan takes place within a single transaction block. If borrower and lender do not meet the predetermined criteria, which will be determined by a smart contract, then the loan will not proceed.

In other words; If the loan is not repaid immediately (within the same block), the transaction will not take place. The transaction will be reversed and the money will be returned to the lender.

A flash loan can be broken down into the following steps:

  1. The transaction (where the borrower applies for a loan) is submitted in the network.
  2. The loan is made available to the borrower.
  3. The borrower enters into a transaction that allows the smart contract to continue if it is profitable. If it’s not, the transaction will not continue.
  4. The only cost to the borrower will be the transaction cost of the transaction made.


The way a flash loan is executed will vary from complex to even more complex. All these instructions are programmed into smart contracts that execute the process in seconds.

What is a flash loan used for?

Flash loans are mainly used when executing arbitrage trades.

Arbitrage trades consist of profiting from a price difference between two different exchanges or trading pairs. One can buy a token at a low price at exchange A, and sell it at a higher price at exchange B.

When an arbitrage opportunity arises, a smart contract will notice this and execute a flash loan. To program this one needs the right know-how.

Where can you perform flash loans?

Flash loans can be executed through the lending platform AavedYdX and Uniswap.

Although the technology is very complex for absolute beginners and is reserved for programmers, it is becoming more and more possible to execute flash loans in increasingly simple models. Currently, there are several interfaces available to execute flash loans without knowing how to code.

CAUTION: Flash Loan tutorials via youtube where one goes over code step by step are usually scams!

What are the risks of flash loans?

By allowing anyone to borrow large amounts of money without collateral, it can be assumed that it will be abused.

A flash loan can be abused by:

  • Manipulating prices: One can “easily” manipulate prices using Flash loans. In fact, anyone could borrow gigantic sums of money and encode smart contracts in a malicious manner.
  • Exploitation vulnerabilities: Vulnerabilities in protocols can/will be exploited by malicious individuals who can use a flash loan. By itself, this is more likely due to vulnerabilities in the protocol than the use of the flash loan.
What are Flash Loans - What are the risks of flash loans

Conclusion

A flash loan is an innovative or even revolutionary way where loans can be taken out. Loans without collateral and within a small time period allow savvy users to make money within seconds.

But with great power, great responsibility follows. In addition to executing arbitrage trades, flash loans will be used to manipulate prices and exploit vulnerabilities.

Flash loans, like DeFi, will have to go through a maturation process if they are to find their way to the wider public.