StangFASToverview
Updated 2023-06-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
›
⌄
-- forked from 01 @ https://flipsidecrypto.xyz/edit/queries/6b4d366b-91ba-452a-9497-1bbc059cbb00
with
near_price AS
(
SELECT
date_trunc( 'day' , a.timestamp ) AS day
, avg( a.price_usd ) AS price
, a.symbol AS token
FROM
near.core.fact_prices a
WHERE
a.symbol LIKE 'wNEAR'
GROUP BY 1 , 3
ORDER BY 1 DESC
)
SELECT
date_trunc( '{{period}}' , a.block_timestamp ) AS date
, count( DISTINCT a.signer_id ) AS users
, count( DISTINCT a.tx_hash ) AS transactions
, sum( ( b.transaction_fee / 1e24 ) * c.price ) AS fees
, sum( users ) over ( ORDER BY date ASC ) AS total_users
, sum( transactions ) over ( ORDER BY date ASC ) AS total_transactions
, sum( fees ) over ( ORDER BY date ASC ) AS total_fees
FROM
near.social.fact_decoded_actions a
JOIN
near.core.fact_transactions b
ON a.tx_hash = b.tx_hash
JOIN
Run a query to Download Data