iboo-jbj2MVAnchor bETH 2
Updated 2022-04-07
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
›
⌄
WITH
provide AS (
SELECT
block_timestamp::date AS pdate,
COUNT(DISTINCT(sender)) AS wallets,
SUM(amount_usd) AS total
FROM
anchor.collateral
WHERE
event_type = 'provide' AND
currency = 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' AND
pdate > CURRENT_DATE - 91
GROUP BY 1
),
withdraw AS (
SELECT
block_timestamp::date AS wdate,
COUNT(DISTINCT(sender)) AS wallets,
SUM(amount_usd) AS total
FROM
anchor.collateral
WHERE
event_type = 'withdraw' AND
currency = 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' AND
wdate > CURRENT_DATE - 91
GROUP BY 1
)
SELECT
provide.pdate AS date,
provide.wallets AS depositers,
provide.total AS deposits,
withdraw.wallets AS withdrawers,
withdraw.total AS withdraws,
deposits - withdraws AS total,