Emergence of Decentralized Exchanges (DEXs)
The initial attempts at building a Decentralized Exchange took inspiration from traditional finance and tried implementing an order book system on blockchain. However, low liquidity coupled with slow transaction speeds on blockchain translated into a subpar user experience.
In 2016, Vitalik Buterin proposed an alternative on a
Reddit Post where he suggested running an on-chain decentralized exchange as a prediction market. Uniswap was the first exchange to implement it. Uniswap was based on two major constructs - Liquidity Pools and Automated Market Makers (AMMs).
A liquidity pool is a set of digital tokens locked by users into a smart contract that enables trading on a decentralized exchange.
Automated Market Maker algorithms decide the price at which a trade should execute on the DEX based on the ratio of the two assets in the pool.
Uniswap became the first protocol to successfully utilize an automated market maker (AMM) system in 2018.
Uniswap algorithm maintains a pool that holds x no. of tokens of type T1, y no. of tokens of type T2, and,
x * y = k for some constant k.
Thus, whenever someone buys token T1 by depositing T2, the price of token T1 increases, reflecting its demand.
Since Uniswap, other DEXes have emerged with different approaches catering to different kinds of use cases. Some exchanges allow you to swap between stablecoins very efficiently or borrow data from off-chain sources to determine asset prices. For example, Curve Finance built its niche by enabling the swapping of similar tokens. Example: Swapping DAI for USDC where both of them are stable coins.
Beyond the fact that DEXes are decentralized and trades execute on blockchain, the permissionless nature of DEXes enables anyone to list a token by creating a liquidity pool and trade without gatekeeping.
Uniswap was launched in November 2018. In less than four years, the cumulative trading volume on Uniswap has surpassed 1 Trillion Dollars.