maybeyonaseth_rem_aave_netflows
    Updated 2022-09-18
    with flows as (
    select
    block_timestamp,
    tx_hash,
    'borrow' as event,
    -borrowed_tokens as amt,
    -borrowed_usd as amt_usd
    from ethereum.aave.ez_borrows
    where symbol = 'WETH'
    union all
    select
    block_timestamp,
    tx_hash,
    'withdraw' as event,
    -withdrawn_tokens as amt,
    -withdrawn_usd as amt_usd
    from ethereum.aave.ez_withdraws
    where symbol = 'WETH'

    union all
    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,
    Run a query to Download Data