What are Flash Loans

To take out a normal loan, you need to provide proof of reserves, income, and more besides. Well, forget all that: flash loans are like lending on steroids.

But are they a good or a bad thing? That depends on who you ask. To some, because flash loans are both a hugely innovative and useful tool in decentralized finance (DeFi), primarily on the Ethereum Network. To their detractors, flash loans present an opportunity for unscrupulous actors to siphon off millions by exploiting poorly protected protocols.

Let’s delve into this innovation of blockchain technology to know why it became so popular in the first place.

Defining Flash Loans

With a run-of-the-mill loan, the lender usually wants some kind of collateral to make sure they get their money back; the contract often takes a while to get approved, and the borrower pays back the loan, with interest, over a period of weeks, months or years.

Flash loans are the antithesis of that. They do what they say on the tin, and occur in an instant because the funds are both borrowed and returned within seconds — in the space of one transaction.

It’s made possible because of the innovative properties of smart contracts, which set out the terms, and also perform instant trades on behalf of the borrower with the loaned capital. Flash loans that result in a profit are typically charged a 0.09% fee.

If the borrower doesn’t repay the capital, or the trade doesn’t make a profit, the conditions set out in the flash loan smart contract aren’t met, and the transaction is reversed — just like it never happened, with the funds returned to the lender. So — in theory, at least — there’s minimal risk for both parties.

In a nutshell, flash loans are:

  • Unsecured — Instead of providing collateral, the borrower immediately repays the loan.
  • Instant — The capital is borrowed and repaid in one transaction.
  • Innovative — Flash loans use smart contracts to set out terms and perform instant trades.

How do Flash Lans work?

There are two main entities in a flash loan: the lender and borrowers.

To interact with the flash loan lender, borrowers must develop a smart contract that consists of three parts:

  • Borrow loans from flash loan lenders (Aave, dYdX, and Uniswap)
  • Interact with smart contracts for other operations
  • Return the loans

The entire workflow consists of five steps:

1. Transfer loan

The flash loan provider transfers requested assets to borrowers.

2. Invoke

The user invokes pre-designed operations.

3. Run operation

The user interacts with different smart contracts to execute operations (arbitrage, liquidation, etc.) with borrowed assets.

4. Repay loan

Once the operations are complete, the user will return the assets to the flash loan providers with or without the borrowed assets.

5. Check state

Lastly, the flash loan providers will check their balance. If the user has submitted insufficient funds, the providers will reverse the transaction immediately.

Why do people use Flash Loans?

Flash loans address the limitations of CeFi and DeFi lending.

In a traditional CeFi lending system, you’d have to wait months to get your loan approved. But thanks to smart contracts, flash loans are processed and approved instantly.

Also, if the borrower defaults, the onus of debt is on the lending authorities. If a borrower defaults on a flash loan, however, the smart contract will cancel the transaction and return the funds to the lender.

As for DeFi lending, users have to provide collateral to get a crypto loan. Flash loans, on the other hand, are uncollateralized, making lending more accessible and giving everyone the opportunity to make money.

Why use a Flash Loan?

Flash loans help traders make a profit without risking their money. They can be used for many things such as the following:

Arbitrage opportunities

Traders use flash loan transactions to make a profit by spotting price discrepancies across price exchanges and exploiting time. Assuming the price of a token varies on different exchanges, a trader can use a flash loan and a separate smart contract to purchase tokens from one exchange at $2,000 and sell them on another exchange for $2,500 generating $500 profit. Following that, the trader repays the loan and keeps the profit.

Collateral Swaps

In this case, one collateral is used to quickly replace the other used to secure the user’s loan.

Reduced transaction fee

Since a flash loan combines several transactions into one (in some cases), the service fee is reduced. The cost of the transaction is then charged on the loan amount so the borrower suffers lower fees.

Final Thoughts

Flash loans have taken the decentralized finance world by storm as they let users instantly borrow unlimited assets without collateral. They’re a double-edged sword, however, and can have unfavorable consequences on the crypto ecosystem depending on what they’re used for.

Many crypto enthusiasts are currently using flash loans to make profits and hedge themselves against liquidation risks. But malicious parties are also using them to engineer attacks on smart contracts and drain them of funds. However, the risk of these attacks might diminish in the future if DeFi platforms spend more resources on testing their code.

It’s also worth remembering that flash loans are relatively new to the DeFi space, so the possibilities for innovation are endless.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store