Lightning Loan: The most magical building block in DeFi Lego


 51 total views

In my eyes, Lightning Loan is the most magical building block in DeFi Lego. But because it is often associated with hacker attacks, and there are not enough applications based on it, the charm of lightning loans has not been fully demonstrated.

So I tried to write this article, wanting to start from a small use case of lightning loan and abstract some of its possible meanings. However, it is suspected to be exaggerated when it reaches the significance level. Please treat this article only as a personal perspective. Thanks also to Gao Jin from the YFII community and Seb from the InstaDApp community for accepting interviews for providing their knowledge and insights on flash loans for this article.

1. Flash loans are a flood of erasing unevenness

When the prices of coins in different DEXs are different, flash loan arbitrage can be used. The process is simple: borrow a flash loan, first use the money to buy coins in the low-priced DEX, and then buy the coins in the high-priced DEX Sell ​​it, and finally use the money sold to repay the flash loan. As long as the price difference between buying and selling tokens is higher than the sum of the flash loan handling fee and the operating gas fee, arbitrage can be completed; while arbitrage, the price difference between different DEXs is “flattened”.

After the liquidation is triggered, the liquidation price is different from the market price, and flash loans can be used 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 use the money from the collateral to repay the flash loan. Generally speaking, the return of liquidation may be 3%~5%, and the fee for flash loan is 0.3% in uniswap v2, 0.09% in aave, and 2wei in dydx.

Arbitrage and liquidation both have different prices in the spatial dimension, while futures have different prices in the time dimension. Lightning loans can also be applied to this.

For example, use Lightning Loan to buy more ETH: Use Lightning Loan to borrow DAI, then use DAI to buy ETH in DEX, and then use Compound to mortgage ETH to lend DAI (here ETH is the sum of the ETH purchased with DAI and the user’s own small portion of ETH ), and finally use the loaned DAI to pay off the flash loan.

The above are just a few examples of price “unevenness”. In the absence of flash loans, these irregularities may not be smoothed out efficiently due to cost and risk.

But with a flash loan, it is different. The cost of flash loan is low but the efficiency is high, the amount of funds that can be used is large but the risk is small, which is an unprecedented relationship between pros and cons (perhaps it can be said that this relationship is Does not conform to the laws of the physical world). Under this premise, any form of price inequality is almost a deterministic opportunity.

READ  Digital currency will make monetary policy implementation more accurate and effective

Flash loans are like a flood of funds that can wipe out unevenness all the way, and the most important thing is that everyone can summon it out without any effort. The DeFi world with flash loans is flat.

If it is extended, the price represents information, and the flash loan erasing the price unevenness may mean: in the DeFi world, as long as new information appears, the information will be transmitted to each participant at the speed of flash loan, and participants can combine new information Information to make decisions, his decision information will also be transmitted at the speed of lightning loans.

This will bring about a system that delivers fast and adequate information. Perhaps the greatest benefit of this system is high efficiency. In addition, the rapid error correction capability of this system can also reduce the accumulation of systemic risks.

2. Lightning loans make money no longer expensive, but the strategy is expensive

The money for flash loans will be cheap, and the amount of funds that flash loans can call will be huge. There are two main reasons for this result:

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 that the borrower will not be able to pay back the money. From the perspective of fund security, the lender of flash loans is risk-free.

Second, you can work part-time. Assets on the chain can bear their original role as flash loan funds in the flash loan fund pool, because in the eyes of other operations on the chain, flash loan funds are always in an unoccupied state. usable.

An extreme example of the part-time job is the built-in flash loan function into the ERC20 token itself, which means that all assets of the token can naturally be loaned out by flash loan.

There is a point of view about flash loans: there is no opportunity cost problem with the funds used for flash loans, and using funds for flash loans will not let this part of the funds lose other opportunities. This should be the same thing as “part-time” means.

Because of the above reasons, the competition in the flash loan market may lead to future flash loan handling fees approaching zero, and the available funds will approach unlimited.

In addition to the lightning loan market, there is a more extreme product called Lightning Cast: You can use Lightning Cast to cast assets out of thin air, and you can cast as many as you want, as long as you destroy all the forged assets at the end of this atomic transaction. can. Think about the cost of using funds and the amount of funds in this case.

