Original title: "Lightning Loan: DeFi Lego's most magical building block"
Original source: Mechanical Clock
In my eyes, flash loan is the most magical building block in DeFi Lego. But because it is often associated with hacking attacks, and there are not enough applications based on it, the charm of flash loans has not been fully revealed.
So I tried to write this article, starting from the small use case of flash loan, abstracting its possibility some meanings. However, if it rises to the level of significance, it will be suspected of being overstated. Please only take this article as a personal perspective. Thanks also to Gao Jin from the YFII community and Seb from the InstaDApp community for being interviewed and providing their knowledge and insights on flash loans for this article.

When tokens have different prices in different DEXs, you can use flash loans to arbitrage. The process is simple: borrow a flash To borrow money, first use the money to buy coins at a low-priced DEX, then sell the bought coins at a high-priced DEX, and finally use the money from selling coins to repay the flash loan. As long as the price difference between buying and selling tokens is higher than the sum of the lightning loan handling fee and the operation gas fee, arbitrage can be completed; while arbitrating, the price difference between different DEXs is "flattened".
After the liquidation is triggered, the liquidation price is different from the market price, and you can use flash loans for liquidation. The process is as follows: borrow a flash loan, first obtain the collateral at the liquidation price, then sell the collateral at the market price, and finally repay the flash loan with the money from selling the collateral. Generally speaking, the liquidation income may be 3% to 5%, while the lightning loan fee is 0.3% in uniswap v2, 0.09% in aave, and 2wei in dydx.
Arbitrage and liquidation have different prices in the spatial dimension, while futures have different prices in the time dimension. Flash loans can also be applied here.
For example, use flash loan to do long ETH: use flash loan to borrow DAI, then use DAI to buy ETH in DEX, and then For example, Compound mortgages ETH to lend DAI (here ETH is the sum of ETH purchased with DAI and a small part of the user's own ETH), and finally uses the loaned DAI to repay the flash loan.
The above are just a few examples of "uneven" prices. When there is no flash loan, due to cost and risk, these Unevenness does not necessarily smooth out efficiently.
But it will be different with the flash loan, the cost of the flash loan is low but the efficiency is high, and the funds that can be used A large amount but a small risk is an unprecedented relationship of unequal advantages and disadvantages (perhaps it can be said that this relationship does not conform to the laws of the physical world). Given this premise, price inequality of any kind is almost a surefire opportunity.
If it is extended, the price represents information, and the erasure of price inequality by flash loans may mean: in the DeFi world, As long as there is new information, the information will be transmitted to each participant at the speed of the flash loan, and the participant can make a decision based on the new information, and his decision information will also be transmitted at the speed of the flash loan.
This will bring a system of fast and full information transmission, and the biggest advantage of this system may be Efficient, in addition, the rapid error correction capability of such a system can also reduce the accumulation of systemic risks.
The money in flash loans will be cheap, and the amount of funds that can be mobilized in flash loans will be huge. There are two main reasons for this outcome:
First, zero risk. The biggest risk faced by traditional lenders is the risk of default, but this risk does not exist for flash loans: lenders never have to worry about borrowers not paying money. From the perspective of capital security, the lender of the flash loan is risk-free.
Second, you can work part-time. The assets on the chain can be placed in the flash loan fund pool as flash loan funds while assuming their original functions, because in the eyes of other operations on the chain, the flash loan funds are always in an unoccupied state and are always usable.
An extreme example of part-time jobs is to build the flash loan function into the ERC20 token itself, which means All assets of the token can be lent out by flash loan naturally.
There is a point of view about flash loans: used as There is no opportunity cost of flash loan funds, and using the funds for flash loans will not make this part of the funds lose other opportunities. This should be the same thing as "part-time job".
Because of the above reasons, the competition in the flash loan market may lead to the handling fee of flash loans approaching zero in the future. The funds available to borrow are nearly unlimited.
In addition to the flash loan market, there is a more extreme product called Lightning Forge: you can use Lightning Forge out of thin air You can mint as many assets as you want, as long as you destroy all the minted assets at the end of this atomic transaction. Think about the funds usage fees and the amount of funds in this case.
If flash loans make money less expensive, what will happen? Perhaps we will decompose and abstract the financial activities on the chain into two categories. The use of flash loan funds, that is, the use of funds. (Note: This category is not named accurately, it is only used in this article to distinguish two different ways in which funds work) p>
The capital-occupied operating model may be similar to the traditional model, in which capital occupies the core position; The operating model may be very different from the traditional model, because the source of funds is easy, cheap flash loans, and funds are no longer important to the model.
When money is no longer expensive, the most expensive is the strategy. A good strategy occupies a central position, which is beneficial to those who propose the strategy and those who invest in the strategy. The income will flow to them instead of the capital that drives the strategy; and the flow of income to the strategy will encourage more good strategies to emerge and development, which is meaningful to the evolution of the entire ecology.
When funds are no longer expensive, the design logic of financial products also needs to be changed. The simplest changes are some arbitrage and liquidation protocols. Their previous important job was to attract user funds, but if the cost of using flash loans approaches zero in the future, they do not need to consider user issues or funds when designing question.
From another point of view, just like Gao Jin’s point of view, he believes that flash loans can change the funds available to users More, one of its application scenarios is that there is some kind of opportunity in the market that allows you to make money, but you lack funds.
However, flash loans are not cheap enough at this stage. The cost of using some funds is lower than that of flash loans, and many arbitrage loans Behavior does not choose flash loans. So now it can only be said that flash loan is the highest value of the capital cost of this type of financial activity, but it cannot be said that flash loan is the best or the only choice, but the future will depend on the development of the flash loan market.
An extended topic is: when the financial activities using funds no longer need to occupy funds, the funds can be used For financial activities that occupy funds, this is equivalent to increasing the total amount of available funds in a disguised form (before the funds were divided into two halves and used in two places, now the funds only need to be used for One place), it can also be considered as improving the utilization rate of available funds ( some funds were waiting to be used before, but now all funds are in use ).
InstaDApp seems to be the application that has developed the most flash loan usage and packaged it for users to use directly. I contacted its community manager Seb on discord to find out Flash loans are being used in the app, and what they think about flash loans.
Seb told me that from the data point of view, a popular usage of flash loans is as a bridge for users to deploy funds. For example, when SAI migrated to DAI, they saw many use cases of flash loans. (Note: Seb is sorting out the relevant data of the flash loan. After he provides it to me, I will put it in the message of this article for reference) p>
It is easy to transfer assets or debts with flash loans, for example, if you want to transfer your loan relationship from Agreement A In agreement B, you can: borrow a flash loan, first use the money to redeem the collateral in agreement A, then deposit the collateral in agreement B to lend funds, and finally use the loaned funds to repay the flash loan.
With flash loans, funds can flow from one agreement to another almost unimpeded, from one type of asset to another asset class.
From an ecological point of view, Lightning Loan shortens the walled garden of the application/protocol a bit, and users only need to If you think that a certain agreement or a certain type of asset is a better choice for you, you can easily migrate the assets there. And that would lead to a more competitive, more evolutionary system.
From the user’s point of view, Seb thinks that using lightning The liquidity provided by loans can provide users with the ability to manage assets across protocols, which is also an ability to automatically manage assets (automated account management< /span>).
Users only need to set their own strategy, and the account can be borrowed from the flash loan, and the operation will be completed automatically after the condition is triggered , such as refinancing when interest rates change. Where does liquidity come from? From flash loans.
Money We are given too many functions, what if we separate these functions? For the human brain, it may be much easier to recognize and process one multifunction than to process multiple single functions, but for a computer, processing single functions is its strong point.
When money exists and operates in the form of code, if we separate the functions of money, can we Is it a more reasonable direction to improve the efficiency of all individual functions?
In my opinion, what Flash Loan is doing is to separate the functions of money.
So finally, let’s end with an excerpt from a poem by William Blake, it’s really flash loan :
One grain of sand, one world,
One flower, one heaven.
Infinity in the palm of your hand,
An instant becomes eternity.
Original text link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia