Statistical Ranking

How is rarity calculated?

CryptoPiggos are created from different categories of traits.

Background, clothing tops, clothing bottoms, facial hair, accessories etc

For each trait in a trait category, a percentage weight is assigned. The sum of all weights in a trait category equals 100%

As an example, if we were creating soccer player NFT's, we may have the following trait categories, traits, and their associated weights.

Stadium Background (trait category)

Attribute

Weight

Wembley

50%

The Maracana

50%

Player Shirt (trait category)

Attribute

Weight

Brazil #10

10%

Generic Spanish shirt

45%

Generic Italian Shirt:

45%

The possible combination of images would be:

Brazil #10

Wembley

Generic Spanish shirt

Wembley

Generic Italian Shirt

Wembley

Brazil #10

The Maracana

Generic Spanish shirt

The Maracana

Generic Italian Shirt

The Maracana

So, 6 possible combinations.

If the weights were evenly distributed across the two sets of traits (50% and 33 & 1/3% respectively),

The chance of anyone combination being selected would be 1/2 * 1/3 = 1/6 (the probability of each independent trait selection multiplied together to find the intersection)

In our case, we have assigned a much lower probability for the "Brazil #10" shirt being randomly selected.

So, the probability of a "Brazil #10, The Maracana" soccer player being generated is 1/2 * 1/10 = 1/20 (5% chance)

This is much lower than a "Generic Spanish Shirt, The Maracana" being generated, as the probability for this trait combination is 1/2 * 9/20 = 9/40 (22.5% probability)

Resulting Probabilities:

Attribute Name (Shirt cat)

Weight

Attribute Name (background cat)

Weight

Probability

Brazil #10

10%

Wembley

50%

5%

Generic Spanish shirt

45%

Wembley

50%

22.5%

Generic Italian Shirt

45%

Wembley

50%

22.5%

Brazil #10

10%

The Maracana

50%

5%

Generic Spanish shirt

45%

The Maracana

50%

22.5%

Generic Italian Shirt

45%

The Maracana

50%

22.5%

We do the same for CryptoPiggos, where the selection of each trait from a category is an independent event.

We use a weighted random function (where the trait and its associated weight are passed into the weighted random function) on each trait category to select the individual traits to be combined.

As above, the probability of a Piggo being created with a specific set of traits is a product of each of the selected trait probabilities.

We also have some dependencies across traits for some Piggo types.

For example, if a Soccer background trait is selected, the generated Piggo has to have a Soccer Jersey for its clothing top trait.

The resulting options for subsequent traits are re-evaluated to ensure that the options are appropriate for that type (in this case, a soccer player).

The weights are re-scaled for a trait category where there are traits that are no longer relevant for a Piggo type.

We use the calculated Piggo probability to assign a rarity index value to the Piggo.

To do this we use the following formula and normalize the results to be between 1 and 10:

log (P(T1 and T2 and T3... and Tn) * 10^n))

where n is the number of trait categories.

So, if the probability of creating a Piggo with a particular set of 7 traits was .00005, the formula would result in a value of ~2.7

The formula would result in a value of ~4.7 for a Piggo probability of .005.

The first Piggo would be considered rarer than the second.

For a log(P(T1 and T2 and T3... and Tn) * 10^n) value up to 10, the resulting nonnormalized rarity value would be <= 1, from 11 to 100, rarity < 2, from 101 to 1000, rarity < 3 and so on .

Based on this formula, we use the above example,

Brazil #10 with Wembley background. The probability is 5%, with 2 traits. Hence, (0.05 x (10x10)) = 1

Generic Spanish Shirt with Wembley background. The probability is 22.5, Hence (0.225 x (10x10)) = 4.5 ~5

The results are Brazil #10 has a rarity of 1 and General Spanish Shirt has a rarity of 5.

Last updated