FatemeTheLadyNear cl12
Updated 2022-11-08
999
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 base as (select
trunc(block_timestamp,'month') as months,
stake_authority,
vote_account,
validator_rank,
sum(post_tx_staked_balance/1e9 - pre_tx_staked_balance/1e9) as sol_delegated
from solana.core.ez_staking_lp_actions
where post_tx_staked_balance > pre_tx_staked_balance
and event_type = 'delegate'
and succeeded = 'TRUE'
and block_timestamp >= '2022-01-01'
and node_pubkey is not null
group by 1,2,3,4),
base2 as (select
trunc(block_timestamp,'month') as months,
withdraw_destination,
vote_account,
validator_rank,
sum(withdraw_amount/1e9) as sol_withdrawn
from solana.core.ez_staking_lp_actions
where event_type = 'withdraw'
and block_timestamp >= '2022-01-01'
and succeeded = 'TRUE'
and node_pubkey is not null
group by 1,2,3,4),
base3 as(select
ifnull(a.months, b.months) as months,
ifnull(a.stake_authority, b.withdraw_destination) as stake_authoritys,
ifnull(a.vote_account, b.vote_account) as vote_accounts,
address_name,
initcap(split(address_name, ': ')[1]) as validator_names,
ifnull(a.validator_rank, b.validator_rank) as validator_ranks,
ifnull(sol_delegated, 0) as sol_delegatedz,
ifnull(sol_withdrawn, 0) as sol_withdrawnz,
Run a query to Download Data