Glossary — DeFi
What is Swap?
A swap is the exchange of one cryptocurrency token for another through a DEX or aggregator — the most fundamental DeFi operation, executed atomically in a single blockchain transaction.
WHY IT MATTERS
Swaps are DeFi's core primitive. Instead of selling Token A for fiat and buying Token B (the centralized exchange flow), a DEX swap atomically exchanges them in one transaction. If any step fails, the entire swap reverts.
The swap flow: user approves token spending, submits swap transaction with parameters (input token, output token, amount, slippage tolerance), the DEX router finds the best path through available pools, and the swap executes.
DEX aggregators (1inch, Paraswap) optimize swaps by routing through multiple DEXs and pools simultaneously, finding the best price across the ecosystem.