# Rating formula

The rating of a token is a daily weighted mean of individual rates of all users who have ever rated the token:

R = (R_{1}W_{1} + R_{2}W_{2} + ... + R_{n}W_{n}) / (W_{1} + W_{2} + ... + W_{n}),

where

R_{n} is a rate of the n-th user,

W_{n} is a rate's weight of the n-th user.

The calculated value of `R`

is rounded to tenths of a number.

## User's rate R_{n}

User rates token with R_{n} inside of the token card using stars and the **Rate** button. R_{n} takes integer values from 1 to 5 inclusive.

User can rate the same token many times — the latest rate will be taken into account.

User can rate any token from the web browser in which Waves Keeper is installed if there is at least 1 WCT on users' address balance. The amount of WCT on the balance affects the weight of the user's rate W_{n}.

At the time when user rates a token, he pays a fee in WAVES for the data transaction.

## Rate's weight W_{n} of a user

The value of W_{n} is calculated by the formula:

W_{n} = B_{n}k_{n},

where

B_{n} is an effective balance of the n-th user in WCT tokens,

k_{n} — is a weight coefficient of the n-th user.

The calculated value of W_{n} is rounded to an integer.

## User's effective balance B_{n}

The effective balance B_{n} is the balance in WCT at the time when the user rates a token, minus the sum of all outgoing operations in WCT during the next 24 hours.

If B_{n} < 1, then the user's rate will not be taken into account during the token's rating calculation.

## User's weight coefficient k_{n}

The value of the coefficient k_{n} depends on the value of the effective balance B_{n} of the user and is calculated by the formula:

The value of the effective balance B_{n} of a user |
The value of the weight coefficient k_{n} |
---|---|

1 — 10 | 1 |

11 — 150,000 | – 0.091 × ln(B_{n}) + 1.20958 |

150,001 — 540,000 | (– 0,00019 × B_{n} + 153) / 1000 |

540,001 — ∞ | 0,05 |

The calculated value of k_{n} is rounded to hundredths of a number.

## Token's rating calculation

**User 1** rated token with 5 stars. At the time of the rate, there were 10,000 WCT on the user's balance.

In 24 hours, there were 3 operations: spending 300 WTC, spending 200 WTC and income of 500 WTC. It turns out that expenditure operations amount to 300 + 200 = 500 WTC. Thus, 9,500 WCT is the effective balance B_{1} (despite the fact that the same 10,000 WCT were on the balance after 24 hours, like they were at the time of the rate).

B_{1} is in the range of 11 — 150,000, which means we calculate k_{1} by the formula:

k_{1} = -0.091 × ln(9,500) + 1.20958 = 0.38

The rate's weight:

W_{1} = B_{1} × k_{1} = 9,500 × 0.38 = 3,610

Summary: token received from the user 1 the rate 5 with the weight 3,610.

**User 2** rated the same token with 4 stars. At the time of the rate, there were 7 WCT on the user's balance.

There were no outgoing operations during the next 24 hours, therefore the effective balance B_{2} is 7 WCT.

B_{2} is in the range of 1 — 10, therefore:

k_{2} = 1

The rate's weight:

W_{2} = B_{2} × k_{2} = 7 × 1 = 7

Summary: token received from the user 2 the rate 4 with the weight 7.

The rating R of the token will be calculated as weighted arithmetic mean of the rates of both users:

R = (5 × 3,610 + 4 × 7) / (3,610 + 7) = 4.998 (rounded to 5.0)

3,610 WCT rated token with 5 stars, 7 — with 4: