Soheil_MKflow
Updated 2022-11-03
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
36
›
⌄
with staking1 as (
select
BLOCK_TIMESTAMP::date as date,
NODE_ID,
sum(AMOUNT) as daily_staked
from flow.core.ez_staking_actions
where ACTION ='DelegatorTokensCommitted' or ACTION ='TokensCommitted'
group by 1,2
),
staking2 as (
select
BLOCK_TIMESTAMP::date as date,
NODE_ID,
sum(AMOUNT) as daily_unstaked
from flow.core.ez_staking_actions
where ACTION ='DelegatorRewardTokensWithdrawn' or action ='UnstakedTokensWithdrawn'
group by 1,2
),
staking_tx1 as (
select
a.date,
a.node_id,
sum(daily_staked-daily_unstaked) as total_staked
from staking1 a
join staking2 b
on ( a.node_id=b.node_id)
group by 1,2
),
staking_tx as (
select
date,
NODE_ID as tx_receiver,
Run a query to Download Data