Learn Crypto and Blockchain

Welcome to the Phemex Academy: a free, comprehensive and unbiased resource for blockchain-related knowledge
Crypto Academy
Phemex Blog
Phemex Crypto Blog: Learn the latest news, updates, and industry insights on bitcoin futures, bitcoin trading, crypto derivatives exchange, and related blockchain technology.

What is Uniswap (UNI): A decentralized exchange

Only two months after its launch, Uniswap had already achieved a significant trading volume. Created in 2018 by Hayden Adams, he was inspired to take on the project after Vitalik Buterin (Ethereum’s co-founder) first described the underlying technology in a forum. Uniswap is a simple concept that seeks to provide automated on-chain liquidity for crypto traders.

Uniswap has contributed to the DeFi boom that has taken the crypto market by storm. It now holds a reputation in the crypto space as one of the most active decentralized exchanges due to the solutions it provides.

what is uniswap

What is Uniswap?

Uniswap is a decentralized exchange (DEX) designed to enable traders to swap or exchange ERC-20 tokens directly from their wallets.  Given the multitude of ERC-20 tokens on Ethereum’s network, it can be challenging or even frustrating to trade one token for another, especially if these are not listed on major centralized crypto exchanges (CEX).

While most of these tokens are listed on other DEXs like EtherDelta, they lack sufficient liquidity and offer counterintuitive user interfaces. For this reason, Uniswap has emerged as the top decentralized protocol that automatically provides liquidity and contributes to the improvement of the Ethereum ecosystem of ERC-20 tokens.

How Does Uniswap work?

Unlike centralized exchanges that depend on market makers to provide liquidity, Uniswap operates on a decentralized automated framework that uses smart contracts to automatically provide liquidity. The smart contracts act as automated market makers and balance out liquidity requests from traders to provide exchange services.

The platform does not have an order book or any centralized intermediary. Because it is open-source software, anyone can become a liquidity provider on Uniswap by creating a liquidity pool. Furthermore, as a permissionless protocol, any ERC-20 token can be listed on the platform as long as it has a liquidity pool.

Liquidity Pools on Uniswap

Uniswaps liquidity providers make the market by depositing an equivalent value of two tokens (e.g., an ETH and ERC-20 pair or an ERC-20 with another ERC-20 pair) in a smart contract that holds the liquidity reserve. In return, the smart contract issues the liquidity provider a redeemable incentive in the form of a liquidity token representing the ratio of that provider’s contribution to the pool.

To access this liquidity, traders looking to swap tokens pay a fee to the liquidity pool., That fee is distributed among the liquidity providers based on the ratio of their contributions to the pool.

How Pricing Works on Uniswap

Uniswap employs Pricing Oracles to pull data from various transactions and aggregates a price for its trading pairs. The Pricing Oracle is a decentralized system that is resistant to manipulation by design. It makes it costly for bad actors to hack the system.

For instance, a trader looking to swap ETH for USDT will request to access the ETH/USDT liquidity pool to conduct the trade. Remember that this Uniswap liquidity pool is designed to maintain equivalent values of both ETH and USDT, ensuring constant balance.

By taking out ETH from the pool, that trader essentially reduces ETH’s supply to USDT and, therefore, increases ETH’s price to USDT.

The Pricing Oracle gathers all the data from these transactions and aggregates them to yield a price for each token pair on the platform.

How to Use Uniswap

Anyone can use Uniswap to trade ERC-20 tokens or earn a fee by providing liquidity. Although Uniswap operates similar to an exchange, under the hood, the platform features a unique design that stands out from other exchanges. The platform’s basic framework enables individuals to swap tokens without KYC (Know Your Customer) regulations, token custody, or any sort of verification from an intermediary authority.

What’s more, given that Uniswap is an open-source platform, anyone can create an application on top of Uniswap and get more functionality from the protocol.

Make an ROI with Uniswap

As a crypto trader, here is how you can make an ROI (Return on Investment) with Uniswap:

  1. First, get a crypto wallet. You can choose any wallet to connect to Uniswap; however, the most convenient option is currently the MetaMask wallet. It allows you to connect to the Uniswap blockchain directly from your browser.
  2. The next step is to buy some ETH, given that Uniswap is an Ethereum based protocol that only works with Ethereum-based digital assets.
  3. Connect to Uniswap with your wallet. Once your wallet is set up, the next step is to head over to Uniswap.org and click the ‘launch app’ button. The interface will give you an option to connect Uniswap to your wallet.
  4. You can now access the token swap interface, where you can trade any ETH in your wallet for any ERC20 token of your choice. If you choose an ERC20 token and swap it with your ETH, you will essentially be sending ETH to the liquidity pool while withdrawing the target ERC20 token from the pool.
  5. Beware of slippage tolerance before swapping tokens. Slippage tolerance is the number of tokens you are buying relative to the amount available in the liquidity pool. Trades with large orders relative to the pool size will have a high percentage of slippage that will stop the trade. Therefore, the lower the slippage, the higher the chance of a successful trade.
  6. Once you confirm your swap after checking all the details, your MetaMask will display a pop up to confirm the transaction. It might take a few minutes for the transaction to be confirmed on the blockchain.

 

Liquidity Providers

If you are looking to provide liquidity on Uniswap, you should hold both ETH and the target ERC20 token in the same wallet. The ETH and ERC20 dollar value should be equal in your wallet.

Once you have your wallet set up, follow the procedure described for swapping tokens; however, instead of clicking on the swap token tab, click on the “Pool” button. Then, connect Uniswap to your wallet to select the token and ETH amount you want to add to the liquidity pool.

After the transaction is confirmed on the blockchain, you will see your pool share percentage and ETH’s ratio to the ETH20 token you chose. As traders make transactions in the pool, the ETH to ERC20 ratio may change; however, the overall dollar value of your contribution to the pool remains constant.

Removing liquidity is just as simple. Head over to the ”Pool” tab and select ‘Remove Liquidity’ from the menu. Now, select the ERC20 token you used to provide liquidity and select the amount of liquidity you want to remove. Once you approve the transaction, you will receive the dollar value equivalent of the liquidity you provided with a share of the accumulated transaction fees you have gathered.

The Risk of Impermanent Loss

Liquidity providers on Uniswap should be aware of impermanent loss, an effect that impacts the value of profit relative to the fluctuating market price of a token once liquidity is pulled out of the pool.

For instance, if a liquidity provider deposits 1ETH and a 100 USDT (meaning the ETH is worth $100) in a pool that has 10ETH and 1000USDT, that liquidity provider now has a 10% share in that pool. However, if ETH’s price goes up to 400USDT and arbitrage traders flood the pool with ETH while withdrawing USDT, the ratio of ETH to USDT in the liquidity provider’s wallet changes, but the value remains the same.

Therefore, if the liquidity provider decides to remove liquidity from the pool while the price is high, that trader will experience a loss or essentially, an opportunity cost. In such a case, the ETH value to USDT in the liquidity provider’s wallet will change to 0.5ETH and 200USDT instead of the original 1ETH to 100USDT. While it might seem like the liquidity provider made a profit of $400 (i.e. 0.5ETH at 200 plus the 200 USDT) the liquidity provider has actually made a loss of 100 since the liquidity provider would have had a total of $500 in his wallet had he not provided liquidity to the pool.

To avoid the risk of impermanent loss, you can look at this technical explanation of how it occurs; however, the best solution is to add and remove liquidity to the pool only when the tokens’ price is relatively stable.

Advantages and Disadvantages of Using Uniswap

Like any other technology, the best way to understand Uniswap is to begin using it. One of Uniswap’s main benefits is that traders can transact directly from their wallets without any verification. The platform is also secure as it is non-custodial, and the protocol does not hold any funds.

Furthermore, Uniswap’s smart contracts have been audited several times, as proven by the platform’s published audit reports. The permissionless design of the exchange allows for easy and fast access to new tokens. Compared to centralized exchanges, the platform features lower fees at 0.3% per trade compared to the regular 0.5%.

Some of the risks that come with Uniswap include gas fees, which can skyrocket when Ethereum’s network is congested, as seen in August this year. Also, since there is no user verification, and anyone can trade, create liquidity, and list a token, scammers can easily create fake tokens. The good news is that you can easily spot scammers with a little bit of due diligence.

Overall, Uniswap represents a welcome reprieve for crypto enthusiasts who have been dependant on centralized exchanges for a long time. So far, the platform has successfully raised $11 million in Series A funding to enable the development of a Uniswap version 3.0.



For any inquiries contact us at support@phemex.zendesk.com .
Follow our official Twitter account to stay updated on the latest news.
Join our community on Telegram to interact with us and other Phemex traders.
Phemex, Trade Simple