benimgTotal Active Wallets
    Updated 2022-05-07
    with month_1 as ( select count(*) as month_1_tx , tx_from as month_1_users
    from terra.transactions
    where block_timestamp::date >= '2022-01-01' and block_timestamp::date <= '2022-01-31' and TX_STATUS = 'SUCCEEDED'
    group by 2
    ),
    month_2 as ( select count(*) as month_2_tx , tx_from as month_2_users
    from terra.transactions
    where block_timestamp::date >= '2022-02-01' and block_timestamp::date <= '2022-02-28' and TX_STATUS = 'SUCCEEDED'
    group by 2 )
    ,
    join_two as ( select month_1_tx , month_1_users , month_2_tx , month_2_users
    from month_1 a left outer join month_2 b on a.month_1_users = b.month_2_users
    where month_1_tx > 30 and month_2_tx > 30
    order by 1)
    ,
    month_3 as ( select count(*) as month_3_tx , tx_from as month_3_users
    from terra.transactions
    where block_timestamp::date >= '2022-03-01' and block_timestamp::date <= '2022-03-31' and TX_STATUS = 'SUCCEEDED'
    group by 2 )
    ,
    join_three as ( select month_1_tx , month_2_tx, month_3_tx , month_1_users,month_2_users , month_3_users
    from month_3 a left outer join join_two b on a.month_3_users = b.month_1_users
    where month_1_tx > 4 and month_2_tx > 30 and month_3_tx > 30
    order by month_1_users)
    ,
    month_4 as ( select count(*) as month_4_tx , tx_from as month_4_users
    from terra.transactions
    where block_timestamp::date >= '2022-04-01' and block_timestamp::date <= '2022-04-30' and TX_STATUS = 'SUCCEEDED'
    group by 2 )
    ,
    final as ( select month_1_tx , month_2_tx, month_3_tx ,month_4_tx, (month_1_tx+month_2_tx+month_3_tx+month_4_tx) as total_tx , month_1_users,month_2_users , month_3_users,month_4_users
    from month_4 a left outer join join_three b on a.month_4_users = b.month_1_users
    where month_4_tx > 30 and month_1_tx > 30 and month_2_tx > 30 and month_3_tx > 30
    order by total_tx desc
    )
    Run a query to Download Data