ML6Metamask wallet holders
    Updated 2022-06-24
    with Metamask_wallet as (select distinct origin_from_address from ethereum.core.ez_dex_swaps where origin_to_address='0x881d40237659c251811cec9c364ef91dc08d300c')

    ,buy as (select sum(amount) as buy_amount , eth_to_address from ethereum.core.ez_eth_transfers inner join Metamask_wallet
    on Metamask_wallet.origin_from_address=ethereum.core.ez_eth_transfers.eth_to_address where amount>0
    group by 2)
    ,sell as (select sum(amount) as sell_amount , eth_from_address from ethereum.core.ez_eth_transfers inner join Metamask_wallet
    on Metamask_wallet.origin_from_address=ethereum.core.ez_eth_transfers.eth_from_address where amount>0
    group by 2)

    ,holds_address as (select (buy_amount-sell_amount) as hold_amount,eth_to_address from buy left join sell
    on eth_to_address=eth_from_address
    where hold_amount>0
    )
    , number_of_holders as (select count(1) from holds_address)
    , avg_eth as (select avg(hold_amount) from holds_address)
    , top10holders as (select hold_amount,eth_to_address from holds_address order by hold_amount desc limit 10)
    , mint_nft as (select count(distinct nft_to_address) from ethereum.core.ez_nft_mints inner join Metamask_wallet
    on Metamask_wallet.origin_from_address=nft_to_address)
    ,mint_nft_chart as (select count(1),block_timestamp::date from ethereum.core.ez_nft_mints inner join Metamask_wallet
    on Metamask_wallet.origin_from_address=nft_to_address
    group by 2)
    , buynft as (select count(distinct buyer_address) from ethereum.core.ez_nft_sales inner join Metamask_wallet
    on Metamask_wallet.origin_from_address=buyer_address)
    , buynft_chart as (select count(1),block_timestamp::date from ethereum.core.ez_nft_sales inner join Metamask_wallet
    on Metamask_wallet.origin_from_address=buyer_address
    group by 2)
    , sellnft as (select count(distinct seller_address) from ethereum.core.ez_nft_sales inner join Metamask_wallet
    on Metamask_wallet.origin_from_address=seller_address)
    , sellnft_chart as (select count(1),block_timestamp::date from ethereum.core.ez_nft_sales inner join Metamask_wallet
    on Metamask_wallet.origin_from_address=seller_address
    group by 2)
    select * from number_of_holders
    Run a query to Download Data