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.

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.

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.