StangFAST01 copy
    -- 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