Author

https://github.com/coffiasd/hackathon-data-analytics

Overview

This is a hackathon data analytics project.I analyze the top 2300 nfts sort by volume. You can find the detail list from my github repo.Or you can click here.

Csv Data

Below is all csv file that i collect.RankNFTs.csv is the top 2300 NFTs list. tokenIds/{contract}.csv is stolen NFTs tokenID list.lastSalePrice/{contract}.csv is the last sale price of each tokenId.

Python script

You can get the all scripts my github repo above.

def getNftsRankTopVolume(page):
    url = "<https://api.traitsniper.com/v1/collections?page=>" + \\
        str(page)+"&limit=100&sort_total_volume=desc"

    headers = {
        "accept": "application/json",
        "x-ts-api-key": TraitsniperApiKey
    }

    response = requests.get(url, headers=headers)
    resp_dict = json.loads(response.text)

def caculateContractItem(contractAddress, table):
    # get collection detail
    item = getCollectionDetail(contractAddress)

    # read stolen nfts list
    data = pd.read_csv("../data/stolen/lastSalePrice/" +
                       contractAddress+".csv", header=None)
    # caculate items
    num = data.count()
    sum = 0
    for index, row in data.iterrows():
        if row[1] > item["floor_price"]:
            sum += row[1]
        else:
            sum += item["floor_price"]
    table.rows.append([item["nft_name"], contractAddress, item["total_volume"],
                       sum, sum/item["total_volume"], num[0]])

Fetch Collections