MLDZMNftx4
Updated 2022-11-11
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 tbt as (select block_timestamp::date as day,
avg (swap_to_amount/swap_from_amount) as SOLprice
from solana.fact_swaps
where swap_from_mint = 'So11111111111111111111111111111111111111112'
and swap_to_mint in ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v','Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')
and swap_to_amount > 0
and swap_from_amount > 0
and succeeded = 'TRUE'
group by 1),
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',
'So11111111111111111111111111111111111111112')
)
select
block_timestamp::date as day,
b.label as source,
case
when mint in ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v','Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB') then sum(AMOUNT)
else sum(AMOUNT*SOLprice)
end as volume_USD,
case
when mint in ('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v','Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB') then avg(AMOUNT)
else avg(AMOUNT*SOLprice)
Run a query to Download Data