Introduction

A flash loan is a feature that allows you to borrow any available amount of assets from a designated smart contract pool with no collateral. Flash loans are useful building blocks in DeFi as they can be used for things like arbitrage, swapping collateral and self-liquidation.

Flash loans, although initially introduced by the Marble protocol, were popularised by Aave and dYdX.

So, what's the catch?

A flash loan has to be borrowed and repaid within the same blockchain transaction.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/271cc396-68f9-4830-867e-c90bf5a69016/Untitled.png

Ethereum Transaction

When it comes to Ethereum, every common operation, such as sending ETH, sending ERC20 tokens and interacting with smart contracts that are executed within a transaction scope.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/773d0ac5-4c0c-443e-ac72-a005d6031332/Untitled.png

Transactions are grouped together and included in Ethereum blocks. We can easily see all of the transactions that were included in a particular block on any popular block explorer, such as Etherscan.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/07f5cf0e-d34d-48be-9306-f1200be4f14a/Untitled.png