Technical Definition

Token Swap

A token swap is the exchange of one crypto asset for another. It can take place on a centralised exchange, decentralised exchange, wallet, automated market maker, or DEX aggregator.

By Crypto University Editorial
DEX AggregatorLiquidity PoolSlippage

Key Insight

Token swaps are a basic part of crypto trading and decentralised finance. They allow users to move between stablecoins, native coins, governance tokens, wrapped assets, and other digital assets. The final result of a swap can be affected by liquidity, slippage, price impact, network fees, priority fees, routing, and token taxes or restrictions.

Common Misconceptions

Swapping the wrong token with a copied symbol

Ignoring the token contract or mint address

Setting excessive slippage

Approving malicious contracts

Forgetting network fees

Assuming a quote guarantees the final amount

Detailed Explanation

How It Works

On a decentralised exchange, the user selects an input and output token. The trading application searches for an available route and provides a quote.

The user may first need to approve the smart contract to use the input token. After the transaction is signed, the smart contract takes the input asset and transfers the output asset to the wallet.

A DEX aggregator may split the order across several liquidity pools to improve execution.

FAQs

Is a token swap a taxable event?
It may be in some jurisdictions. Tax treatment depends on local rules.

Why did I receive less than the quote?
The price, route, liquidity, or slippage may have changed before execution.

Can a swap be reversed?
Confirmed blockchain swaps are generally irreversible.

In Practice

A user swaps 1,000 USDC for SOL. The quoted amount is 5.5 SOL, but the final amount is 5.47 SOL because the market price changes slightly and the trade experiences slippage. Network fees may be charged separately.

Dig Deeper