StangFAST01 copy
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/bb68fbcc-21c9-4e37-a8ee-0206ecfa73f6
with
horizon AS
(
SELECT
a.signer_id AS address
FROM
near.horizon.fact_decoded_actions a
WHERE
a.method_name = 'add_project'
)
SELECT
count( DISTINCT date_trunc( '{{period}}' , a.block_timestamp ) ) AS date
, count( DISTINCT a.tx_signer ) AS users
, count( DISTINCT a.tx_hash ) AS transactions
, sum( a.transaction_fee / 1e24 ) AS fees
, users / date AS avg_users
, transactions / date AS avg_transactions
, fees / date AS avg_fees
FROM
near.core.fact_transactions a
JOIN
horizon b
ON a.tx_receiver = b.address
WHERE
a.block_timestamp::date >= dateadd( 'year' , -{{year}} , current_date )
AND a.block_timestamp::date < dateadd( '{{period}}' , -1 , current_date )
Run a query to Download Data