What is arbitrage?
To understand the concept of flash loans and the Flash Loan Attack, first, we must understand what arbitrage is. Arbitrage refers to buying an asset on one exchange and selling it for a different price on another one to earn a profit. The price of stocks and other assets may vary from exchange to exchange. This is due to the difference in demand and supply on each exchange.
This works for cryptocurrency as well. Due to the difference in supply and demand, the price of cryptocurrency varies slightly from exchange to exchange. For example, if a person buys 100 Bitcoin for $30 each on Binance, he can then immediately sell them on Coinbase where the value is $32 each. This earns him a tidy profit of $200! In many cases, the exchange does not levy any transaction fees. Even if there are any fees or commissions involved, it makes for a small fraction of the profit.
Traditional loans vs. Flash loans
Decentralized Finance apps like DEX (Decentralized Exchange) platforms have come up with flash loans for this purpose. With flash loans, a person can take a short-term loan from another user for the purpose of arbitrage. This process makes use of smart contracts to facilitate the smooth movement of funds from one platform to another.
Flash loans enable a person to borrow funds for the purpose of making a transaction. They can be risky as opposed to traditional loans, as they do not require any collateral. Usually, when a person takes out a loan, there are certain conditions put in place to protect the lender. This is for in the case that the borrower defaults. For example, a person who needs money may approach a pawn shop and leave a valuable item with them in exchange for money. In order to retrieve their possession, they must then repay the amount of the loan plus any accumulated interest in full. In case they are unable to repay the loan, the pawnshop owner can sell the valuables and recover his money.
How do Flash Loans work?
However, this is not the case on De-Fi platforms. Users can take uncollateralized loans from other users on the basis of smart contracts, called ‘flash loans’. Flash loans ensure that the money is borrowed and returned in the same transaction- in a matter of seconds.
The smart contract usually lays out terms that stipulate the amount at which the cryptocurrency must sell in order to avail a profit. If the borrower is unable to sell the coins for a profit within the decided time, then they are returned to the owner. In the case that the transaction is successful, the borrower is able to retain their earnings. In addition to this, the original principal returns to the lender. Either way, the smart contract provides protection to the original lender. All transactions are done automatically by the blockchain that the smart contract is built on. This is what enables flash loans to be made in the first place- the absence of manual operations makes the transactions lightning fast.
What are Flash Loan Attacks?
However, hackers have come up with a way to exploit these flash loans to steal crypto coins and make quick gains. As Flash Loan Attack are a type of unsecured loan, lending out cryptocurrency can pose a great risk to the owners if things go wrong. Flash Loan Attack abuse these smart contract transactions to manipulate the cryptocurrency market for their own gain. They take advantage of the lack of collateral to borrow a large amount of crpytocoins. This causes a shift in the supply and demand of the market, that can cause a steep decline in its value. By repeating this process many times, flash loan attackers are able to hack the system. In this way, they are able to make money on other people’s capital. After doing so, they can disappear scot-free, as the monitoring of crypto platforms is not very strict.
Though the smart contract still works as required, the shift in value inaverdently causes loss to the lender! Technically, they are still getting back the same number of coins that they had loaned out. However, due to the value of the cryptocurrency dropping, these coins are now worth far less. Hence, the hacker was able to use other peoples money to make quick bucks, without adding any risk of his own.
Why is cryptocurrency liquidity so important?
As of now, Flash Loan Attack are fairly common in the cryptocurrency space. Blockchain technology is still fairly new, because of which developers have not been able to sort out all the problems regarding security yet. Hackers also take advantage of inaccurately calculated liquidity pools. These ‘pools’ are put in place to protect the exchange in case of an excess of cryptocoins are sold off. Liquidity pools consist of back-up tokens, which are locked in place by smart contracts. If these liquidity pools are unable to keep up with the actions of flash loan attackers, then it can cause problems regarding the crypto coins value. Crypto owners are encouraged to invest in crypto coins. This increases the liquidity of the ‘pool’, for which they may receive incentives.
Increasing liquidity ensures that there is no need for the matching of buyers and sellers. In other words, it eliminates the need for the ‘double coincidence of wants’. Here, users can simply buy and sell tokens at any time, aided by smart contracts. Attackers are able to pinpoint the weaknesses of smart contracts in order to manipulate the entire cryptocurrency market.
Conclusion of Flash Loan Attack
The main point of these smart contracts is to ensure that both the buyer and the seller are able to make risk-free transactions. Smart contracts provide protection to the lender’s funds, and the borrower is able to make a profit without staking any capital of his own. However, Flash Loan Attack have managed to use this system to their advantage.
Using dirty tactics, they are able to make much more money than what the system was intended for. It is extremely important for developers to identify the problems with flash loans and rectify them to prevent future problems. Though De-Fi platforms are decentralized, it is extremely important to put a security system in place. This will help protect the hard-earned funds of the investors, as well as let borrowers make profits safely.