KaskoazulNEAR City - Users
    Updated 2022-07-06
    with active_users as (
    select tx_signer as users,
    max (block_timestamp::date) as last_day
    from flipside_prod_db.mdao_near.transactions
    group by users
    ),

    active_users_last_days as (
    select users, last_day
    from active_users
    where last_day > CURRENT_DATE - {{last_day}}
    ),

    unique_active_users as (
    select t.block_timestamp::date as fecha,
    count (distinct t.tx_signer) as users
    from flipside_prod_db.mdao_near.transactions t
    inner join active_users_last_days a
    on t.tx_signer = a.users
    where fecha > CURRENT_DATE - 90
    group by 1
    ),


    unique_users as (
    select block_timestamp::date as fecha,
    count (distinct tx_signer) as users
    from flipside_prod_db.mdao_near.transactions
    where fecha > CURRENT_DATE - 90
    group by 1
    ),

    final as (
    select ac.fecha,
    ac.users as active,
    al.users as all_users,
    Run a query to Download Data