How To Use Uniswap V3 For Trading & Yield Farming
Step By Step Uniswap V3 Tutorial
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.
Download the chrome extension.
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.
You can also buy it directly on your Metamask with your credit card now.
Once your Ethereum or any other erc20 token is in your Metamask wallet, you’re ready to use Uniswap.
Let me walk you through the entire interface here.
How Uniswap Works
First to get you more familiar with how Uniswap works.
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.
If you click on the documents button,
It will take you to Uniswap’s documents.
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
You can see that there are a lot more updates and new products being updated here on Uniswap.
If you have any questions, you can always click the FAQ button
and you can have your questions answered by the FAQ.
The Uniswap protocol empowers developers, liquidity providers and traders to participate in a financial marketplace that is open and accessible to all.
It also 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.
If you want to learn more about their guide's references and more, go ahead and click Developer Docs
and it will take you to the 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 also has its very own token called the UNI token. The UNI token is the Uniswap protocol token and it is now live.
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.
Swapping Tokens On Uniswap
Now let’s go ahead and start swapping for some tokens.
First, click on the 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.
Connect Coinbase wallet.
I will be connecting with Metamask.
After you’ve connected, you can see your balance in Ethereum.
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.
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.
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.
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.
I can go ahead and click on the button here. Then, I can go and find the 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.
After that, I will head back to the Uniswap interface here is where I will paste in the contract address.
As you can see link pops up and you can see that it is now active.
Now, let’s say I wanted to trade some of my Ethereum for some 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.
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.
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.
Now the maximum I will send is 0.007658 Ethereum and my slippage tolerance is 0.10%.
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.
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%
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.
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
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.
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.
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.
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.
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.
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.
and the Chainlink should show up in my account. It will then say transaction submitted.
In the right-hand corner, you can see that my transaction is pending.
If you Click on transaction pending. You will then be able to see your swap for Chainlink on etherscan as soon as it appears.
You can see on etherscan that it’ll take approximately 5 to 6 minutes for this transaction to be made.
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.
If you’ve done everything correctly, you will see a successful transaction as you can see.
Now I have 1 Chainlink in my wallet.
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.
I can get a better price using version 2. so I will go ahead and click on this button.
As you can see the amount of Ethereum that I’ll be receiving actually went up.
You then will have to allow Uniswap protocol to use your Chainlink. Go ahead and click this button.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
The HEX/ETH pair has 7.35 million in volume and the total value locked is 8 million.
The HEX/DAI pair has only 953 dollars in volume and only 23 thousand dollars in total value lock.
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.
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/
Also Read,