Determining which ticks to borrow from

When a user seeks to obtain leverage in Limitless, the system selects specific ticks from which to borrow. This selection via our indexing algorithm is designed to ensure LPs' solvency in any market conditions. Limitless's innovative approach to utilizing discretized ticks and an indexing algorithm allows a streamlined process for one to obtain leverage from order books like AMMs.

Necessity of Discretization

The discretization of liquidity positions is pivotal for two key reasons:

  1. Efficient Indexing: The system must efficiently identify tick ranges that fulfill solvency criteria,

  2. Computational Efficiency: Discretizing tick ranges streamlines the process of tracking, managing, and adjusting borrowed and repaid liquidity.

Example Scenario

A trader wants a 20x long position on ETH, at the current price of 2000 USD/ETH. In this case, the indexing algorithm says the trader should ideally be borrowing from the 1900-1910 and 1910-1920 USD bins.

If liquidity is available across a broader range, say 1800-2200 USD, the lending process would involve: a. Withdrawing liquidity from 1800-2200 USD. b. Lending liquidity within the 1900-1910 and 1910-1920 USD ticks. c. Reproviding liquidity in segmented positions (1800-1900, 1900-1910, 1910-1920, 1920-2200 USD), since liquidity is no longer uniform in 1800-2200.

This naive approach is more computationally demanding than just withdrawing and lending from the 1900-1910 and 1910-1920 ticks

Indexing Algorithm

Therefore Limitless uses an algorithm that, given a collateral amount and a desired leverage, will output one or more ticks that

The indexing algorithm determines which discretized tick ranges(bins) to borrow from, given desired leverage and collateral amount.

Ensuring LP Solvency

Every debt originated in Limitless begins overcollateralized. However, as price fluctuates, the system needs to ensure the LPs are always made whole, or that the LP's loss is capped by his impermanent loss. This is achieved by enforcing the collateral amount to be greater than or equal to what the LP would expect for his liquidity to be converted to.

For all borrowed ticks i, this is represented via enforcing the invariant below;

  1. Borrowing token y with token x as collateral, the system necessitates collateralAmount_x

collateralAmountx>=iLiPai+1PaiPai+1PaicollateralAmount_x>=\sum_i L_i *\frac{\sqrt{P_{a_{i+1}}} -\sqrt{P_{a_i}} } {\sqrt{P_{a_{i+1}}} \sqrt{P_{a_i}} }

when debt amount in token y is

debty=iLi(Pai+1Pai)debt_y=\sum_i L_i *({\sqrt{P_{a_{i+1}}} -\sqrt{P_{a_i}} })
  1. Borrowing token x with token y as collateral, the system necessitates collateralAmount_y

collateralAmounty>=iLi(Pai+1Pai)collateralAmount_y>=\sum_i L_i *({\sqrt{P_{a_{i+1}}} -\sqrt{P_{a_i}} })

when debt amount in token x is

debtx=iLiPai+1PaiPai+1Paidebt_x=\sum_i L_i *\frac{\sqrt{P_{a_{i+1}}} -\sqrt{P_{a_i}} } {\sqrt{P_{a_{i+1}}} \sqrt{P_{a_i}} }

and where L_i denotes the liquidity borrowed and reduced in tick i.

Minimizing Premiums Quoted

When determining which ticks to borrow from, the indexing algorithm is designed to

  1. skip the highly utilized ticks

  2. borrow from ticks the farthest possible tick ranges from current prices(since premiums quoted are proportional to the distance to current price from the borrowed price), subject to the solvency condition above.

Last updated