The Flash DeFinnovation

Edgar Moreau
Fuji Finance
Published in
8 min readJul 14, 2021

DeFi operates quite differently from the world of traditional financial services, enabling anyone in the world to borrow and lend capital in a trustless, decentralized ecosystem. They say money makes the world go around, and a robust financial services environment makes money go around.

While loans in the traditional realm incur some counter-party risk, DeFi ensures participants are fairly compensated in any scenario by having users interact with smart contracts instead of another person. Smart contracts are snippets of code deployed to the blockchain which can be programmed to perform specific tasks when the requirements are met. For example, a borrower only receives his collateral back if he repays the loan in full.

Despite their fundamental differences, centralized and decentralized finance do share many characteristics. In fact, many of the models that DeFi applications are built on stemmed from similar systems in the traditional finance space. For example, Wrapped Bitcoin (WBTC), which allows users to deposit Bitcoin into a smart contract in exchange for ERC-20 WBTC tokens, is quite heavily based on the gold-backed currency notes of old.

However, not every concept can be mapped between the two since they use different approaches to achieve the same outcome. For instance, crypto-backed loans are usually highly over-collateralized, meaning borrowers must deposit assets worth more than the loan itself, sometimes up to 300% more. This is done for two main reasons — first, to minimize lender losses in a trustless manner, and second, not all assets have the same value as collateral.

This does raise the question of why any would borrow cryptocurrencies at all, but there are various advantages to doing so, from increasing risk exposure to hedging existing investments. Even some traditional loans are over-collateralized (to a smaller degree), with businesses placing collateral such as property or equipment worth 10–20% more than the borrowed amount to obtain large loans.

Why to Borrow in DeFi ?— FujiDAO

Loans in the traditional space are often under-collateralized, meaning borrowers only need to present a fraction of the loan amount as collateral. These types of loans are near-impossible to replicate on the blockchain without losing funds, and even centralized peer-to-peer lending platforms like Lending Club see high defaulting rates for personal loans.

Decentralized finance may not offer under-collateralized loans, but it does offer loans that need no collateral at all — a concept entirely unheard of in centralized banking. Flash loans are a model unique to DeFi and let users loan crypto-assets without locking up any collateral. However, there’s a catch — borrowers must repay the loan in the same transaction.

A Flash of Funds

The Aave platform pioneered Flash loans in early 2020, and though it brings a whole new dimension to the blockchain lending scene, it introduces many issues that have yet to be resolved. According to Aave themselves, “There is no real-world analogy to Flash Loans.”

Trying to understand flash loans in the traditional sense won’t work. The advent of programmable smart contracts on blockchain networks has enabled all kinds of money-based applications, and since they can be designed to perform specific tasks with tokens sent to them, borrowers can route loans to other decentralized platforms and back.

Flash loan scheme

In recent times, flash loans have made quite the news splash for their use in exploiting vulnerabilities in certain DeFi protocols, which has led to millions of dollars in losses. However, flash loan proponents claim it as an innovative tool that is highly beneficial to arbitrageurs and high-frequency traders to construct trades that weren’t feasible before blockchain technology.

With flash loans, the rules are simple: the loan is repaid before the transaction ends, or the smart contract reverses the transaction like it never happened. This allows DeFi platforms to offer loans without requiring any collateral since loan repayment is practically guaranteed. By sending funds to a smart contract, traders can take advantage of price variances of different exchanges to make quick (and often sizable) profits.

This is a huge deal, considering the transaction has to perform instant trades with loaned capital in a matter of seconds. Since there are no collateral requirements, this also offers a much deeper liquidity pool for borrowers to reach into. This gives everyone in the blockchain space to have the ressources of a whale, if only for an instant, and also allows external actors monitoring market discrepancies to find and solve issues more quickly.

Arbitrage

Flash loans are a groundbreaking application of digital money — one that is likely to stick around as we move into a more blockchain-driven economy. The most obvious use case is arbitrage, where traders make money by identifying price discrepancies across various exchanges. For example, if 1 ETH was priced at $2000 on Exchange A and $2300 on Exchange B, traders could call a smart contract to buy 1 ETH worth $2000 on Exchange A and sell it for $2300 on Exchange B, pocketing the $300 difference as profit.

Arbitrage scheme

Of course, arbitrage opportunities aren’t as obvious or common as the example above, and as markets become more efficient, these opportunities should (in theory) become less prevalent. However, using smart contracts to automate the process using a flash loan can be a hugely beneficial tool for arbitrageurs without collateral to spare.

Collateral Swap

Flash loans can also help swap a loan’s collateral backing with another type of asset. For instance, in a single transaction, users on a multi-collateral lending application could utilize flash loans to withdraw their collateral, swap it for another asset on a DEX, and re-collateralize the loan before repaying the flash loan.

