jackguyUntitled Query
Updated 2023-04-13Copy Reference Fork
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
›
⌄
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