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.
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
| Input | Value |
|---|---|
| Liquidity in consistent units | 120 |
| Lower price boundary | 1 |
| Upper price boundary | 9 |
| Observed price (token1 per token0) | 4 |
| Result | Value |
|---|---|
| Token0 quantity | 20 |
| Token1 quantity | 120 |
| Position value in token1 | 200 |
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.
| Input | Original input | New input | Affected result | Original result | New result |
|---|---|---|---|---|---|
| Liquidity in consistent units | 120 | 132 | Token0 quantity | 20 | 22 |
| Lower price boundary | 1 | 2 | Token1 quantity | 120 | 70.294373 |
| Upper price boundary | 9 | 10 | Token0 quantity | 20 | 22.052668 |
| Observed price (token1 per token0) | 4 | 5 | Token0 quantity | 20 | 13.665631 |
