What Are Flash Loans In Decentralized Finance?

BeginnerJan 20, 2023
Flash loans are a form of unsecured loans available to cryptocurrency traders on some DeFi protocols that require no collateral or intermediaries.
What Are Flash Loans In Decentralized Finance?

Out of a need to improve access to financial services and solutions comes the decentralized finance movement. Decentralized Finance provides an ecosystem of finance that can be accessed without requiring formal terms or documents.

Decentralized Finance, or DeFi, is modifying the world of financial loans as we know it. It has introduced a new lending option that eliminates the need for collateral, high-interest rates, and formal identification. This lending option is called a flash loan. A trader needs no collateral or identification to obtain a flash loan on a DeFi protocol.

What Are Flash Loans?

In a nutshell, flash loans are a form of unsecured loans that traders can lend through decentralized protocols in single instantaneous transactions on the blockchain network.

Flash loans are open source unsecured loans that can be accessed by any trader with a cryptocurrency wallet. Unlike traditional loans, a trader does not need to come up with collateral or pass a credit check to get a flash loan. This is because the flash loan transaction is backed by smart contracts, which ensure that the loan is repaid to the lender within the same transaction and in no more than a few seconds.

Where Did Flash Loans Come From?

The original model of flash loans was introduced by Marble, an open-source bank that preceded DeFi in 2018. Introduced as Flash lending, the premier concept allowed lenders to borrow Ether and ER20 tokens to leverage arbitrage opportunities on the Ethereum mainnet in public beta.

The concept was developed upon and introduced to the Ethereum blockchain network in the first month of 2020 by the leading decentralized exchange platform AAVE. As of June 2022, the DeFi platform has issued flash loans totaling over $5 billion.

Why Are Flash Loans So Popular?

Since their emergence, DeFi loans have amassed a lot of popularity due mainly to the profit opportunities it provides and their unique properties. Flash loans differ from traditional and over collateralized loans in the following ways:

Instantaneous Transactions

The process of obtaining and fulfilling traditional loans is often long and arduous. Traditional banks require lenders to provide a lot of data and, in some cases, collateral before they can qualify for a loan. Paying back that loan, as well, can take several months, with the lender paying a percentage of interest fees.

Flash loans are the exact opposite. Not only are they seamless, but the entire process of borrowing and repayment happens in the same transaction that happens rapidly. Flash loans include a series of transactions; lending, using the loan, and repayment, but they are all counted as one.

Smart Contracts

The innovation behind smart contracts, a significant feature of blockchain technology, contributes to the popularity of flash Loans. Smart contracts ensure that the lender gets their funds back if the borrower fails to meet the conditions of their agreement.

Due to this feature, the risk of loan scams is reduced. Although flash loans are subject to risks, the possibility of the borrower running off with borrowed funds is not one of them.

Unsecured Loans

Unlike the other DeFi loan available, over collateralized loans, borrowers do not need to provide any form of collateral to get a flash loan. It is as simple as requesting and getting funds in the form of a loan. Flash loans can work in this manner because smart contracts are built to reverse the transaction if the borrower cannot meet the terms of the agreement.

How Do Flash Loans Work?

Flash loans are primarily backed by smart contracts, which are lines of code that contain the terms of the agreement between borrower and lender. These smart contracts ensure that the funds are transferred to the borrower only temporarily and that the loan is repaid within the same transaction, which happens in a flash. What does this mean?

There are four processes involved in a flash loan transaction:

  1. The borrower requests funds;
  2. A smart contract allows for the temporary transfer of the funds to the possession of the borrower;
  3. That same smart contract performs trades on behalf of the lender to make a profit;
  4. If a profit is made, the initial loan is returned to the lender, the borrower pays a fee of 0.09% to the protocol and keeps the remaining.

Should the borrower fail to make a profit, the funds are instantaneously reversed to the lender’s possession. This is because the smart contract is built to reverse a transaction if the terms of the contract (making a profit) are not met. In theory, the funds do not leave the lender’s possession until the borrower makes a profit.

Are Flash Loans Beneficial?

The nature of flash loans can often cause confusion. Afterall, the transaction may be reversed before the borrower has an opportunity to put the borrowed funds to good use and yield a profit. How then can a user benefit from borrowing assets if they must be repaid in a short time anyway? There are several ways a DeFi user can benefit from using flash Loans. They include:

