Flash Loans, Flash Swaps, and Optimistic Transfers #DEFI

Both flash loans and flash swaps employ a technique called optimistic transfer. This remarkable DeFi innovation allows a user to take uncollateralized loans or swaps and execute a trade as long as the user pays the service back by the end of the trade.

To better understand this mind-bender, let’s take a look at some code from Uniswap and Aave: