A Beginner’s Guide. What is Uniswap and how does it work?

Date:

Uniswap is an Ethereum-based decentralized exchange (DEX) that facilitates the exchange of ERC-20 tokens between traders. As decentralized finance (DeFi) flourishes, the hype around the Uniswap protocol also continues to grow, but not without reason. Compared to any other DEX exchanges, Uniswap is a lot easier. It’s never been easier to add or strip tokens for rewards. Also, thanks to peer-to-peer (P2P) transactions, any transaction can be done without intermediaries.

Uniswap, one of the first DeFi exchanges, aims to revolutionize traditional DEX with its automated liquidity protocol. This means that Uniswap can facilitate the exchange of tokens without relying on traditional architecture with the exchange tumbler method, while solving liquidity problems. In this guide, you will learn what Uniswap is, how it works, and its pros and cons.

What is Uniswap?

Uniswap is an open-source protocol built on the Ethereum blockchain. It provides a unique solution to facilitate the exchange of ERC-20 tokens without any centralized third parties. This means that users manage their own funds and do not depend on any centralized resources.

However, the lack of liquidity, that is, the insufficient amount of funds passing through the platforms, did not allow these decentralized exchanges to become popular among liquidity providers.

However, Uniswap is different from other exchanges. It does not use the order book to determine prices. Instead, the protocol works based on an equation where total liquidity is a constant in the pool. For the model to work, it considers sources of liquidity. So it creates a pool that supports decentralized trading and lending. The process involves listing and swapping ERC-20 tokens without an order book.

How does Uniswap work?

The Uniswap protocol was inspired by Vitalik Buterin’s automated market maker (AMM) concept. Uniswap mainly uses the Constant Product Market Maker Model, a variant of Automated Market Making (AMM), which contains liquidity pools for traders.

Subsequently, in May 2020, Uniswap introduced an updated version – Uniswap V2 along with liquidity pools. Unlike its predecessor (V1), users can now swap ETH and ERC-20 token, while V2 uses wrapped ether (wETH) in basic contracts, where users can combine ERC-20 tokens directly with any other ERC-20 tokens. In addition, the prices have become more reliable and harder to manipulate.

But how does it work?

How does the liquidity pool work?

Liquidity pools are liquidity reserves locked into a smart contract, usually funded by liquidity providers. Stablecoins, such as USDT and DAI, are the main component of the pool. Because Uniswap exists in an inclusive environment, and liquidity pools are the foundation of Uniswap, it is very important to understand its fundamentals.

In principle, anyone can be a liquidity provider (LP). To become an LP, you need to contribute the equivalent value of ETH and ERC-20 tokens to the pool. One of the functions of AMM is that you can provide liquidity regardless of the size of the liquidity pool. In exchange, you will be rewarded with liquidity tokens according to your contribution. This also means that the number of unique tokens you receive is proportional to the liquidity of the pool. These liquidity tokens are used to track your contribution to the pool, distribute transaction fees and for various uses in DeFi applications (dApps).

In these liquidity pools, the total liquidity derived from the product of the two types of tokens always remains constant, following this simple equation X × Y = K, in which the total liquidity remains constant.

Let’s understand how this equation works using the ETH/USDT liquidity pool as an example. If a user buys (x) from the ETH/USDT pool, the supply of USD (y) will be greater than ETH after the transaction. When the supply of ETH is less, there will naturally be a price spike, and vice versa. This is where total liquidity (k) remains constant for price determination. As a general rule, the larger the liquidity pool, the easier it is to process large orders. However, slippage does occur because the x and y ratios are not in a linear relationship.

When comparing Uniswap and centralized exchanges, you will find that the former has no listing fees on Uniswap. Thus, Uniswap quickly became one of the most popular protocols for exchanging tokens. Interestingly, Uniswap took off when Ethereum was still struggling with scalability issues during the Proof of Work consensus.

Uniswap Retrospective

In 2016, Ethereum creator Vitalik Buterin proposed creating a decentralized exchange combined with an “on-chain automated market maker. In his post on Reddit, he also shared some technical details of how this could be achieved.

Hayden Adams, a former Siemens mechanical engineer, picked up the idea and began developing a fully functional Uniswap platform. Soon after he pitched the idea, the project received several grants and $100,000 from the Ethereum Foundation. Shortly thereafter, the first version was officially launched in November 2018. Subsequently, in April 2019, Paradigm (a digital asset investment firm) contributed $1 million to further develop Uniswap.

In 2019, Uniswap became the “King of DEX” and the largest project by volume. After the launch of Uniswap V2 in May 2020, along with the growth of DeFi, the number of transactions on the Ethereum network quickly increased to the level of the previous peak in 2017.

Competing with SushiSwap

Uniswap has surpassed some of the leading centralized exchanges in terms of daily trading volume. This happened just a few months after launch. Users could use smart contracts and make money through yield farming or liquidity mining. However, investors quickly realized that they had little control over their investments. So the developers saw an opportunity and quickly launched SushiSwap(fork of Uniswap) to solve the problem. To compete with Uniswap, SushiSwap provides additional rewards for mining liquidity and launches its own token as an incentive for LPs.

Many believe that the SushiSwap project was designed as a “vampire attack” that would force Uniswap to end its yield farming incentive program. As a result, Uniswap’s total locked-in value (TVL) plummeted by more than $1 billion, and SushiSwap profited from it. On September 16, however, Uniswap launched its UNI token, which led to a significant increase in TVL, while SushiSwap experienced a sharp decline in TVL. Although this rivalry is quite intense, these events do not seem to threaten Uniswap. Uniswap remains the famous DEX with almost 3 billion TVL at the beginning of January 2021.

How does Uniswap make money?

Uniswap receives no profit from end-user commissions, trades, or any other means commonly referred to in the blockchain world. Commissions paid by users are rewards for liquidity providers.

Liquidity providers receive 0.3% of the commission charged by the pool contract per transaction. However, the commission is calculated proportionally to each provider’s contribution. For example, if a provider contributes 10% to the DAI/ETH pool liquidity, he receives 10% of the commission.

As a liquidity provider, you can either add this commission back into the pool to increase your profits or withdraw funds at any time.

The purpose of Uniswap tokens (UNI)

In September 2020, Uniswap released its UNI management token. Its main goal is to further decentralize the protocol by offering end users more governance rights. The main purpose of the UNI token is to allow holders to vote on various proposals and improvements to further develop the platform. This not only increases public trust in the Uniswap protocol, but also provides better protection of users’ funds.

The launch was accompanied by a generous eirdrop of UNI tokens, which went to about 50,000 Ethereum addresses. Users of the protocol could claim 400 UNI, then the equivalent of about $1,200. A few days later, the price of UNI soared to $8, and the final amount could be exchanged for $3,200.

There are a total of 1 billion UNI tokens on the network. Uniswap community members will receive 60% of all UNI tokens. Users will receive 25% of that portion (equivalent to 15% of the total). The Uniswap team and its employees, advisors and investors will receive the remaining 40% of UNI tokens over the next four years.

To be rewarded, community members must provide liquidity to one of the following pools: USDT, USD, DAY and WBTC, each of which must be paired with ETH.

Users can get their rewards at app.uniswap.org by joining the wallet they have used with Uniswap in the past.

Is Uniswap safe?

Despite its outstanding contribution to the DeFi ecosystem, Uniswap has security flaws. After the launch of Uniswap V2, community members were actively testing the protocol. Two months later, in July 2020, complaints about counterfeit tokens began to appear.

Since there was no pre-moderation for token listing, scammers took advantage of this loophole to distribute tokens similar to those produced by popular DeFi products. They tricked users into buying these useless coins. Unfortunately, there is no information about how much money was lost as a result of these scams. However, there have been several reports and announcements about these scams.

In August 2020, Uniswap introduced a new platform (token lists) to address this problem. This community-led, decentralized initiative serves to ensure the legitimacy of new tokens. And the more authoritative platforms like CoinMarketCap and Coingecko list a token, the better. Ultimately, the token ranks higher along with its credibility score. Token issuers can apply to list tokens through the Uniswap interface. Tokens with lower ratings are likely to be susceptible to fraudulent activity.

How to exchange tokens with Uniswap?

The process of exchanging tokens on Uniswap is quite simple. To convert one ERC-20 token into another, you need an Ethereum wallet and Internet access. Since Uniswap is an open-source protocol, anyone can use its code to run their own applications. Alternatively, you can access it through your own Uniswap app.

Here’s a step-by-step guide on how you can swap tokens on Uniswap:

Open the Uniswap application.

  1. Connect your ERC 20-wallet such as Metamask, Trust Wallet, or a hardware wallet such as Trezor or Ledger Nano S.
  2. Select the pair of tokens you want to swap, click the “Swap” button.
  3. In the pop-up window, review the transaction data and confirm the request in your wallet.
  4. You can monitor the status of the transaction on Etherscan.

Conclusion

The Uniswap team created a solution that the cryptocurrency community has been waiting for a long time. Moreover, the automated liquidity protocol combined with the unique management system via UNI tokens gave users confidence, which, in turn, increased the use of the platform. With Uniswap, swapping Ethereum-based tokens has become incredibly easy.