> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eigenexplorer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rewards

> Understanding APY calculations in the protocol

This documentation outlines the process for calculating the annual percentage yield (APY) for a given restaking strategy (accepted restaking asset), Actively Validated Service (AVS), and for operators who participate in restaking strategies. The calculations involve aggregating data related to reward submissions and strategy performances.

It is important to note that the final APY you earn may differ from the aggregated APY listed for a specific operator or AVS. Your earned APY depends on the specific restaking token you select, the operator to whom you delegate, and the AVSs the operator has opted into. Therefore, the APY youearn must be calculated on a case-by-case basis. The aggregated APY for an AVS or operator is simply the sum of the APYs from all associated restaking token strategies.

## Calculating APY for an AVS

An AVS's total APY represents the combined yield potential across all its accepted restaking strategies. The calculation process involves analyzing reward submissions, strategy multiples, and token economics to derive accurate APY figures.

<Steps>
  <Step title="Gathering Reward Submissions">
    We start by collecting all reward submissions emitted by the AVS. This
    data is captured through the `AVSRewardsSubmissionCreated` event.
  </Step>

  <Step title="Identifying Accepted Restakeable Strategies">
    Next, we compile a list of accepted restakeable strategies within each
    operator quorum, along with their total value locked (TVL) figures.
  </Step>

  <Step title="Linking Strategies to Reward Submissions">
    For each strategy identified, we create a list of reward submissions
    that specifically reward that strategy.
  </Step>

  <Step title="Calculate Strategy APY">
    For each relevant reward submission, we retrieve the reward token
    metadata, the strategy multiplier, reward amount, and reward duration
    and conduct the calculation.

    Specifically, we use the following formulas to derive the final strategy APY:

    ```
    rewardRate = totalRewardsEth / strategyTvl
    annualizedRate = rewardRate * (secondsPerYear / totalDuration)
    apy = annualizedRate * 100

    Where:
    secondsPerYear = 365 * 24 * 60 * 60 (31,536,000 seconds)
    ```
  </Step>

  <Step title="Calculate AVS APY">
    Finally, the aggregate APY for the AVS is computed by summing the individual
    APYs of each strategy.
  </Step>
</Steps>

## Calculating APY for an Operator

The total APY for an operator reflects the combined yield potential from all the AVSs they have opted into, along with the accepted restaking assets or strategies. Calculating an operator's APY is more complex than that of an individual AVS reward, as it must consider multiple selected AVSs and incorporate the operator's earnings.

<Steps>
  <Step title="Identifying Rewarded Restakeable Strategies">
    We start by identifying the AVS that the operator has opted into and selecting the corresponding restaking token that generates rewards from that AVS. The calculation outlined below must be performed for each AVS the operator has opted into.
  </Step>

  <Step title="Linking Strategies to Reward Submissions">
    For each strategy identified within the selected AVS, we compile a list of reward submissions that specifically correspond to that strategy.
  </Step>

  <Step title="Calculate Strategy APY">
    For each relevant AVS reward submission, we retrieve the reward token metadata, strategy multiplier, reward amount, and reward duration, and then perform the necessary calculations.

    Specifically, we use the following formulas to derive the final strategy APY:

    ```
    rewardRate = totalRewardsEth (deduct the operator earnings, which is currently set to 10% across all operators) / strategyTvl
    annualizedRate = rewardRate * (secondsPerYear / totalDuration)
    apy = annualizedRate * 100

    Where:
    secondsPerYear = 365 * 24 * 60 * 60 (31,536,000 seconds)
    ```
  </Step>

  <Step title="Calculate selected AVS APY">
    The aggregate APY for the AVS is calculated by summing the individual APYs of all strategies.
  </Step>

  <Step title="Calculate Operator APY">
    The aggregate APY for the operator is calculated by summing the individual APYs of all AVSs.
  </Step>
</Steps>