Arbitrage

Possibly the most common way DeFi users can profit from flash loans, arbitrage is a trading strategy that is based on price discrepancies across different decentralized exchange platforms (DEX). Traders who take advantage of arbitrage opportunities apply a separate smart contract to a flash loan transaction to make a profit by buying and selling at different prices and profiting from the margin.

In simpler terms, say DeFi platform 1 priced a token at $1 and DeFi platform 2 priced the same token at $1.50, the user can make a profit margin of 50 cents per token. If the user adds a separate smart contract built to take advantage of the price discrepancies, they can trade safely without putting their funds or that of the lender at risk. Should the separate smart contract fail to make a profit from the arbitrage opportunity, the original flash loan smart contract would reverse the transaction, making it as though the transaction never happened.

Collateral Swaps

Usually employed to avoid liquidation of a trader’s asset, Collateral swaps involve the replacement of the collateral backing a user’s loan with a different type of collateral. If the market value of a crypto asset backing a loan falls too far, the lender faces the risk of liquidation.

Liquidation in DeFi lending is where a smart contract backing a DeFi loan sells off the provided collateral after noticing a drop in the market value of the collateral. The smart contract often does not consider how much of the loan has been paid off.

Using a flash loan, a DeFi user can swap the collateral he used to back his original loan with a different asset with better or higher market value.

Lower Fees

As referenced above, flash loans are a series of transactions counted as one. This means that even though a flash loan involves more than one transaction, the borrower is charged fees only on the loan amount, which amounts to about 0.09%. Some traders take advantage of this to carry out trading activities that would otherwise cost them higher gas fees.

Risks involved in Flash Loans

Like many other aspects of the cryptocurrency space, flash Loans are subject to scams and risks of other kinds. The experimental nature of the concept, and the DeFi movement as a whole, makes it subject to attacks by hackers and fraudulent users, who consistently look for ways to exploit the system. Some of them succeeded in the past with flash loan attacks.

What Is a Flash Loan Attack?

Flash loan attacks occur when malicious users succeed in finding vulnerabilities in a smart contract and use it to their advantage. As mentioned earlier, flash loans are relatively new and as a result, the technology backing the concept is still under development. Hackers often attempt to exploit flash loans by manipulating the market or making unwanted modifications to the terms of a smart contract.

Noticing a flash loan attack and preventing it can be difficult because the process is an intricate one that involves complex transactions.

Examples of Flash Loan Attacks

Several flash loan attacks happened during the first few months after flash loans were introduced to the ethereum blockchain. Here is some information on one of the biggest attacks.

dYdX

This attack was one of the first flash loan attacks after flash loans were introduced to the Ethereum blockchain network. The attack went like this:

The attacker first manipulated the DeFi platform to get the initial loan. The initial loan was then divided and put into two other lending platforms namely, Compound and Fulcrum. On the latter platform, the attacker used his loan, which was in ETH to long WBTC on the Uniswap pool. The result of this action was a significant rise in the price of WBTC due to the size of the Uniswap liquidity pool. Fulcrum, in turn, has no choice but to pay a very high price for the WBTC.

The attacker then used the other half of the initial loan to take out a WBTC loan on Compound, which he then flipped on Uniswap and made a profit. After paying back the Compound loan, the attacker successfully tipped the market in their favor and deceived Fulcrum into buying WBTC at a much higher price.

Conclusion

It is not arguable that flash loans contribute significantly to the world of DeFi. The concept has the power to alter and improve the world of DeFi significantly. However, in light of the several flash loan attacks, it is also certain that for flash loans to be highly profitable and secure, significant improvements need to be made.

Автор: Tamilore
Перекладач: Piper
Рецензент(-и): Matheus, Ashley, Joyce
* Ця інформація не є фінансовою порадою чи будь-якою іншою рекомендацією, запропонованою чи схваленою Gate.io.
* Цю статтю заборонено відтворювати, передавати чи копіювати без посилання на Gate.io. Порушення є порушенням Закону про авторське право і може бути предметом судового розгляду.
Розпочати зараз
Зареєструйтеся та отримайте ваучер на
$100
!
Створити обліковий запис