chill1opaave19
    Updated 2024-06-21
    with borrows as (select count(*) as p1 , count(distinct borrower_address) as p2 , sum(borrowed_usd) as p3 from ethereum.aave.ez_borrows
    where borrowed_usd < pow(10,15) and borrowed_usd is not null and year(block_timestamp) >= 2022
    )
    , deposits as (select count(*) as p1 , count(distinct depositor_address) as p2 , sum(supplied_usd) as p3 from ethereum.aave.ez_deposits
    where supplied_usd < pow(10,15) and supplied_usd is not null and year(block_timestamp) >= 2022
    )
    ,borrows_chart as (select count(*) as p1 , count(distinct borrower_address) as p2 , sum(borrowed_usd) as p3 , date_trunc('WEEK', block_timestamp) as d from ethereum.aave.ez_borrows
    where borrowed_usd < pow(10,15) and borrowed_usd is not null and year(block_timestamp) >= 2022
    group by d
    )
    , deposits_chart as (select count(*) as p1 , count(distinct depositor_address) as p2 , sum(supplied_usd) as p3 , date_trunc('WEEK', block_timestamp) as d from ethereum.aave.ez_deposits
    where supplied_usd < pow(10,15) and supplied_usd is not null and year(block_timestamp) >= 2022
    group by d
    )
    , borrows_tokens as (select count(*) as p1 ,count(distinct borrower_address) as p2 , sum(borrowed_usd) as p3 , symbol from ethereum.aave.ez_borrows
    where borrowed_usd < pow(10,15) and borrowed_usd is not null and year(block_timestamp) >= 2022
    group by 4
    )
    , borrows_tokens_chart as (select count(*) as p1 ,count(distinct borrower_address) as p2 , sum(borrowed_usd) as p3 , symbol , date_trunc('WEEK', block_timestamp) as d from ethereum.aave.ez_borrows
    where borrowed_usd < pow(10,15) and borrowed_usd is not null and year(block_timestamp) >= 2022
    group by 4 , 5
    )
    , deposits_tokens as (select count(*) as p1 ,count(distinct depositor_address) as p2 , sum(supplied_usd) as p3 , symbol from ethereum.aave.ez_deposits
    where supplied_usd < pow(10,15) and supplied_usd is not null and year(block_timestamp) >= 2022
    group by 4
    )
    , deposits_tokens_chart as (select count(*) as p1 ,count(distinct depositor_address) as p2 , sum(supplied_usd) as p3 , symbol, date_trunc('WEEK', block_timestamp) as d from ethereum.aave.ez_deposits
    where supplied_usd < pow(10,15) and supplied_usd is not null and year(block_timestamp) >= 2022
    group by 4 , 5
    )
    , borrows_count_top10 as (select count(*) as p1 , borrower_address from ethereum.aave.ez_borrows
    where borrowed_usd < pow(10,15) and borrowed_usd is not null and year(block_timestamp) >= 2022
    group by 2
    QueryRunArchived: QueryRun has been archived