Uniswap V3 hands-on tutorial for the first time: a new market-making experience
区块律动BlockBeats
2021-05-06 08:23
本文约4521字,阅读全文需要约18分钟
Bring you the first-time hands-on experience.

The Uniswap V3 version was officially launched in the early morning of May 6, Beijing time. Since the user interface and market-making logic of the new version have undergone major changes compared with the V2 version, many users have reported that the operational complexity of providing liquidity in V3 has greatly increased. In order to better help users understand the interaction logic of the new version, Rhythm BlockBeats will take you through the experience step by step in this article, and provide users with the first-time hands-on tutorial.

How to trade in V3

Open the official website link address, the first thing that pops up is still familiar with the exchange interface:

It can be seen that for users who just want to execute transactions, the new version of the user interface has almost no changes on the front end compared to the previous version. However, it can be known from the prompt at the arrow in the lower left corner that at this time, the user conducts transactions again, and the fund pool used behind has been switched to the new V3 version by default.

Of course, since many fund pools of the V3 version have just been established, the trading prices and slippage provided by some trading pairs are not as advantageous as the V2 version. So when this happens, the interface will automatically provide a switch button at the bottom left, and the user can switch to the V2 version of the fund pool with one click to obtain the best transaction price.

How to provide liquidity in V3

(1) How to choose different transaction fee rate fund pools

Let's start with the user interface. Click the Pool button at the top of the interface to switch to the fund pool interface.

The upper left is a link to the official introduction document, so I won’t introduce too much here.

On the right side is the detailed information of the current top 200 capital pools, and you can browse the timely data information of mainstream trading pairs.

Click to enter the following interface:

The leftmost part of the interface displays the specific trading pairs of the fund pool. Behind the name of the trading pair, the transaction fee rate corresponding to the fund pool of this trading pair is displayed. It should be noted here that since the V3 version provides three different rates of 0.05%, 0.3%, and 1%, resulting in the same transaction pair, three fund pools with different rates can be established in V3.

So, how should users choose different fund pools to provide liquidity?

For example, as can be seen from the figure below, at least two fund pools have been created for the USDC/USDT trading pair in V3, one with a fee rate of 0.05% and the other with a fee rate of 1%. It can be seen that since USDC/USDT is a stable currency trading pair, LP basically does not need to bear too much risk of impermanent loss, so trading users will be more inclined to choose a fund pool with a low fee rate for trading, and LP in order to earn more If there are more handling fees, it will be more inclined to provide liquidity in a more concentrated pool of funds for traders.

So we see that a pool with a fee rate of 0.05% is much better than a pool with a fee rate of 1%, both in terms of TVL and 24-hour trading volume. Here I would like to remind the majority of users that when providing liquidity, be sure to choose a fund pool with a larger TVL and trading volume, so as to prevent the liquidity provided by yourself from being idle in an inactive fund pool and miss the opportunity to obtain income.

So, for different trading pairs, how to choose the fee rate to effectively avoid funds being idle?

Let's take a look at this timely ranking list provided by TVL.

It can be seen that for any trading pair with stablecoins on both sides, the top-ranked fund pool is undoubtedly the fund pool with the lowest fee rate of 0.05%. And as long as a currency with large price fluctuations is involved in the transaction pair, the top-ranked ones are the intermediate rate tiers of 0.3% handling fee. It can be seen that for trading pairs of fluctuating coins, LPs need to obtain higher fee income to make up for the impermanent losses they suffer in market making. However, due to the relatively stable price of stablecoin trading pairs, LP suffers less impermanent losses, which leads to a more competitive advantage for trading pairs with lower fees. (The highest rate level of 1% is mainly applied to some new coins or altcoins, etc. Due to the huge price fluctuations, it is necessary to give the market-making LP a higher fee rate to make up for the impermanent losses caused by its market-making. )

(2) How to add liquidity

Go back to the Pool interface just now, click the New Position button on the upper right to enter the interface for adding liquidity.

Step 1: Select the trading pair you want to add liquidity to at the top

