Abolfazl_771025Untitled Query
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
›
⌄
with main as (
select
tx_from as user,
date_trunc('day',block_timestamp) as date,
sum (amount)*-1 as vol
from solana.core.fact_transfers
where mint = 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263'
group by 1,2
union
select
tx_to as user,
date_trunc('day',block_timestamp) as date,
sum(amount) as vol
from solana.core.fact_transfers
where mint = 'DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263'
group by 1,2
),table1 as (
select date,
user,
sum(vol) as hold_vol
from main
group by 1,2),active as (select
signers[0] as user,
count (distinct tx_id) as TX_Count
from solana.core.fact_transactions
where block_timestamp >= CURRENT_DATE - 90
group by 1 having tx_count > 10), main1 as(select
distinct(case when user in (select user from active) then user end) as user,
avg(case when user in (select user from active) then hold_vol end) as avg_hold_pactive_user
from table1
where hold_vol > 0
and date >= '2022-12-24'
group by 1)
select
case
Run a query to Download Data