Restake
Incentives

Restaking Rewards Overview

Restaking rewards in the Tangle Network are designed to incentivize both operators and delegators through a structured system of rewards, which are distributed based on staked assets and specific reward configurations. Below is a detailed explanation of how the restaking rewards mechanism works, including setting APY and caps, distributing rewards, and managing assets within reward pools.

Key Concepts

  1. APY (Annual Percentage Yield): A percentage that determines the rewards distributed to stakers based on their contribution to the pool.
  2. Cap: The maximum amount of staked assets that can earn rewards within a given pool.
  3. Reward Pools: Asset pools to which restaked tokens are assigned for reward distribution.
  4. Delegators: Users who delegate their tokens to operators, sharing in the rewards generated by the operators' activities.
  5. Operators: Validators who restake their tokens and provide services, earning rewards through their participation in the restaking protocol.

Setting Incentive APY and Cap

The set_incentive_apy_and_cap function allows the network (democracy) to configure the APY and cap for a specific asset pool, ensuring that stakers know the potential rewards and the upper limits of participation for rewards.

  • Function: set_incentive_apy_and_cap
  • Description: Sets the APY (Annual Percentage Yield) and cap for a specific asset pool.
  • Inputs:
    • pool_id: The ID of the pool for which the APY and cap are being set.
    • apy: The APY (percent) to be applied to the pool.
    • cap: The maximum amount of staked assets eligible for rewards in this pool.

Once set, the APY and cap are used to calculate the total rewards distributed among operators and delegators based on their staked amounts.

Whitelisting Blueprints for Rewards

The network allows developers to create blueprints for restaking services. These blueprints can be whitelisted for rewards, meaning services built using these blueprints can attract incentivized staking.

  • Function: whitelist_blueprint_for_rewards
  • Description: Whitelists a blueprint, allowing services using this blueprint to be eligible for reward distribution.

Distributing Rewards

Rewards are distributed to delegators based on the total amount staked in a reward pool and the pool's APY and cap configuration. The distribute_rewards function handles the distribution process, ensuring that all delegators receive their fair share of rewards based on the assets they have staked.

Distribution Process

  1. Gather Delegation Data: The system collects the information for all delegations for the current round by iterating through operator snapshots and mapping delegations to their respective assets.

  2. Retrieve Reward Configuration: The system checks the reward configuration for each asset to determine the APY and cap for the associated reward pool.

  3. Calculate Rewards: If the total amount staked in a pool exceeds the cap, rewards are calculated based on the cap. The total reward is calculated by multiplying the staked amount by the APY.

  4. Distribute to Delegators: The calculated total reward is distributed proportionally to all delegators based on their stake. Each delegator receives a percentage of the reward based on the size of their stake relative to the cap.

Reward Calculation

  • Total Reward Calculation: The total reward is calculated by multiplying the APY by the total staked amount, capped at the pool's limit.
  • Individual Reward Calculation: Each delegator's reward is calculated as a percentage of the total reward based on the delegator’s stake in relation to the cap.

Example:

  • If a pool has a cap of 1000 tokens and an APY of 10%, the total reward distributed will be 100 tokens (10% of 1000).
  • If a delegator staked 100 tokens, they will receive 10 tokens as a reward (10% of the total reward).

Managing Assets in Pools

Assets can be added or removed from reward pools using the following functions:

Adding an Asset to a Pool

  • Function: add_asset_to_pool
  • Description: Adds a new asset to an existing reward pool.
  • Inputs:
    • pool_id: The ID of the pool to which the asset is being added.
    • asset_id: The ID of the asset being added to the pool.

This function ensures that the asset is not already associated with a pool before adding it.

Removing an Asset from a Pool

  • Function: remove_asset_from_pool
  • Description: Removes an asset from a reward pool.
  • Inputs:
    • pool_id: The ID of the pool from which the asset is being removed.
    • asset_id: The ID of the asset being removed.

This function ensures that the asset is part of the specified pool before removing it.