Sbhn_NPaave 2 over time
    Updated 2023-03-01
    select 'Deposit' as type,
    date_trunc('day',block_timestamp) as date,
    count(DISTINCT tx_hash) as txs,
    count(DISTINCT depositor_address) as users,
    sum(supplied_usd) as volume_usd,
    avg(supplied_usd) as avg_volume
    from ethereum.aave.ez_deposits
    where block_timestamp::date >= CURRENT_DATE - {{Date}}
    group by 1,2

    UNION ALL

    select 'Borrow' as type,
    date_trunc('day',block_timestamp) as date,
    count(DISTINCT tx_hash) as txs,
    count(DISTINCT borrower_address) as users,
    sum(borrowed_usd) as volume_usd,
    avg(borrowed_usd) as avg_volume
    from ethereum.aave.ez_borrows
    where block_timestamp::date >= CURRENT_DATE - {{Date}}
    group by 1,2
    Run a query to Download Data