KaskoazulNEAR City - Transactions
    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}}
    ),

    raw_txs_active_users as (
    select t.block_timestamp::date as fecha,
    t.tx_receiver,
    t.tx_signer as users,
    t.txn_hash,
    e.action_name,
    e.action_data:gas / pow(10,24) as gas,
    e.action_data:method_name
    from flipside_prod_db.mdao_near.transactions t
    join active_users_last_days a
    on t.tx_signer = a.users
    left join flipside_prod_db.mdao_near.actions_events e
    on t.txn_hash = e.txn_hash
    --where users in (select users from active_users_last_days)
    ),

    active_users_txs as (
    select fecha,
    --tx_receiver,
    action_name,
    count (txn_hash) as txs,
    sum (gas) as gas_used
    from raw_txs_active_users
    Run a query to Download Data