Here we choose to add the fund pool of USDC/ETH trading pair.

Step 2: Choose the rate of the fund pool

Here, we follow the tips below. For non-stable currency trading pairs, generally choose the middle gear, and add liquidity to the fund pool with a fee rate of 0.3%.

Step 3: Choose the price range for market making

Here we should note that the V3 version of the system does not support LP to input any price when selecting a price range.

Since the V3 version provides the liquidity aggregation function, the calculation amount is greatly increased compared with the V2 version. Therefore, in order to minimize the calculation process in the transaction and reduce the gas fee that traders need to pay, the V3 version artificially divides the complete price range that was originally optional into different price points.

Taking a fund pool with a fee rate of 0.3% as an example, the minimum price change unit is 0.6% of the adjacent price point as the minimum change range. For example, after the price point of 3401.6USDC, it is 3422.1USDC (3401.6*(1+0.6%)). Fund pools with different fee rates will correspond to different minimum change ratios. For example, for a fund pool with a 0.05% rate, the minimum price change ratio is 0.1%, while for a fund pool with a 1% rate rate, the minimum price change rate is 2%.

But users don’t need to worry here, as long as we enter the price we want, the system will automatically adjust the price you entered to the nearest optional price point for you. If you are not satisfied, just click the pink button below to make fine adjustments. Here we choose to enter 3165.3USDC and 3590.3USDC as our market-making range.

Step 4: Select the deposit amount of the market-making currency

Note that this is the most confusing place, because in the Uniswap V3 version, the market value ratio of the two tokens that LP needs to provide for market making is no longer a simple 50/50 ratio. So, what will determine how much USDC and how much ETH LP needs to provide for market making?

Here, we should pay attention to the following three important parameters:

1. The lower limit of the market-making range (Min Price)

2. The upper limit of the market-making range (Max Price)

3. The current market price of the trading pair (Current Price)

In the end, the proportion of ETH and USDC that LP needs to provide is completely determined by the above three parameters. In more professional terms, the ratio of ETH to USDC finally provided by LP is a function of three variables: the lower limit of the market-making range, the upper limit of the market-making range, and the spot price. Among them, since the spot price is completely determined by the market, users cannot adjust it. Therefore, for LP, only by adjusting the range of the price range can it affect the proportion of the final provided currency.

For a more intuitive display, we illustrate this problem through experiments.

The current market price of ETH is 3490USDC, the lower limit of the price range is 3165.3USDC, and the upper limit is 3590.3USDC. At this time, if we have 1 ETH in our hands to make a market, how much USDC should we provide at the same time?

We only need to enter 1 in the ETH deposit amount below, and the system will automatically calculate the corresponding amount of USDC that needs to be provided for us (see the figure below). It can be seen that the market value of the two currencies, one is $3,491 and the other is $11,252, which is no longer the ratio of 1:1 in the original V2 version.

Of course, we can also input the amount of USDC and let the system automatically calculate the amount of ETH. It can be seen that although the quantity of the two currencies has changed, the relative ratio has not changed. Therefore, once we have determined the three key parameters mentioned earlier, the lower limit of the market-making range, the upper limit of the market-making range, and the spot price. Then the relative ratio of ETH to USDC has been fixed. If users want to adjust this ratio, they can only do so by adjusting the market-making price range.

(3) Special circumstances: market making in a price range other than the spot price

In the example given above, we have chosen a price range that is on both sides of the spot price. But what happens if the LP chooses a market-making price range well above the current spot price?

We set the lower limit of the market-making price range to 4023.8USDC, the upper limit to 5024USDC, and the spot price is still 3490USDC.

At this time, we can see that a line of small yellow characters appears below the spot price in the above picture, reminding users that they may not be able to earn commission income if they make markets within this range. But it doesn’t matter, LP can still provide liquidity in this price range, and maybe ETH will rise to more than $4,000 tomorrow.

It should be noted here that in this case, the market-making funds we provide are no longer composed of two currencies.

