permarycombative-bronze
Updated 2024-10-08
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 aave_users as (
select
'aave' as protocol,
depositor_address as wallet_address
from ethereum.aave.ez_deposits
where block_timestamp >= current_date - interval '3 months'
),
compound_users as (
select
'compound' as protocol,
supplier as wallet_address
from ethereum.compound.ez_deposits
where block_timestamp >= current_date - interval '3 months'
),
silo_users as (
select
'silo' as protocol,
depositor as wallet_address
from ethereum.defi.ez_lending_deposits
where block_timestamp >= current_date - interval '3 months'
)
select
'aave' as protocol,
count(wallet_address) as unique_user_count,
(select(count(distinct wallet_address)from (
SELECT wallet_address FROM aave_users
UNION
SELECT wallet_address FROM compound_users
UNION
SELECT wallet_address FROM silo_users
)) AS total_unique_users
from aave_users
union all
QueryRunArchived: QueryRun has been archived