NavidCopy of Untitled Query
Updated 2022-11-09Copy 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 near_minser_daily_activity as (
select
BLOCK_AUTHOR as miner,
date(block_timestamp) as day
from
near.core.fact_blocks
where
BLOCK_TIMESTAMP>CURRENT_DATE-180 and
BLOCK_TIMESTAMP<CURRENT_DATE
group by
day, miner
), eth_minser_daily_activity as (
select
miner,
date(block_timestamp) as day
from
ethereum.core.fact_blocks
where
NETWORK='mainnet' and
BLOCKCHAIN='ethereum' and
BLOCK_TIMESTAMP>CURRENT_DATE-180 and
BLOCK_TIMESTAMP<CURRENT_DATE
group by
day, miner
)
select * from
(select
a.day,
'Near' as type,
count(distinct a.miner) as active_miners_count
from
near_minser_daily_activity a join near_minser_daily_activity b on a.miner=b.miner and b.day<a.day and b.day>a.day-30
group by
a.day
order by day desc
limit 1) as t1
Run a query to Download Data