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
| Parameter | Type | Required | Description |
|---|---|---|---|
feeGrowthDeltaSy | bigint | Yes | Change in global SY fee growth over the period |
feeGrowthDeltaPt | bigint | Yes | Change in global PT fee growth over the period |
avgLiquidity | bigint | Yes | Average liquidity in the range during the period |
hoursElapsed | number | Yes | Number of hours in the measurement period |
Returns
Returns an object with:| Property | Type | Description |
|---|---|---|
feeApySy | number | Annualized APY for SY fees as a percentage |
feeApyPt | number | Annualized APY for PT fees as a percentage |
feeApyTotal | number | Combined annualized APY (SY + PT) as a percentage |
totalFeesSy | bigint | Total SY fees earned during the period |
totalFeesPt | bigint | Total PT fees earned during the period |
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.