HadisehUntitled Query
Updated 2022-08-31Copy Reference Fork
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 price as ( select trunc(hour,'day') as price_date, avg(PRICE) as prices
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
group by 1)
,
buyer as (select trunc(block_timestamp,'day') as day,
buyer_address,
tx_hash,
tokenid,
price*prices as buy_usd
from ethereum.core.ez_nft_sales a left outer join
price b on a.block_timestamp::date = b.price_date
where nft_address = lower('0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB')
and buyer_address <> '0x0000000000000000000000000000000000000000'
and seller_address <> '0x0000000000000000000000000000000000000000'
and tx_hash <> '0x92488a00dfa0746c300c66a716e6cc11ba9c0f9d40d8c58e792cc7fcebf432d0' -- 120,000 ETH sale
and event_type = 'sale'
and price > 0
)
,
seller as (select trunc(block_timestamp,'day') as day,
seller_address,
tx_hash,
tokenid,
price*prices as sell_usd
from ethereum.core.ez_nft_sales a left outer join
price b on a.block_timestamp::date = b.price_date
where nft_address = lower('0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB')
and buyer_address <> '0x0000000000000000000000000000000000000000'
and seller_address <> '0x0000000000000000000000000000000000000000'
and tx_hash <> '0x92488a00dfa0746c300c66a716e6cc11ba9c0f9d40d8c58e792cc7fcebf432d0' -- 120,000 ETH sale
and event_type = 'sale'
and seller_address in (select buyer_address from buyer)
and price > 0
)
Run a query to Download Data