Curriculum
Course: Coins & Exchanges
Login

Curriculum

Coins & Exchanges

Video lesson

Uniswap.org DEX

Uniswap Decentralized Trading

In the ever-evolving world of finance, decentralized exchanges (DEXs) are breaking down barriers and revolutionizing how we trade cryptocurrencies. One notable player in this arena is Uniswap, a decentralized platform built on the Ethereum blockchain that enables seamless swapping of tokens without the need for a central authority. Understanding Uniswap is not only crucial for navigating the crypto landscape but also highlights the core principles that bridge traditional finance and this new digital frontier.

Core Concepts

  1. Decentralized Exchange (DEX)
    A DEX operates without a central authority, allowing users to trade directly with one another through smart contracts. In the traditional finance realm, exchanges like the New York Stock Exchange serve as intermediaries that facilitate trades. Uniswap, by contrast, uses code to operate, democratizing the trading process.

  2. Liquidity Pools
    Liquidity pools are collections of funds locked in a smart contract, facilitating trades on the platform. In traditional finance, these are similar to market maker firms that provide liquidity for buyers and sellers. Uniswap’s liquidity pools allow users to trade effectively without a central order book, using tokens supplied by liquidity providers instead.

  3. Liquidity Provider (LP) Tokens
    LP tokens represent your stake in a liquidity pool, akin to owning shares in a company. When you provide liquidity to Uniswap, you receive LP tokens which entitle you to a proportional share of the fees earned by the pool.

  4. Arbitrage Trading
    This strategy involves buying assets in one market and selling them in another for a profit. In the context of DEXs, if Ethereum is cheaper on Uniswap compared to other exchanges, savvy traders can exploit this price difference to profit. This is similar to how traditional traders exploit market inefficiencies.

  5. Slippage Tolerance
    Slippage is the difference between the expected price of a trade and the actual price. In traditional trading, slippage occurs in volatile markets, affecting the transaction outcome. Uniswap allows traders to set slippage tolerance, ensuring that their trades execute within acceptable limits despite price changes during transaction processing.

  6. Constant Product Market Maker (CPMM)
    This mathematical formula ensures that the product of two tokens’ quantities remains constant, driving pricing in liquidity pools. Traditional markets rely on order books and price discovery mechanisms, but Uniswap’s CPMM creates a unique pricing structure independent of those methods.

  7. Ethereum Gas Fees
    These are transaction fees required to execute operations on the Ethereum blockchain, akin to brokerage fees in traditional finance. Gas fees can fluctuate based on network congestion, playing a crucial role in the cost structure for using DEXs like Uniswap.

Understanding these concepts is vital as they lay the groundwork for comprehending how decentralized finance (DeFi) operates and its implications for investors stepping into the crypto space.

Key Steps

1. What is Uniswap?

  • Uniswap is a decentralized exchange that allows users to swap Ethereum-based tokens without a centralized entity.
  • It operates through smart contracts, automating trades and maintaining transparency.

2. The Mechanics of Trading on Uniswap

  • Users deposit tokens into liquidity pools.
  • The platform utilizes a pricing algorithm to adjust token prices based on supply and demand dynamics.

Crypto Connection:
Traditional exchanges like Coinbase require users to deposit fiat and navigate multiple steps. In Uniswap, you directly trade tokens within a seamless ecosystem, highlighting the efficiency of decentralized trading.

3. Joining the Uniswap Ecosystem

  • Investors deposit tokens into chosen liquidity pools to earn returns.
  • They receive LP tokens representing their investment and share of transaction fees.

Crypto Connection:
This mimics traditional stock ownership, where owning shares entitles individuals to dividends. However, LP tokens provide additional benefits from trading fees, an intriguing twist that incentivizes liquidity provision.

4. Pricing Dynamics in Uniswap

  • Prices fluctuate based on the amount of tokens in liquidity pools using a constant product formula.
  • Arbitrage opportunities arise when price discrepancies appear between different exchanges.

