Good and Bad Flash Loans.
Welcome to all our new subscribers! Please forward today's note to a friend, neighbour, colleague, frenemy, or in-law to spread the word. And for those who missed last week's episode, you can find it here.
TLDR below. This is not financial advice.
Economics of tokenisation and ecosystem is free weekly in your inbox. Please share it with anyone that can benefit from this knowledge.
What is Flash Loan?
The concept of Flash Loans for the first time was "called by the name" by Max Wolff, the creator of Marble Protocol in 2018.
Flash Loans is an uncollateralised loan provided that the loan amount must be returned to the lending platform in the same transaction. It is usually used for Ethereum or ERC20 assets to be borrowed only for the amount of time it takes to complete a transaction block on the blockchain. As long as the loan is repaid before the next block of transactions begins, the borrower will not incur interest charges.
ELI5: You borrow and return the loan + interest within the same transaction.
Wait a minute: why will I do that?
Because during the same transaction, you are also doing other activities like borrowing USDC to get ETH and use that ETH to get DAI on a DEX, and change that to USDC via Curve and keep the profits. When do you see this in action? In arbitrage.
In essence, a transaction can contain a lot of other different execution orders in it and most users only use one executable, which is to transfer tokens. (Hint: that also means cheaper transaction fees!)
Thus, Flash Loans users can utilise the various execution commands as long as the loaned amount is finished.
More Detailed Example
You borrow 10.000 $USDC with Flash Loans
Then swap 10.000 $USDC to 10 $ETH via Uniswap
Then swap 10 $ETH to 11.000 $DAI on Mooniswap
Then use 11.000 $DAI swap to 12.500 $USDC on Curve
And pay 10.000 + 0.50 (interest) $USDC for the borrowed platform.
So you earn 2.000 $USDC profit. And all those execution orders will have to happen in 1 transaction.
Some projects provide Flash Loans services such as Aave, dYdX.
Benefits of Flash Loans
1) "Zero" Loan Fee
If the traditional lender bears two forms of risk: liquidity risk and opportunity cost, Flash Loans solves these two problems. Basically, It works as follows:
I lend you the money you want in a single transaction. But at the end of this transaction, you must pay me back at least the amount I lent you. If you don't pay, I will automatically reinstate your transaction, which means it looks like things haven't started yet.
Flash loans are really risk-free with no opportunity cost. This is because borrowers are "frozen time" during their Flash Loans so the system's capital is never risky and never impeded, so it cannot earn interest in other places (i.e. it has no opportunity cost).
Basically, the main cost to flash loans is the transaction cost.
Flash loans cannot be charged in the traditional way, because loans are valid for a period of zero:
(1+r)^t -1 = 0, (t=0). (Compound Interest)
e^(r*t) -1 = 0, (t=0). (Continuous Compounding Interest)
And of course, if organisations offer Flash Loans with higher interest rates, they will quickly be charged with lower interest rates by other flash lending pools.
Some projects currently apply zero-fee Flash Loans, such as dYdX or AAVE, which charge 0.09% of the principal on Flash Loans.
2) Optimising the crypto ecosystem
Users can execute the arbitrage strategy thanks to Flash Loans. In addition to economic benefits, they are bringing a price balance to the asset, namely bringing the asset where it is expensive to where it is priced.
3) Helping users avoid asset liquidation
In the event of a user's collateral deteriorating, the user can use Flash Loans to exchange the collateral into Debt token and then use it to repay Flash Loans. All these actions only cost 0.09% + gas fee instead of ~ 13% liquidation penalty.
4) Add more capital to your collateral
Users can use the Flash Loans Collateral Swap which allows users to swap ineffective collateral for more valuable collateral without having to close CDP.
5) Refinancing quickly
By using Flash Loans, users can transfer their loans from one protocol to another.
What Else Did You Miss?
Flash Loans Application:
Flash Loans Attack
How Can I Be Protected From Flash Loans Attack?
Is Flash Loans Bad Or Good?
Flash Loans is one of the interesting ideas in DeFi, but has yet to be fully applied, as evidenced by costly attacks. Even so, we cannot deny that it has brought an interesting product, making the DeFi space more efficient.
DeFi is evolving and difficulties will appear in the meantime. Flash Loan is the current problem, but that doesn't mean we'll get rid of it entirely.
Ps: Order the textbook "Economics and Math of Token Engineering and DeFi" today!
This article is sent to everyone for this Tuesday. Upgrade to our premium newsletter and receive 2 newsletters a week, an article on finance on Tuesday and a full case study. See you on the other side!
Get premium access to unlock more content