Photo by Peter Galbraith from FreeImages

Ethereum: Ever heard of flash loans?

By SylarHeisenberg | blockchain-blog | 22 Mar 2020


After the two exploits of the DeFi project bZx, everyone is talking about Flash Loans. But what are flash loans? What do they mean to Ethereum, what damage can they do and how do they work?

Two attacks on bZx and Fulcrum, whose strategy had been known for a long time according to 1inch.exchange, caused a stir in Decentralized Finance. This further intensified the pre-existing concerns about an attack vector on the MakerDAO. Although they were somewhat dispelled, for the larger Decentralized Finance sector the question still remains as to what to do with these Flash Loans.

As always, investors need to beware of the two extremes. Neither should we indulge in Fear, Uncertainty and Doubt (FUD) nor in uncritical optimism. The thing that helps you with this issue is to become a responsible crypto-citizen.

What are Flash Loans?

Simply put, Flash Loans are credit transactions that are repaid in the same transaction. Within a Smart Contract, you would define a complex transaction. Through these, funds would be borrowed, used and returned.

A simple Metamask Wallet will not be able to initiate such Flash Loans. For complex transactions, investors will have to get their hands dirty and write their own Smart Contracts. Ambitious Solidity developers can take a look at a template on the DeFi platform Aave.

Unlike loans that investors enter into on MakerDAO and other DeFi platforms, Flash Loans does not require collateral. Since the borrowed funds are reduced in the same transaction, the whole thing is a zero-sum game for the lender.

Flash Loans: For example for arbitrage on Ethereum

What can investors use something like this for? It can be useful for arbitrage transactions between different decentralized exchanges in the DeFi ecosystem. One borrows Ethereum to buy certain tokens on a stock exchange. On another exchange you sell these tokens again for Ethereum. If you make a profit, the transaction is triggered, if you make a loss and cannot repay this loss - also in the same transaction - from another Ethereum investment, the transaction does not occur at all. All in all, a quite interesting construction, which allows a fast interaction between different DeFi applications.

This can be well illustrated by arbitrage transactions. If the value pair WBTC/ETH has different prices on two different decentralized stock exchanges, this is an opportunity for a fast, profitable trade. WBTC and the world of DEXes are well known for their lack of liquidity, so there can be significant price differences across different exchanges. The problem: these profitable price differences can quickly disappear again.

After all, you won't be the only person who wants to take advantage of the investment opportunity that presents itself. Anyone who has ever carried out an arbitrage trade between two normal crypto exchanges knows this restless feeling of waiting for funds to be released while the profit window slowly closes. This waiting time would not exist with a Flash Loan.

Apart from the profit opportunities for individuals, such Flash Loans can help the liquidity of all decentralized exchanges incredibly. After all, arbitrage transactions are also a system of price determination or price alignment in the classic financial world. If this can now be done without long delays, it would be extremely attractive for the DEXes concerned.

Are there any risks for Ethereum and DeFi?

But even here, flash loans do not stop. Gavin McDermott, developer from the BitGo environment, introduced the idea of Flash Minting on Twitter. Flash Minting is the instantaneous generation of tokens that can be sold again in the same transaction on Uniswap against Ether. As with Flash Loans, if a trade comes about, it is good, if not, nothing happened.

However, the example can also be used to illustrate the risks of flash loans or flash mining for Ethereum and the entire DeFi ecosystem. Flash Minting in particular sounds like the DeFi version of counterfeit money, even though admittedly defenders of Flash Minting could say that without a market, in the above case on Uniswap, little could happen.

There are also various risks to be considered with flash loans. It is certainly true that the risk for creditors is very low. After all, they get their money back in one transaction. However, the possibility of borrowing a lot of money in order to trade on an illiquid stock exchange offers many possible attack vectors for attackers. The above-mentioned attacks on bZx are an example of the opportunities, but also risks, that Flash Loans pose for the entire market.

Controlling risks around Flash Loans, but how?

The various dApps in the Decentralized Finance ecosystem are now faced with the big question of how they position themselves in relation to Flash Loans and Flash Minting. If they were to introduce a kind of holding period, i.e. that trades on a decentralised exchange, for example, would have to wait a few blocks until finality, the risks associated with Flash Loans would disappear.

For projects that are not decentralized exchanges, this would be a possibility. MakerDAO has decided something similar in the governance voting mentioned above. The time during which the governance could veto significant decisions such as a disposal of the stored ethereum has now been set at 24 hours. Within a transaction, it would not be possible to get the ethers out of the MakerDAO Smart Contracts.

However, this would also render flash loans on the stock exchange useless. Decentralized stock exchanges would thus be dramatically slowed down. Even more importantly, the problems caused by a lack of liquidity in the DEX ecosystem would become even greater. For decentralized exchanges, the safest approach would therefore be to find dynamically adjustable transaction limits. This would prevent an attacker from using one or more coordinated transactions to draw funds from projects like bZx.

It is still unclear whether this or other methods are the solution. Currently there is a lot of research work going on around Flash Loans. They will probably continue to play a central role in Decentralized Finance.

Also interesting:

How do you rate this article?

8


SylarHeisenberg
SylarHeisenberg

I am a 36 year old businessman, based in Germany with a great passion for our monetary system, cryptographic currencies and marketing. I would like to share this passion with you here.


blockchain-blog
blockchain-blog

This is my blog in the areas of Blockchain, digital currencies and Bitcoin. I report on important developments in the digital currency markets and provide readers with a critical and independent assessment of the news situation.

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.