cheeyoung-kekMakerDao 6
    Updated 2022-09-06
    with


    symbol as(

    select
    address,address_name
    from ethereum.core.dim_labels
    where label='aave'
    ),


    total_deposit as(

    SELECT

    block_timestamp::date as day,
    case when symbol like '0x%' then address_name else symbol end as symbol,
    count (tx_id) as tx_count,
    count (distinct depositor_address) as depositors,
    sum (SUPPLIED_USD) as total_usd,
    sum (total_usd) over (order by day) as cum_usd,
    sum (depositors) over (order by day) as cum_dep,
    sum (tx_count) over (order by day) as cum_tx_count

    from flipside_prod_db.aave.deposits a
    left outer join symbol b
    on a.symbol=b.address
    where SYMBOL <> 'REP'
    group by 1,2
    order by 1

    ),
    total_withdrawal as(


    Run a query to Download Data