Ali3NAverage Daily AAVE Withdraw Comparison
    Updated 2022-09-14
    with t1 as(
    select block_timestamp::date as date,
    count (distinct tx_hash) as Withdraw_Count,
    count (distinct depositor_address) as Users_Count,
    sum (withdrawn_tokens) as ETH_Volume,
    sum (withdrawn_usd)
    from ethereum.aave.ez_withdraws
    where symbol in ('WETH','ETH','aETH','aWETH','cETH','cbETH','fETH','iETH','ibETH','icETH','pETH','rETH','sETH','stETH','stkETH','vETH','wstETH')
    --and platform ilike 'uniswap%'
    and block_timestamp >= CURRENT_DATE - 21
    group by 1),

    t2 as (
    select block_timestamp::date as date,
    count (distinct tx_hash) as Withdraw_Count,
    count (distinct depositor_address) as Users_Count,
    sum (withdrawn_tokens) as ETH_Volume,
    sum (withdrawn_usd)
    from ethereum.aave.ez_withdraws
    where symbol in ('WETH','ETH','aETH','aWETH','cETH','cbETH','fETH','iETH','ibETH','icETH','pETH','rETH','sETH','stETH','stkETH','vETH','wstETH')
    --and platform ilike 'uniswap%'
    and block_timestamp < CURRENT_DATE - 21 and block_timestamp >= '2022-08-01'
    group by 1)

    select 'Recent 3 Weeks' , avg (withdraw_count), avg (users_count), avg (eth_volume) from t1
    union all
    select 'Before Recent 3 Weeks' , avg (withdraw_count), avg (users_count), avg (eth_volume) from t2


    Run a query to Download Data