How To Use Uniswap V3 For Trading & Yield Farming

Step By Step Uniswap V3 Tutorial

Ishan Shahzad
18 min readMay 20, 2022
Uniswap V3
Uniswap V3

What is Uniswap and how is it different from every other cryptocurrency exchange? In this step by step Uniswap v3 tutorial, I’ll show you how to use Uniswap V3 for trading & yield farming, so that you can buy some of the hottest new cryptocurrencies as soon as they hit the market.

Before we get started, let me introduce you to Uniswap v3!

Overview of Uniswap

Uniswap v1 was launched in November 2018 as a proof of concept for automated market makers (AMMs), a type of exchange where anyone can pool assets into shared market-making strategies.

In May 2020, Uniswap v2 introduced new features and optimizations, setting the stage for exponential growth in AMM adoption. Less than one year since its launch, v2 has facilitated over $135bn in trading volume, ranking as one of the largest cryptocurrency spot exchanges in the world.

Uniswap now serves as a critical infrastructure for decentralized finance, empowering developers, traders, and liquidity providers to participate in a secure and robust financial marketplace.

Today, we are excited to present an overview of Uniswap v3. We are targeting an L1 Ethereum Mainnet launched on May 5, with an L2 deployment on Optimism set to follow shortly after.

Uniswap v3 Introduces:

Concentrated liquidity gives individual LPs granular control over what price ranges their capital is allocated to. Individual positions are aggregated together into a single pool, forming one combined curve for users to trade against

Multiple fee tiers, allowing LPs to be appropriately compensated for taking on varying degrees of risk

These features make Uniswap v3 the most flexible and efficient AMM ever designed:

LPs can provide liquidity with up to 4000x capital efficiency relative to Uniswap v2, earning higher returns on their capital.

Capital efficiency paves the way for low-slippage trade execution that can surpass both centralized exchanges and stable coin-focused AMMs

LPs can significantly increase their exposure to preferred assets and reduce their downside risk

LPs can sell one asset for another by adding liquidity to a price range entirely above or below the market price, approximating a fee-earning limit order that executes along a smooth curve

Uniswap’s oracles are now far easier and cheaper to integrate.

New to trading? Try crypto trading bots or copy trading

Step By Step Guide

I’m going to teach you how to use the decentralized exchange (DEX) Uniswap. Unlike a traditional exchange, Uniswap uses automated market makers (AMMS) and AMM uses liquidity pairs to allow traders to swap new tokens. Unlike a traditional exchange that uses order books where you have buyers and sellers. Let’s go ahead and get started now!

Set Up Your Metamask Wallet

To use Uniswap, you will need a chrome extension wallet like Metamask. This is what I will be using here. Simply go to Metamask’s website.

Metamask website
Metamask website

Download the chrome extension.

Installing Metamask for Chrome
Installing Metamask for Chrome
Adding Metamask Extension
Adding Metamask Extension
Getting Started with Metamask
Getting Started with Metamask
Confirmation
Confirmation
All done with Metamask
All done with Metamask

Write down and set up your keys and then your wallet will be open next. You will need to buy some cryptocurrency on the Ethereum network and send it to your Metamask account. You can buy cryptocurrency like Ethereum using Coinbase or any other centralized exchange.

Coinbase website
Coinbase website

You can also buy it directly on your Metamask with your credit card now.

Metamask Website
Metamask Website

Once your Ethereum or any other erc20 token is in your Metamask wallet, you’re ready to use Uniswap.

Uniswap Website
Uniswap Website

Let me walk you through the entire interface here.

How Uniswap Works

First to get you more familiar with how Uniswap works.

Uniswap.org
Uniswap.org

Here I am on uniswap.org.

Uniswap is a decentralized trading protocol and it is now operating in version 3. Uniswap guarantees liquidity for millions of users and hundreds of Ethereum applications. If you click on the launch app button, it’ll take you directly to the trading protocol.

Launch App Button
Launch App Button
Trading Protocol
Trading Protocol

If you click on the documents button,

Docs Button
Docs Button

It will take you to Uniswap’s documents.

Uniswap Docs
Uniswap Docs

Here you can learn more about what Uniswap is, the smart contract overview, v3 SDK and much more.

For more time-sensitive updates, go ahead and click on their blog

Blog Button
Blog Button

You can see that there are a lot more updates and new products being updated here on Uniswap.

Uniswap Blog
Uniswap Blog

If you have any questions, you can always click the FAQ button

FAQ Button
FAQ Button

and you can have your questions answered by the FAQ.

Uniswap FAQ
Uniswap FAQ

The Uniswap protocol empowers developers, liquidity providers and traders to participate in a financial marketplace that is open and accessible to all.

