Decentralized exchanges solve many of the problems of their centralized counterparts including risk of hacking, mismanagement, and arbitrary fees. However, decentralized exchanges have their own problems, mainly lack of liquidity–which means a lack of amount of money sloshing around an exchange that makes trading faster and more efficient. That’s where Uniswap comes in. It’s trying to solve decentralized exchange’s liquidity problem by allowing the exchange to swap tokens without relying on buyers and sellers creating that liquidity.
Below we explore how Uniswap works and how it became one of the most popular decentralized exchanges on Ethereum.
What is Uniswap?
Uniswap is a protocol on Ethereum for swapping ERC20 tokens. Unlike most exchanges, which are designed to take fees, Uniswap is designed to function as a public good–a tool for the community trade tokens without platform fees or middlemen. Also unlike most exchanges, which match buyers and sellers to determine prices and execute trades, Uniswap uses a simple math equation and pools of tokens and ETH to do the same job.
Who Invented Uniswap?
Uniswap was created by Hayden Adams who was inspired to create the protocol by a post made by Ethereum founder Vitalik Buterin.
What’s so special about it?
Uniswap’s main distinction from other decentralized exchanges is the use of a pricing mechanism called the “Constant Product Market Maker Model.”
Any token can be added to Uniswap by funding it with an equivalent value of ETH and the ERC20 token being traded. For example, if you wanted to make an exchange for an altcoin called Poop Token, you would launch a new Uniswap smart contract for Poop Token and create a liquidity pool with–for example–$10 worth of Poop Token and $10 worth of ETH.
Where Uniswap differs is instead of connecting buyers and sellers to determine the price of Poop Token, Uniswap uses a constant equation: x * y = k.
In the equation, x and y represent the quantity of…