ramishoowUntitled Query
Updated 2023-01-05
9
1
2
3
4
5
6
›
⌄
with ramishoow as (select date_trunc('week', block_timestamp) as date, count(distinct tx_id) as tx_count, sum(tx:body:messages[0]:amount[0]:amount/1e6) as tx_volume, avg(tx_count) over (order by date, date rows between 6 preceding and current row) as ma7_tx_count,
avg(tx_volume) over (order by date, date rows between 6 preceding and current row) as ma7_tx_volume, sum(tx_count) over (order by date) as cum_tx_count, sum(tx_volume) over (order by date) as cum_tx_volume,
--avg(tx_volume) over (order by date, date rows between 6 preceding and current row) as ma7_tx_volume, sum(tx_count) over (order by date) as cum_tx_count, sum(tx_volume) over (order by date) as cum_tx_volume,
(select count(distinct tx_id) from terra.core.fact_transactions where tx:body:messages[0]:amount[0]:denom = 'uluna' and tx_succeeded = TRUE) as total_tx_count,
(select sum(tx:body:messages[0]:amount[0]:amount/1e6) from terra.core.fact_transactions where tx:body:messages[0]:amount[0]:denom = 'uluna' and tx_succeeded = TRUE) as total_tx_volume from terra.core.fact_transactions
where tx:body:messages[0]:amount[0]:denom = 'uluna' and tx_succeeded = TRUE group by 1 ), avg_info as ( select avg(tx_count) as avg_tx_count, avg(tx_volume) as avg_tx_volume from ramishoow ) select * from ramishoow, avg_info
Run a query to Download Data