vendettaUntitled Query copy
Updated 2023-02-12
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
›
⌄
-- 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