Uniswap | CoinNav- Blockchain Crypto Exchange Starts Here
A beginner's guide to the popular DEX on the Ethereum blockchain. Uniswap allows users anywhere in the world to trade crypto without an intermediary.
Uniswap VS Traditional Centralized Exchanges
Uniswap, one of the pioneer decentralized finance (DeFi) applications, gained significant attention upon its launch on the Ethereum network in November 2018. Since then, many other decentralized exchanges have emerged (including Curve, SushiSwap, and Balancer), but Uniswap remains the most prominent and widely used decentralized exchange. According to the latest data, Uniswap currently ranks as the fourth largest decentralized finance (DeFi) platform, with over $3 billion worth of crypto assets locked in its protocol.
On the other hand, Uniswap is entirely open-source, allowing anyone to replicate the code and create their own decentralized exchange. It even enables users to list tokens in exchange for free. This stands in stark contrast to traditional centralized exchanges that operate for profit and charge significant fees for listing new coins. Being a decentralized exchange (DEX), Uniswap ensures users retain control over their funds at all times, unlike centralized exchanges such as Coinbase and Binance that require traders to relinquish control of their private keys for orders to be recorded in internal databases, which can be time-consuming and costly. By maintaining control over their private keys, users eliminate the risk of losing assets in the event of exchange hacks.
The majority of cryptocurrency trading occurs on centralized exchanges such as Coinbase and Binance. These platforms are managed by single entities (the companies operating the exchanges), requiring users to entrust their funds under their control and utilize traditional order book systems to facilitate trades.
Order book-based trading refers to the display of buy and sells orders along with the total amount for each order in a list. The number of outstanding buy and sell orders for an asset is known as the "market depth." For successful trades within this system, a buy order must match with a sell order on the opposite side of the order book, at the same quantity and price, and vice versa.
How Uniswap works
Uniswap runs on two smart contracts; an “Exchange” contract and a “Factory” contract. These are automatic computer programs that are designed to perform specific functions when certain conditions are met. In this instance, the factory smart contract is used to add new tokens to the platform and the exchange contract facilitates all token swaps, or “trades.” Any ERC20-based token can be swapped with another on the updated Uniswap v.2 platforms.
Your Go-To Source for the Latest News and Tools in the Blockchain Sector - Coinnav.io.
Automated liquidity protocol
Uniswap addresses the liquidity challenges faced by centralized exchanges through its automated liquidity protocol. This protocol incentivizes users to become liquidity providers (LPs) by pooling their funds on the platform. The pooled funds are utilized to facilitate all trades conducted on Uniswap. Each listed token has its own pool, and the token prices are determined by a mathematical algorithm executed by a computer.
This system enables buyers and sellers to execute trades instantly at a known price, without the need for counterparties. As long as there is sufficient liquidity in the relevant pool, trades can be completed seamlessly. In return for providing liquidity, LPs receive tokens representing their stake in the pool. For example, if an LP contributes $10,000 to a pool with a total value of $100,000, it would receive a token representing a 10% stake in that pool. These LP tokens can be redeemed for a share of the trading fees.
Uniswap charges users a flat 0.30% fee for each trade, which is automatically directed to a liquidity reserve. When an LP decides to withdraw its liquidity, they receive a portion of the total fees from the reserve proportional to its stake in the pool. The LP token they received, which records their stake, is then destroyed.
Following the Uniswap v.2 upgrades, a new protocol fee was introduced. This fee, which can be enabled or disabled through a community vote, allocates 0.05% of the 0.30% trading fee to a Uniswap fund, intended to finance future development. Currently, this fee option is turned off. However, if activated, LPs will start receiving 0.25% of the trading fees collected by their respective pools.
Determining Token Price
The process of determining the price of each token on Uniswap differs from traditional order book systems. Instead of relying on the highest buyer and lowest seller, Uniswap utilizes an automated market-maker system. This system adjusts the price of an asset based on its supply and demand using a mathematical equation that has been in use for a long time. The equation, represented as x * y = k, takes into account the amounts of two tokens, A and B, in the pool, with k being a constant value.
To start a liquidity pool for a new ERC-20 token on Uniswap, a certain amount of the chosen token and an equal amount of another ERC-20 token must be added. The equation then calculates the price of each token based on the changing ratio of the tokens in the pool. For example, when someone adds a large amount of LINK (Chainlink) to the LINK/ETH pool, the ratio of LINK to ETH in the pool increases. As the value of k remains constant, the cost of ETH increases while the cost of LINK in the pool decreases. Therefore, the more LINK added, the less ETH is obtained in return due to the increased price of ETH.
The size of the liquidity pool also plays a role in determining how much the token price will change during a trade. A larger pool with more liquidity enables larger trades to occur without significant price slippage.