jackguynear_contract_1
Updated 2023-03-24
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
›
⌄
with top10 as (
select
TX_RECEIVER as contract,
count(DISTINCT TX_SIGNER) as users,
count(DISTINCT TX_HASH) as transactions
from near.core.fact_transactions
WHERE block_timestamp > '2023-01-01'
AND TX_RECEIVER in (
SELECT
tx_receiver
FROM (
SELECT
tx_receiver,
min(block_timestamp) as first_day
FROM near.core.fact_transactions
GROUP BY 1
)
WHERE first_day > '2022-12-01'
)
--AND not id is NULL
group by 1
ORDER by 2 DESC
LIMIT 10
)
SELECT
date_trunc('day', block_timestamp) as day,
tx_receiver as contract,
count(DISTINCT TX_SIGNER) as users,
count(DISTINCT TX_HASH) as transactions
FROM near.core.fact_transactions
WHERE tx_receiver IN (SELECT contract FROM top10)
GROUP BY 1,2
HAVING NOT day is NULL
AND NOT contract is NULL
AND NOT users is NULL
Run a query to Download Data