What is Flash Swap?
A flash swap is a feature of DEX protocols (primarily Uniswap) that allows you to receive tokens from a liquidity pool before paying for them — as long as payment or return occurs within the same transaction.
WHY IT MATTERS
Flash swaps are related to flash loans but work through DEX pools. You withdraw tokens from a pool, use them however you want within the transaction, and either pay the equivalent value (in the other pool token) or return them. If you do neither, the transaction reverts.
Use cases include: arbitrage (take tokens from one pool, sell on another, pay the first pool from proceeds), liquidations (borrow the repayment asset, liquidate, use proceeds to repay), and one-step token migrations.
Flash swaps are gas-efficient compared to multi-step approaches because everything happens in a single transaction.