Loading...

    Q3. How popular are NFTs on Polygon? Track daily volume over the past month/year/etc.

    How many Polygon users started off with NFTs? Who made the most profit?

    db_img

    At first we should find first transaction of each address then we must check if that transaction realted to trade NFT’s or not.

    then we should count addresses that their first transaction is trading NFT’s

    for doing that we used code bellow:

    WITH FIRST_TRANSACTION_OF_WALLETS AS ( SELECT FROM_ADDRESS AS NFT_ADDRESSES_FROM , TX_ID , BLOCK_TIMESTAMP , row_number() over (partition by FROM_ADDRESS order by BLOCK_TIMESTAMP) as position FROM flipside_prod_db.polygon.transactions

    ),

    NFT_TOKEN_CONTRACT_INFO AS ( SELECT TX_ID FROM flipside_prod_db.polygon.labels JOIN flipside_prod_db.polygon.udm_events ON flipside_prod_db.polygon.labels.ADDRESS=flipside_prod_db.polygon.udm_events.CONTRACT_ADDRESS WHERE LABEL_TYPE LIKE '%nft%' AND LABEL_SUBTYPE='token_contract' )

    SELECT COUNT (FIRST_TRANSACTION_OF_WALLETS.NFT_ADDRESSES_FROM) AS ADDRESS_NUMBER FROM NFT_TOKEN_CONTRACT_INFO JOIN FIRST_TRANSACTION_OF_WALLETS ON NFT_TOKEN_CONTRACT_INFO.TX_ID=FIRST_TRANSACTION_OF_WALLETS.TX_ID WHERE position=1

    WHERE LABEL_TYPE LIKE '%nft%' AND LABEL_SUBTYPE='token_contract'

    this condition seprates transactions trading NFT’s from other transactions for us

    visualization bellow is result of code above

    Who made the most profit?

    we used TO_ADDRESS and FROM_ADDRESS column of flipside_prod_db.polygon.udm_events to find inflow and outflow of each address

    when the transaction address is in TO_ADDRESS column , means tat USD gets into the wallet

    and when transaction address is in FROM_ADDRESS column , means tat USD goes out of the wallet

    we ordered each address by the profit they earned and picked top 10 of them

    here is the result :

    Loading...
    Loading...