HadisehSolana Since The Mango Hack 8
Updated 2022-10-17Copy Reference Fork
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
›
⌄
with t1 as ( select date(block_timestamp) as date,
case
when block_timestamp::date < '2022-10-11' then 'befor-hack'
when block_timestamp::date >= '2022-10-11' then 'after-hack'
end as date_case,
SWAP_PROGRAM,
count(DISTINCT tx_id) as transactions,
swapper
from solana.core.fact_swaps
where date > CURRENT_DATE - 20
group by date,date_case,SWAP_PROGRAM,swapper)
,
t2 as ( select date,
date_case,
SWAP_PROGRAM,
count(DISTINCT swapper) as total_user,
sum(transactions) as total_transaction,
avg(transactions) as average_tx
from t1
group by date,date_case,SWAP_PROGRAM
order by date)
select date_case,
swap_program,
avg(total_user) as user_average,
avg(total_transaction) as transactions_average
from t2
group by date_case,swap_program
Run a query to Download Data