374 Interactions, 20 today
Flash loans have even made headlines on many occasions, as “hackers” exploited stocks to their favour, resulting in massive gains.
Flash Loans – Explained
People may access two forms of loans in the field of conventional finance: secured and unsecured. Unsecured loans are those in which the lender would not want the borrower to put up any kind of collateral. Banks can make unsecured loans available to their borrowers depending on their financial records. A guaranteed loan requires the borrower to put down collateral – anything of value that the lender will sue if the borrower fails to repay. A pawn shop is a real-world example of this, where customers will momentarily “sell” their jewels or other items and then buy them back later.
Users must have collateral to borrow funds in DeFi applications such as Compound or Maker. Typically, these loans are highly overcollateralized, which means that the user must tie up properties worth more than the debt. This guarantees that the consumer can repay their loan, since there is no such thing as a credit rating in the pseudonymous realm of DeFi – at least not yet. It also mitigates the volatility uncertainties associated with lending and borrowing cryptocurrencies.
How Does a Flash Loan Work?
A flash loan allows a DeFi customer to borrow cryptocurrency without having to put up any collateral. The catch is that the loan terms are programmed into a smart contract that allows the user to repay the loan in the same transaction until the Ethereum blockchain changes the user’s account balances. The deal would collapse if they do not repay.
This, of course, implies that the loan is, by necessity, very short-term. However, flash loans provide DeFi consumers with the ability to prosper depending on what they can do with the loan in a single purchase.
Arbitrage traders profit from minor price fluctuations between decentralised markets. Assume a DAI/USDC trades at a 1:1 ratio on Uniswap, but you can buy 1 USDC for 0.99 DAI on Curve Finance.
On Curve Finance, a trader who borrows 10,000 DAI will sell it for 10,101 USDC. They will then exchange them for DAI at a 1:1 ratio on Uniswap, repaying the 10,000 DAI loan and pocketing the 101 DAI gap. In fact, there will be fees, and arbitrage trading carries the possibility of price slippage. As a result, traders typically sell at high prices to cover fees and look for token pools with high liquidity to reduce slippage risk.
A collateral exchange allows DeFi users to swap the collateral they used to obtain a loan from a multi-collateral lending app. Assume a dealer has staked their ETH in Maker in order to build DAI.
They can take out a DAI flash loan for the same amount they borrowed from Maker. The flash loan will then be used to repay their Maker loan, remove their ETH, and exchange it for BAT on a DEX. They use the BAT to secure the production of more DAI on Maker, which repays the flash loan.
Flash Loan: The DeFi Attacks
In February 2020, when flash loans were still a relatively recent phenomenon in the DeFi markets, bZx made headlines after a so-called hacker managed to rig the markets and earn handsomely. The attacker gained about $950,000 in two separate attacks by using flash loans to exploit DeFi vulnerabilities.
It is now unknown who carried out these attacks. They did, however, need to be highly knowledgeable about how DeFi protocols operate since it was a complex operation requiring many applications. The hacker effectively triggered a sequence of transactions that took advantage of the low liquidity in a WBTC/ETH pool on Uniswap. They were able to execute simultaneous swaps and transactions that resulted in a price pump, from which they profited and repaid their flash loan.
It’s worth noting that these were not “hacks” in the common sense of the word. The intruder was merely leveraging bugs in the DeFi architecture, not modifying code or stealing money.
One of the crypto revelations of 2020 has been the quickly evolving DeFi campaign. The definition of flash loans is one of the many emerging ideas and technologies that have arisen. Given their success, it seems that flash loans are here to remain. Even the February hackers were ineffective in discouraging consumers. However, these events highlight the DeFi space’s immaturity and how much work has to be done to insure that smart contracts and markets are not vulnerable to misuse and manipulation. Before throwing your money on the line in the wild west of DeFi, make sure you understand the risks.