If flash loans make money no longer expensive, what will happen? Perhaps we will decompose and abstract the financial activities on the chain into two major categories. One is the type that cannot use flash loan funds, that is, the type of capital occupation, and the other type can use flash loan funds, that is, the use of funds. (Note: The naming of this classification is inaccurate. It is only used in this article to distinguish two different ways in which funds function)

READ  Litecoin, ETC, Neo Price Analysis: 07 January

The capital-occupied operation model may be similar to the traditional model, and capital occupies the core position in this model; but the capital-based operation model may be completely different from the traditional model, because the source of funds is readily available and cheap lightning loans. Funding is no longer important to the model.

When funds are no longer expensive, what is expensive is strategy. Good strategies occupies the core position, which is beneficial to those who propose strategies and those who invest in them. The income will flow to them, not to the capital that drives the operation of the strategy; and the income flow 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 such as some arbitrage and liquidation agreements, their previous important work was to attract user funds, but if the cost of using flash loans in the future approaches zero, then they do not need to consider user issues or funds when designing problem.

From another point of view, just like Gao Jin’s point of view, he believes that lightning loans have increased the funds available to users. One of its major application scenarios is that there is a certain opportunity in the market that allows you to make money, but you lack funds. .

However, flash loans are not cheap enough at this stage. Some funds have lower usage costs than flash loans. Many arbitrage behaviors do not choose flash loans. Therefore, it can only be said that flash loans are the highest value of the funding costs of such financial activities, and cannot be said that flash loans are the best or only option, but how the future will depend on the development of the flash loan market.

An extension of the topic is: when the use of capital-based financial activities no longer need to occupy funds, the funds can be used for capital-based financial activities, which is equivalent to a disguised increase in the total amount of available funds (the capital was previously divided into two halves Used in two places, and now funds only need to be used in one place), it can also be considered that the utilization rate of available funds has been improved (some funds were waiting to be used before, and now the funds are all in use).

READ  Binance Coin performance in Q1 2019: 200% increase

3. Lightning loan is a bridge to deploy funds, providing users with the ability to manage assets across agreements

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 at discord to learn about the usage of flash loan in this application and their views on flash loan .

Seb told me that from the data point of view, a popular use of flash loans is to serve as a bridge for users to deploy funds. For example, they saw many use cases of flash loans when migrating from SAI to DAI. (Note: Seb is sorting out the relevant data of Lightning Loan. After he provides it to me later, I will put it in the message of this article for reference)

It is easy to transfer assets or debts with flash loans. For example, if you want to transfer your loan relationship from agreement A to agreement B, you can: borrow a flash loan and use the money to redeem it in agreement A. As the collateral, deposit the collateral into the loaned funds of agreement B, and finally use the loaned funds to pay off the flash loan.

With flash loans, funds can flow from one agreement to another, and from one type of asset to another almost unimpeded.

From an ecological point of view, Lightning Loan has shortened the walled garden of the application/protocol again. As long as users think that a certain protocol or a certain type of asset is a better choice for them, they can easily migrate their assets. . This will lead to a more competitive and evolving system.

From the user’s point of view, Seb believes that using the liquidity provided by lightning loans can provide users with the ability to manage assets across agreements, which is also an ability to automatically manage assets (automated account management).

Users only need to set their own strategies, the account can borrow from flash loans, and automatically complete operations after the conditions are triggered, such as on-lending when the interest rate changes. Where does liquidity come from? Loan from lightning.


Money is endowed with too many functions. What if we separate these functions? For the human brain, it may be much simpler to recognize and process a single function than to process multiple single functions, but for a computer, processing single functions is its strong point.

So when money exists and operates in the form of code, if we separate the functions of money, can the efficiency of all individual functions be improved? Is it a more reasonable direction?

In my opinion, what flash loans are doing is to separate the functions of money.

So in the end, let’s end the article with an excerpt from a poem by William Blake, which is really a flash loan:

One sand one world,

One flower, one heaven.

Infinite palm placement,

An instant becomes eternity.