Azinn13.the Number of Near pools
Updated 2022-11-06Copy 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
31
32
33
34
35
36
›
⌄
with t1 AS
(select count(distinct POOL_ADDRESS ) as number from
near.core.dim_staking_actions),
number as
(
select
count(case when POOL_ADDRESS='astro-stakers.poolv1.near' then 1 else null end) as pool_1,
count(case when POOL_ADDRESS='aurora.pool.near' then 1 else null end) as pool_2,
count(case when POOL_ADDRESS='binancestaking.poolv1.near' then 1 else null end) as pool_3,
count(case when POOL_ADDRESS='zavodil.poolv1.near' then 1 else null end) as pool_4,
count(case when POOL_ADDRESS='valisaurus-dex.poolv1.near' then 1 else null end) as pool_5,
count(case when POOL_ADDRESS='binancenode1.poolv1.near' then 1 else null end) as pool_6,
count(case when POOL_ADDRESS='figment.poolv1.near' then 1 else null end) as pool_7,
count(case when POOL_ADDRESS='staking_yes_protocol1.poolv1.near' then 1 else null end) as pool_8,
count(case when POOL_ADDRESS='blockdaemon.poolv1.near' then 1 else null end) as pool_9,
count(case when POOL_ADDRESS='bisontrails.poolv1.near' then 1 else null end) as pool_10,
count(case when POOL_ADDRESS not in ('bisontrails.poolv1.near','aurora.pool.near','binancestaking.poolv1.near','zavodil.poolv1.near','valisaurus-dex.poolv1.near',
'binancenode1.poolv1.near','figment.poolv1.near','staking_yes_protocol1.poolv1.near','blockdaemon.poolv1.near','bisontrails.poolv1.near')
then 1 else null end) as other,
date_trunc('day',BLOCK_TIMESTAMP) as date from near.core.dim_staking_actions
group by date) ,
volume as
(
select
sum(case when POOL_ADDRESS='astro-stakers.poolv1.near' then STAKE_AMOUNT else null end) as pool_1,
sum(case when POOL_ADDRESS='aurora.pool.near' then STAKE_AMOUNT else null end) as pool_2,
sum(case when POOL_ADDRESS='binancestaking.poolv1.near' then STAKE_AMOUNT else null end) as pool_3,
sum(case when POOL_ADDRESS='zavodil.poolv1.near' then STAKE_AMOUNT else null end) as pool_4,
sum(case when POOL_ADDRESS='valisaurus-dex.poolv1.near' then STAKE_AMOUNT else null end) as pool_5,
sum(case when POOL_ADDRESS='binancenode1.poolv1.near' then STAKE_AMOUNT else null end) as pool_6,
sum(case when POOL_ADDRESS='figment.poolv1.near' then STAKE_AMOUNT else null end) as pool_7,
Run a query to Download Data