FatemeTheLadynear cl4
Updated 2022-11-08
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
›
⌄
WITH
near as (
SELECT
trunc(block_timestamp,'week') as date,
method_name,
case when method_name in ('deposit_and_stake','stake','stake_all') then 'staking'
when method_name in ('unstake','unstake_all') then 'unstaking'
else method_name end as method_name2,
count(distinct TX_HASH) as actions
from near.core.fact_actions_events_function_call
WHERE method_name in ('deposit_and_stake','stake','stake_all','unstake','unstake_all','unbond_delegation','update_validator')
--'vote',
and date>=date>='2022-01-01' and date<CURRENT_DATE
group by 1,2,3
),
solana as (
select
trunc(block_timestamp,'week') as date,
event_type as method_name,
case when event_type in ('delegate','activate') then 'staking'
when event_type in ('undelegate','deactivate','withdraw') then 'unstaking'
when event_type like '%split%' then 'Split'
else 'Merge' end as method_names2,
COUNT (distinct tx_id) as actions
from solana.core.ez_staking_lp_actions
where succeeded = 'TRUE'
and date>='2022-01-01' and date<CURRENT_DATE
and node_pubkey is not null and event_type is not null and event_type not in ('initializeChecked','authorize','authorizeChecked','initialize','setLockup')
group by 1,2,3
)
select * from solana order by 1 asc,2
Run a query to Download Data