Updated 2023-05-27
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
ava_price AS
(
SELECT
date_trunc( 'day' , a.hour ) AS day
, avg( a.price ) AS price_usd
FROM
avalanche.core.fact_hourly_token_prices a
WHERE
a.symbol = 'WAVAX'
GROUP BY
1
ORDER BY
1 DESC
)
SELECT
count( DISTINCT date_trunc( 'month' , a.block_timestamp ) ) AS date
, count( DISTINCT a.from_address ) AS users
, count( DISTINCT a.tx_hash ) AS transactions
, sum( a.tx_fee * c.price_usd ) AS fees
, users / date AS avg_users
, transactions / date AS avg_transactions
, fees / date AS avg_fees
FROM
avalanche.core.fact_transactions a
JOIN
avalanche.core.dim_labels b
ON a.to_address = b.address
JOIN
ava_price c
ON date_trunc( 'day' , a.block_timestamp ) = c.day
Run a query to Download Data