StangFASTdaily - [ NFTs ]
Updated 2023-07-05
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
›
⌄
-- forked from daily - overview @ https://flipsidecrypto.xyz/edit/queries/287d1015-40f6-4ad1-b5f9-ddeea8403383
with
avax_price AS
(
SELECT
date_trunc( '{{period}}' , a.hour ) AS day
, avg( a.price ) AS price
FROM
avalanche.core.fact_hourly_token_prices a
WHERE
a.symbol = 'WAVAX'
GROUP BY 1
ORDER BY 1 DESC
)
SELECT
date_trunc( '{{period}}' , a.block_timestamp ) AS " Day "
, count( DISTINCT a.from_address ) AS " Active users "
, count( DISTINCT a.tx_hash ) AS " Transaction count "
, sum( d.amount_usd ) AS " USD volume "
, sum( a.tx_fee * c.price ) AS " Fees paid "
, b.project_name AS " NFT "
, sum( " Active users " ) over ( partition BY " NFT " ORDER BY " Day " ASC ) AS " Total of Active users "
, sum( " Transaction count " ) over ( partition BY " NFT " ORDER BY " Day " ASC ) AS " Total of Transaction count "
, sum( " USD volume " ) over ( partition BY " NFT " ORDER BY " Day " ASC ) AS " Total of USD volume "
, sum( " Fees paid " ) over ( partition BY " NFT " ORDER BY " Day " ASC ) AS " Total of Fees paid "
FROM
avalanche.core.fact_transactions a
JOIN
avalanche.core.dim_labels b
ON a.to_address = b.address
JOIN
Run a query to Download Data