> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rated.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Gini coefficient measurement

> This page details the approach Rated uses in computing this metric for the Solana network.

## Interpreting the Gini

A Gini coefficient of 0 reflects perfect equality, where all income or wealth values are the same, while a Gini coefficient of 1 (or 100%) reflects maximal inequality among values.

## Gini calculation

We first take the stake weight of each of the validators on the latest day and rank in descending order accordingly. We then use the 1-2B formula for measuring Gini, where B is the area under the Lorenz curve such that:

<Frame className="text-grey-800 dark:text-white text-sm overflow-x-auto lg:justify-start justify-center">
  $$
  1 - 2 \times \frac{\text{SUM}(\text{staked SOL} \times (\text{rank} - 1) + \text{staked SOL} / 2)}{\text{COUNT(validators)} \times \text{SUM}(\text{staked SOL})}
  $$
</Frame>

<Frame caption="The shape of a Lorenz Curve.">
  <img src="https://mintcdn.com/rated/t60xYZQW8_HmTEzr/images/methodologies/lorenz-curve.png?fit=max&auto=format&n=t60xYZQW8_HmTEzr&q=85&s=a0a61256051859c62daa64d8d0919728" width="1388" height="1374" data-path="images/methodologies/lorenz-curve.png" />
</Frame>

### Function Components

<Frame className="text-grey-800 dark:text-white text-sm overflow-x-auto lg:justify-start justify-center">
  $$
  \text{staked SOL} \times (\text{rank} - 1)
  $$
</Frame>

is the area of the rectangular horizontal slice under the Lorenz curve

<Frame className="text-grey-800 dark:text-white text-sm overflow-x-auto lg:justify-start justify-center">
  $$
  \frac{\text{staked SOL}}{2}
  $$
</Frame>

is the area of the triangle on the left of the rectangular slice

<Frame className="text-grey-800 dark:text-white text-sm overflow-x-auto lg:justify-start justify-center">
  $$
  \text{SUM}(\text{staked SOL} \times (\text{rank} - 1) + \frac{\text{staked SOL}}{2})
  $$
</Frame>

is the sum of all the slices

<Frame className="text-grey-800 dark:text-white text-sm overflow-x-auto lg:justify-start justify-center">
  $$
  \text{COUNT(validators)}
  $$
</Frame>

normalizes the x axis to the range 0 to 1

<Frame className="text-grey-800 dark:text-white text-sm overflow-x-auto lg:justify-start justify-center">
  $$
  \text{SUM}(\text{staked SOL})
  $$
</Frame>

normalizes the y axis to the range 0 to 1

<Frame className="text-grey-800 dark:text-white text-sm overflow-x-auto lg:justify-start justify-center">
  $$
  \text{SUM}(\text{staked SOL})
  $$
</Frame>
