# 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 — 100] | 1 |

(100 — 35,000] | – 0.086 × ln(B_{n} × 2 ) + 1.66 |

(35,000 - 150,000] | – 0.0705 × ln(B_{n}) + 1.34 |

(150,000 — 420,000] | – 0,00019 × B_{n} + 162.77 |

(420,000 - 580,000] | – 0,00011 × B_{n} + 128.56 |

(580,000 — ∞) | 0,0621 |

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 100 — 35,000, which means we calculate k_{1} by the formula:

k_{1} = -0.086 × ln(9,500 × 2) + 1.66 = -0.086 × 14.2137118 + 1.66 = 0.43762

The rate's weight:

W_{1} = B_{1} × k_{1} = 9,500 × 0.43762 = 4,157

Summary: token received from the user 1 the rate 5 with the weight 4,157.

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

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

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

k_{2} = 1

The rate's weight:

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

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

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

R = (5 × 4,157 + 4 × 70) / (4,157 + 70) = 4,983 (rounded to 5.0)

4.157 WCT rated token with 5 stars, 70 — with 4, and total WCT weight is 4,227: