HosseinUntitled Query
Updated 2022-11-13Copy Reference Fork
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
with list as (
select
date_trunc('day', block_timestamp)::date as day,
address as staker,
iff(day >= '2022-11-06', 'After Madness', 'Before Madness') as status,
count(distinct(tx_id)) as txn_count,
sum(amount / pow(10, 9)) as volume,
avg(amount / pow(10, 9)) as average_amount,
row_number() over (partition by day order by volume desc) as n
from solana.core.fact_stake_pool_actions
where action ilike any ('%withdraw%', '%unstake%')
and block_timestamp::date between '2022-11-01' and '2022-11-14'
and succeeded = 1
and amount > 0
group by day, address
qualify n <= 10
)
select day, staker, status, txn_count, volume, average_amount
from list
order by day, volume desc
Run a query to Download Data