maybeyonasparas_nft_degens
Updated 2022-10-11
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
flat_logs as (
select
block_timestamp,
tx_hash,
receiver_id,
value as log
from near.core.fact_receipts r,
lateral flatten(input => r.logs)
),
nft_sales as (
select
block_timestamp,
tx_hash,
receiver_id,
try_parse_json(log) as log_json,
log_json:params:owner_id as seller,
log_json:params:buyer_id as buyer,
log_json:params:nft_contract_id as nft_contract,
log_json:params:token_id as nft_token,
log_json:params:ft_token_id as payment_token,
log_json:params:price/pow(10,24) as price
from flat_logs
where true
and try_parse_json(log):type = 'resolve_purchase'
and try_parse_json(log):params:ft_token_id = 'near'
),
user_buy as (
select
buyer,
sum(price) as buy_vol
from nft_sales
group by 1
),
user_sell as (
select
Run a query to Download Data