adriaparcerisasNear report 5
Updated 2024-12-09
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
hourly as (
select
trunc(block_timestamp,'hour') as date,
sum(TRANSACTION_FEE/1e24) as fees,
sum(fees) over (order by date) as cum_fees,
avg(TRANSACTION_FEE/1e24) as avg_tx_fee
from near.core.fact_transactions x
--join near.price.fact_prices y on trunc(x.block_timestamp,'hour')=trunc(y.timestamp,'hour')
where x.block_timestamp > getdate() - interval '1 WEEK' --and symbol='wNEAR'
group by 1
),
daily as (
select
trunc(block_timestamp,'day') as date,
sum(TRANSACTION_FEE/1e24) as fees,
sum(fees) over (order by date) as cum_fees,
avg(TRANSACTION_FEE/1e24) as avg_tx_fee
from near.core.fact_transactions x
--join near.price.fact_prices y on trunc(x.block_timestamp,'hour')=trunc(y.timestamp,'hour')
where x.block_timestamp > getdate() - interval '1 MONTH' --and symbol='wNEAR'
group by 1
),
weekly as (
select
trunc(block_timestamp,'week') as date,
sum(TRANSACTION_FEE/1e24) as fees,
sum(fees) over (order by date) as cum_fees,
avg(TRANSACTION_FEE/1e24) as avg_tx_fee
from near.core.fact_transactions x
--join near.price.fact_prices y on trunc(x.block_timestamp,'hour')=trunc(y.timestamp,'hour')
where x.block_timestamp > getdate() - interval '3 MONTHS' --and symbol='wNEAR'
group by 1
)
select * from {{granularity}} where date <trunc(current_date,'hour') order by 1 asc
QueryRunArchived: QueryRun has been archived