Collateral swap scheme

With how volatile cryptocurrency markets can be, asset prices are constantly fluctuating, and at any given point, some assets are bound to perform better than others. With the ability to swap loan collateral, traders can add passive long assets to their portfolio since they receive higher profits if the new collateral performs better than the old one.

Before flash loans, this would have required numerous transactions performing complicated debt wind-downs while incurring hefty transaction fees. DeFi isn’t just creating a decentralized alternative to existing financial systems — it’s pushing the industry to evolve and create more exciting and valuable tools to make markets and business better.

Additionally, since there are no capital requirements to execute a transaction, they further democratize the liquidation market and reduce the ecosystem’s bad debt. Volatility is a risk that every investor is concerned about, and its ability to cause mass liquidations and cascading effects like short squeezes can seem intimidating, especially for newer investors.

Liquidations

The DeFi space currently stands on a foundation of over-collateralization and leverage, when collateral values drop, the liquidation events begin. Say an investor deposits 10 ETH worth $20,000 as collateral to borrow 15,000 USDC. He could then use that loaned capital to buy 6 ETH more, and if the value of ETH rose by, say, 30%, he could sell those assets to repay the loan with some profit to spare.

However, if the value of ETH drops under a certain threshold, the ETH he holds will be worth a lot less, and the collateral in the DeFi platform is liquidated completely. DeFi platforms also tend to enforce a 3–15% liquidation penalty.

Liquidation scheme

This means that when asset prices dip under certain levels, liquidations have a cascading effect on market prices as lenders scramble to sell the liquidated collateral. With flash loans, users can design self-liquidating positions that trigger a smart contract when certain market events occur.

De-Risking DeFi

DeFi is a growing space, but with thousands of tokens and hundreds of platforms out there, knowing which ones are worth investing in is often unclear. FujiDAO is a platform that hopes to improve capital efficiency and volatility in lending and borrowing rates by aggregating the different markets.

This not only allows investors to diversify their holdings more easily, it also saves on trading fees since the platform automatically rebalances its underlying assets using flash loans. Fuji uses an interface provider base contract to define standards for interactions with each lending protocol, and executes its vault strategies through flash loans using a flasher contract. It also uses a debt token to track individual user debt positions linked to the vault.

This swaps the loan’s collateral along with its debt, using market discrepancies to make cost-effective swaps while considering other fixed market costs. This also enables Fuji to become more efficient as more assets are added since the fixed costs are shared between pool stakeholders.

Beyond the Flash

Many talented teams and projects inspired themselves from the concept of flashloan, they came with their own way of flashing funds.

The main difference compared to the original flashloans are the mechanisms behind, in fact, the use-cases covered are the same, improved and expanded to more domains.

FlashSwaps

Flashswaps are available on Uniswap and Dodo, it is a feature that let anyone use a Dex’s liquidity pool, to perform any external operations, if they repay their borrowed amount before the transaction ends.

The main advantage is to be able to repay your debt with the asset you choose within the pair (ETH/DAI repay ETH or DAI at the end of your operation).

FlashswapsDodo
FlashswapsUniswap

FlashMints

The concept of Flashmint was introduced by Austin Williams.

It uses the same bases as Flashloans, but using the minting and burning functions, you don’t require liquidity pool to borrow from anymore, instead you “mint” the required asset, and “burn” it within the same transaction.

The advantages compared to Flashloans are multiple.
First the gas cost is reduced because of the simplicity of the operation.
Second, you don’t need liquidity pools anymore, while Flashloan amount are limited by its quantity inside of the pool.

Flash-Mintable AssetsAustin Williams
Flash-Mintable Asset-Backed Tokens OpenZeppelin

NFT Flashloans

The last innovation we’ve seen using the concept of flashloans came from NFT20. They allow the NFT standards known as ERC721 & ERC1155, to use flashloans, opening a new range of possibilities for the NFT space to grow.

Introducing NFT Flash Loans NFT20
NFT Flashloans tutorial— EatTheBlocks

Final words

DeFi gives users infinitely more control over their finances than any traditional offering and has garnered a lot of attention due to how incredibly profitable it can be. However, though flash loans are an excellent way to make substantial gains without risking any capital, they represent more than just a way to make a quick buck.

Since everyone has practically the same rights to conduct business on decentralized ecosystems, the competition is fierce — but that’s not a bad thing. Competition profits the whole ecosystem, and with flash loans affording markets more efficient capital allocation and price stability, the race has only just begun.

Become a DeFi climber today!

Now that you know more about Flashloans and innovations around it, you can join Fuji DAO on Discord, and try out the Alpha to become an early climber.

If you found this article interesting, feel free to comment and share it with your friends, eager to learn more about the DeFi ecosystem!

--

--

Edgar Moreau
Fuji Finance

Currently creating the future of worldwide finance.