Madiusers
Updated 2023-12-10
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
›
⌄
with
contracts as (
select
ORIGIN_FROM_ADDRESS as wallet,
count (DISTINCT contract_address) as count_contracts
from ethereum.core.ez_token_transfers
group by 1),
maxbalancedate as (
select
USER_ADDRESS as wallet,
max(block_timestamp) as maxdate
from ethereum.core.fact_eth_balances
group by 1
),
balancewallet as
(select
USER_ADDRESS, sum(USD_VALUE_NOW) as usd_balance
from ethereum.core.ez_current_balances a join maxbalancedate b on USER_ADDRESS = wallet
group by 1
)
select USER_ADDRESS as wallet, count_contracts, usd_balance
from balancewallet join contracts on USER_ADDRESS = wallet
order by usd_balance desc, count_contracts desc
Run a query to Download Data