MLDZMNfish2
    Updated 2022-07-29
    with tb1 as (select
    NFT_ADDRESS,
    count(distinct TOKENID) as count_nfts,
    count(distinct NFT_FROM_ADDRESS) as count_victims
    from ethereum.core.ez_nft_transfers
    where nft_to_address='0x8c7934611b6ad70fbea13a1593de167a4689b9a9' --Address of thief
    and block_timestamp between '2022-04-20' and '2022-04-26'
    group by 1 ),

    tb2 as (select
    NFT_ADDRESS,
    avg(PRICE_USD) as USD_price
    from ethereum.core.ez_nft_sales
    where block_timestamp between '2022-04-20' and '2022-04-26'
    and NFT_ADDRESS in (select NFT_ADDRESS from tb1)
    group by 1),

    tb3 as (select
    x.NFT_ADDRESS,
    count_nfts*USD_price as value_solen
    from tb1 x join tb2 y on x.NFT_ADDRESS=y.NFT_ADDRESS)

    select
    sum(value_solen) as total_value
    from tb3
    Run a query to Download Data