First look at the screenshot below, we still enter 1 ETH to be provided. At this time, you can see that the place where the amount of USDC will be automatically returned has become a small lock. At this time, users must not think that they have done something wrong, and it is not because you have not authorized the transaction pair. This is simply because the market-making price range is completely higher than the spot price, so users only need to provide a single currency to complete the market-making.

Yes, when the lower limit of the market-making price range is completely higher than the spot market price, LP only needs to provide a single currency ETH to make the market. And when the market-making price range is completely lower than the spot market price, LP also only needs to provide a single USDC to complete the market-making.

See the figure below for details. At this time, as long as you have enough USDC tokens in your wallet, you can enter any amount of USDC to make a market without caring about the amount of ETH.

How to build range orders

Range Order (Range Order) is a new function introduced in V3 version. The new range order can simulate to some extent the limit order function in the traditional order book trading platform. Assuming that the user has 10 ETH in his hand and plans to sell it for USDC to take profit when the price rises to 4000 USD, then he should operate as follows:

1. Choose to provide liquidity in the ETH/USDC fund pool, and the fee rate is 0.3% of the largest fund size.

2. Try to keep the upper and lower limits of the market-making price range around 4000USDC

(Since the nearest optional price point above 3999.8 is 4023.8 (3999.8*1.006=4023.8), here we choose 3999.8-4023.8 as the market-making price range)

3. Enter the deposited amount at the Deposit Amounts below: 10ETH

4. Click the bottom button to execute the transaction

(Because there is not so much ETH in the account of Rhythm BlockBeats, I can't show you the screenshot here...)

If the user successfully completes the above steps, then when the price of ETH rises to $3999.8, the 10 ETH positions he deposited will start to be converted into USDC. When the price rises above $4023.8, the user's position will be All are converted to USDC. At this time, if the user withdraws liquidity immediately, it is equivalent to automatically executing a take-profit sell order with a price approximately equal to 4011.78 US dollars through Uniswap V3.

For a detailed analysis of range orders, please refer to the articles published by Rhythm:"Is a range order a limit order? | Uniswap V3 New Feature Analysis Series II》

LP Token NFT

In order to help users better understand the new form of NFT Token. Rhythm is trying to provide some liquidity to the ETH/USDC fund pool, and the Gas is nearly 100 knives. Since there are no more USDC tokens in the account, we chose a market-making range that is higher than the spot market price, with a lower limit of 4000USDC and an upper limit of 4994USDC. At this time, we can conduct market making in ETH single currency.

The display interface of NFT is also very cool. The name of the trading pair is displayed on the top of the interface: ETH/USDC, and the fee rate of the fund pool is below: 0.3%. The ID number displayed in the lower left corner of the NFT card is 3045, and Rhythm Guess is a ranking based on the time when users provide liquidity. It is said that the first 100 users who provide liquidity to each new fund pool may get a rare logo of a small sun in the lower right corner of the card, which Rhythm has not yet experienced.

The number of tokens contained in this part of the market-making position is displayed on the upper right side of the interface. It can be seen that the amount of USDC is 0, and the current position is all composed of ETH. It is indicated in orange font right above the interface that the current ETH spot price is not within the market-making price range selected by Rhythm. Therefore, the unclaimed handling fee displayed on the lower right is also 0.

secondary title

How to browse the fund pool data in V3

Still take the USDC/ETH (0.3% handling fee) trading pair as an example. It can be seen that the interface shows in detail the latest transaction volume, lock-up data, and recent transaction records of this fund pool. These are not much different from those in the V2 version, and will not be explained in detail here. Users need to pay attention to the Liquidity section indicated by the arrow in the upper right corner of the interface.

We click on the link to see the liquidity distribution display page below.

This page shows the liquidity of the fund pool and its distribution in different price ranges. We move the mouse to the highest point of the curve at the arrow. It can be seen that at the current price point of 3463.3623USDC/ETH, the liquidity is the most concentrated. This is also highly correlated with the ETH price of the day. It can be seen that LP provides the most liquidity near the spot price of the day, which also means that traders trading near this price point can enjoy lower slippage.

区块律动BlockBeats
作者文库