As crypto loans become more and more popular, people are looking into new methods of lending and borrowing, but not all loans are built the same, and some DeFi loan options come with inherent risks. One such option is known as a “flash loan”, a somewhat recent, albeit increasingly popular choice. 


What are Flash Loans?


A flash loan is a type of decentralized loan where all activity happens within one single block transaction. This means that the money being borrowed and the money being repaid must all happen within in transaction, all entering the blockchain at once. These loans are instantaneous, happening at the moment they are created, which is possible as DeFi lending platforms have no regulation on this front. As money is loaned and then subsequently returned within one blockchain transaction, these are called atomic actions because they are indivisible and inseparable from the perspective of the database. The loans only fully execute if all the actions within the transaction can be performed, so if by the last action, a user no longer has the money in their wallet, then the loan will cancel and all money will be returned to its initial owners.


Flash loans can only exist for an extremely brief period of time, sometimes only lasting seconds, as all actions must be fulfilled as one block. This might seem confusing, considering how very little can truly be done in such a minimal space of time. However, flash loans can contain many actions written within one block, and those actions can occasionally yield reasonable returns, depending on how the crypto markets are operating. For instance, users could theoretically open a flash loan in which they lend 1 ETH in return for borrowing 0.03249217 WBTC (a version of Bitcoin which runs on the Ethereum network), and then within the same block, they could lend that 0.03249217 WBTC for 7.24701577 WXMR (a version of Monero which runs on the Ethereum network). Due to the sheer speed and volatility of the crypto markets, this activity could bring about a profit, as the exchange rates for ETH, WBTC, and WXMR could all work in the user’s favor. All these actions happen inside one block and once the block has been admitted onto the blockchain all actions will be chronologically performed, with the final action being the user paying back the loan with, hopefully, some gains leftover from playing the market. 


Alternatively, flash loans are used to maximize arbitrage opportunities, which has become increasingly popular as there are currently so many DeFi exchanges all competing with one another and therefore offering slightly different prices for tokens. 


Too good to be true?


Flash loans can sound like a simple tool for making quick money, but there are many, many risks involved. For starters, using flash loans to either play the markets or to use arbitrage to your advantage leaves you in a vulnerable position, as the cryptocurrency markets can swing as easily in your favor as they can out of your favor (even during a bull market). Within the seconds it takes to execute a flash loan, it may no longer be profitable. Flash loan providers usually advertise their service by saying that this does not matter, because if you no longer have the right amount in your wallet, then the loan will cancel, however, this is misleading. Even on failed loans, a user will still have to pay a transaction fee, and if they are using a platform running on Ethereum, then those fees could typically be between $18 and $70, and as flash loans contain more data than a simple transaction, they usually cost more money to execute. Also bear in mind that as flash loans are only profitable because of their speed, people are usually forced to pay higher fees for transactions as they need them to be executed as soon a possible or the financial opportunities disappear. This oftentimes requires people to pay hundreds of dollars for such transactions. 


Are flash loans safe?


Paying extortionate Ethereum fees is only one worry with flash loans. There is also a question of how safe and secure they are on a technological level. In March 2020, researchers at Imperial College London analyzed two wide-scale flash loan attacks which had taken place. Both attacks, while different in methodology, resulted in manipulating the price of DeFi exchanges to either create unusually large arbitrage opportunities or create wide profit margins within loans. These allowed attackers to gain profits of around $829,500 and $1 million respectively. Such attacks were possible because DeFi technology is too new, and in many cases, too experimental in its methods. 


Proceed with caution


The fact that two separate attacks could happen shows that DeFi flash loans have multiple weaknesses built within their infrastructure, causing an inherent risk to the end user. They may seem like straightforward tools which can be used to quickly gain money within a matter of seconds, but the truth is that these are experimental concepts that need more testing and security before they can be deemed safe. DeFi loans are simply too new and inexperienced, and the lack of regulation means that attacks can happen with relative ease. Not to mention the cost of transaction fees which means only those with a great deal of disposable cash can partake. Flash loans promise a lot of good, but their risks are hidden in the details.