How to use SunSwap V3?

I. SunSwap V3 Overview

SunSwap V3 utilizes concentrated liquidity to boost capital efficiency, allowing users to add liquidity by customizing the token pair, fee tier, and price range. As trading fees collected within the price range are allocated in proportion to the amount of liquidity contributed, investors need to find a reasonable range for their liquidity in order to maximize their gains.

1.1 Limitations of SunSwap V2

SunSwap V2 uses the classic constant product model, expressed as x * y = k. Here, x and y represent the respective reserve balance of the tokens involved (tokenA and tokenB). Their product, denoted as k, remains constant. When trading tokenA for tokenB, users deposit their tokenA into the contract and receive a corresponding amount of tokenB in exchange. As a result, the product of x and y remains unchanged no matter how many trades have been executed. The price curve is illustrated below:

The horizontal axis represents the reserve balance of tokenA, the vertical axis represents the reserve balance of tokenB, and the green curve reflects the price change of the pool. Given the indexes above, we can draw a green block that stands for the product of the quantity of tokenA and tokenB, and a red line that indicates the price of tokenA. When the price of tokenA/tokenB remains relatively stable, the major chunk of the market’s volume will fall within the price range represented by the orange block, which means the funds indicated by the green block are not put into good use.

To improve the capital efficiency of the pools, a concentrated liquidity model SunSwap V3 has been redesigned based on SunSwap V2.

1.2 Concentrated liquidity model

SunSwap V3 adopts a concentrated liquidity model based on constant product, introducing the idea of virtual liquidity to SunSwap V2. The formula for this market maker model is the following:

(x + x_virtual)(y + y_virtual)= L^2* Formula 1

It is clear from the mechanism of concentrated liquidity that x_virtual and y_virtual correlate with p_upper and p_lower. The formula for the concentrated liquidity model can then be derived as the following:

(x + L / √p_upper (y +L√p_lower) = L^2 Formula 2

1.3 Price range and fee

SunSwap V3 enables users to choose the price range their liquidity is added to, which spans from p_lower to p_upper in Formula 2. According to Formula 2, a user’s price range should cover the current price, and the narrower the range, the more efficient the user’s funds and the higher the return; conversely, the wider the price range, the less efficient the user’s funds. Users of SunSwap V3 are encouraged to select an appropriate price range to effectively manage the trade-off between risks and returns.

SunSwap V3 offers four tiers of fee rates, allowing users to customize pools for tokens with different levels of risk. The use case for each fee tier is outlined below. Liquidity providers are advised to choose pools based on the type of tokens they hold.

Fee Rate Use Case
0.01% For stablecoins in large amounts
0.05% For tokens with lower price volatility
0.3% For the majority of tokens
1% For tokens with greater price volatility

II. Instruction Manual

You can refer to the V3 section in the Liquidity Pool.

1 Like