Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Creating a Uniswap Liquidity Pool on Testnet

Hello! Welcome to the next lesson in our journey to build a tradable cryptocurrency.

In the previous lesson, we established the foundational theory behind decentralized markets. You learned what liquidity pools are, the vital role of liquidity providers (LPs), and how LP tokens act as a receipt for their deposited assets. We saw that for a token to have any trading life, it needs a market, and that market is a liquidity pool.

Today, we move from theory to practice. This lesson is all about taking the ERC-20 token you've designed and giving it its first marketplace. You will learn how to use the Uniswap dApp, the largest decentralized exchange on Ethereum, to create a new liquidity pool on a testnet. This is a crucial milestone, as it's the step that makes your token tradable and gives it a discoverable price.

By the end of this lesson, you will have created your token's very first market.

1. Preparation: What You'll Need

Before we dive into the Uniswap interface, let's make sure you have everything ready. This process takes place on a testnet, so there's no real money at risk. You will need:

  • MetaMask: Your wallet should be installed and connected to an Ethereum testnet (e.g., Sepolia).
  • Testnet ETH: You need a small amount of testnet ETH to pay for transaction gas fees. You should already have some from previous lessons.
  • Your ERC-20 Token Address: In Module 4, you deployed your own ERC-20 token to a testnet. Please locate the contract address for that token. We will be creating a market for it.

2. The Uniswap Interface: Creating the Pool

We will be using Uniswap v3, the latest version of the protocol. A key feature of v3 is concentrated liquidity, which we will discuss as we go. It allows liquidity providers to be much more efficient with their capital.

Let's walk through the process step-by-step. The following article provides an excellent textual and visual guide to the entire process. We will follow its structure.

How To Create A New Token And Uniswap Liquidity Pool

The article 'How To Create A New Token And Uniswap Liquidity Pool' by James Bachini provides a direct, step-by-step walkthrough of creating a liquidity pool on the Uniswap web interface. We will use this as our primary guide.

Please read the section 'How To Set Up A Uniswap Liquidity Pool'. Focus on the sequence of actions: connecting your wallet, navigating to the 'Pool' section, and the initial setup steps. We will break down each configuration step next.

Now, let's break down the configuration of your new liquidity pool, which involves four main decisions.

Step 1: Select the Token Pair

First, go to the Uniswap App.

  1. Connect your MetaMask wallet in the top-right corner. Ensure you are on the correct testnet (e.g., Sepolia).
  2. Navigate to the Pool tab in the top menu.
  3. Click the + New Position button.
Uniswap 'Pools' Interface for Creating a New Liquidity Position
This image shows the starting point on the Uniswap 'Pools' page where you'll click '+ New Position' to begin creating your liquidity pool.

You'll now be asked to select the pair of tokens for your pool. A liquidity pool always consists of a pair of assets. For a new token, it's standard practice to pair it against a well-established asset like ETH (or WETH on a testnet) or a major stablecoin (like USDC).

  • Select the first token: Choose WETH (Wrapped Ether).
  • Select the second token: Your token won't appear in the default list. Paste your ERC-20 token's contract address into the search bar. You'll see a prompt to "import" it. This is normal for new, unlisted tokens.

Step 2: Set the Fee Tier

Uniswap v3 isn't a one-size-fits-all protocol. It allows pools to be created with different fee tiers, which determine how much traders pay for swaps. The fee you choose should reflect the expected volatility of the pair.

  • 0.05%: Best for very stable pairs, like two stablecoins (e.g., USDC/DAI).
  • 0.30%: The most common tier, suitable for less correlated but still established pairs (e.g., ETH/USDC).
  • 1.00%: Best for new or "exotic" tokens where high price volatility is expected. Liquidity providers take on more risk with these pairs and are compensated with higher fees.

For your new token, starting with the 0.30% or 1.00% tier is a reasonable choice.

Step 3: Set the Initial Price and Price Range

This is the most critical and innovative part of Uniswap v3.

