At the end of a rewards epoch, once the rewards have been distributed, we publish four different annual percentage rates (APRs):
The APR for a single PKH, displayed when claiming rewards, is defined as the annualized rate of returns for the epoch:
$$ APR_{epoch,pkh} = \frac{RewardsValue_{epoch, pkh}}{AverageSuppliedValue_{epoch,pkh}} \times \frac{YearInSlots}{epoch_{end} - epoch_{start}} $$
where:
$YearInSlots$ is the average number of slots in a year, considering a year as comprised of 365.25 days and an average slot rate of 1 slot/second.
$epoch_{end}$ and $epoch_{start}$ are the final and initial slots of the epoch, respectively$^1$.
$RewardsValue = AveragePrice_{epoch,LQ}\times Rewards_{epoch,pkh}$ is the value (in USD) of the LQ rewards received by the PKH, taking into account the average price of LQ throughout the epoch$^2$ and the amount of rewards accrued by the PKH$^3$.
$AverageSuppliedValue_{epoch,pkh} = \sum\limits_{m \in markets} \left( AveragePrice_{epoch, m} \times AverageSuppliedBalance_{epoch, m, pkh} \right)$ is the value (in USD) of the time-weighted average balances held by the PKH in each market during the epoch, taking into account the average prices of the underlying assets throughout the epoch$^4$. This balance is computed as:
$$ AverageSuppliedBalance_{epoch,market,pkh}= \frac{ 1 }{ 50 \times 10^6 \times \left( epoch_{end} - epoch_{start}\right) } \times \sum\limits_{u\in TxOut_{epoch,pkh}} \left[ QTokens_{market}(u) \times \left( \mathrm{min(epoch_{end}, u_{spentAt}) - \mathrm{max(epoch_{start}, u_{createdAt})}} \right) \right] $$
where:
NOTE: The average qToken exchange rate (expressed in qTokens / underlying token) for all markets is approximated to $50 \times 10^6$ qTokens/underlying token for the purposes of the APR computations. This is an adequate approximation for the earlier epochs, but may be replaced by the actual time-weighted average exchange rate in the future.
holder_pkh
column matches the PKH of interest.created_at
and spent_at
columns, respectively. If the transaction output wasn’t spent as of the moment the data was gathered, the spent_at
cell will be blank. In this case, the end of the epoch must be used in its place.qtokens
column by the time span computed in (b), sum them all together, divide the result by the epoch’s length (final slot - initial slot), and then divide again by $50 \times 10^6$. This is the time-weighted average balance supplied by the PKH during the epoch, expressed in each market’s underlying token.The Supplier APR is computed in the same manner as the more general APR above, but only the LQ rewarded for supplying is counted: