Uniswap: The Decentralized Exchange (DEX)


Uniswap is a leading decentralized crypto exchange built in 2018 that runs on the Ethereum blockchain, which makes it compatible with all ERC-20 tokens and infrastructure like wallet services. A decentralized exchange, means, this platform is not governed by a single authority. Usually, the company that operates the exchange, (which requires users to place funds under their management) uses a traditional order book system to facilitate trading, which is a relatively new type of trading model called an automated liquidity protocol. With centralized exchanges, the company that operates the exchange usually owns the exchange. This type requires users to place funds under their control and uses a traditional order book system to facilitate trading.

Order book-based trading, is where buy and sell orders are presented with the total amount placed side by side in a list form. The amount of open buy and sell orders for an asset is called “market depth.” For a successful trade, a buy order must match with a sell order on the opposite side of the order book for the same amount and price of an asset, and vice versa.

The main problem with this type of system is liquidity, which in this context refers to the depth and number of orders there are in the order book at any given time. If there’s low liquidity, it means traders may not be able to fill their buy or sell orders.

How different is Uniswap from these exchanges?

Uniswap is a fully decentralized exchange that uses an automated liquidity protocol. It is also completely open source, and anyone can copy the code to create their own decentralized exchanges. At Uniswap, users are allowed to list tokens on the exchange for free. The major difference between Uniswap and the centralized exchanges is, centralized exchanges are profit-driven and charge high fees to list new coins.

As Uniswap is a decentralized exchange (DEX), users maintain control of their funds which means they don’t require traders to give up control of their private keys so that orders can be logged on an internal database rather than be executed on a blockchain, which is more time consuming and expensive. By retaining control of private keys, it eliminates the risk of losing assets if the exchange is ever hacked.

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 platform.

Automated liquidity protocol 

As mentioned earlier, the way Uniswap solves the liquidity problem is through an automated liquidity protocol. This works by encouraging the traders on Uniswap to become liquidity providers (LPs). Uniswap users pool their money together to create a fund that’s used to execute all trades that take place on the platform. Each token listed has it’s own pool that users can contribute to, and the prices for each token are worked out using a math algorithm run by a computer.

With this system, a buyer or seller does not have to wait for an opposite party to appear to complete a trade. Instead, they can execute any trade instantly at a known price provided there’s enough liquidity in the particular pool to facilitate it.

In exchange for putting up their funds, each LP receives a token that represents the staked contribution to the pool. This token can be redeemed for a share of the trading fees. Uniswap charges users a flat 0.30% fee for every trade that takes place on the platform and automatically sends it to a liquidity reserve.

Whenever a liquidity provider decides they want to exit, they receive a portion of the total fees from the reserve relative to their staked amount in that pool. The token they received which keeps a record of what stake they’re owed is then destroyed.

After the Uniswap v.2 upgrade, a new protocol fee was introduced that can be turned on or off via a community vote and essentially sends 0.05% of every 0.30% trading fee to a Uniswap fund to finance future development. Currently, this fee option is turned off, however, if it is ever turned on it means LPs will start receiving 0.25% of pool trading fees.

How token price is determined?

Another important element of this system, is how it determines the price of each token. Instead of an order book system, where the price of each asset is determined by the highest buyer and lowest seller, Uniswap uses an automated market maker system. This alternative method for adjusting the price of an asset based on its supply and demand, uses a long-standing mathematical equation. It works by increasing and decreasing the price of a coin depending on the ratio of how many coins there are in the respective pool.

The size of the liquidity pool also determines how much the price of tokens will change during a trade. The more money, aka liquidity, there is in a pool, the easier it is to make larger trades without causing the price to slide as much.

Leave a Reply