Initial Price: Since you are the very first person to provide liquidity for this token pair, you set the initial price. This is the opening market rate for your token. For example, you might decide that 1 WETH = 10,000 of your tokens.

Price Range (Concentrated Liquidity):
In older AMMs, liquidity was distributed along an infinite price curve. This meant much of the capital sat unused unless there were extreme price swings. Uniswap v3 allows you to concentrate your liquidity within a specific price range.

  • Benefit: By providing liquidity only in the range where most trading occurs, you can earn significantly more fees with the same amount of capital.
  • Risk: If the token's price moves outside your specified range, your position becomes inactive, and you stop earning fees until the price moves back into your range.

When launching a new pool, it's often wise to set a wide price range initially, as you don't know how the market will value your token. Once the price has stabilized, you or other LPs can create new positions with tighter, more efficient ranges.

Set your starting price, and then choose a minimum and maximum price for your liquidity range.

Step 4: Specify Deposit Amounts

After you set the price and range, you need to deposit the assets. You only need to enter the amount for one of the tokens (e.g., 0.1 WETH), and the Uniswap interface will automatically calculate the required amount of your token based on the price you set.

Remember from our last lesson, you must deposit an equal value of both tokens.

Uniswap Add Liquidity Interface for AAVE/ETH Pair
An example of the 'Add Liquidity' interface, showing the selected tokens, fee tier, price range, and deposit amounts. Your interface will look similar but with your token and chosen values.
Test your understanding!

You are creating the first liquidity pool for your new token, MYT, paired with WETH. You decide the initial price should be 1 WETH = 5,000 MYT.

If you decide to deposit 0.5 WETH into the pool, how many MYT will you also need to deposit?

Show answer

You will need to deposit 0.5 * 5,000 = 2,500 MYT. The protocol requires you to supply an initial value ratio that matches the price you are setting.

3. Approving and Creating the Pool

With all the parameters set, you're ready to create the pool. This involves two separate blockchain transactions you'll need to confirm in MetaMask.

  1. Approve Token Spend: You must first grant the Uniswap router contract permission to withdraw your ERC-20 tokens from your wallet. This is a standard security measure in DeFi. Click the "Approve" button and confirm the transaction in MetaMask.
  2. Add Liquidity: After the approval transaction is confirmed, the "Add" (or "Preview") button will become active. Clicking this will execute the final transaction, which transfers your WETH and your tokens into the new liquidity pool contract.

The following video provides a concise visual walkthrough of this user interface flow.

How To Create A New Token & Uniswap Liquidity Pool

This segment from the video 'How To Create A New Token & Uniswap Liquidity Pool' demonstrates the UI steps we've just discussed, from selecting the token to approving the spend and adding liquidity.

Watch from 11:26 to 13:21. Note that the video uses the Ropsten testnet, which is now deprecated, but the Uniswap UI flow remains the same on current testnets like Sepolia. Focus on the sequence of clicks and MetaMask confirmations to approve and create the pool.

Once your second transaction is confirmed on the blockchain, congratulations! You have successfully created a liquidity pool. Your token is now officially tradable on the Uniswap testnet. You can see your active position on the "Pool" page, which is represented as an NFT.

Conclusion

In this lesson, you took a significant practical step in your project's lifecycle. You bridged the gap between merely having a token contract and creating a live, functioning market for it.

Key Takeaways:

  • Creating a liquidity pool on Uniswap is a permissionless process anyone can do.
  • The key steps are: selecting a token pair, choosing a fee tier, setting the initial price and price range, and depositing an equal value of both assets.
  • Uniswap v3's concentrated liquidity allows for much higher capital efficiency but requires you to manage your price range.
  • The process requires two transactions: one to approve your token for spending by Uniswap and a second to add the liquidity.

Preview of the Next Lesson:
Providing liquidity is a powerful way to enable a market and earn fees, but it's not without risk. The most unique and often misunderstood risk for liquidity providers is something called impermanent loss. In our next lesson, we will dissect this concept, so you understand the potential downsides and financial considerations of being a liquidity provider.

Can't find a good explanation? Sign up and we'll make it for you

Sign up