jackguyUntitled Query
    Updated 2023-04-13
    WITH tab1 as (
    SELECT
    TX_SIGNER,
    count(DISTINCT tx_hash) as from_events,
    sum(TRANSACTION_FEE / power(10, 24)) as Near_spent_gas,
    count(DISTINCT date_trunc('week', block_timestamp)) as active_weeks,
    count(DISTINCT TX_RECEIVER) as Tx_to_wallets
    FROM near.core.fact_transfers
    GROUP BY 1
    ), TAB2 AS (
    SELECT
    TX_RECEIVER,
    count(DISTINCT tx_hash) as to_events
    FROM near.core.fact_transfers
    GROUP BY 1
    )

    SELECT *
    from tab2
    left outer join tab1
    ON TX_SIGNER = TX_RECEIVER
    WHERE tx_receiver like '{{ user }}'
    --LIMIT 100
    Run a query to Download Data