zakkisyedAnchor: Total Borrows & Deposits
Updated 2021-12-25
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
29
30
31
32
33
34
35
36
›
⌄
select t1.borrowed_amount, t2.deposit__amount, t1.dayz
from
--borrow_USD
( select sum(amount_usd) as borrowed_amount, date_trunc('day', block_timestamp) as dayz
from anchor.borrows
--where block_timestamp = current_date - 90
group by 2
order by 2 desc
) as t1
INNER JOIN
--deposit_USD
(
select sum(deposit_amount_usd) as deposit__amount, date_trunc('day', block_timestamp) as dayz
from anchor.deposits
where block_timestamp > '2021-09-24' --last 3 days
group by 2
order by 2 desc
) as t2
ON t1.dayz = t2.dayz
Run a query to Download Data