Protocon
Published in

Protocon

Automated Convenience Store in Virtual Asset World — Uniswap

Hello, this is Team Protocon’s Editor Y.

A month-long series of Slicing Token Staking has ended. This time, while I was thinking about which topic to cover, I decided that I would like to start a series about recently rising DeFi projects. Not sure exactly what DeFi is? I briefly touched on it here, [DeFi and Protocon’s FeeFi], so please check it out.

Let’s take a look at the first of all the DeFi project series, also known as the DeFi Captain, Uniswap.

We trade tokens derived from blockchain with the ideology of decentralization on a centralized exchange. In a way, it’s very ironic. In addition, all four major virtual asset exchanges in Korea(Upbit, Coinone, Bithumb, Korbit) are centralized exchanges. Since the central system directly participates in these exchanges to mediate transactions and in order to trade, various steps such as membership registration, identity verification, and account registration are required.

Decentralized Exchange (DEX)

Decentralized Exchange, or DEX, is a popular DeFi (Decentralized Finance) service in the virtual asset market. The decentralization of traditional financial services such as transactions, loans, and insurance through blockchain technology is often called ‘DeFi’. Unlike traditional exchanges, DEX does not have a separate company that operates the exchange, and there is no centralized operating server. It adopts a structure that operates automatically with the designed code through smart contracts on top of the blockchain. No one controls the exchange, so anyone can resume transactions through simple wallet links without identification or account creation.

Appearance of Uniswap

Uniswap is an Ethereum-based decentralized exchange developed by Ethereum developer Hayden Adams. In Uniswap, liquidity providers are staking on the AMM algorithm, helping users who use the swap* function to exchange and trade at low cost. I will explain the details of AMM along with the working principle of Uniswap.

*Swap — Financial techniques carried out through exchange of funds flow at a certain point in time according to contract terms, etc. (Source: Hashnet)

Image Credit: CoinMarketCap

As of August 30, 2021, Uniswap currently has a 24-hour trading volume of $1,340,926,030 (Uniswap V2: $996,492,817, Uniswap V3: $344,433,213) on the CoinMarketCap DEX chart. This is a transaction volume of more than KRW 1 trillion in Korean Won, occupying an unrivaled №1 position in the DEX market. In addition, Uniswap’s current TVL (Total Value Locked) is $6.77B, about 7.9 trillion in Korean Won, and it is positioned as one of the top players in the DEX market. Sushi Swap, made by forking Uniswap, is ranked 7th, so you can see that Uniswap is a very well-made project.

How does it work?

So, let’s take a look at how it works. Uniswap is a platform that reflects the high level of understanding decentralization, which is the characteristic of blockchain and the direction it is pursuing. Existing centralized exchanges have order books, and people can buy and sell based on the data in the order book. In a decentralized exchange, a fee (gas fee) is charged for all transactions, and the transaction takes a certain amount of time due to the block generation time of Ethereum. However, if we create an order book-based exchange, it becomes an inefficient exchange that is slow and expensive. Uniswap solved this dilemma with the introduction of Automated Market Maker (AMM). AMM is a type of decentralized exchange (DEX) protocol that uses a mathematical formula to calculate a price. Due to this, the price of virtual assets is determined through an algorithm, without using an order book like the existing exchanges. In other words, the exchange rate is set automatically even if users do not raise the asking price.

The algorithm used by Uniswap is CPMM (Constant Product Market Maker), which is expressed by the formula x*y=k. x is the quantity of A tokens and y is the quantity of B tokens. x and y are inversely proportional to each other, and their product always satisfies the constant k.

I will explain using an example from Uniswap’s white paper.

Image Credit: Uniswap V1 Whitepaper, ETH to OMG Exchange in Uniswap

1) Assuming that 10 Ethereum (ETH) and 500 OmiseGo (OMG) are in the exchange pool, the product of both is 5000. In other words, the value multiplied by the two cryptocurrencies in all exchanges should remain 5000.

2) In the same situation, if someone sends 1 Ethereum to buy OmiseGo, it will increase from 10 to 11 Ethereum on the contract.

3) The quantity of OmiseGo will be 5000/11 to maintain a constant value of 5000 which is the product of OmiseGo and Ethereum at the beginning of exchange.

4) In other words, 454.5 OmiseGo should remain in this exchange pool. So the quantity of OmiseGo that you can buy in exchange for 1 Ethereum is 45.5.

If someone else wants to buy an Ethereum, the quantity of Ethereum in the exchange pool will be 12, and 1 Ethereum will be exchanged at 37.8 which is the difference between 5000/12, or 416.7 from the previous 454.5. As additional Ethereum is supplied to the exchange pool and OmiseGo is exchanged, the supply of OmiseGo is reduced. This will have the effect of increasing the price of OmiseGo.

This leads to the transaction of profit-taking traders who want to sell OmiseGo at a high price and buy Ethereum at a low price. The profit-taking transaction is repeated, resulting in the continuous supply of OmiseGo and the transaction price of OmiseGo, which can be purchased close to 50 OMG at 1 ETH again. It’s a decentralized exchange, but it’s able to form a price range that converges on the trading price of the centralized exchange.

Advantages of Uniswap

Image Credit: Uniswap Whitepaper V1

When trading virtual assets using Uniswap, one of the biggest advantages is that gas costs are relatively low compared to other exchanges. It boasts better gas efficiency than the representative exchanges EtherDelta and Bancor. Another advantage is that the Uniswap protocol is open source, so access to code sources is free and accessible to anyone. For example, the Sushi Swap mentioned above is representative.

Growing Uniswap

Image Credit: Uniswap V3

Uniswap launched V1 in November 2018 and successfully settled V3 in May 2021 following V2 in May 2020. As mentioned above, I think it is sufficiently proven that Uniswap V3 is on the top of the Coin Market Cap DEX ranking.

By launching the V3, Uniswap has subdivided the smart contract which automatically closes deals. This has allowed liquidity providers to make a lot of money by focusing their money efficiency on the section where most transactions occur. In addition to the original fee section of 0.3% to 0.5, 1% of the fee range has been created and provided to liquidity providers. If you form a liquidity pool of a token with high price volatility, you will get a higher fee. In addition, Uniswap added the gas fee discount and range order function. Also, if a liquidity provider supplies a pool to Uniswap V3, Uniswap issues certificates in the form of NFTs.

We had time to learn about the concept of DEX and Uniswap. Uniswap has continued to evolve, leading the DeFi craze, and has now completed updates to V3. Team Protocon will also keep improving so please keep your eyes on. In the next episode, we will talk about Sushi Swap, which is similar to Uniswap, but also different in some ways. Please show a lot of interest and look forward to the next research.

You’ve been with Editor Y!

Official Protocon Links

Telegram

Twitter

Youtube

Github

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store