par_rnAll Solana tx VS. Staking tx on Solana over time
Updated 2022-12-24Copy 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
all_tx as (
SELECT
block_timestamp::date as date,
sum(1) as tx_count
from solana.core.fact_events
where block_timestamp>='2022-09-01'
and event_type is not null
group by 1
),
staked_tx as (
SELECT
block_timestamp::date as date,
sum(1) as tx_count
from solana.core.fact_events
where block_timestamp>='2022-09-01'
and (event_type='delegate' or event_type='deactivate' or instruction:programId='Stake11111111111111111111111111111111111111')
and event_type is not null
group by 1
)
SELECT
x.date,
x.tx_count as total_tx,
sum(total_tx) over (order by x.date) as cum_tx,
y.tx_count as staked_tx,
sum(staked_tx) over (order by x.date) as cum_staked_tx,
(staked_tx/total_tx)*100 as pcg_staking_tx,
100-pcg_staking_tx as pcg_non_staking_tx
from all_tx x, staked_tx y where x.date = y.date
order by 1 asc
Run a query to Download Data