Coming up with something new in the cryptocurrency space isn't as easy as it once was. With literally thousands of cryptocurrencies on the market, the novelty wore off long ago. But that has not stopped one Ethereum developer from coming up with something that truly is innovative. It is called Uniswap, and it quickly changed the way ERC-20 tokens are swapped.
Uniswap is a decentralized exchange, or DEX, for swapping ERC-20 tokens on the Ethereum network. It is open source software developed not to generate a profit, but to give the Ethereum community a platform in which they could freely trade coins without having to surrender to the policies and profits of other exchanges. Uniswap defines itself as a “decentralized protocol for automated liquidity provision on Ethereum.”
Uniswap and Liquidity Pools
A traditional exchange, whether decentralized or not, seeks to match buyers and sellers looking to trade. The two parties work out a deal, trade their coin, and pay the exchange a fee for its services. Uniswap is different in that it is built on something known as a 'liquidity pool'.
Liquidity pools are essentially trading venues for pairs. A pair is typically made of a ERC-20 token and Ether (ETH). Traders volunteer to establish liquidity pools and fund them initially. From there, other traders can buy and sell within the liquidity pool based on the number of tokens available.
Uniswap relies on what its developer calls the Constant Product Market Maker (CPMM) model to determine the value of tokens within a pool. This model is based on a set mathematical formula that never changes. This is what made Uniswap so groundbreaking. Prices cannot in theory be manipulated by outside forces because they depend on static math.
Balancing Tokens and Prices on Uniswap
The desire to create a decentralized exchange for freely swapping ERC-20 tokens motivated Uniswap's creator to come up with something that was 'for the people' rather than 'for the exchange'. He carried out this goal by designing the CPMM model to balance out the tokens in a pool so that value remained consistent within that pool.
Let say you created a liquidity pool to enable users to buy and sell BEAVER* tokens. You would create a pair and then fund the pool with equal amounts in terms of value of both BEAVER and ETH. Let's assume $50,000 of each to start with. Now the liquidity pool is open and ready.
The CPMM equation is
x * y = k, where x is the quantity of ETH and y is the quantity of BEAVER; k is a constant. If a buyer spend ETH to buy BEAVER, the supply of ETH in the pool increases while the supply of BEAVER decreases.
The end result is that BEAVER's price goes up to account for supply and demand. The opposite is also true. If the volume of BEAVER exceeds that of ETH, you will see a price drop for BEAVER. It is a rather simple equation but clever in its application.
Trading Fees on Uniswap
That being said, Uniswap is not entirely free of fees. The platform has its own bills to pay, so there is a 0.30% fee assessed on all trades. The revenue goes into Uniswap's reserves. This actually increases the value of K in each liquidity pool, ultimately driving prices up.
Other Things to Know about Uniswap
One of the best things about Uniswap is that it can handle all ERC-20 tokens. If you are not familiar with these tokens, they are Ethereum-based tokens that follow a certain set of rules defined by the Ethereum platform. There are lots of them, making Uniswap that much more valuable to token owners.
Topping it all off is Uniswap V2, a platform upgrade released early in 2020. As part of that upgrade, a Uniswap token known as UNI was later introduced. All users (defined as each individual ETH address) who had used the platform prior to September 1, 2020 were automatically given at least 400 UNI via an airdrop. UNI was priced at around $3.00 USD on initial launch, making the airdrop worth at least $1,200 USD to each address. Prices have fluctuated since then.
If you are into ERC-20 tokens and looking for a decentralized exchange with low fees, censorship resistance, and security, you might want to give Uniswap a look.
*BEAVER tokens, as far as we know, does not exist; they are just used as an example.