tomingTop NFT Traders' Profit over last 30 days copy
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
›
⌄
-- forked from Ario / Top NFT Traders' Profit over last 30 days @ https://flipsidecrypto.xyz/Ario/q/6Uu7O8FaNDKz/top-nft-traders-profit-over-last-30-days
WITH buy as (
select
BLOCK_TIMESTAMP,
BUYER_ADDRESS,
NFT_ADDRESS,
TOKENID,
PRICE_USD as Buy_Price
from ethereum.core.ez_nft_sales
where BLOCK_TIMESTAMP::date >= current_date - 30
and PRICE_USD is not null
and EVENT_TYPE = 'sale'
),
sell as (
select
BLOCK_TIMESTAMP,
seller_ADDRESS,
NFT_ADDRESS,
TOKENID,
PRICE_USD as Sell_Price
from ethereum.core.ez_nft_sales
where BLOCK_TIMESTAMP::date >= current_date - 30
and PRICE_USD is not null
and EVENT_TYPE = 'sale'
)
select
seller_ADDRESS as Trader,
sum(Sell_Price - Buy_Price) as Profit_USD
from sell a join buy b on a.seller_ADDRESS = b.BUYER_ADDRESS and a.NFT_ADDRESS = b.NFT_ADDRESS and a.TOKENID = b.TOKENID
and a.BLOCK_TIMESTAMP > b.BLOCK_TIMESTAMP
group by 1
order by 2 desc
limit 10
Run a query to Download Data