MufasaBuyers by their total spend on NFTs (in ETH)
Updated 2022-10-18Copy 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_of_optimism as (
select hour::date as date,
avg (price) as average_op_price
from optimism.core.fact_hourly_token_prices
where symbol = 'OP'
group by date
),
price_of_eth as (
select hour::date as date,
avg (price) as average_eth_price
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
group by date
),
eth_op_price as (
select op.date,
average_op_price/average_eth_price as average_price
from price_of_optimism op join price_of_eth eth on op.date = eth.date
order by op.date
),
overall_data as (
select block_timestamp,
tx_hash,
seller_address,
buyer_address,
price_usd,
case when currency_symbol = 'ETH' then price when currency_symbol = 'OP' then price*average_price end as price_of_ethereum
from optimism.core.ez_nft_sales sales join eth_op_price price on sales.block_timestamp::date = price.date)
-- data as (
-- select buyer_address,
-- sum (price_of_ethereum) as total_amount_of_eth,
-- sum (price_usd) as total_amount_of_usd
-- from overall_data
-- group by buyer_address
Run a query to Download Data