The Graph: APY calculation post-mortem

Dear community chefs,

Recently members from the Tenderize and Graph community brought to our attention that the APY (annual percentage yield) for staking GRT through Tenderize (tGRT) is relatively high compared to the rate of most indexers on the Graph network. GRT deposited in Tenderize is staked in the Graph network, without amplification of rewards.

While a slightly higher APY could be achieved through strategy optimization, such as frequently compounding rewards, the discrepancy still seemed fairly large, so the team set out to investigate the issue.

After investigation, we discovered an error in the way the APY is calculated.

Tenderize calculates the APY by querying our subgraph for the reward periods that happened in the last 30 days. For each reward period, the APY is calculated individually with the average being the resulting APY. Reward periods are not fixed in length or amount of rewards, it’s a recording of the number of rewards that came in since the last event.

The miscalculation occurred due to not considering the length of a reward period when calculating the average APY over the 30-day time series. The issue is magnified when reward periods are very irregular, like in the case of The Graph, where one large chunk of rewards comes in every ~28 days. We don’t observe the issue with other protocols supported by Tenderize because their reward periods are much more regular.

Difference in reward frequency between The Graph and Livepeer. Source: https://dune.com/reuben/Tenderize

To make the APY calculation more accurate moving forward, we’ve made two changes to the existing methodology:

  1. Use a time-weighted average when calculating the average APY of a time-series.
  2. Query 90 days of historical data instead of 30 days

With this change, The Graph’s APY in Tenderize over the last 90 days comes down significantly to ~26.80%. While this is still slightly over the market rate for The Graph, we’ll continue to improve our APY calculation going forward.

The team would like to apologize for any inconvenience caused by this issue and the wrong perception you might have had from the rate of return when staking GRT through Tenderize. No funds were ever at risk due to this issue, as it wasn’t an issue with the smart contracts but rather how the APY is calculated on our API endpoint.

We would like to thank the community for their understanding and patience in resolving this matter and for supporting us on our mission to bring liquid staking to web3 infrastructure.