primo_dataAave - 7. AAVE movements
    Updated 2022-08-12
    --Daily AAVE supplied and withdrawn on Aave protocol.

    with supplied as (
    select date(block_timestamp) dt
    , blockchain
    , aave_version
    , symbol token
    , 'supplied' typ
    , count(distinct tx_id) tx_ct
    , count(distinct depositor_address) depositer_ct
    , sum(supplied_usd) total_amount_usd
    from flipside_prod_db.aave.deposits
    group by 1,2,3,4
    ),
    withdrawn as (
    select date(block_timestamp) dt
    , blockchain
    , aave_version
    , symbol token
    , 'withdrawn' typ
    , count(distinct tx_id) tx_ct
    , count(distinct depositor_address) depositer_ct
    , -sum(withdrawn_usd) total_amount_usd
    from flipside_prod_db.aave.withdraws
    group by 1,2,3,4
    )
    select *
    from
    (
    select *
    from withdrawn
    )
    union ALL
    (
    select *
    from supplied
    Run a query to Download Data