eferfanSeasons 3
Updated 2022-10-19
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
›
⌄
with Base_Data as
(
select
date_trunc('Day', block_timestamp) as date,
tx_hash ,
tx_signer ,
tx_receiver ,
TRY_PARSE_JSON(REPLACE(tx:receipt[0]:outcome:logs[0], 'EVENT_JSON:')):data[0]:token_ids[0] as Nft,
(tx:actions[0]:FunctionCall:deposit / POW(10, 24)) as volume
FROM
near.core.fact_transactions
WHERE
date_trunc('Day', block_timestamp) >= (CURRENT_DATE - 90)
AND SPLIT_PART(tx:receipt[0]:outcome:status, '"', 2) = 'SuccessValue'
AND tx:actions[0]:FunctionCall:method_name = 'nft_mint'
)
SELECT
tx_receiver,
COUNT(DISTINCT tx_hash) AS Mint_Count,
COUNT(DISTINCT tx_signer) AS Minter_Count,
COUNT(DISTINCT Nft) AS Nft_Count,
SUM(volume) AS Volumes,
AVG(volume) AS Price
FROM
Base_Data
GROUP by 1
HAVING Minter_Count > 1 and NFT_COUNT > 1
order by 5 DESC
LIMIT 10
Run a query to Download Data