Afonso_Diaz2023-09-27 03:17 PM
Updated 2023-09-27
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 t as (
select
tx_id,
block_timestamp,
'From CEX' as type,
tx_to as user,
amount as amount_usd
from solana.core.fact_transfers
join solana.core.dim_labels
on address = tx_from
where label_type = 'cex'
and mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
and block_timestamp::date >= current_date - interval '{{ days }} days'
union all
select
tx_id,
block_timestamp,
'To CEX' as type,
tx_from as user,
amount as amount_usd
from solana.core.fact_transfers
join solana.core.dim_labels
on address = tx_to
where label_type = 'cex'
and mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
and block_timestamp::date >= current_date - interval '{{ days }} days'
)
select
type,
count(distinct tx_id) as transactions,
count(distinct user) as users,
sum(amount_usd) as volume_usd,
avg(amount_usd) as average_volume_usd,
Run a query to Download Data