anniecryptoAAVE and stAAVE movements_total 1
    Updated 2022-08-07
    with tab1 as(SELECT 'deposit' as type_of_activity, count(distinct tx_id) as count_of_deposit_transactions,
    sum(supplied_usd) as usd_amount_deposited,
    sum(issued_tokens) as token_amount_deposited
    from flipside_prod_db.aave.deposits
    where block_timestamp::date >= '2022-01-01' and block_timestamp::date <= current_date - 1
    and SYMBOL = 'AAVE' and supplied_usd is not null and issued_tokens is not null),
    tab2 as(SELECT 'withdraw' as type_of_activity, count(distinct tx_id) as count_of_withdraw_transactions,
    sum(WITHDRAWN_USD) as usd_amount_withdrawn,
    sum(withdrawn_tokens) as token_amount_withdrawn
    from
    flipside_prod_db.aave.withdraws
    where SYMBOL = 'AAVE' and WITHDRAWN_USD is not null and withdrawn_tokens is not null
    and block_timestamp::date >= '2022-01-01' and block_timestamp::date <= current_date - 1)
    select type_of_activity, count_of_deposit_transactions, usd_amount_deposited, token_amount_deposited from tab1
    union ALL
    select type_of_activity, count_of_withdraw_transactions, usd_amount_withdrawn, token_amount_withdrawn from tab2