# Reward

The reward programs for DGYM in DeGym are designed to incentivize and reward stakeholders based on their participation and commitment to the platform. The DGYM rewards are influenced by the amount staked and the duration of the stake.

## <mark style="color:green;">Rewarding DGYM</mark>

### Inflow

Inflows of DGYM are generated through [inflation](/dao/dgym-tokenomics/inflation.md).

### Distribution

Distributions are triggered at every period where DGYM is inflated. The distribution weight is calculated based on the amount staked and the locked time.

To address the concern of extremely long lock times distorting the reward distribution, we can modify the time weight calculation using a logarithmic function. This approach ensures that the weight increases with time but at a diminishing rate, preventing excessively long lock durations from overwhelming the distribution.

#### Bond Weight Calculation

We will use the following formula to calculate the weight for **each bond**:

$$
w\_i​=a\_i​×log(\Delta T\_i ​+ 1)
$$

Where:

* $$a\_i$$ is the DGYM amount locked by **bond** $$i$$.
* $$\Delta T\_i$$ is the remaining time locked by **bond** $$i$$ (in days).
* $$w\_i$$ is the amount locked by **bond** $$i$$.

#### Total Weight Calculation

The total weight for all staking bonds remains the same:

$$
W=  \sum\_{j=1}^{n}​w\_j
$$

#### Distributed Reward

The reward for **each bond** can be calculated as follows:

$$
r\_i​=\frac{w\_i}{W}​​×R
$$

Where:

* $$R$$ is the total reward (generated from inflation).

### Outflow

After distribution, stakeholders can claim their DGYM rewards from all bonds not set as auto compound.

{% @mermaid/diagram content="%%{init: {'theme': 'forest'}}%%

graph TB
A\[Inflation Generates DGYM] --> B\[Distribution Triggered]
B --> C\[Calculate Distribution Weight]
C --> D\[Amount Staked]
C --> E\[Locked Time]
D & E --> F\[Distribute DGYM]
F --> G\[Claim DGYM Not Set to Auto Compound]" %}

## Detailed Steps

1. **Stake DGYM**: Users stake their DGYM tokens.
2. **Set Lock Duration**: Users set the duration for which their DGYM will be locked.
3. **Calculate DGYM Reward**: The reward in DGYM is calculated based on the stake amount and lock duration.
4. **Distribute DGYM Reward**: The calculated DGYM reward is distributed to the stakeholders.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.degym.net/dapp/staking/reward-program.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
