MarketThree.calculateHistoricalFeeApy() static method calculates the annualized fee APY (Annual Percentage Yield) based on historical fee growth data over a specific time period.
Usage
Parameters
Returns
Returns an object with:Calculation Details
The APY calculation follows these steps:-
Calculate total fees earned using Q64.64 math:
-
Calculate annualization factor:
-
Calculate APY:
avgLiquidity is 0 or hoursElapsed is 0, all return values will be 0.