whatsapp
Telegram
Subscribe to the Asia Signal Telegram channel and benefit from our latest free singals @Asiasignal_com
slide
< >

Flash loan arbitrage

2022/12/07 - 14:27


Flash loan is a new and advanced concept that has no equivalent in the traditional world; therefore, it requires knowledge of Atrium infrastructure and smart contracts. Simply put, a payday loan is like saying I don't trust you (the human) and I only trust a smart contract or a set of smart contracts. These loans are mostly used for arbitrage and are known as unsecured loans.

What is a flash loan or a loan without collateral in DiFi?

Flash Loan is the first loan option without collateral in DeFi

These loans are designed for developers. Flash loans allow you to borrow instantly and easily; here, there is no need to pledge in the pool to ensure the return of the loan. Fast loans are done with only one transaction; That is, a loan is received during one transaction and repaid in the same transaction, along with the platform fee.

Quick loans are executed with only one transaction; That is, in one transaction, you receive the loan and in the same transaction, you repay it with interest. If the transaction is not completed correctly, the entire transaction is rolled back to undo all the work done from the beginning. This ensures the security of the assets in the respective pool. Use cases of flash loans include arbitrage, collateral exchange, etc.

Flash loans are special unsecured loans that offer an asset loan (and fees) before the transaction closes. In the real and traditional world, flash loans have nothing to compare them to; therefore, it requires a basic understanding of how to manage the state of the blocks in the blockchain.

Types of loans in the traditional world

Unsecured loans

In an unsecured loan, there is actually no asset that you can provide to the lender to ensure that the loan is repaid, and it is a loan that you do not need collateral for.

As for financial institutions, they look at your financial records to see if you can repay the loan. In fact, these types of loans require a credit check. So, if they see that you have taken several loans and you have paid them back on time, they will give you a loan.

You all know that the loan that banks give you comes with an interest rate; it means that you have to return the loan along with its interest. We are all familiar with this method; if you don't pay off the loan on time, interest will continue to accrue until you are able to pay it back.

Secured loans

Sometimes a good financial history is not enough to get a loan; Even if you have paid all your loans exactly on time. To receive large loans, you must provide collateral; because it is a big risk for the lender. Therefore, it requires you to pledge an asset that you own. This collateral can be a house deed, personal car, jewelry, etc., so that the lender can seize your property if you fail to repay the loan.

In general, traditional lenders accept one or two types of risk; the first is default risk; If the borrower runs away with the money, the lender loses his money. But the second type of risk is the risk of illiquidity.

If the lender lends out most of its assets at the wrong time or does not have a loan repayment schedule (i.e., the borrower does not repay the loan on time), the lender may become insolvent and inadvertently default on its obligations. Do not act yourself.

How a flash loan works

Now, according to the above explanations, we can consider the flash loan as a type of "unsecured loan". Because it does not require collateral. But you also don't need to present a check or anything like that. All you do is ask the lender to lend you $50,000 worth of Ether. This!

How is it reimbursed?! A quick loan must be repaid in the same transaction. This is a bit difficult to understand and the reason is that we are used to traditional loans where assets are transferred from one user to another. Like when you pay for a service or product.

If you know anything about Atrium, you know that the platform is very flexible. For this reason, many people call it programmable money.

When it comes to payday loans, you can think of your transaction as being divided into three parts: get the loan, do something with it, pay the loan back!

This transaction is registered on the network and temporarily lends you these assets. You can do whatever you like in the second part of the transaction (using the loan); provided that in the third part, you pay this loan with its interest. If you don't, the network will reverse the entire transaction; That is, the lender gets his money back. This explains why the lender does not require any collateral from you.

Now, you may be asked the question, what is the reason for taking a flash loan? I can't do anything or buy anything during a transaction!

Let's focus on the second step of the quick loan. The idea is to enter your assets into one or more smart contracts, make a profit, and return the original loan, plus some interest, to the lender. As you can see, the flash loan is designed to make a profit.

