Skip to main content
The liquidityUnitPriceInAsset() method calculates the price per unit of liquidity in underlying asset terms, considering only the principal value (excluding fees) for a specific tick range.

Usage

Parameters

Returns

Returns a number representing the price per unit of liquidity in underlying asset terms (principal only). Returns 0 if:
  • No ticks exist in the specified range
  • Total share supply is 0
  • lowerTickKey >= upperTickKey (throws error)

Calculation Details

The method:
  1. Filters tick intervals within the specified range
  2. Aggregates principalPt, principalSy, and principalShareSupply across intervals
  3. Calculates PT asset value using time decay:
  4. Computes total principal value:
  5. Returns price per unit:
This calculation excludes accrued fees and represents only the principal component of the liquidity position.