MLDZMNstba7
    Updated 2023-03-07
    with tb2 as (
    select
    BLOCK_TIMESTAMP,
    FROM_ADDRESS,
    ORIGIN_FROM_ADDRESS,
    TO_ADDRESS,
    tx_hash,
    RAW_AMOUNT/POWER(10, 6) as amount
    from arbitrum.core.fact_token_transfers
    WHERE contract_address = '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8'
    order by 1
    )

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