purifLeft curve bera mint data
    Updated 2024-09-03
    with minters as ( select minter, sum(amount_minted) as amount_minted from (
    select ORIGIN_FROM_ADDRESS as minter, (utils.udf_hex_to_int(substr(data,3,64))::int) as amount_minted from base.core.fact_event_logs
    where contract_address=lower('0x2422c8A8F7da90231E96e6c5f4cC763644d8347C')
    and topics[0]='0x0bcebb3a67a4c96cfa0fbe0cf3b655f40d2248e18932a3a845823ca57620c9de'
    and topics[1]='0x000000000000000000000000737732ba94b868e5115cce477bfb171ae9069d88'
    )
    group by 1),
    hc_holders as (
    SELECT
    current_owner,
    COUNT(*) AS cnt
    FROM (
    SELECT NFT_TO_ADDRESS AS current_owner,
    t.tokenId,
    t.BLOCK_TIMESTAMP
    from ethereum.nft.ez_nft_transfers t
    INNER JOIN (
    SELECT tokenId, max(BLOCK_NUMBER) AS BLOCK_NUMBER
    from ethereum.nft.ez_nft_transfers t where NFT_ADDRESS=lower('0xcb0477d1af5b8b05795d89d59f4667b59eae9244')
    GROUP BY tokenId
    ) t2 ON t2.tokenId = t.tokenId AND t2.BLOCK_NUMBER = t.BLOCK_NUMBER
    where NFT_ADDRESS=lower('0xcb0477d1af5b8b05795d89d59f4667b59eae9244')
    ) t3
    GROUP BY current_owner
    order by cnt desc
    ),
    hc_minters as (
    select distinct minter as hc_holders_count from minters m
    join hc_holders hc on hc.current_owner=m.minter
    ),
    testnet_users as (
    select distinct minter as testnet_users_count from minters m
    join (
    select distinct from_address as user, count(distinct tx_hash) as txs from berachain.testnet.fact_transactions
    group by 1 having count(distinct tx_hash)>0
    ) t on t.user=m.minter
    QueryRunArchived: QueryRun has been archived