mattkstewTotal Metamask Users 2.0
    Updated 2022-06-23
    with tab1 as (
    select
    origin_from_address



    from ethereum.core.fact_event_logs
    where contract_address like lower('0x881D40237659C251811CEC9c364ef91dC08D300C')

    )

    , tab2 as (
    select
    user_address,
    avg(balance) as amount1

    from flipside_prod_db.ethereum.erc20_balances
    where user_address in (select * from tab1)
    and balance_date > current_date - 2
    and balance < 100000
    and symbol like 'ETH'
    group by 1
    )

    select
    Case
    when amount1 between 0 and 1 then 'Between 0 and 1 ETH'
    when amount1 between 1 and 10 then 'Between 1 and 10 ETH'
    when amount1 between 10 and 100 then 'Between 10 and 100 ETH'
    when amount1 between 100 and 1000 then 'Between 100 and 1000 ETH'
    when amount1 > 1000 then 'Greater than 1000 ETH'
    END as balance1,
    count(*)


    from tab2
    Run a query to Download Data