vendettaUntitled Query copy
    Updated 2023-02-12
    -- forked from 04d7f46f-8dec-4eb4-a81c-b7bd20817562


    WITH TEMP_1 AS (
    SELECT block_timestamp,
    BORROWED_USD as borrow
    FROM ethereum.aave.ez_borrows
    where symbol <> 'REP'

    ), TEMP_2 AS (
    SELECT block_timestamp,
    SUPPLIED_USD as deposit
    FROM ethereum.aave.ez_deposits
    where symbol <> 'REP'
    )
    SELECT date_trunc('day',b.BLOCK_TIMESTAMP) as date_D,
    sum(b.borrow) AS borrow,
    sum(d.deposit) AS deposit
    FROM TEMP_1 as b
    join temp_2 as d
    on d.BLOCK_TIMESTAMP = b.BLOCK_TIMESTAMP
    where deposit <> 0 or borrow <> 0
    group by 1
    order by (3,2) desc


    Run a query to Download Data