Uniswap Protocol’s Ecosystem
Uniswap Protocol’s Ecosystem

It also offers a suite of tools for a tokenized world.

Uniswap offers a suite of tools for a tokenized world
Uniswap offers a suite of tools for a tokenized world

Uniswap has built the state-of-the-art open-source app to access the Uniswap protocol and to contribute to a world of decentralized finance. Uniswap allows for superpowers for DEFI developers.

Uniswap allows for superpowers for DEFI developers
Uniswap allows for superpowers for DEFI developers

If you want to learn more about their guide's references and more, go ahead and click Developer Docs

Developer Docs
Developer Docs

and it will take you to the Uniswap docs.

Uniswap Docs
Uniswap Docs

If you have any questions or need additional help with Uniswap, they are a global community to learn more. Chat with the team and others in the community and hear what you have to say in shaping the future of the Uniswap protocol. they do have a discord, Twitter, disclosure and Reddit.

Uniswap, A Global Community
Uniswap, A Global Community

Uniswap also has its very own token called the UNI token. The UNI token is the Uniswap protocol token and it is now live.

UNI token
UNI token

The Uniswap token is trading right around 19 a token. The uni token is a community-led token and is the official governance token of the Uniswap protocol. Here is the Genesis UNI allocation and other tokenomics.

Genesis UNI allocation
Genesis UNI allocation
+10 Year Inflation UNI Allocation
+10 Year Inflation UNI Allocation
UNI 4 Year Release Schedule
UNI 4 Year Release Schedule
UNI 4 Year Release Schedule
UNI 4 Year Release Schedule

Swapping Tokens On Uniswap

Now let’s go ahead and start swapping for some tokens.

First, click on the launch app button.

Launch App Button
Launch App Button

You will then be taken to the Uniswap protocol.

Next in the top right-hand corner, you will need to connect your wallet as you can see you can use Metamask wallet.

Uniswap Protocol
Uniswap Protocol

Connect Coinbase wallet.

Connect a Wallet
Connect a Wallet

I will be connecting with Metamask.

Connect with Metamask
Connect with Metamask

After you’ve connected, you can see your balance in Ethereum.

Ethereum Balance
Ethereum Balance

If you have any Ethereum in your wallet for our demonstration purposes. I will be using Ethereum as the main token to use on Uniswap.

Next, if you click to select a token you can see a variety of different tokens on the Uniswap exchange that you can swap for.

Select a token
Select a token
List of tokens
List of tokens

You can search for the name of your token directly at this search name by searching the name at the top or pasting in the contract address.

Search for token
Search for token

Sometimes new tokens do not show up in the name and you will need to paste in the address.

Let me share with you how to do this. You will first need to go to a website like a coin gecko or CoinMarketCap.

coingecko.com
coingecko.com
coinmarketcap.com
coinmarketcap.com

From there you can search for the token that you would like to trade on Uniswap. Let’s say it was Chainlink, as it is a very popular cryptocurrency.

Chainlink Token
Chainlink Token

I can go ahead and click on the button here. Then, I can go and find the contract address.

Chainlink Contract Address
Chainlink Contract Address

This is where you will need to. Either add it to your Metamask or click to copy for demonstration purposes. I will click to copy.

Copy Chainlink Contract Address
Copy Chainlink Contract Address

After that, I will head back to the Uniswap interface here is where I will paste in the contract address.

Chainlink Active
Chainlink Active

As you can see link pops up and you can see that it is now active.

Active Chainlink Token
Active Chainlink Token

Now, let’s say I wanted to trade some of my Ethereum for some Chainlink.

Trade Ethererum for Chainlink
Trade Ethererum for Chainlink

All we need to do is type in the amount of Ethereum that I would like to trade or the amount of LINK that I would like to receive. Let’s say I would like to buy 1 Chainlink.

Buying 1 Chainlink
Buying 1 Chainlink

One chainlink is worth 16 dollars and 44 cents which would cost me approximately 0.00765 Ethereum. Now, to swap my Ethereum for a chain link, all I need to do is click on the Swap button.

Click Swap Button
Click Swap Button

It will then ask me to confirm my swap. You can see I’m going from Ethereum to Chainlink. There will be a slight liquidity provider fee. The route is from Ethereum to Chainlink and the price impact is 0.01.

Price impact
Price impact

Now the maximum I will send is 0.007658 Ethereum and my slippage tolerance is 0.10%.

Slippage Tolerance
Slippage Tolerance

I also wanna share with you how you can change some of your settings directly here on Uniswap.

If you click on this gear icon. you can see something called slippage tolerance.

Transaction Settings
Transaction Settings

Now your slippage tolerance will basically allow your transaction to revert if the price changes unfavourably by more than the percentage that you set.

