Squart

The square root perpetual

We introduce square root perpetual (Squart), a financial product that enhances trading strategies and risk management. Squart redefines perpetual futures by not having a strike price, yet it carries gamma exposure like options, addressing liquidity fragmentation in gamma trading. Squart is fully covered by Uniswap V3 LP positions. This section explains how Squart is covered by Uniswap V3 LP positions.

Prerequisite: We assume that you own the Uniswap V3 LP position as an asset and can borrow it.

The Relationship between the Value of Uniswap V3 LP Position and the square root of the price

First, let's confirm that the value of a Uniswap V3 liquidity provider (LP) position can be represented by the following formula [2]:

Here, pap_a represents the lower price of the Uniswap LP position, pbp_b represents the upper price, and x is expressed as the current price of Token0 in terms of Token1.

To make it easier to understand, let's assume Token0 is ETH and Token1 is USDC.

V(x)={x(LpaLpb)for x<pa,2LxLpaxLpbfor pa<xpbLpbLpafor pbx      \begin{equation} V(x)= \begin{cases} x(\frac{L}{\sqrt{p_a}}-\frac{L}{\sqrt{p_b}}) & \text{for $x<p_a$,} \\ 2L\sqrt{x}-L\sqrt{p_a}-x\frac{L}{\sqrt{p_b}} & \text{for $p_a<x≤p_b$} \\ L\sqrt{p_b}-L\sqrt{p_a} & \text{for $p_b≤x$} \end{cases} \ \ \ \ \ \ \end{equation}
Delta of V(x)=V(x)x={(LpaLpb)for x<pa,(LxLpb)for pa<xpb,0for pbx     \begin{equation} Delta \ of \ V(x)= \frac{\partial V(x)}{\partial x}= \begin{cases} (\frac{L}{\sqrt{p_a}}-\frac{L}{\sqrt{p_b}}) & \text{for $x<p_a$,} \\ (\frac{L}{\sqrt{x}}-\frac{L}{\sqrt{p_b}}) & \text{for $p_a<x≤p_b$} ,\\ 0 & \text{for $p_b≤x$} \end{cases} \ \ \ \ \ \end{equation}
Gamma of V(x)=2V(x)(x)2={0for x<pa,12Lp3/2for pa<xpb,0for pbx\begin{equation} Gamma \ of \ V(x)= \frac{{\partial}^2 V(x)}{(\partial x)^2}= \begin{cases} 0 & \text{for $x<p_a$,} \\ -\frac{1}{2}\frac{L}{p^{3/2}} & \text{for $p_a<x≤p_b$} ,\\ 0 & \text{for $p_b≤x$} \end{cases} \end{equation}

Here, we define the quantities of Token 0 and Token 1 as equation (4) as follows.

(Amounttoken0,Amounttoken1)=(L1pb,Lpa)\begin{equation} (Amount_{token0}, Amount_{token1})=(L\frac{1}{\sqrt{p_b}}, L{\sqrt{p_a}}) \end{equation}

By adding equation (4) to equation (1), which represents the value of the Uniswap LP position, we create a position with a value of 2√x. In Squart, by combining asset borrowing/lending with the Uniswap LP position, the value of 2√x is maintained even when the range shifts.

(1)+(4)=L(2xpaxpb)+(Lxpb+Lpa)=2Lx\begin{equation} (1)+(4) = L(2\sqrt{x}-\sqrt{p_a}-\frac{x}{\sqrt{p_b}}) + (L\frac{x}{\sqrt{p_b}}+L\sqrt{p_a}) = 2L\sqrt{x} \end{equation}

However, these equations are valid only when the price x is within the LP range. We will explain range switching in the next chapter.

Switching Price Ranges in Uniswap V3 Liquidity Provider Positions

Let the initial LP Price range be denoted as pa1p_{a_1}and pb1p_{b_1}. The 2x2\sqrt{x} configuration can be derived from equation (5) as follows:

L(2xpa1xpb1)+(Lxpb1+Lpa1)=2Lx\begin{equation} L(2\sqrt{x}-\sqrt{p_{a_1}}-\frac{x}{\sqrt{p_{b_1}}}) + (L\frac{x}{\sqrt{p_{b_1}}}+L\sqrt{p_{a_1}}) = 2L\sqrt{x} \end{equation}

When the range is set as pa2p_{a_2}and pb2p_{b_2}, the configuration is as follows.

L(2xpa2xpb2)+(Lxpb1+Lpa1)=2Lx\begin{equation} L(2\sqrt{x}-\sqrt{p_{a_2}}-\frac{x}{\sqrt{p_{b_2}}}) + (L\frac{x}{\sqrt{p_{b_1}}}+L\sqrt{p_{a_1}}) = 2L\sqrt{x} \end{equation}

Equations (6) and (7) must be satisfied within the range.

V(x)={2LxLpaxLpbfor pa<x<pb,\begin{equation} V(x)= \begin{cases} 2L\sqrt{x}-L\sqrt{p_a}-x\frac{L}{\sqrt{p_b}} & \text{for $p_a<x<p_b$} ,\\ \end{cases} \end{equation}

Additionally, the change from equation (6) to equation (7) can be represented as follows.

(6)(7)=L(xpb1xpb2)+L(pa1pa2)\begin{equation} (6)-(7) =L(\frac{x}{\sqrt{p_{b_1}}}-\frac{x}{\sqrt{p_{b_2}}}) + L(\sqrt{p_{a_1}}-\sqrt{p_{a_2}}) \end{equation}

Equation (9) holds for any arbitrary n and n-1 states. Therefore, we should adjust by borrowing or lending the token amount in equation (10) during each rebalance.

Δ(Amounttoken0,Amounttoken1)=(L(1pbn11pbn),L(pan1pan))\begin{equation} \Delta(Amount_{token0}, Amount_{token1})=(L(\frac{1}{\sqrt{p_{b_{n-1}}}}-\frac{1}{\sqrt{p_{b_n}}}) , L(\sqrt{p_{a_{n-1}}}-\sqrt{p_{a_n}})) \end{equation}

What we aim to do is to maintain Squart at 2√x by adjusting the offset during rebalances. Equation (11) represents the LP position after the n th rebalance. Equation (12) represents the position created through borrowing and lending from the lending pool. When combined, they amount to 2√x.

V(x)=L(2xpanxpbn)\begin{equation} V(x)= L(2\sqrt{x}-\sqrt{p_{a_n}}-\frac{x}{\sqrt{p_{b_n}}}) \end{equation}

(Amounttoken0,Amounttoken1)=(L1pbn,Lpan)\begin{equation} (Amount_{token0}, Amount_{token1})=(L\frac{1}{\sqrt{p_{b_n}}}, L{\sqrt{p_{a_n}}}) \end{equation}
(10)+(11)=2Lx\begin{equation} (10)+(11)= 2L\sqrt{x} \end{equation}

However, these processes are only valid when the price x is within the LP range. The following explains how to handle situations when the price is outside the range.

Handling Cases When Falling Outside the Range

This section explains the process when the timing to switch ranges has already reached the following state due to price changes.

V(x)={x(LpaLpb)for x<pa,LpbLpafor pbx\begin{equation} V(x)= \begin{cases} x(\frac{L}{\sqrt{p_a}}-\frac{L}{\sqrt{p_b}}) & \text{for $x<p_a$,} \\ L\sqrt{p_b}-L\sqrt{p_a} & \text{for $p_b≤x$} \end{cases} \end{equation}

Exceptional handling is necessary when it occurs after the LP position has fallen outside the range. We consider each case below.

Switching to a normal state from the upper side of the range

Switching from a State pbn1<xp_{b_{n-1}} < x to a range that satisfies the state pan<xpbnp_{a_{n}}<x≤ p_{b_{n}}

From equation (14), we have the following case:

V(x)={Lpbn1Lpan1for pbn1x\begin{equation} V(x)= \begin{cases} L\sqrt{p_{b_{n-1}}}-L\sqrt{p_{a_{n-1}}} & \text{for $p_{b_{n-1}}≤x$} \end{cases} \end{equation}

In this case, the amount of Token0 and Token1 obtained when burning the LP position in equation (15) is as follows:

(Amounttoken0,Amounttoken1)=(0,Lpbn1Lpan1)\begin{equation} (Amount_{token0}, Amount_{token1})=(0, L\sqrt{p_{b_{n-1}}}-L\sqrt{p_{a_{n-1}}}) \end{equation}

Also, the amount of Token0 and Token1 that make up the LP position satisfying State $p_{a_{n}}<x< p_{b_{n}}$, according to equation (4), is as follows:

(Amounttoken0,Amounttoken1)=(L(1x1pbn),L(xpan))\begin{equation} (Amount_{token0}, Amount_{token1})=(L(\frac{1}{\sqrt{x}}-\frac{1}{\sqrt{p_{b_{n}}}}), L({\sqrt{x}}-{\sqrt{p_{a_n}}})) \end{equation}

Therefore, by holding a position with the change from equation (16) to equation (17) added, it becomes possible to switch the range.

Δ(Amounttoken0,Amounttoken1)=(L(1x1pbn),L(xpanLpbn1Lpan1))\begin{equation} \Delta (Amount_{token0}, Amount_{token1})=(L(\frac{1}{\sqrt{x}}-\frac{1}{\sqrt{p_{b_{n}}}}), L({\sqrt{x}}-{\sqrt{p_{a_n}}}-L\sqrt{p_{b_{n-1}}}-L\sqrt{p_{a_{n-1}}})) \end{equation}

As a generalization, adding the difference between equation (10) and equation (18) allows the range to be switched. By adjusting the token amount in equation (19) through the lending pool, we can maintain the value of Squart.

(18)(10)=(Amounttoken0,Amounttoken1)=(L(1x1pbn1),L(xpbn1))\begin{equation} (18) - (10) = (Amount_{token0}, Amount_{token1})=(L(\frac{1}{\sqrt{x}}-\frac{1}{\sqrt{p_{b_{n-1}}}}) , L(\sqrt{x_{{}}}-\sqrt{p_{b_{n-1}}})) \end{equation}

Switching to a normal state from the lower side of the range

Switching from state x<pan1x<p_{a_{n-1}} to a range that satisfies state pan<xpbnp_{a_{n}}<x≤ p_{b_{n}}

From equation (14), we have the following case:

V(x)={x(Lpan1Lpbn1)for x<pan1,\begin{equation} V(x)= \begin{cases} x(\frac{L}{\sqrt{p_{a_{n-1}}}}-\frac{L}{\sqrt{p_{b_{n-1}}}}) & \text{for $x<p_{a_{n-1}}$,} \\ \end{cases} \end{equation}

In this case, the amount of Token0 and Token1 obtained when burning the LP position in equation (20) is as follows:

(Amounttoken0,Amounttoken1)=((Lpan1Lpbn1),0)\begin{equation} (Amount_{token0}, Amount_{token1})=((\frac{L}{\sqrt{p_{a_{n-1}}}}-\frac{L}{\sqrt{p_{b_{n-1}}}}), 0) \end{equation}

Therefore, by holding a position with the change from equation (21) to equation (17) added, it becomes possible to switch the range.

Δ(Amounttoken0,Amounttoken1)=(L(1x1pbn)L(1pan11pbn1),L(xpan))\begin{equation} \Delta (Amount_{token0}, Amount_{token1})=(L(\frac{1}{\sqrt{x}}-\frac{1}{\sqrt{p_{b_{n}}}})-L(\frac{1}{\sqrt{p_{a_{n-1}}}}-\frac{1}{\sqrt{p_{b_{n-1}}}}), L({\sqrt{x}}-{\sqrt{p_{a_n}}})) \end{equation}

As a generalization, adding the difference between equation (10) and equation (22) allows the range to be switched. By adjusting the token amount in equation (23) through the lending pool, we can maintain the value of Squart.

(22)(10)=(Amounttoken0,Amounttoken1)=(L(1x1pan1),L(xpan1))\begin{equation} (22) - (10) = (Amount_{token0}, Amount_{token1})=(L(\frac{1}{\sqrt{x}}-\frac{1}{\sqrt{p_{a_{n-1}}}}) , L(\sqrt{x_{{}}}-\sqrt{p_{a_{n-1}}})) \end{equation}

Oracle-free Pricing

The key difference between the pricing of regular options in TradFi (Traditional Finance) and in Predy is the way the premium is calculated. Instead of requiring users to pay for their options upfront, the pricing of Predy's Squart depends on the trading fee income from the UniswapPool and increases with each block. While this may add a level of uncertainty for traders, it is a unique feature of Predy's pricing model.

Conclusion

Using the method described above, it is possible to create a perpetual contract with a constant 2x2\sqrt{x} price using Uniswap V3 LP positions. This perpetual contract has convexity, and its theoretical interest rate is expressed as xσ24\sqrt{x}\frac{\sigma^2}{4} in terms of Token1.

Reference

  1. Adams, H., Zinsmeister, N., & Robinson, D. Uniswap (2020). v2 Core. Available at https://uniswap.org/whitepaper.pdf

  2. Clark, Joseph, The Replicating Portfolio of a Constant Product Market with Bounded Liquidity (August 3, 2021). Available at SSRN: https://ssrn.com/abstract=3898384 orhttp://dx.doi.org/10.2139/ssrn.3898384

  3. Clark, Joseph, Spanning with Power Perpetuals (January 3, 2023). Available at SSRN: https://ssrn.com/abstract=4317072 orhttp://dx.doi.org/10.2139/ssrn.4317072

Last updated