ErsvanAverage staking amount
Updated 2023-01-09
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
›
⌄
WITH w_events_stake (day,address,amount,tx_id) AS
(
SELECT
DATE_TRUNC('day', block_timestamp) AS day,
inner_instruction:instructions[array_size(inner_instruction:instructions)-1]:parsed:info:authority AS address,
inner_instruction:instructions[array_size(inner_instruction:instructions)-1]:parsed:info:amount/1e9 AS amount,
tx_id
FROM
flipside_prod_db.solana.fact_events
WHERE
PROGRAM_ID = 'StaKe9nb7aUjXpjpZ45o6uJBsZxj2BWCDBtjk8LCg2v' AND
inner_instruction:instructions[array_size(inner_instruction:instructions)-1]:parsed:type = 'transfer'
),
total_staking (staking) as (
select count(tx_id) as staking from w_events_stake
where day < current_date and day >= current_date - 30
),
total_volume (volume) as (
select sum(amount) as volume from w_events_stake
where day < current_date and day >= current_date - 30
)
SELECT volume/staking as "Average staking amount" from total_staking,total_volume
Run a query to Download Data