> For the complete documentation index, see [llms.txt](https://polketio.gitbook.io/toearnfun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polketio.gitbook.io/toearnfun/guide/gamefi-system/earning.md).

# Earning

### Calculation Parameters

| Parameter                                         | Type | Description                                                                                                                               |
| ------------------------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Lv                                                | u16  | Level                                                                                                                                     |
| R                                                 | u64  | On-chain Random Seed                                                                                                                      |
| E                                                 | u16  | Current efficiency value                                                                                                                  |
| S                                                 | u16  | Current skill value                                                                                                                       |
| L                                                 | u16  | Current luck value                                                                                                                        |
| D                                                 | u16  | Current durability value                                                                                                                  |
| $$E\_{base}$$                                     | u16  | Basic efficiency value                                                                                                                    |
| <p><span class="math">S\_{base}</span></p><p></p> | u16  | Basic skill value                                                                                                                         |
| <p><span class="math">L\_{base}</span></p><p></p> | u16  | Basic luck value                                                                                                                          |
| $$D\_{base}$$                                     | u16  | Basic durability value                                                                                                                    |
| $$J\_{max}$$                                      | u16  | Maximum number of jumps                                                                                                                   |
| $$J\_{avg}$$                                      | u16  | Average jumps per minute                                                                                                                  |
| G                                                 | u16  | After upgrading, the growth points obtained, refer to **Upgrade Growth Points**                                                           |
| T                                                 | u16  | Trip rope times                                                                                                                           |
| N                                                 | u16  | Energy value, `Jump Rope` consumes 1 point of energy for every 30 seconds of exercise, and no energy is consumed for less than 30 seconds |
| K                                                 | u16  | Assessment frequency constant, system value = 120 times/minute.                                                                           |
| FUN                                               | u128 | Reward tokens with a decimal precision of 12. 1 FUN=10^12 unit                                                                            |

### **Calculate random luck score**

$$L\_{Rnd} = R \pmod L + 1$$

The actual luck score is calculated via on-chain random number.

### **Compute the skill score for this training**

$$S' = \lfloor \frac {S\*J\_{max}}{(T+1)\*K} \rfloor$$

$$\Delta S = R \pmod {\vert S - S'\vert}$$

$$
S''= \begin{cases} S-\Delta S, & S' \lt S \ S+\Delta S, & S' \ge S \end{cases}
$$

In a training session, the maximum number of consecutive jumps and the number of trip ropes are the key factors affecting skill scores. The trainer's mastery of jumping rope skills will double the skill scores.

### **Calculate Jump Frequency Factor**

$$
F= \begin{cases} 0, & J\_{avg} \notin \[80, 400] \ 1, & J\_{avg} \in \[80, 400] \end{cases}
$$

Valid frequency factor: the value is 1 within the range of 80 times/minute to 400 times/minute, otherwise it is 0.

### **FUN reward base**

$$B = \frac {FUN} {10}$$

### **FUN reward formula**

$$FUN\_{reward} = (E+S'' + 2 \* L\_{rnd} ) \* N \* F \* B$$