Let me share with you an example if you set the percentage to 1%

Setting Slippage Tolerance
Setting Slippage Tolerance

that means if the price moves 5% or 10%. Your transaction will fail and you will not receive the cryptocurrency that you’re trying to swap for.

Setting Slippage Tolerance
Setting Slippage Tolerance

This is because you would have received less cryptocurrency than you were trying to buy. Now you can automatically set your cryptocurrency slippage or you can do so manually by typing in below.

Now if you do set your slippage to a higher percentage your transaction may be front-run. What this means is that a bot or other crypto investor may buy the cryptocurrency right before you. Charging you a higher price for most transactions anywhere between 1%-5% is going to be a good slippage tolerance depending upon how much cryptocurrency you’re buying

Setting your slippage
Setting your slippage

but again this will all depend upon which cryptocurrency you’re buying, how much liquidity is being provided and also how much you’re trying to buy all at one time. You can also see that there’s a transaction deadline. It automatically defaults to 20 minutes.

Setting Slippage
Setting Slippage

This means your transaction will fail if for whatever reason your transaction does not go through within 20 minutes on the Ethereum blockchain. Sometimes transactions can get stuck for hours. This is because the network gets very congested and this is where this transaction deadline can come into play.

Now if you are an expert you can always toggle to expert mode. Expert mode turns off the confirmed transaction prompt and allows high slippage trades that often result in bad rates and lost funds.

Expert mode
Expert mode

Only use this mode if you know what you’re doing. You can also disable multi-hops. What this means is it will restrict swaps to direct pairs only once.

Transaction settings done
Transaction settings done

You have all of your transaction settings set.

You’re now ready to swap for your new cryptocurrencies.

If everything looks okay, go ahead and confirm your swap.

Confirm Swap
Confirm Swap
Waiting for confirmation
Waiting for confirmation

Next in order to make this transaction, there will be a gas fee that you may have to pay. The average gas fee is right around $9.

Gas Fees
Gas Fees

This would give me a total of 25 that I’d have to be paying 16 to swap from Ethereum to Chainlink and then 9.45 to pay as a fee for demonstration purposes. I will go ahead and confirm this transaction.

Confirm Transaction
Confirm Transaction

and the Chainlink should show up in my account. It will then say transaction submitted.

Transaction submitted
Transaction submitted

In the right-hand corner, you can see that my transaction is pending.

Pending Transaction
Pending Transaction

If you Click on transaction pending. You will then be able to see your swap for Chainlink on etherscan as soon as it appears.

Recent Transaction
Recent Transaction

You can see on etherscan that it’ll take approximately 5 to 6 minutes for this transaction to be made.

Etherscan
Etherscan

This is because the network is currently a little bit more congested on Ethereum. You can see the total value of Ethereum that I’m swapping the transaction fee cost and the gas price in Gwei.

Gas Price in Gwei
Gas Price in Gwei

If you’ve done everything correctly, you will see a successful transaction as you can see.

Transaction successful
Transaction successful

Now I have 1 Chainlink in my wallet.

Chainlink Balance

Now if I ever wanted to trade back my Chainlink for Ethereum, all I would need to do is click 1 Chainlink and it would trade me back for my Ethereum as you can see.

Click on 1 Chainlink
Click on 1 Chainlink

I can get a better price using version 2. so I will go ahead and click on this button.

Get a better price on V2
Get a better price on V2

As you can see the amount of Ethereum that I’ll be receiving actually went up.

Amount of Ethereum
Amount of Ethereum

You then will have to allow Uniswap protocol to use your Chainlink. Go ahead and click this button.

Allow Uniswap
Allow Uniswap

Now you may have to pay a small transaction fee to allow Uniswap to trade back your chain link for Ethereum. Go ahead and click Confirm.

Confirm Transaction
Confirm Transaction

Once this is confirmed, you will then be able to swap your Chainlink back for Ethereum or any other erc20 token that you’re looking to swap for.

Swap back
Swap back

How To Use The Pools With Uniswap

Now, let me share with you how to use the pools with Uniswap and add liquidity. If you want to learn more about how to provide liquidity you can simply click the Pool button.

Pool Button
Pool Button

In Uniswap v3 LPs can concentrate their capital within a custom price range providing greater amounts of liquidity at desired prices. Here’s how you provide liquidity on Uniswap.

Pools Overview
Pools Overview

Step 1 — Select a Pair

The first step is to select a pair in which you want to provide liquidity. Any pair of erc20 tokens are valid but each pair has different characteristics. You may wish to consider factors such as TVL, trading volume and the assessment of the risk of the token prices diverging in the future.

Select a Pair
Select a Pair
Select a Pair
Select a Pair
Select a Pair
Select a Pair

