MLDZMNaal6
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
33
34
35
36
›
⌄
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
'Inflow to Alameda or FTX' as actions,
b.label as token,
count(distinct TX_ID) as no_transfer,
count(distinct TX_FROM) as no_sender,
sum(AMOUNT) as total_volume,
avg(AMOUNT) as avg_volume
from solana.core.fact_transfers s left join solana.core.dim_labels b on s.mint=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 BLOCK_TIMESTAMP>='2022-10-01'
group by 1,2
union all
select
'Outflow from Alameda or FTX' as actions,
b.label as token,
count(distinct TX_ID) as no_transfer,
count(distinct TX_TO) as no_sender,
sum(AMOUNT) as total_volume,
Run a query to Download Data