MLDZMNaal9
Updated 2022-11-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
›
⌄
with tb1 as(SELECT
*
from solana.core.dim_labels
where label ilike '%alameda%'
or label ilike 'ftx%'
),
tb2 as (select
mint
from solana.core.fact_transfers
where mint in ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
'6nuaX3ogrr2CaoAPjtaKHAoBNWok32BMcRozuf32s2QF',
'FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1')
)
select
BLOCK_TIMESTAMP::date as day,
b.label as source,
count(distinct TX_ID) as no_transfer,
count(distinct TX_FROM) as no_sender,
sum(AMOUNT) as total_volume,
avg(AMOUNT) as avg_volume,
row_number () over (order by total_volume desc) as rank
from solana.core.fact_transfers s left join solana.core.dim_labels b on s.TX_FROM=b.address
where MINT in (select mint from tb2)
and TX_TO in (select ADDRESS from tb1)
and TX_FROM not in (select ADDRESS from tb1)
and source is not null
and LABEL_TYPE='cex'
and BLOCK_TIMESTAMP>='2022-10-01'
group by 1,2
Run a query to Download Data