sinahosseinzadehUntitled Query
Updated 2022-08-31
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 buyer as
(select distinct buyer_address as buyadd,
sum(price_usd) as purchase
from ethereum.core.ez_nft_sales
where project_name like 'cryptopunks'
and block_timestamp like '2022%'
and price_usd > 0
group by 1),
seller as(
select distinct seller_address as selladd,
sum(price_usd) as sales
from ethereum.core.ez_nft_sales
where project_name like 'cryptopunks'
and block_timestamp like '2022%'
and price_usd > 0
group by 1
),
users as
(select buyadd,
selladd,
sum(sales - purchase) as profit,
sum(sales) as saless
from seller
join buyer
where buyadd = selladd
group by 1,2
order by 3 desc
limit 10),
tpurch as
(select sum(price_usd) as costs,
block_timestamp as days
from ethereum.core.ez_nft_sales
where buyer_address in (select buyadd from users)
Run a query to Download Data