tvemulapCurrent Azuki Holders
    Updated 2023-04-26
    WITH
    current_holder as (
    SELECT
    nt.tokenid,
    max(nt.block_timestamp) as last_move
    FROM
    ethereum.core.ez_nft_transfers as nt
    WHERE
    nt.nft_address = lower('0xED5AF388653567Af2F388E6224dC7C4b3241C544')
    and nt.event_type != 'mint'
    and nt.nft_to_address not in (
    select distinct
    (contract_address)
    from
    ethereum.core.dim_contract_abis
    )
    GROUP BY
    tokenid
    )
    SELECT
    t.nft_to_address,
    count(t.tokenid) as "# Held"
    FROM
    current_holder as c
    LEFT JOIN ethereum.core.ez_nft_transfers as t on (
    c.tokenid = t.tokenid
    and c.last_move = t.block_timestamp
    )
    GROUP BY
    t.nft_to_address
    order by
    count(t.tokenid) DESC
    Run a query to Download Data