KaskoazulBAYC price vs trait
Updated 2022-09-22
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
›
⌄
SELECT a.*, b.price as last_price, b.price_usd as last_price_usd
FROM
(SELECT tokenid,
token_metadata:Background as background,
token_metadata:Clothes as Clothes,
token_metadata:Eyes as Eyes,
token_metadata:Fur as Fur,
token_metadata:Hat as Hat,
token_metadata:Mouth as mouth,
count(DISTINCT tx_hash) as n_sales,
avg(price_usd) as avg_price_usd,
avg(price) as avg_price
FROM ethereum.core.ez_nft_sales
WHERE nft_address = '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'
GROUP by
tokenid,background,clothes,eyes,fur,hat,mouth) a
LEFT JOIN (
SELECT tokenid,
price,price_usd, rank
FROM(
SELECT *,
rank()over(partition by tokenid ORDER BY block_timestamp DESC) as rank
FROM ethereum.core.ez_nft_sales
WHERE nft_address = '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'
)
WHERE rank = 1
) b
ON a.tokenid = b.tokenid
Run a query to Download Data