maybeyonaseth_rem_aave_inflow
    Updated 2022-09-18
    -- aave inflows

    with inflows as (
    select
    block_timestamp,
    tx_hash,
    'deposit' as event,
    issued_tokens as amt,
    supplied_usd as amt_usd
    from ethereum.aave.ez_deposits
    where symbol = 'WETH'
    union all
    select
    block_timestamp,
    tx_hash,
    'repay' as event,
    repayed_tokens as amt,
    repayed_usd as amt_usd
    from ethereum.aave.ez_repayments
    where symbol = 'WETH'
    )

    select * from (
    select
    date(block_timestamp) as date,
    event,
    count(tx_hash) as txs,
    sum(amt) as eth_vol,
    sum(amt_usd) as usd_vol,
    avg(amt) as avg_eth
    from inflows
    group by 1,2
    order by date desc
    limit 180
    Run a query to Download Data