# Scoring Methodology

This document presents an overview of the methodology used to determine the final scores for The Quest for Kresk.

The competition encouraged participants to earn points in the following categories:

1. **Mission XP:** Earn mission XP by completing missions.
2. **Profits:** Compete by generating profits.
3. **Farming Rewards:** Stake LP tokens to accrue krRewards.

Three roles participated in The Quest for Kresk: Investor, Operator, and Trader. To ensure a fair selection of the competition winner, it was necessary to normalize the results for the three roles, as each role had distinct objectives and missions.

The methodology was designed to transform the three components—Missions, Profits, and Farming Rewards—into normalized scores to calculate the final score. Scores were divided into three categories:

1. Mission Score
2. Profit Score
3. Farming Reward Score

The final score was capped at 250,000.

## **Overview of Steps**

1. Calculate percentile ranks for each component (Missions, Profits, and Farming Rewards) within each role.
2. Scale scores based on the maximum values for each role.
3. Calculate Global Score as the sum of the scaled Profit Score and Farming Reward Score.
4. Combine scaled Mission Score and Global Score to compute the Final Score.

## **Calculate Percentile Ranks**

Percentile rank is used to compare each user’s performance in the three component areas against users with the same role. This helps improve the balance between the three roles in each area of scoring.

For each component (Missions, Profits, and Farming Rewards), calculate the percentile rank for each user within their role:

**`percentile_rank = (user_rank / total_users_in_role) * 100`**

## **Scale Scores**

All roles have the same maximum score from completing missions.

All roles have the same maximum Global Score from Profit and Farming Rewards. Maximum scores for Profits and Farming Rewards are weighted by role to align with the objectives and activities of the role.&#x20;

{% hint style="info" %}
**Example**\
Operators receive 30% of their Global Score from Farming Rewards, but Traders only 10%.
{% endhint %}

The percentile ranks for each component are scaled according to the maximum values for each role:

| Role     | Max Mission Score | Max Profit Score | Max Farming Reward Score |
| -------- | ----------------- | ---------------- | ------------------------ |
| Trader   | 125,000           | 112,500          | 12,500                   |
| Investor | 125,000           | 100,000          | 25,000                   |
| Operator | 125,000           | 87,500           | 37,500                   |

**`Scaled Component Score = Percentile Rank * Maximum Component Score`**

{% hint style="info" %}
**Example**\
An Investor who had higher profit than 98% of Investors will receive:

\
$$scaledProfitScore = 0.98 * 100,000$$

$$scaledProfitScore = 98,000$$
{% endhint %}

## **Calculate Global Score**

Compute each user's Global Score by summing the scaled Profit Score and Farming Reward Score:

**`Global Score = Scaled Profit Score + Scaled Farming Reward Score`**

## **Combine Scores**

Calculate the Final Score for each user by adding the scaled Mission Score and the Global Score:

**`Final Score = Scaled Mission Score + Global Score`**

The maximum possible Final Score is 250,000.