Crypto Connection:
Just like traditional traders capitalize on price differences across exchanges, crypto traders leverage arbitrage to optimize gains, maintaining equilibrium between various markets.

Real-World Applications

In traditional finance, exchanges play a pivotal role by bridging buyers and sellers. Uniswap’s architecture adapts this model, allowing individuals to trade directly while providing liquidity—a trend that shapes the future of decentralized trading. The rapid rise of DeFi has led to increased exploration of these platforms, with numerous liquidity pools catering to different asset classes.

Challenges and Solutions

Uniswap faces challenges such as high gas fees and impermanent loss risk for liquidity providers. These issues are exacerbated by market volatility, making participation daunting for newcomers. However, blockchain technology offers solutions, such as the implementation of layer-2 solutions to reduce transaction costs and risks associated with liquidity provision.

Key Takeaways

  1. Uniswap enables decentralized trading: Break free from traditional exchange limitations by trading directly on the Ethereum network.

  2. Understanding liquidity pools is essential: Grasping how liquidity works can empower you to make informed investment decisions.

  3. LP tokens are your investment shares: Recognize that your LP tokens are more than mere receipts—they grant you a stake in the pool’s earnings.

  4. Arbitrage opportunities await: Price discrepancies are commonplace; seeking them can yield quick profits.

  5. Gas fees matter: Always factor in transaction costs when engaging with any DeFi platform.

Discussion Questions and Scenarios

  1. How does trading directly on a DEX like Uniswap differ from using traditional exchanges like Coinbase?

  2. Imagine you’re a liquidity provider in Uniswap. Analyze the risks you face and potential strategies to mitigate them.

  3. What advantages do DEXs offer that make them attractive compared to established traditional exchanges?

  4. Consider an example where the price of LINK on Uniswap is lower than on another exchange. How would arbitrage traders respond, and what effects would this have on liquidity pool prices?

  5. How does the volatility of cryptocurrencies influence slippage in DEX trading compared to traditional markets?

  6. What might be the long-term implications of decentralized exchanges on the traditional financial system?

  7. Reflect on the importance of community governance in platforms like Uniswap. How does this differ from corporate governance in traditional finance?

Glossary

  • Decentralized Exchange (DEX): A trading platform that operates without a central authority, using smart contracts.
  • Liquidity Pool: A collection of tokens locked in a smart contract used to facilitate trading.
  • Liquidity Provider (LP) Tokens: Tokens representing ownership in a liquidity pool.
  • Arbitrage Trading: The practice of exploiting price differences between markets for profit.
  • Slippage Tolerance: The maximum price difference a trader is willing to accept for a transaction.
  • Constant Product Market Maker (CPMM): A formula used by DEXs to maintain price balance in liquidity pools.
  • Ethereum Gas Fees: Transaction fees required to execute operations on the Ethereum blockchain.

As you journey through the fascinating landscape of cryptocurrencies and DeFi, the lessons learned from Uniswap will arm you with essential knowledge and tools to engage with the ecosystem effectively.

Continue to Next Lesson

With this foundational understanding of decentralized exchanges, you’re now equipped to delve deeper into the wonderful world of cryptocurrencies. Continue with the next lesson in the Crypto Is FIRE (CFIRE) training program, where we will explore even more insightful concepts and actionable strategies.

 

Read Video Transcript
What is Uniswap? & How it Actually Works
https://www.youtube.com/watch?v=Z7d1g_cBL9k
Transcript:
 If you have some Ethereum and want to swap them for some Monotokens, how can you do this? Well,  you have two options. You can use an exchange like Coinbase or Binance to sell your Ethereum  for US dollars, then use the money to buy some Monotokens. Or you can use something like Uniswap,  where you deposit your Ethereum, and Uniswap will automatically give you the Monotokens.
 Ethereum, and Uniswap will automatically give you the Monitokens. Welcome to CryptoBe, where we explain cryptocurrencies and DeFi topics in the most simple and beginner-friendly  way.  In this video, you will know what is Uniswap and how does it work, how to use Uniswap,  and finally, we will talk about the Uniswap token.
 We have included timestamps so you can easily skip to  any part you want. So, let’s get started.  Uniswap is a decentralized exchange that allows you to easily swap your Ethereum for Mono for example, or swap your Tether for Link tokens. In fact, you can swap between  any two Ethereum tokens. Decentralized here means that Uniswap is not owned by any company.
 It is just pieces of code or a program that runs  on the Ethereum blockchain. Anyone can view this code and verify it if he wants to.  So how does Uniswap allow you to swap your Tether for linked tokens, for example?  Well, Uniswap stores a lot of both tokens.
 So you can go give it your Tether, and it will give you  some of its stored linked tokens, and then Uniswap will take your tether, and it will give you some of its stored link tokens,  and then Uniswap will take your tether coins and store them to sell them in the future for  other people. You know when something has a low supply, so sellers increase its price.
 Well,  Uniswap does just that, but there is no human doing that on Uniswap, but the code itself is  written to do that automatically. So, when Uniswap has but the code itself is written to do that automatically. So when Uniswap has a small  amount of LINK tokens, it increases the price you need to pay for each LINK token.
 So for example,  if Uniswap has 100,000 LINK tokens stored, it will sell you 1 LINK token for 20 Tether.  And if the amount of LINK dropped to 90,000, it will then sell you 1 LINK token for 25 Tether.  of LINK dropped to 90,000, it will then sell you one LINK token for 25 Tether.
 And as the amount of LINK decreases even more, Uniswap will continue to raise the price more and more, until the amount  of LINK tokens increases again. Let’s now go deeper into how Uniswap actually works.  As we have said, Uniswap stores a lot of Ethereum tokens, but the thing is, it stores these tokens in pairs.  So you have a container that contains a lot of Tether and LINK tokens, and you have another  container containing Ethereum and USDC, and another one for Ethereum and Tether.
 Each pair of Ethereum tokens has its own container. These containers are called  liquidity pools, which basically means money pools.  Currently, Uniswap has more than 600 liquidity pools for different tokens.  You may be wondering where do these coins come from?  Well, all these stored tokens come from investors.
 These investors are called liquidity providers,  and they deposit their money into these pools to make money or return on their investments.  So, for example, if you want to invest your money into one of these pools,  you need to deposit the two tokens stored in the pool you chose.  So, if you have $1,000 to invest and you chose the Tetherlink pool,  then you will deposit $500 in Tether and $500 in Link tokens.
 When you deposit these tokens in the pool, your share in the pool is calculated, which  means how much of the pool you own.  And then you get some tokens called Liquidity Provider tokens, also called LP tokens.  These tokens represent your ownership in the pool.  So for example, if you deposited $10,000 worth of tokens in a pool  that has $90,000 worth of tokens, then you will get an LP token representing 10% ownership in  the pool. You can think of these tokens as shares of stock. Shares of stock represent
 ownership in a company, and LP tokens represent ownership in a liquidity pool.  If you have been enjoying the video, consider rewarding our hard work by giving us a like.  As a new channel, it helps us tremendously.  If you own 10% of a pool, then when any token swaps are made using this pool, you get 10%  of the fees collected by this pool.
 And if you own 20% of a pool, you get 20% of the fees collected by this pool and if you own 20 of a pool you get 20 of the fees collected  so the fees you earn are based on the percentage of the pool you own currently all uniswap v2 pools  take 0.
