NFTs and Rarity: Bored Ape Yacht Club

Quantitools
8 min readJul 7, 2022

--

As the EIP-721: Non-Fungible Token (NFT) Standard says, NFTs can represent ownership over digital or physical assets. In general, all houses are distinct and no two kittens are alike. NFTs are distinguishable and you must track the ownership of each one separately.

Popular NFT collections such as CryptoPunks and BAYC are stored in the Ethereum blockchain. At the time this article is being written, with 1 Ethereum at $1200, the total value of all sales (lifetime) of CryptoPunks is $765,828,000 (638.19K ETH), and the lowest price a punk is available is $77,268 (64.39 ETH). Meanwhile, BAYC all time volume is $742,610,811.84 (618,84K ETH) and the lowest price an ape is being listed is $106,800 (89 ETH).

Bored Ape Yatch Club #7495, one of the rarest items in the collection because of its attributes.

When estimating NFT prices, the main differentiation between items of the same collection are their individual attributes. This means that studying the attribute distribution may help when pricing items. During this article, the BAYC collection is going to be analysed. First to that, Smart Contracts and Tokens are going to be discussed. Following these topics, a first view of how attributes are linked to the items of the collection is going to be shown. Finally, a simple mathematical analysis is going to be performed by proposing rarity metrics and studying the results.

What are Smart Contracts

As the official Ethereum documentation defines, a Smart Contract is simply a program that runs on the Ethereum blockchain. It’s a collection of code (its functions) and data (its state) that resides at a specific address on the Ethereum blockchain. Also, Smart Contracts are a type of Ethereum account. This means they have a balance and they can send transactions over the network. However they’re not controlled by a user, instead, they are deployed to the network and run as programmed. User accounts can then interact with a Smart Contract by submitting transactions that execute a function defined on the smart contract. Smart contracts can define rules, like a regular contract, and automatically enforce them via the code. Smart Contracts cannot be deleted by default, and interactions with them are irreversible.

What are Blockchain tokens

The Ethereum Blockchain is able to host Tokens using Smart Contracts. Each of the standards is a general structure about what functionality the Token’s Smart Contract must provide in order to be usable. As Tokens may be implementing important assets, security is one of the main concerns. Regarding this topic, OpenZeppelin offers a library for secure Smart Contract development. Built on a solid foundation of community-vetted code, in this library there exist an implementation for both ERC-20 and ERC-721. There also exist some useful functionality that is pluggable into other Smart Contracts, such as Mintable, Burnable and Pausable.

According to the official documentation, tokens can represent virtually anything in Ethereum. Some examples are reputation points in an online platform, a fiat currency like USD, lottery tickets, financial assets like a share in a company and more. That’s a powerful feature, and so, it must be handled by a robust standard. On the one hand, the ERC-20 standard allows for the implementation of a standard API for tokens within Smart Contracts, and it provides basic functionality to transfer tokens, as well as allow tokens to be approved so they can be spent by another on-chain third party. On the other hand, the ERC-721 standard is inspired by the ERC-20 token standard and builds on two years of experience since EIP-20 was created, mainly because EIP-20 is insufficient for tracking NFTs because each asset is distinct (non-fungible) whereas each of a quantity of tokens is identical (fungible). As said in the EIP-721, the ERC-721 standard allows for the implementation of a standard API for NFTs within Smart Contracts. This standard provides basic functionality to track and transfer NFTs.

NFT collections and Attributes

When some NFT is bought using a platform like OpenSea, the Transfer event is emitted in the same transaction, meaning that the owner of the token has changed. This can be checked by looking into the transaction events, as well as using the ownerOf function and specifying the token ID. NFT collections are implementations based on ERC-721 tokens, and usually, they have their own Smart Contract. There are some exceptions such as some tokens in OpenSea that depend on a single contract that groups every NFT uploaded through the same procedure.

In order to associate attributes to each item of the collection, the smart contract usually has a function tokenURI(tokenId) that returns addresses to the NFTs metadata. In this context, metadata usually refers to the attributes of every item in the collection. Typically, these links refer to some cloud platform or to Inter Planetary File System (IPFS). When accessing to it, it is common to find a json file storing the data.

Occurrence of attributes

The following images show different details about the BAYC collection, beginning with the attributes quantity distribution in this collection. As some items have certain attributes equal to None, the second image shows their distribution.

Now every attribute is going to be analysed, finding the value distribution.

First attribute is Background. This attribute happens to be evenly distributed, as every value appears almost the same number of times, being 1200 the number that every value oscillates around.

Second attribute is Fur. This one differs from the previous, as it isn’t evenly distributed, but more arbitrary. Some values could be grouped by number of apparitions. Brown, Dark Brown and Black is the group of values that have greater values than the other. There is another group with members Golden Brown, Cream and Tan around 600 apparitions each. The values not covered are all below 600 apparitions, and could be think of as Uncommon/Rare. The values with lowest apparitions are Trippy and Solid Gold, which could be think of as Epic/Legendary.

Third attribute is Hat. It is notorious that more than 2000 items of the collection doesn’t have any hat. When analysing the rest of them, the most common hat is Beanie, followed by Seaman’s Hat and Fez. The less common values seem to be Laurel Wreath, King’s Crown and Trippy Captain’s Hat. Every value except Seaman’s Hat, Beanie and None appears less than 400 times.

Fourth attribute is Clothes. Again, it is found that the most common value is None. If that value is ignored, the most common values are Striped Tee, Navy Striped Tee and Black T. The rest of values oscillate around 200 apparitions. The less common values are Admirals Coat and Black Suit.

Fifth attribute is Eyes. The most common eyes value is Bored, followed by Bloodshot, Sleepy and Closed. Almost every value is oscillating 400 apparitions except extremes. The less common values are Cyborg, Laser Eyes and Blue Beams.

Sixth attribute is Mouth. Its most common value is Bored, followed by Bored Unshaven. If these two are excluded, the next common values are Grin and Bored Cigarette, and the rest of the values have less than 500 apparitions. The less common values are Bored Dagger, Bored Pizza, Bored Unshaven Dagger and Bored Unshaven pizza.

The seventh and last attribute is Earring. This attribute is possibly None for some items in the collection. As other attributes with None as a possible value, it is the most common one. After excluding it, the most common values are Silver Hoop and Silver Stud. The less common values are Diamond Stud and Cross.

Rarity calculation

In order to calculate rarity, two metrics are going to be used. These two metrics are average trait rarity and rarity score. Rarity Tools has a post about metrics, but they don’t combine them the way we do. Rarity Score is obtained by summing up every result of the fraction between the total number of items and the number of items with certain value in the attribute. Average trait rarity is obtained after comparing each attribute value with the rest of the collection, obtaining the percentage of apparition. Once this percentage is obtained for each attribute, one could just sum up every obtained value and then divide the resulting number between the number of different attributes in the collection.

Rarity Score calculation
Average Trait Rarity calculation

After calculating these two metrics, and summing up the rarity score of each attribute in each item, and then making a scatter plot, this is the result. The data used to perform the calculations is data from the first quarter of 2022.

As it can be seen, there are two different groups of items in the BAYC collection when the used metrics are Average Trait Rarity and the sum of the Rarity Score. The existence of these two groups is because the number of attributes of each element. While the items that have 6 or 7 elements have a lower Average Trait Rarity, almost every item with less than 6 attributes is in the upper group. Both groups have the same shape, but they differ in position.

After seeing this chart, one could come up with a formula that compresses the information that these two dimensions give and reformulates the rarity again in one dimension, or even more metrics that measure the rarity of the collection, but this will be done in the next article about NFTs.

By Alfonso Camblor García

--

--