There are a number of uses to benefit from a quick loan; But in neither case do you need to do anything off-chain. So what you need to do is to use DeFi protocols.

You need to know that the most popular way to profit from instant loans is arbitrage; That is, you use the difference in the price of assets in different trading platforms.

Flash loans should be free, or to be more precise, there should be a very small fee to run the three extra lines of code that are written to create a loanable asset.

Flash loans are not able to claim interest in the traditional sense; because this loan is active for time 0 (annual interest rate * 0 = 0). In addition, if lenders are quick to charge higher rates, they will be out-competed by other pools of lenders with lower rates. The result of this flow of competition towards low fees is that fees are at least nominally zero or close to zero.

 Be the dYdX platform now offers zero fees for flash lending. On the other hand, AAVE (AAVE) platform has considered a 0.09% fee for flash loans. However, it seems that this is not sustainable and users of the platform (ouch) have requested that it consider zero fees for large loans.

The concept of flash loans was first introduced by the Marble protocol in 2018. Marble introduced itself as a "smart contract bank" and its product was a simple but brilliant innovation in DeFi; Risk-free loans by smart contract!

Quick loans reduce the risks involved in traditional lending. A flash loan works like this:

In other words, a flash loan is atomic; That is, if you fail to repay the loan, the entire process is reversed, as if it never happened!

I want to lend you as much as you want by one transaction; but at the end of this transaction, you must return to me the same amount that I lent you, plus interest; if you can't do this, I will automatically refund your transaction! (Smart contracts can do this).

Instant loan security

Flash loans don't require any capital to get started, this is just the opposite of DeFi loans, where we need to deposit a larger amount of collateral to get the loan. This possibility lowers the barriers to borrowing and makes it an efficient tool for everyone. These loans cannot be blacklisted by exchanges, because their nature does not allow this. This loan is quite complex and this is important; because we can understand the calculations behind these attacks.

Complex attacks and inflation in flash loans system

Recently, 2 flash loans on the BZX DeFi platform have been discussed a lot. This plan has been used twice to abuse and attack the BZX platform; a person or group was able to receive about $954,000 in profit within 4 days!

One of these attacks happened on February 14 and the other on February 18, 2020. This method is much discussed; because people don't accept that flash loans are attacked or hacked. Because this plan only follows the rules defined by smart contracts and the loan system. A number of Atrium proponents believe that quick loans are very practical and open new avenues for a decentralized economy.

During the first attack, the hacker borrowed 10,000 Ether from the dYdX platform and 112 WBTC tokens (Bitcoin based on the Atrium blockchain) from the Compound platform. The person or group then sent 1,300 Ether to the BZX Protocol Fulcrum trading platform and borrowed 5,637 Ether. After that, he borrowed about 51 WBTC from the Uniswap platform.

From here on, prices changed; because slippage changed in the market. The hacker then made a profit of around $318,000 from the 112 WBTC he borrowed from Compound. This single transaction allowed the attacker to easily repay the 10,000 ether he borrowed from dYdX with interest.

These steps seem a bit confusing; but in general, instant loans offer the ability to leverage capital without the need for DeFi collateral, and to earn profits through trading on decentralized exchanges (DEX). This process is very fast and effective and eliminates the risk of capital loss during execution. Of course, there have been other attacks on different platforms that here, we only limited to this example.

What platforms give flash loans?

This part of the DeFi field is very new and currently, among the well-known DeFi projects, three platforms, Ave, Dy/Dx and Kollateral, grant flash loans. Cryptocurrencies such as Ether, Dai, Tether and Maker and some other stable coins are present in the Ave protocol. The loan interest rate on this platform is 0.09%. In the Dy/Dx protocol, the interest rate is zero, but only three cryptocurrencies, Ether, Dy and USDC, are present in it. Atrium is also WETH on this platform. The Kollateral protocol does not clearly state the fee or interest rate of the loan. But this protocol supports many assets found in other protocols.

