misaghlbThe Law Offices of NEAR
Updated 2022-07-31
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
›
⌄
with contracts_data as (
SELECT * from (
SELECT
RECEIVER_ID, min(a.BLOCK_TIMESTAMP) as created_date
from near.core.fact_actions_events a
join near.core.fact_receipts b on a.TX_HASH = b.TX_HASH
where ACTION_NAME= 'DeployContract'
-- where TX_HASH = '7SepTbpq3yQkgynvytEoWzkQLJQG3STtB9fE7WXpi1Yr' -- sample deploy
GROUP by RECEIVER_ID
)
where created_date >= CURRENT_DATE - 30
)
SELECT TX_RECEIVER, COUNT(DISTINCT TX_HASH) as tx_count
from near.core.fact_transactions
where date(BLOCK_TIMESTAMP) >= CURRENT_DATE - 30
and TX_RECEIVER in (SELECT RECEIVER_ID from contracts_data)
GROUP by TX_RECEIVER
ORDER by tx_count DESC
limit 10
Run a query to Download Data