mamad-5XN3k3Copy of Untitled Query
Updated 2023-03-14
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
›
⌄
select
sum(txs) as "Total Transactions",
--sum(senders) as "Total Senders",
--sum(receivers) as "Total Receivers",
sum(LUNA_volume) as "Total Luna Volume",
sum(fees) as "Total Fees",
avg(txs) as "Average Transactions per Week",
--avg(senders) as "Average Senders",
--avg(receivers) as "Average Receivers",
avg(LUNA_volume) as "Average Volume per Week",
avg(fees) as "Average Fees per Week",
avg(tps) as "Average TPS per Week"
from(
SELECT
date_trunc('week', block_timestamp) as date,
count(DISTINCT tx_id) as txs,
count(DISTINCT TX_SENDER) as senders,
count(DISTINCT TX:body:messages[0]:to_address) as receivers,
sum(TX:body:messages[0]:amount[0]:amount)/pow(10,6) as LUNA_volume,
sum(fee) as fees,
txs/(7*24*60*60) as TPS,
sum (txs) over (order by date) as Cumulative_txs,
sum (senders) over (order by date) as Cumulative_users
from terra.core.fact_transactions
where tx:body:messages[0]:amount[0]:denom = 'uluna'
and tx_succeeded ilike 'true'
and date < current_date
group by 1
order by 1 asc)
Run a query to Download Data