Instant loan benefits

Taking traditional loans has a long process, and in most cases, people give up taking loans because of the problems that arise. While the borrower can receive large loans without having the necessary initial capital through cryptocurrency loans. This is because the loan is based on a smart contract.

 Another important difference between an instant loan and a traditional loan is the lack of collateral. While the bank guarantee is one of the most important documents for validating and guaranteeing bank obligations, the borrower in this method does not need to provide a guarantee to convince the lender to comply with his obligations.

Another advantage is that the borrower does not need to wait for a long time to get a loan. In this type of loan, the recipient only needs a few seconds to complete the loan process.

Instant loan benefits

•    It is based on a smart contract
•    No collateral is required
•    It does not require large initial capital
•    It is instantaneous

Disadvantages of instant loans

Digital currency loan is not without its challenges along with its many advantages. One of the most important drawbacks is that a product is under development and therefore has some important flaws and can cause problems for the lender or the borrower. For example, they are vulnerable to some attacks. If the contracts are not set up correctly, the possibility of hacking is very high; therefore, beginners should be very alert and complete their information before entering this field.

Disadvantages of instant loans

•    It is possible to hack the lender's platform
•    It requires high technical knowledge
•    They are in the early stages of their development

How to get an instant loan in Difa?

Currently, the best way to get an instant loan is to write an Ethereum-based smart contract using the Solidity language. Among the best digital currency lending and borrowing platforms in DiFi,

the following three can be mentioned:

Aave

This protocol was launched for the first time in 2020 and is currently one of the open-source protocols in the DeFi field. Lenders on this platform have the option to deposit their cryptocurrencies into a pool and receive an equivalent amount of aToken. The interest rate in Avi is adjusted according to the amount of supply and demand. In other words, it can be said that the more aTokens users hold, the more profitable it will be.

Compound

Another popular platform for lending and borrowing is Compound. This platform has announced its goal of providing free financial programs globally, and it can be said that it has taken very positive steps in this direction. Users on this platform can get loans by depositing their digital currencies. Also, Compound has a governance token called COMP. The most important use of this token for holders is voting rights for protocol updates.

Like Avi, this platform also has its own local token called cToken. The most important use of this token is to track deposits.

Frucombo

Another platform that can be used for instant loans is Furocombo. One of the advantages of this platform is the lack of coding knowledge. Most people who don't know enough about coding go to Furocombo instead of the above platforms, because they can get a quick loan without any coding. Of course, if you are a beginner, you should not have the impression that working with Furocombo is easy and hassle-free. You should know that this platform also has its complications and you will have access to more limited protocols and digital currencies.

Is investing with a flash loan dangerous?

Investing in this style has its own complications and shortcomings. But one cannot ignore its extraordinary capacities. We have to admit that unsecured loans are an interesting solution that will probably become more common in blockchain networks day by day.

One should be careful and observe the side of caution in this path and accept that there are risks. However, there is an optimistic view of the flash loan outlook. Experts and professionals believe that in the future, a world of new opportunities will be created for everyone with the help of such loans. Being in the world of decentralized networks is the same; Profit and loss are double-edged swords and one should be careful and attentive to benefit from the situation.

Conclusion

Flash loans are another great addition to the DeFi ecosystem. Although they are currently susceptible to attack, the trend will change in the future. As developers write better smart contracts and more systems use security tools and decentralized oracles for pricing, we will see a decrease in the number of attacks by hackers.

If you're wondering if flash loans are a good investment, the answer seems to be yes. Remember, there is always a minimal risk of a quick loan attack, so use caution when lending your cryptocurrencies on DeFi platforms.


Exchange Fee discount Register Link
bingx Yes Register
coinex Yes Register
kucoin Yes Register
okexen Yes Register
Share

Comments

You send the first comment.