> For the complete documentation index, see [llms.txt](https://chess3.gitbook.io/chess3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chess3.gitbook.io/chess3/rewards-and-assets/leaderboard-system.md).

# Leaderboard System

**The leaderboard works exactly how you think it does.**

<figure><img src="https://1549484835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJcIvXLDWutBkcaemH11%2Fuploads%2F535wisehfTegSby5bSD9%2FScreenshot%202024-02-27%20at%202.43.42%E2%80%AFpm.png?alt=media&amp;token=b581c14c-0a2f-402b-bf49-622176988036" alt=""><figcaption></figcaption></figure>

We have both a global and a weekly leaderboard. Global is our all time stats whereas Weekly is for our weekly stats. If you're an exceptional player, you have the chance to get to the top of the Global leaderboard. If you're a semi-average player, you might get to the top of the Weekly.

Our rankings are based on a robust ELO system that we're actively working towards putting on-chain. Here is the breakdown of how it works:

#### Define Constants and Scores:

* K = 32: This is a constant that determines how much a player's rating can change from a single game. The value of 32 is commonly used for chess but can vary depending on the competition.
* R\_A and R\_B: These are the current Elo ratings of players A and B before the game starts. Higher ratings indicate stronger players.
* S\_A and S\_B: These are the game outcomes for players A and B. If a player wins, their score is 1. If they lose, their score is 0.

#### **Calculate the Rating Difference (RD):**

* RD = R\_A - R\_B: This is the difference in ratings between player A and player B. It helps predict who is expected to win. If RD is positive, player A is expected to be stronger; if negative, player B is expected to be stronger.

#### **Calculate Expected Scores (E\_A and E\_B):**

* The expected scores predict how likely each player is to win based on their current ratings. It's a number between 0 (expected to lose) and 1 (expected to win). This is calculated using the formula with the rating difference (RD) and adjusting for scale using 400 in the exponent.

#### **Update Elo Ratings:**

* After the game, the players' Elo ratings are updated based on their actual scores (S\_A and S\_B) versus their expected scores (E\_A and E\_B).
* For player A: The new rating R'\_A is the old rating R\_A plus K times the difference between the actual outcome (S\_A) and the expected outcome (E\_A).
* For player B: Similarly, the new rating R'\_B is the old rating R\_B plus K times the difference between the actual outcome (S\_B) and the expected outcome (E\_B).

Your rankings will determine what bonus prizes you receive. Weekly rewards happen more often but are less valuable whereas Global rewards happen less often but are more valuable.
