Nige7777wbtc_user_switch
Updated 2023-03-27
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
›
⌄
with cte_wbtc2 as (
select
supplier
-- ,date_trunc('hour', block_timestamp) hour
,sum(supplied_base_asset) Supplied_WBTC
from compound.deposits d
where
d.ctoken in
(
'0xccf4429db6322d5c611ee964527d42e5d685dd6a' --'cWBTC2'
)
and ( block_timestamp >= '2021-03-19T15:02:04Z' and block_timestamp <= '2021-03-20T15:02:04Z') -- first 24 hours
group by supplier
)
,
cte_wbtc as (
select
supplier
,SUM(recieved_amount) Redeemed_WBTC
--,date_trunc('hour', block_timestamp) hour
from compound.redemptions r
where
r.ctoken in
(
'0xc11b1268c1a384e55c48c2391d8d480264a3a7f4' -- 'cWBTC'
)
and block_timestamp>= '2021-03-18T15:02:04Z' and block_timestamp <= '2021-03-20T15:02:04Z'
--and supplier in (select supplier from cte_wbtc2)
group by supplier
)
select r.supplier,r.Redeemed_WBTC, s.Supplied_WBTC from cte_wbtc r
join cte_wbtc2 s on s.supplier = r.supplier
where r.supplier in (select supplier from cte_wbtc2)
order by 2 desc
Run a query to Download Data