
Flash loans are an effective tool, even though the current high gas fees deter most users. However, the relevant principles and application scenarios still need to be known. In the future, flash loans will become more convenient and there will be more opportunities for rapid arbitrage. Today we will talk about the basic application scenarios of flash loans.
Structure of this article:
Flash loan definition
When do you need to use flash loans?
Specific operation process example
For the second usage scenario: get back the collateral without repaying the money
For the third usage scenario: do not pay back the money, exchange collateral
secondary title
Summarize
Flash loan definition
secondary title
When do you need to use flash loans?
Currently, there are three scenarios for normal use of flash loans:
Find the price difference between different platforms (more of the price difference between different stablecoins), and use flash loan arbitrage, as mentioned in this article before, the reference article is linked at the end of the article;
In the lending platform, if the loaned money is occupied, the principal needs to be repaid, and the pledged assets are proposed;
In the lending platform, the loaned money is occupied, and the pledge needs to be converted into another asset, such as the pledged BTC wants to be exchanged for ETH.
secondary title
Specific operation process example
For the second usage scenario: get back the collateral without repaying the money
I deposited 1 million US dollars worth of ETH on Compound, lent 500,000 US dollars of stable coins such as DAI or USDC, and then bought a house or spent it. Now I need to repay the borrowed money before I can withdraw ETH, and the market has fallen When you want to sell Ethereum.
There are two methods here:
For futures and spot hedging, it is also possible to open a USDT-based ETH with double leverage for a short-term period, but there is a holding fee for holding positions. Treat the symptoms but not the root cause, because you still have no money to return to the lending platform.
The pledge rate has not been used up. At this time, some ETH can be exchanged for DAI, returned to the platform, and some ETH can be exchanged for DAI, returned to the platform, and so on. However, this operation will be very slow and consume a lot of gas fees.
At this time, you can use flash loans, and use platforms such as AAVE or dydx to initiate flash loans.
Launch a flash loan to borrow 500,000 DAI from aave,
500,000 DAI returned to compound;
Withdraw ETH;
Use Uniswap to sell part of the withdrawn ETH, which is enough to return the 500,000 DAI to aave, plus a handling fee of 0.09%, which is 450 DAI. Considering slippage, sell more ETH and get more DAI;
Repay the money to the flash loan platform aave.
The above five steps are to take out your Ethereum and sell it, when you are worried that the borrowed currency will not be available and the market is fluctuating. Having said so much, in fact, the whole process is executed for about ten seconds. Those who can program can program themselves, and those who are not good at programming can use modular tools such as furucombo.
For the third usage scenario: do not pay back the money, exchange collateral
Similarly, when you lose confidence in the short-term ETH market, you need to exchange ETH for another currency such as Bitcoin, but as in the above situation, you still have to repay the borrowed money, and the borrowed money has been taken up. You can choose the simplest method above, take out some ETH and exchange it for BTC, deposit it back, and then continue to withdraw some ETH, exchange it for BTC, deposit it back, and so on. If you want to solve the problem efficiently, you can still use flash loans.
At this time, you need to make changes in the five-step operation.
Launch a flash loan to borrow 500,000 DAI from aave,
500,000 DAI returned to compound;
Withdraw ETH;
Use Uniswap to swap the withdrawn ETH into wBTC (that is, BTC's mapping currency and encapsulation currency)
wBTC is deposited into compound,
500,000 DAI lent from Compound plus AAVE's platform handling fee, such as 0.09%, that is, 500,450 DAI is lent
Return DAI to the flash loan platform aave.
secondary title
Problems facing flash loans
First, the gas fee is higher.
Each step is a gas fee, but for a fund of hundreds of thousands of dollars or millions of dollars, this problem is not very big. The current gas fee consumption of each step requires tens of dollars, so if a set is laid down, if the basic The gas fee of hundreds of dollars is not too much. However, even if the flash loan is not successfully run, once it starts, the gas fee will still have to be paid.
Second, price slippage.
Before launching the flash loan, consider the price slippage and leave enough capital space to make the flash loan go smoothly.
Third, the risk of early trading.
If someone with the same strategy as you initiates a flash loan at the same time, the person with the highest gas fee will be executed first in the transaction. If many people share the same strategy with you (the first application scenario), then, theoretically, the gas fee can continue to rise High, greatly reducing the arbitrage space.
Summarize
Summarize
This article describes the basic application scenarios and cases of flash loans, which is just the tip of the iceberg, and there are many innovative ways of playing that are not mentioned in this article. Flash loan is a very unique financial tool in the blockchain world. It can be said that it can only appear in this way if there are continuous "blocks". Financial models related to encrypted assets such as spot, options, futures, lending, asset management, etc., are available in traditional finance, and are even more complete, but flash loans are different. Although many ordinary users do not use flash loans most of the time, in the future, this method that fits the basic principles of the blockchain will definitely grow flowers that are very different from traditional finance.