What Is Swap in Crypto?

A swap is the direct exchange of one token for another on a DEX. You send X of token A to the pool contract and receive Y of token B back in a single transaction. Swaps are the fundamental DeFi action — every trade, every rebalance, every entry and exit ultimately resolves to one or more swaps on an AMM or aggregated router.

Also known as: token swap, crypto swap

Ask Stingray anything about Swap

How a swap works

A single-hop swap on Uniswap V3:

  1. You sign a transaction calling swapExactTokensForTokens on the router.
  2. The router calculates the output based on the pool’s reserves and fee tier.
  3. The pool contract deducts your input token, adds the output token from its reserves, and transfers the output to you.
  4. The pool’s fee (0.05%, 0.3%, or 1%) stays in the pool as compensation for LPs.

Most swaps go through an aggregator (1inch, 0x, Paraswap, CoW Swap) rather than a single DEX. The aggregator splits your trade across multiple pools to minimize total slippage — so a $100k swap might route 60% through Uniswap V3, 30% through Curve, 10% through Balancer in one atomic transaction.

Swap considerations

Every DEX swap has several costs:

  • Gas — the on-chain transaction fee. On Ethereum mainnet, a swap ranges from $3 to $50 depending on congestion. On L2s (Arbitrum, Base, Optimism) it’s typically $0.10-$1.
  • Pool fee — 5-100 bps depending on pool tier.
  • Slippage — the gap between quoted and executed price, driven by trade size vs pool depth.
  • Price impact — the permanent price move your swap causes. For small trades, invisible; for institutional-sized trades, the dominant cost.
  • MEV — sandwich attacks can extract 0.5-3% on unprotected swaps. Aggregators with MEV protection mitigate this.

Risks and considerations

Token contract impersonation is a persistent retail trap. Anyone can create an ERC-20 with the symbol “USDC” or “ETH” and seed a pool. The token aggregator can include these by default unless filtered. Before any swap, verify:

  1. Token contract address — not just the symbol. CoinGecko, official project docs, and established block explorers all publish the real addresses.
  2. Destination wallet address — especially if you’re bridging or transferring post-swap.
  3. Slippage tolerance — set to the minimum that works. 0.5% is typical for major pairs; 1-2% is often enough even for smaller alts. Going above 3% invites sandwich attacks.
  4. Route preview — most aggregators show which pools the swap traverses. Avoid unusual routes through unknown pools.

For swaps above a few thousand dollars, use a DEX aggregator with MEV protection (CoW Swap, UniswapX, 1inch Fusion). The 1-3% of MEV they neutralize pays for itself on every large trade.

Related terms