cyphereth removed from aave
    Updated 2022-09-17
    with eth_deposited as (select * from ethereum.aave.ez_deposits
    where contains(symbol, 'ETH')),

    daily_eth_deposited as (select
    date_trunc('day', block_timestamp) as day,
    sum(issued_tokens) as eth_amount_deposited,
    sum(supplied_usd) as usd_amount
    from eth_deposited
    where day >= current_date() - 30
    group by day),

    eth_withdrawn as (select * from ethereum.aave.ez_withdraws
    where contains(symbol, 'ETH')),

    daily_eth_withdrawn as (select
    date_trunc('day', block_timestamp) as day,
    sum(withdrawn_tokens) as eth_amount_withdrawn,
    sum(withdrawn_usd) as usd_amount
    from eth_withdrawn
    where day >= current_date() - 30
    group by day),

    net_deposited as (
    select d.day, d.eth_amount_deposited, w.eth_amount_withdrawn, d.eth_amount_deposited-w.eth_amount_withdrawn as net_deposited
    from daily_eth_deposited d, daily_eth_withdrawn w
    where d.day = w.day
    )

    select * from net_deposited
    Run a query to Download Data