# How we Calculate Rarity

(DeGod #9999) The Solana Metadata Standard:

```json
{
"name":"DeGod #9999",
"symbol":"DGOD",
"description":"10,000 of the most degenerate gods in the universe.",
"seller_fee_basis_points":999,
"image":"https://metadata.degods.com/g/9998-dead.png",
"external_url":"https://degods.com/",
"attributes":
    [
        {
        "trait_type":"background",
        "value":"Deep Ocean Blue"
        },
        {
        "trait_type":"skin","value":"Gold"
        },
        {
        "trait_type":"specialty",
        "value":"None"
        },
        {
        "trait_type":"clothes",
        "value":"DeDoctor Coat"
        },
        {
        "trait_type":"neck",
        "value":"None"
        },
        {"trait_type":"head",
        "value":"Bleached Curls"
        },
        {
        "trait_type":"eyes",
        "value":"Swirly Glasses"
        },
        {
        "trait_type":"mouth",
        "value":"None"
        },
        {
        "trait_type":"version",
        "value":"DeadGod"
        },
        {
        "trait_type":"y00t",
        "value":"Claimed"
        }
    ],
"collection":
        {
        "name":"DeGods",
        "family":"Godplex"
        },
"properties":
    {"files":
        [
            {
            "uri":"https://metadata.degods.com/g/9998-dead.png",
            "type":"image/png"
            }
        ],
    "category":"image",
    "creators":
        [
            {
            "address":"AxFuniPo7RaDgPH6Gizf4GZmLQFc4M5ipckeeZfkrPNn",
            "share":100
            }
        ]
    }
}
```

### What are Absent Traits?&#x20;

Since some NFTs have **layers (trait\_type)** that other NFTs do not, we need to account for this.&#x20;

If 99% of a collection has a layer (trait\_type), and 1% does not, the 1% that **does not should receive a boost** since it's immensely more rare to own the NFT that **does not** have the layer that 99% of the collection **does**.&#x20;

<figure><img src="https://2183478501-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoZcq0BV67tD9XnjDX9oe%2Fuploads%2FPoHnhaFpilzn5kBTiedC%2FScreen%20Shot%202022-10-06%20at%204.49.48%20PM.png?alt=media&#x26;token=c043a03c-0fd8-434b-bb19-09c080fcb09f" alt=""><figcaption></figcaption></figure>

So how do we account for absent traits? We add an additional **trait (value)** for every **layer (trait\_type)** that's missing **on every NFT**. Then, that absent **trait (value)** is given a score depending on how rare it is to ***not have that trait***. We do this by using the same formula as before.&#x20;

Here's the best way to explain absent traits:

Let's use a one-of-one NFT for example that has one layer and no layers in common with the rest of the collection.

&#x20;If every NFT in a collection of 10,000 has five **layers (trait\_types)**, except for the one-of-one, which only has one **layer (trait\_type)**, the score for the five absent **layers (trait\_types)** on the one-of-one will be enormous. This is because there is only one NFT in the entire collection of 10,000 that does not have a **trait (value)** for the other five **layer (trait\_type)**.&#x20;

However, the rest of the collection will also be given a score for an absent trait since they do not have the same **layer (trait\_type)** as the one-of-one NFT. Since 9,999 / 10,000 NFTs have this absent **trait (value)** for that specific **layer (trait\_type)**, it's very common for NFTs in this collection to have this absent **layer (trait\_type)**.&#x20;

When some NFTs have completely different **layers (trait\_types)** & **traits (value*****s*****)** than other NFTs in the same collection, comparing their rarities is somewhat like comparing apples to oranges.&#x20;

By calculating the score for absent traits we can correctly calculate the rarity of NFTs that do not have much in common. We use the score for absent traits for both methods of our calculation

### Rarity Score VS Absolute Statistical Rarity

There's somewhat of a debate ongoing currently in regards to the best way to calculate the rarity of NFTs. The two most common methods of calculating are ***absolute statistical rarity*** & ***rarity score***. We decided that we'd calculate rarity both ways to make it easy for both sides of the debate to check their rarity in their preferred method.

### Absolute Statistical Rarity

Absolute *statistical rarity is based on the following formula:*

***occurence % = attribute occurence / total number of NFTs in collection***&#x20;

then:

***absolute statistical rarity score = occurence % of trait 1 \* occurence % of trait 2 \* ...***

We include absent traits in this calculation.&#x20;

The NFT with the **lowest** score in this method is the rarest NFT in the collection.&#x20;

### **Rarity Score**

Rarity score can be calculated with the following formula:&#x20;

**trait rarity  = number of trait occurence's / number of NFTs in the collection**&#x20;

then:&#x20;

**trait rarity score =  1 / trait rarity**&#x20;

We include absent traits in this calculation.&#x20;

The NFT with the **highest** score in this method is the rarest NFT in the collection.&#x20;

### Trait Normalization

We currently do not use any trait normalization methods. Although there are some arguments for trait normalization, most platforms that use this method keep their formula private information and do not publicly state their method of normalizing traits or adjusting rankings.

***We will never manipulate rarity rankings with a secret method.***&#x20;

This is not what we do here. If we ever do add trait normalization in the future, we will add toggle functionality in addition to publicly stating exactly the calculations we run to get the output you see on our rarity tool.

### Custom Rankings

Some platforms enable creators to set custom rarities for their collection.&#x20;

**We don't, nor will we ever, make custom rarity rankings.**&#x20;

Think of it this way, if there was a baseball card that wasn't very rare and the company that created it lied about the amount they released. Would this be morally wrong? We think so.

Sometimes project owners mess up. Sometimes they accidentally have their "rarest" NFTs end up scoring pretty common.&#x20;

It sucks when a collections intended rarity doesn't pan out, but we believe project owners should make sure their metadata is in the format they intend, ***before they tokenize it on the blockchain***.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mark-eting.gitbook.io/roguestudios/rogue-studios/rogue-rarities/how-we-calculate-rarity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
