Rarity ranking on Jam On Bread

Education 23.02.2023

Rarity ranking on Jam On Bread

How we calculate rarities on JamOnBread

There are multiple approaches to calculating rarities. Different websites use different ways. We at JAM ON BREAD decided to explore all resources on rarity calculation we could find and select the way that was the most reasonable according to our opinions. The approach we chose is, we believe, the most independent method to calculate rarity.

Possibilities

To understand why we chose our approach, we need to throw some shade on other rarity calculation methods. So that you know why they are inferior to our solution :)

The most straightforward approach to calculating rarity is simply looking at the rarest attribute. This is usually not a good metric, as an NFT with many common traits and one ultra-rare trait will be rarer than an NFT with all attributes rare.

Another common approach is to look at the rarity of all attributes of a specific NFT and multiply these rarities together to get a rarity score for this particular NFT. You can see this approach used on many rarity ranking sites.

When counting rarity this way, the lower the score, the rarer the NFT. Such an approach might not treat different NFTs the same way; some NFTs might be favoured. The problem is the number of traits. An NFT with 3 traits will probably have a very different score than an NFT with 7 traits because, in the case of the first NFT, only 3 numbers are multiplied, but in the other case, 7 numbers are multiplied. In these approaches, a normalisation of rarity scores might be needed.

Our approach

We decided to use the Jaccard distance of NFTs to order a collection. This is a statistical approach that measures similarities between two sets of data. The Jaccard distance of 2 NFTs is calculated using the following formula: dist(NFT_1, NFT_2) = 1 — (num_of_common_traits / num_of_all_traits)


Let’s look at an example. Let’s consider an NFT_1 and NFT_2 with following traits:

| | **NFT 1** | **NFT 2** |

| — — — — — — — — | — — — — — — | — — — — — — |

| **Background** | Blue | Orange |

| **Eyes** | *Scared* | *Scared* |

| **Mouth** | Smiling | Sad |

| **Body** | *Muscular* | *Muscular* |

| **Nose** | Long | Short |

In this case, our NFTs have 2 common traits (*Scared* eyes and *Muscular* body). In total, they have 8 traits (Blue background, Orange background, Scared eyes, Smiling mouth, Sad mouth, Muscular body, Long nose, and Short nose). Therefore, their Jaccard distance is 1–2 / 8 = 0.75.

We do this calculation for each NFT pair in the collection we are calculating rarity for. For each NFT, we take the average distance between this NFT and the rest of the collection. Now we have a relative rarity order for each NFT.

Is this ranking accurate?

Calculating an accurate rarity for each collection using a single approach is very difficult. Some attributes are subjectively considered rarer by the collection’s creators or by the community. In addition, many aspects are difficult to catch by a mathematical model. For example, a combination of matching attributes that are common individually can be considered rare. Such subjective factors make it practically impossible to calculate rarities exactly as collection creators intended them.

We wanted a consistent and straightforward way to calculate rarities for all collections. Jaccard distance does this well. However, it doesn’t answer the question of how rare people believe the NFT to be. Instead, it shows how rare a particular NFT is, compared to the whole NFT collection.

This approach penalizes common attributes. For example, an NFT with one ultra-rare attribute and many common ones will be considered common. On the other hand, an NFT where all attributes are relatively rare will be regarded as rare.

How we display rarity on JAM ON BREAD

We calculate the rarity for most of the collections automatically. However, it is not calculated for collections that are too big or the ones where statistical rarity does not make much sense (such as virtual land plots).

If a collection has a rarity calculated, a rarity badge will be present next to each NFT from this collection. All NFTs in the lower half of the collection’s rarity ordering are labeled as COMMON. All other ones have a TOP X% displayed beside them. So, for example, if an NFT from a 10k collection is considered 150th most rare, there will be a TOP 1.5% badge displayed.

Badges are divided into classes, and each class is colour-coded, so it is simple to spot rare NFTs easily.

Filtering by rarity

There is an option on the collection’s detail page to only display NFTs up to some rarity. So, for example, you can choose only to see NFTs in the TOP 20%. Besides that, it is possible to order by rarity in both ascending and descending order.

In the end, rarity ranking is still very subjective. Some collections might prefer to be ranked using different methods, so we are considering adding support to sort rarities by various calculation algorithms. Let us know if this is something you would like to see, even if you are not a collection creator. You can test our rarity features yourself.