At the end of a rewards epoch, once the rewards have been distributed, we publish four different annual percentage rates (APRs):

APR for a single PubKeyHash (PKH)

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:

Computing a PKH’s APR using the results spreadsheet

  1. First, compute the time-weighted average value supplied by the PKH:
    1. Go through the “QToken utxos in epoch” sheet for each market and filter the rows for which the holder_pkh column matches the PKH of interest.
    2. For each row in (a), compute the span of time through which that transaction output remained unspent in the epoch (i.e., the time it remained unspent between the initial and final slots of the epoch), as described in the $AverageSuppliedBalance$ formula above. The initial and final slots of the epoch can be found in the “Calculation parameters” sheet and the creation and spending slots (if applicable) of each utxo can be found in the 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.
    3. For each row in (a), multiply the value of the 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.
    4. Multiply each balance computed in (c) by the average price for the respective market’s underlying token and add them all together. This is the time-weighted average value supplied by the PKH.
  2. Compute the value of the rewards accrued during the epoch by multiplying the amount of LQ distributed to the PKH (as listed in the “Total rewards (LQ)” column of the “LQ rewards” sheet) by the average LQ price during the epoch, available in the “Calculation parameters” sheet.
  3. Divide the value of the rewards computed in (2) by the average supplied value computed in (1). This is the rate of return on the average value supplied during the epoch.
  4. Annualize the rate of return computed in (3) by multiplying it by the average number of slots in an year ($31557600$ slots), divided by the duration of the epoch (final slot - initial slot). This is the APR for the PKH of interest.

Supplier APR for a single PKH

The Supplier APR is computed in the same manner as the more general APR above, but only the LQ rewarded for supplying is counted: