Centaur Library: What is a Flash Loan?
One of the major motives of decentralised finance (DeFi) is to reduce the dependency of finance on centralised intermediaries. This goal of DeFi has led to the disruption of many established financial services such as swaps, lending, market making etc.
But one area which people thought DeFi wouldn’t be able to work is in the area of instant collateral-free loan (eg: credit card). Typically collateral-free loans require a centralised entity to verify the borrower. But flash loans, a radical new concept might soon change that.
In this article, we will look at what a flash loan is, how it works, and what it can be used for.
What is Flash Loan?
Flash Loan is a crypto-only twist towards traditional lending. To understand flash loans we first need to understand how regular lending works. A loan is when one individual or organisation lends money to another individual or organisation.
There are usually two main types of loan:
In a secured loan, a borrower puts in collateral to get a loan. Let’s take an example, a guy named Billy wants to buy a new car worth $10k. He doesn’t have the funds to buy the car so he decides to take a loan from Alice. But Alice doesn’t know Billy, so she gives the loan but takes his gold watch as collateral. In case Billy is unable to pay back the loan, Alice can sell Billy’s gold watch to recover her funds.
In an unsecured loan, a borrower doesn’t need a collateral to get a loan. Tweaking our above example of Billy and Alice, but this time, Billy doesn’t have a collateral (his gold watch) to give. By checking Billy’s credit score Alice decides to give a loan to Billy without collateral but at a higher interest rate. This way Billy is able to secure a loan, without collateral. With the risk being high, the interest rate on the loan will also be high.
In both cases, the lender takes a form of risk. But in a decentralised scenario, the absence of a centralised entity increases the risk. Flash loan solves the problem of risk associated with lending. It is a form of a no-risk unsecured loan by which anyone can borrow cryptocurrency without any collateral. The catch is that the loan has to be repaid before the transaction is confirmed. Hence, the name Flash Loan.
For example, Billy wanted $50K, through a flash loan Billy can borrow $50K of ETH instantly — without any collateral or credit check.
Fascinating right? Let’s see how it works and discuss the scenario where one might use it.
How Does Flash Loan Work?
Flash Loan allows anyone to borrow cryptocurrency instantly without any collateral. But to ensure there is no loss of funds to the lender, the loan has to be repaid within the same block space.
To visualise, a flash loan contract is made up of three parts — borrow, do something, repay. When someone borrows funds from a flash loan, the contract immediately gives the funds to the borrower and the blockchain starts the transaction. The borrower can do anything with the funds, as long as the loan is repaid back before the block is mined. If the borrower fails to repay the loan before the block is mined, the transaction will get rejected automatically bringing the funds back to its original place.
In a way, the transaction never happened and the repayment of the loan is enforced by the code.
What’s the use for a Flash Loan?
At this stage, you probably might be wondering as to what’s the point of a Flash Loan. You can’t actually use the flash loan for buying a cool car, or pay for college education right?
Yeah true, but Flash loans aren’t designed for such stuff. The entire goal of a flash loan is to use the loan to make a quick profit through trading — for example, via arbitrage.
Let’s understand the use case with an example, Token A is trading on Dex 1 at $10 & the same token is trading on Dex 2 at $10.5. While trading a small amount on such a trade makes no difference , a trader can use a flash loan of $100,000 to buy 10,000 Token A for $10 on Dex 1 and sell all of it at $10.5 on Dex 2. This way a trader quickly makes a profit of $5,000 after returning the original amount.
This is an example, although in the real world, things are not simple as there will be slippage fee and transaction fee associated.
Flash loans sound fascinating, and one might wonder why they aren’t mainstream?
Flaw With Flash Loans
While flash loans by themselves aren’t risky, as the payback is enforced via code, they do put many DeFi applications at risk. Via Flash Loans anyone can become a “whale” in mere seconds, and can potentially tip the market to favour them. One example of this is the attack on margin trading protocol bZx, where hackers “stole” close to a million dollars.
Nevertheless, flash loans are a new concept popularized by the general adoption of DeFi applications. It’s too early to say what the future of flash loans is, but there’s no denying that this DeFi only application has a lot of potential.
By combining the best elements of decentralised finance with measured regulatory control, Centaur is bridging DeFi and traditional finance. For more information, please take at a look at our website or join our Telegram community discussion group and announcement channel.
You can also go through our whitepaper or play around with our testnet block explorer and liquidity pool (Ethereum Ropsten).
For more information, please take at a look at our:
· Telegram Announcement Channel
· Liquidity Pool (Ethereum Ropsten)