Skip to content

Commit

Permalink
Update staker README.md
Browse files Browse the repository at this point in the history
Adding links to docs
  • Loading branch information
dongwon8247 authored Jan 20, 2025
1 parent 2d993db commit f66eecc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contract/r/gnoswap/v1/staker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

The **Staker** module handles the distribution of both **internal** (GNS emission) and **external** (user-provided) rewards to stakers:

- **Internal rewards (GNS emission)** are allocated to “tiered” pools (tiers 1, 2, and 3). First, emission is split across the tiers according to the **TierRatio**. Then, within each tier, the emission is shared evenly among member pools and finally distributed proportionally to each staked position’s in-range liquidity.
- **[Internal rewards](https://docs.gnoswap.io/references/warm-up-periods)** (GNS emission) are allocated to “tiered” pools (tiers 1, 2, and 3). First, emission is split across the tiers according to the **TierRatio**. Then, within each tier, the emission is shared evenly among member pools and finally distributed proportionally to each staked position’s in-range liquidity.

- **External rewards** (user-provided incentives) can be created for specific pools. Each external incentive emits a constant reward per block. Any user with in-range staked liquidity on that pool can claim a share of the reward, proportional to their staked liquidity.
- **[External rewards](https://docs.gnoswap.io/references/warm-up-periods)** (user-provided incentives) can be created for specific pools. Each external incentive emits a constant reward per block. Any user with in-range staked liquidity on that pool can claim a share of the reward, proportional to their staked liquidity.

- If, during a given block, no staked liquidity is in range, the internal emission is diverted to the community pool, and any external reward for that block is returned to the incentive creator.

- Every staked position has a designated warmup schedule. As it remains staked, the position progresses through multiple warmup periods. In each warmup period, a certain percentage of the reward is awarded to the position, and the remainder goes either to the community pool (for internal incentives) or is returned to the incentive creator (for external incentives).
- Every staked position has a designated [warmup schedule](https://docs.gnoswap.io/references/warm-up-periods). As it remains staked, the position progresses through multiple warmup periods. In each warmup period, a certain percentage of the reward is awarded to the position, and the remainder goes either to the community pool (for internal incentives) or is returned to the incentive creator (for external incentives).

## Main Reward Calculation Logic

Expand Down Expand Up @@ -93,7 +93,7 @@ func CalcPositionReward(param CalcPositionRewardParam) []Reward {
3. Depending on whether the total staked liquidity is now nonzero or zero, it begins or ends any unclaimable period.
4. Updates the `CurrentOutsideAccumulation` for the tick.

The variable `globalRewardRatioAccumulation` holds the integral of $\(f(h) = 1 \div \text{TotalStakedLiquidity}(h)\)$, but only when \(\text{TotalStakedLiquidity}(h)\) is nonzero. Meanwhile, `CurrentOutsideAccumulation` tracks the same integral but over intervals where the pool tick is considered “outside” (i.e., on the opposite side of the current tick). When a tick cross occurs, this “outside” condition may flip, so the hook adjusts `CurrentOutsideAccumulation` by subtracting it from the latest `globalRewardRatioAccumulation`.
The variable `globalRewardRatioAccumulation` holds the integral of $\(f(h) = 1 \div \text{TotalStakedLiquidity}(h)\)$, but only when $\text{TotalStakedLiquidity}(h)$ is nonzero. Meanwhile, `CurrentOutsideAccumulation` tracks the same integral but over intervals where the pool tick is considered “outside” (i.e., on the opposite side of the current tick). When a tick cross occurs, this “outside” condition may flip, so the hook adjusts `CurrentOutsideAccumulation` by subtracting it from the latest `globalRewardRatioAccumulation`.

## Internal Reward

Expand Down

0 comments on commit f66eecc

Please sign in to comment.