3 percent as a fee for the liquidity providers uniswap v3 isn’t another story and it  is a topic for another video but for for now, to help you understand all of  this, let’s go over an example. Let’s say that you and three of your friends own the pool worth  $100,000. At the beginning, you deposited $50,000, so you own 50% of the pool. John paid $30,000,  so he owns 30%. Taylor paid $10,000, so he owns 10%, and Rebecca also paid $10,000 and owns 10%.
 If during a month, the pool collected $1,000 in fees, then you will get 50% of these fees,  which equals $500. John will get $300, Taylor will get $100, and Rebecca will also get $100.  Another important point you should understand is the price of tokens in a pool.  As we have said, the prices depend mainly on the supply and demand.
 In a TetherLink pool, if the supply of LINK decreases and the supply of Tether increases,  then the pool automatically raises the price paid for each LINK token.  This is done to avoid running out of LINK tokens. prices, then the pool automatically raises the price paid for each linked token.  This is done to avoid running out of linked tokens.
 And these price adjustments are done using a mathematical equation called the Constant  Product Market Maker.  And we have explained it in a very simple way in our liquidity pools video.  Check it out if you want to learn how it works.  But the question here you may have is is can the pool have token prices different  from other exchanges like coinbase or finance well the answer is yes and when this happens  many traders buy the token where it is cheap and sell it where it is correctly priced for example
 the price of ethereum on uniswap may be 3 000000 tether which equals $3,000 and the price of Ethereum on Coinbase  may be $3,040. So, you can make an easy, no-risk $40 profit by buying Ethereum from Uniswap  and selling it on Coinbase.
 When a number of people do this, the supply of Ethereum on Uniswap  will decrease and the pool will raise its price until it  reaches the market price of $3,040.  The people who do this are called arbitrage traders, and although they make easy no-risk  profits, they play a very important role in keeping the prices the same on all exchanges.  Now we are going to go over how you can actually use Uniswap to swap tokens.
 It actually pretty easy to swap tokens on Uniswap.  First, you need a crypto wallet.  If you don’t have a wallet, we recommend creating a MetaMask wallet, as it is very easy to use  and we have a full video about MetaMask and how you can get started.  After that, go to app.uniswap.org.  Make sure you are on the correct website.
 Then enter the amount and the token you currently have, then select the token you want.  Uniswap will automatically show you the exchange rate and the Ethereum gas fee you need to pay,  which make it very high, as you can see. Click on the settings icon on the right  to adjust the swap settings.
 The slippage tolerance  is by how much you accept the price to change during the processing of your swap. For example,  the price of the Uniswap token may increase while your transaction is being processed,  so you get less tokens than what you are seeing right now. For popular cryptos like Ethereum,  now. For popular cryptos like Ethereum, Dytether, and other well-known currencies, you can set this tolerance to 0.
5% or 1%, but for small cryptos, you may need to increase the tolerance  to get your swap done. Next, you have the deadline, which is the  maximum time you allow Uniswap to execute your transaction. After you set it up, click Connect Wallet. Choose MetaMask or any other  wallet you like. If you chose MetaMask, then MetaMask will pop up asking you to connect with  Uniswap. Choose the account you want, then click Next, then Connect.
 Click the Swap button, and it  will ask you to pay the gas fees and approve the swap on MetaMask. Click confirm and you are done.  The transaction may take a few minutes and then the tokens will appear in your MetaMask wallet.  Before we end the video, you should also know about the Uniswap token,  which is an Ethereum token developed by the Uniswap team and was launched in September 2020.
 Holders of this token get the right to vote on changes and new features  of Uniswap. The total supply of the Uniswap token is 1 billion tokens, and 15% of all tokens  were given for free as an airdrop to people who used Uniswap before September 2020. A total of  60% of the tokens will go to the community members in the form of grants and staking rewards,  which we will explain in details in the Uniswap V3 video. This 60% includes the 15% given to users.
 Also, 21.5% of the total supply will go to team members, and 18% will go to investors and 0.5% will go to advisors. You should know that in 2024,  a 2% inflation rate will start, which means that the total supply will increase each year  and will eventually exceed 1 billion tokens.
 Always do your research before taking any  investment decision.