Uniswap V3 LP Leverage Yield Farming (ERC20)

Leverage yield farming is identified as one of the main use cases for users to deposit their Uniswap V3 LP tokens as collateral to borrow more ERC20 tokens on Parallel and add to their yield farming position. Without credit expansion, a leverage yield farmer would borrow the one or both assets (depending on whether the spot price is outside or within the selected liquidity provision range), deposit the borrowing into an Uniswap L3 LP position, deposit the LP token back to Parallel and collateralize it, then repeat the process a number of times to reach maximum leverage.

In such case, we calculate the credit limit, as the sum of all borrowing power the user can achieve through the aforementioned recursion of the series of transactions. Specifically, with the currently available borrow credit denoted by CRCR and the targeted Uniswap V3 LP token’s collateral factor denoted by CFCF, the amount of deposit and borrow for each repetition is projected in the table below:

RepetitionDepositBorrow

1

Supplied Collateral

CRCR

2

CRCR

CRCFCR*CF

3

CRCFCR*CF

CRCF2CR*CF^2

nn

CRCFn2CR*CF^{n-2}

CRCFn1CR*CF^{n-1}

Therefore, the credit limit (i.e. maximum amount of borrowing) can be calculated as the sum of all borrow amounts as projected in the table above when n.n\to\infty.

CRmax=limnCR+CRCF+CRCF2+...+CRCFn=CR1CF\begin{equation} \begin{aligned} CR_{\max}&=\lim_{n\to\infty}\sum CR+CR*CF+CR*CF^2+...+CR*CF^{n} \\ &=\frac{CR}{1-CF} \end{aligned} \end{equation}

This means, for a user with currently available borrow credit of CRCR and CFCF determined given the Uniswap V3 LP token he chooses to provide liquidity to with the borrowed assets from Parallel, rather than leaving the user perform the series of transactions repetitively, we develop a solution for the user such that he can achieve desired leverage with one click.

Specifically, The user can choose to borrow any amount up to CR1CF\frac{CR}{1-CF} of value. Such value will then be allocated proportionally to the two underlying assets of the LP position as calculated per eq. (3) and (4) on Uniswap V3 LP Token Analyzer page, such that all borrowing will be put into the user-defined Uniswap V3 LP position which is, in turn, deposited back to Parallel as the user’s collateral. Note the series of transactions are done through flashloan within one block.

Last updated