Hadisehethe 1
    Updated 2022-09-18
    ---with help masi#0814
    with t1 as ( select date(block_timestamp) as date ,
    LIQUIDITY_PROVIDER as user ,
    tx_hash,
    AMOUNT0_ADJUSTED as amount
    from ethereum.uniswapv3.ez_lp_actions
    where ACTION = 'DECREASE_LIQUIDITY' and TOKEN0_SYMBOL = 'WETH'
    UNION
    select date(block_timestamp) as date ,
    LIQUIDITY_PROVIDER as user ,
    AMOUNT1_ADJUSTED as amount,tx_hash
    from ethereum.uniswapv3.ez_lp_actions
    where ACTION = 'DECREASE_LIQUIDITY' and TOKEN1_SYMBOL = 'WETH' )


    select 'Maker' as protocol,
    date(block_timestamp) as date,
    count(DISTINCT tx_hash) as total_transactions,
    count(DISTINCT WITHDRAWER) as unique_user,
    sum(AMOUNT_WITHDRAWN)*-1 as total_amount,
    sum(total_amount) over (order by date asc) as cumulative_amount,
    avg(AMOUNT_WITHDRAWN) as avg_amount
    from ethereum.maker.ez_withdrawals
    where symbol = 'WETH' and block_timestamp::date >= CURRENT_DATE - 30
    group by 1,2
    UNION
    select 'AAVE' as protocol,
    date(block_timestamp) as date,
    count(DISTINCT tx_hash) as total_transactions,
    count(DISTINCT DEPOSITOR_ADDRESS) as unique_user,
    sum(WITHDRAWN_TOKENS)*-1 as total_amount,
    sum(total_amount) over (order by date asc) as cumulative_amount,
    avg(WITHDRAWN_TOKENS) as avg_amount
    from ethereum.aave.ez_withdraws
    where block_timestamp::date >= CURRENT_DATE - 30 and symbol = 'WETH'
    group by 1,2
    Run a query to Download Data