Concentrated liquidity inventory at a price · Calculation guide

Find the inventory of each token inside or outside a selected range.

Calculation guide

Enter human-unit price as token1 per token0 and liquidity in matching units. Continuous formula ignores tick rounding, accrued fees and token-decimal conversion.

a = liq*(1/sqrt(min(high,max(low,price)))-1/sqrt(high)) · b = liq*(sqrt(min(high,max(low,price)))-sqrt(low)) · value = a*price+b

Inputs

Liquidity in consistent units

Example entry 120.

Lower price boundary

Example entry 1.

Upper price boundary

Example entry 9.

Observed price (token1 per token0)

Example entry 4.

Worked example

InputValue
Liquidity in consistent units120
Lower price boundary1
Upper price boundary9
Observed price (token1 per token0)4
ResultValue
Token0 quantity20
Token1 quantity120
Position value in token1200

Calculation steps

Token0 quantity = (Liquidity in consistent units × ((1 ÷ √(min(Upper price boundary, max(Lower price boundary, Observed price (token1 per token0))))) − (1 ÷ √(Upper price boundary))))

(120 × ((1 ÷ √(min(9, max(1, 4)))) − (1 ÷ √(9)))) = 20

Token1 quantity = (Liquidity in consistent units × (√(min(Upper price boundary, max(Lower price boundary, Observed price (token1 per token0)))) − √(Lower price boundary)))

(120 × (√(min(9, max(1, 4))) − √(1))) = 120

Position value in token1 = ((Token0 quantity × Observed price (token1 per token0)) + Token1 quantity)

((20 × 4) + 120) = 200

How each input affects this example

Each row starts from the worked example and changes one input.

InputOriginal inputNew inputAffected resultOriginal resultNew result
Liquidity in consistent units120132Token0 quantity2022
Lower price boundary12Token1 quantity12070.294373
Upper price boundary910Token0 quantity2022.052668
Observed price (token1 per token0)45Token0 quantity2013.665631
Concentrated liquidity inventory at a price →

Sources