MLDZMNpes8
    Updated 2022-10-19
    select
    block_timestamp::date as day,
    'Optimism' as network,
    count(FROM_ADDRESS) as no_users,
    sum(no_users) over (order by day) as grow_rate,
    sum(TX_FEE) as fee
    from optimism.core.fact_transactions x join optimism.core.dim_labels y on x.TO_ADDRESS= y.address
    where label_subtype != 'token_contract'
    and LABEL_TYPE in ('dex')
    and STATUS = 'SUCCESS'
    and block_timestamp>=CURRENT_DATE- {{Time_period}}
    group by 1
    union all
    select
    block_timestamp::date as day,
    'Arbitrum' as network,
    count(FROM_ADDRESS) as no_users,
    sum(no_users) over (order by day) as grow_rate,
    sum(TX_FEE) as fee
    from Arbitrum.core.fact_transactions x join Arbitrum.core.dim_labels y on x.TO_ADDRESS= y.address
    where label_subtype != 'token_contract'
    and LABEL_TYPE in ('dex')
    and STATUS = 'SUCCESS'
    and block_timestamp>=CURRENT_DATE- {{Time_period}}
    group by 1
    union all
    select
    block_timestamp::date as day,
    'Avalanche' as network,
    count(FROM_ADDRESS) as no_users,
    sum(no_users) over (order by day) as grow_rate,
    sum(TX_FEE) as fee
    from Avalanche.core.fact_transactions x join Avalanche.core.dim_labels y on x.TO_ADDRESS= y.address
    Run a query to Download Data