afonsoUntitled Query
Updated 2023-01-20
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
›
⌄
select
b.block_timestamp::date as day,
count(distinct a.tx_hash) as stakes_count,
count(distinct tx_signer) as stakers_count,
sum((regexp_substr(c.value, 'contract total staked balance is ([0-9]+)[\.]' , 1, 1, 'ei')::float / pow(10, 24))) as total_volume,
sum(stakes_count) over (order by day) as cumulative_stakes_count,
sum(stakers_count) over (order by day) as cumulative_stakers_count,
sum(total_volume) over (order by day) as cumulative_volume
from near.core.fact_receipts a,
lateral flatten(input => logs) c
join near.core.fact_transactions b
where c.value ilike '%contract total staked balance is%'
and b.block_timestamp >= '2022-12-01'
and a.tx_hash = b.tx_hash
group by day
order by day
Run a query to Download Data