0xaimanYearly NFT Sales
Updated 2022-07-14
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
›
⌄
with raw as (with s1 as (select block_timestamp, tx_id,contract_address, event_inputs:tokenId as token_id, event_inputs:from as NFT_seller ,event_inputs:to as nft_buyer from flipside_prod_db.polygon.events_emitted
where event_name='Transfer' and event_inputs:tokenId is not null
and event_removed='FALSE'),
s2 as (
select tx_id, event_inputs:takerAssetFilledAmount/10e17 as price_paid from flipside_prod_db.polygon.events_emitted
where event_name='Fill' and event_inputs:makerFeeAssetData like '0%'
)
select block_timestamp as t, s1.tx_id,contract_address as NFT_ca, NFT_seller,NFT_buyer, token_id, price_paid
from s1 inner join s2 on s1.tx_id=s2.tx_id),
asales as (select month, avg(n_txn) as avg_purchase_nft
from (select date_trunc('year',t) as month, NFT_ca, count(tx_id) as n_txn
from raw
group by 1,2)
group by 1 order by 1),
sales as (select date_trunc('year',t) as month, count(tx_id) as n_txn
from raw
group by 1)
select sales.month as year, n_txn as n_nft_purchased
from sales inner join asales on sales.month=asales.month
Run a query to Download Data