eferdegen top + random holders copy
Updated 2024-04-20
999
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
›
⌄
-- forked from mo115 / degen top + random holders @ https://flipsidecrypto.xyz/mo115/q/Td2hRrp0KNyB/degen-top-random-holders
with w as(
with degen as (
(with T_in as (select TO_ADDRESS as user
, sum(RAW_AMOUNT_PRECISE)as in_token
from base.core.fact_token_transfers
where CONTRACT_ADDRESS = '0x4ed4e862860bed51a9570b96d89af5e1b0efefed'
and BLOCK_NUMBER <= 13333333
group by 1)
, T_out as (select FROM_ADDRESS as user
, sum(RAW_AMOUNT_PRECISE)as out_token
from base.core.fact_token_transfers
where CONTRACT_ADDRESS = '0x4ed4e862860bed51a9570b96d89af5e1b0efefed'
and BLOCK_NUMBER <= 13333333
group by 1)
select i.user as user,
case when in_token is null then '0' else in_token end as i,
case when out_token is null then '0' else out_token end as o,
(i-o) as hold,
'top' as type
from T_in i left join T_out o on i.user=o.user
where hold >= 1.0e+22
order by hold DESC
limit 1000)
UNION
((with T_in as (select TO_ADDRESS as user
, sum(RAW_AMOUNT_PRECISE)as in_token
from base.core.fact_token_transfers
where CONTRACT_ADDRESS = '0x4ed4e862860bed51a9570b96d89af5e1b0efefed'
and BLOCK_NUMBER <= 13333333
group by 1)
, T_out as (select FROM_ADDRESS as user
QueryRunArchived: QueryRun has been archived