MLDZMNDDU10
    Updated 2023-01-25
    with tt as (select
    USER_ADDRESS as users
    from ethereum.core.ez_current_balances
    where CONTRACT_ADDRESS='0x92d6c1e31e14520e676a687f0a93788b716beff5'
    and CURRENT_BAL>0
    ),

    tb2 as (
    select
    x.BLOCK_TIMESTAMP,
    x.FROM_ADDRESS,
    x.tx_hash,
    sum(RAW_AMOUNT/1e18) as send,
    x.TO_ADDRESS
    from ethereum.core.fact_token_transfers x
    join tt y on x.from_address = y.users
    and contract_address = '0x92d6c1e31e14520e676a687f0a93788b716beff5'
    group by 1,2,3,5 )

    select
    date_trunc('day',BLOCK_TIMESTAMP) as date,
    LABEL_TYPE,
    count(distinct FROM_ADDRESS) as users,
    count(tx_hash) as count_txn,
    sum(count_txn) over (partition by LABEL_TYPE order by date) as cum_txn
    from tb2 q join ethereum.core.dim_labels w on q.TO_ADDRESS= w.address
    where LABEL_TYPE not in ('chadmin','operator','token')
    and BLOCK_TIMESTAMP>='2022-12-01'
    group by 1,2
    Run a query to Download Data