A decentralized exchange (DEX) is a protocol or application for exchanging crypto assets where key operations are executed on a blockchain through smart contracts.

Unlike a centralized exchange, a DEX generally does not require users to deposit assets with a traditional exchange operator for ordinary swaps. Users connect a non-custodial wallet, authorize the transaction, and interact directly with the protocol. Trading may rely on an automated market maker and liquidity pool.

How a DEX works

The user selects an asset to sell and an asset to receive. The protocol calculates the swap according to available liquidity and the rules of its smart contracts. The final result may be affected by slippage, protocol fees, and the blockchain transaction fee.

A DEX reduces the need to trust a centralized operator, but introduces or shifts risks toward smart contracts, oracles, liquidity, and blockchain infrastructure. Users therefore also need to consider smart-contract risks and the quality of available smart-contract audits.