shawnedwards Daily AAVE supplied and withdrawn on Aave protocol
    Updated 2022-08-10
    with deposit as (SELECT block_timestamp::date as daily,
    count(distinct tx_id) as deposit_transaction_count,
    coalesce(sum(issued_tokens),0) as amount_deposit, coalesce(sum(supplied_usd),0) as deposit_amount_usd
    from flipside_prod_db.aave.deposits
    where block_timestamp >= '2022-01-01' and block_timestamp <= current_date - 1
    and SYMBOL = 'AAVE' group by 1),
    withdraw as (SELECT block_timestamp::date as daily, count(distinct tx_id) as withdraw_transaction_count,
    coalesce(sum(withdrawn_tokens),0) as amount_withdraw,
    coalesce(sum(withdrawn_usd),0) as withdraw_amount_usd
    from
    flipside_prod_db.aave.withdraws
    where block_timestamp >= '2022-01-01' and block_timestamp <= current_date - 1 and SYMBOL = 'AAVE'
    group by 1)
    select deposit.daily, deposit_transaction_count, amount_deposit,deposit_amount_usd, withdraw_transaction_count, amount_withdraw,
    withdraw_amount_usd
    from deposit, withdraw where deposit.daily = withdraw.daily


    Run a query to Download Data