Step 2- Reviewing The Fee Tier

Once you’ve selected your pair of tokens. The next step is to select the right fee tier. Every pair of tokens offers three fee tiers.

Reviewing The Fee Tier
Reviewing The Fee Tier

0.05% is a fee to your best for stable coins. This is where LPs take on minimal risks in the pools and the traders expect to pay minimal fees.

0.05% Fee Tier
0.05% Fee Tier

Next is the 0.3% fee tier. This is best for most pairs. The 0.30 fee tier is best suited for less concentrated token pairs such as the ETH-DAI token pair which are subject to significant price movements. Both on the upside and to the downside. The higher fee is more likely to compensate liquidity providers for the greater price risk that they take on relative to the stable coin.

0.3% fee tier
0.3% fee tier

LPs and the 1.0% fee tier are best for exotic pairs. The 1.0% fee tier is designed for exotic assets where the LPs can take on extreme price risk. An example would be Ethereum and GTC. Relevant assets are those that are particularly subject to monotonic price movements.

1.0% fee tier
1.0% fee tier

Step 3 — Setting your price range

Step 3 is going to be setting your price range. You will then need to choose the price range in which you would like to provide liquidity. When making a price range decision, you should consider the degree to which you think prices will move over the course of a position’s lifetime. You should also consider your willingness to actively manage the position as the market evolves and the economics or transactions required to actively manage a position.

Setting your price range
Setting your price range

If the price does move outside your specific range then your position will be concentrated on one of two assets and you will not earn trading fees until the price return to that range. Here’s how concentrated liquidity works.

concentrated liquidity
concentrated liquidity
concentrated liquidity
concentrated liquidity
concentrated liquidity
concentrated liquidity
concentrated liquidity
concentrated liquidity
concentrated liquidity
concentrated liquidity

You can see that liquidity is concentrated between these ranges and if the trading actually goes outside these ranges you will not be guaranteed any fees. You can see that you have custom control to control which range you ultimately want to provide liquidity.

Set Price Range
Set Price Range

For next, you will need to deposit equal amounts of the two tokens in order to provide the liquidity you will then need to add and approve the first transactions and once that is done.

Add Liquidity
Add Liquidity

Congratulations! you now have created your LP tokens. Now that you know how to swap on Uniswap and also provide liquidity.

Uniswap Analytics

Let me share with you some more analytics so that you understand how Uniswap works even better if you go to info.uniswap.org.

info.uniswap.org
info.uniswap.org

Click on the tokens tab. You can see a variety of different token lists that are available on Uniswap. You can also find more statistics and analytics here.

Tokens Tab
Tokens Tab
List of Tokens
List of Tokens

Here you can see a complete overview of all the different token pairs, tokens and analytics. If you go to the overview tab here’s what you will see right at the beginning, you will see the name of the top tokens, their current price, their price change, the volume and their total volume.

Overview Tab
Overview Tab

If you then scroll down you will be able to see the top pairs. Right now the USDC/ETH pool is your top pair with the most liquidity followed by WBTC/ETH, ETH/USDT, USDC/USDT and many others.

Top Pools
Top Pools

You will then be able to see all of the different transactions that are happening in real-time on Uniswap. If you click on the pools tab here you will be able to see all the different pools again.

Pools Tab
Pools Tab

Now let’s say your pool is not being shown on the pools list. You can search for pools or tokens up here in the right-hand corner. Let’s say I wanted to search for the HEX pair. You can see that there are HEX/USDC, HEX/ETH and HEX/DAI.

HEX Pairs
HEX Pairs

There are also other pools that you can trade to buy HEX on Uniswap but the most liquid pair is the USDC pair.

We can see that in the last 24 hours 5.61 million has been traded in volume and the total value locked is more than 18.16 million.

HEX/USDC
HEX/USDC

The HEX/ETH pair has 7.35 million in volume and the total value locked is 8 million.

HEX/USDC
HEX/ETH pair

The HEX/DAI pair has only 953 dollars in volume and only 23 thousand dollars in total value lock.

HEX/DAI pair
HEX/DAI pair

So if you are making big transactions the top pool with the most liquidity is most likely going to be your best option. this means in order to receive hex coins you’re going to need USDC coins and this means if you wanted to trade out of your HEX coins you would be receiving USDC coins.

Now if you click on the tokens tab you can see all the different tokens and you can also see the top movers.

Tokens Tab
Tokens Tab

You can also scroll down and see some of the most popular tokens on Uniswap today. Again you can also search for the different pool tokens.

I hope you have completely learnt in this step-by-step Uniswap V3 tutorial how to use Uniswap V3 for trading & yield farming. Follow me on LinkedIn to stay connected → https://www.linkedin.com/in/ishanshahzad/

--

--