Skip to main content
The MarketThree.computeFeeInsideForRange() static method computes the fee growth that has occurred inside a specified tick range. This is essential for calculating fees earned by liquidity positions.

Usage

Parameters

Returns

Returns an object with:

Calculation Logic

The method implements the Uniswap V3 formula for computing fee growth inside a range:
  • If current price < lower price: inside = outside(lower) - outside(upper)
  • If current price >= upper price: inside = outside(upper) - outside(lower)
  • If current price is inside range: inside = global - outside(lower) - outside(upper)
This allows tracking of fees earned specifically within the position’s active range.