For years, centralised exchanges have always been the basis of the cryptocurrency industry. With fast settlement times, high trading volumes, and increasingly improving liquidity, Centralized exchanges have been the cryptocurrency market’s backbone.
Interestingly, along with centralised exchanges is a parallel universe built with the infrastructure of trustless protocols. Decentralised exchanges have amazingly eradicated the need for mediators or custodians to facilitate trading.
However, due to blockchain technology’s inherent limitations, building Decentralized exchanges has been challenging, at least those that can meaningfully compete with and replace their centralised counterparts. In different areas, such as efficiency and user interface, most DEXes require enhancement.
However, Developers worldwide have been brainstorming new ways to build a competitive decentralised exchange, and one of the leading drivers are Uniswap. Although Uniswap’s operation maybe a little more complicated than usual, it is expected to roll out some attractive benefits into Decentralized exchanges. It is among the most ambitious programs in the Decentralized Finance movement due to its innovation.
This article will explain Uniswap, how it functions, and through your Etheruem Wallet, how you can swap tokens on it.
What is Uniswap?
Built on the Ethereum network, Uniswap is a pioneer decentralised exchange protocol. It is an automatic liquidity protocol to be more specific. Uniswap has no order book or any centralised intermediary required to make trades, and it allows users to trade without any arbiters under a decentralised ecosystem.
Although Hayden Adams founded it in 2018, the underlying technology that drove its implementation was first proposed by Ethereum’s co-founder, Vitalik Buterin.
Moreover, Uniswap is open-source; this means users can check the source code on the Uniswap GitHub.
Uniswap’s mechanism is established on a model that allows liquidity providers to create liquidity pools. Interestingly, this system enables a decentralised pricing mechanism that allows for a seamless order book depth.
Simply stated, users can switch between ERC-20 tokens smoothly rather than have to go through the hassles of dealing with an order book. Moreover, there is no listing process, as this Uniswap protocol is decentralised. This implies that almost every ERC-20 token can always be introduced while there is a liquidity pool for trades. Uniswap would not, therefore, charge any listing fees either. The Uniswap protocol promotes social good in a manner.
Uniswap V1 vs V2
Uniswap introduced a proof of concept version in 2018, which was later updated to V2 for improved security and a myriad of other benefits. However, some users still like the initial proof of concept version more than the recent V2.
Unlike Uniswap V1, Uniswap V2 is written in Solidty instead of Vyper and supports ERC-777 and other non-standard ERC-20 tokens. While Uniswap V1 only allowed users to swap between ETH and ERC-20 token, Uniswap V2 is dependent on Wrapped ETH (WETH) to create pools of any ERC 20 token directly with any other token.
Moreover, with Uniswap V2, users can quickly flash swap to withdraw tokens at no added costs. Since it relies on price oracles and is far more secure and robust than V1, we believe it is an ideal option. Moreover, Uniswap V2 has also set a feasible framework for self-governance via its UNI Token.
Now that we understand the different versions of Uniswap and what Uniswap is let’s see how it works.
How does Uniswap work?
Uniswap is not based on the traditional digital exchange infrastructure that has no order book. Instead, it is built on a Constant Product Market Maker design, an iteration of an Automated Market Maker model, commonly known as AMM.
Smart contracts that hold liquidity pools against which traders can trade are AMM. Liquidity providers typically finance these reserves. Interestingly, anybody could be a liquidity provider by placing an equal amount of a couple of tokens in the pool. In exchange, traders submit a pool fee that is further allocated to liquidity providers depending on their stake in the pool.
Liquidity providers build demand by placing an equal value of two tokens, to be more precise. ETH and an ERC-20 token or two ERC-20 tokens would be used for these tokens. Pools are typically made up of notable stable coins such as DAI, USDC, and USDT in Uniswap.
Liquidity providers receive liquidity tokens in return that are relevant to their percentage of the overall liquidity pool. Moreover, users can also redeem these tokens for the percentage they represent in the pool.
Let’s take an example. Suppose we’re investing in an ETH/USDT liquidity pool. To compute the overall liquidity in the pool, Uniswap extracts these two quantities and multiplies them. Uniswap does this so it can keep the total liquidity constant.
Suppose we want to make a trade. Using the ETH/USDT liquidity pool, we purchased 1 ETH for 1100 USDT. Through doing so, we are raising the USDT in the pool and lowering the ETH in the pool, thereby increasing the ETH price. With lesser ETH in the pool after our transaction, Uniswap’s algorithm tries to keep the total liquidy constant, therefore increasing the cost.
Ultimately, the price we paid for 1 ETH is dependent on how much our trade shifts the ratio between the pair. It is also important to remember that this process does not scale linearly. As a consequence, the bigger the order, the more it changes the equilibrium of the pair.
Uniswap is a revolutionary exchange protocol built on Ehteruem. It allows everyone with an Etherum wallet to trade tokens under a decentralised ecosystem. Although it has a fair share of risks and drawbacks, the system has laid the groundwork indeed for the prospect of trustless token swapping. Once Ethereum 2.0 is introduced, Uniswap could likely overcome its weaknesses. What do you think? What’s does the future hold for Uniswap?