ramishoowUntitled Query
Updated 2023-01-13
9
1
2
3
4
5
›
⌄
with ramishoow as ( select date_trunc('week', block_timestamp) as time, count(distinct TX_HASH) as tx_count, (sum(iff(TX_STATUS = TRUE, 1, 0)) / tx_count) * 100 as success_rate,
avg(tx_count) over (order by time, time rows between 6 preceding and current row) as ma7_tx_count, sum(tx_count) over (order by time) as cum_tx_count,
--avg(tx_count) over (order by time, time rows between 6 preceding and current row) as ma7_tx_count, sum(tx_count) over (order by time) as cum_tx_count,
(select count(distinct TX_HASH) from near.core.fact_transactions) as total_tx_count from near.core.fact_transactions group by 1 ), avg_info as (
select avg(tx_count) as avg_tx_count, avg(success_rate) as avg_success_rate from ramishoow ) select * from ramishoow, avg_info
Run a query to Download Data