Sbhn_NPDistribution of Sellers by Their USD Amount
Updated 2022-10-18
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 oppricet as (
select hour::date as day,
avg (price) as OPUSDPRice
from optimism.core.fact_hourly_token_prices
where symbol = 'OP'
group by 1),
ethpricet as (
select hour::date as day,
avg (price) as ETHUSDPrice
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
group by 1),
opethpricet as (
select t1.day,
OPUSDPrice/ETHUSDPrice as OPETHPrice
from oppricet t1 join ethpricet t2 on t1.day = t2.day
order by 1),
maintable as (
select tx_hash,
buyer_address,
seller_address,
price_usd,
case when currency_symbol = 'ETH' then price when currency_symbol = 'OP' then price*OPETHPrice end as ETH_Price
from optimism.core.ez_nft_sales t1 join opethpricet t2 on t1.block_timestamp::date = t2.DAY
where price_usd > 0),
userstable as (
select seller_address,
sum (price_usd) as Total_USD_Volume,
sum (eth_price) as Total_ETH_Volume
from maintable
group by 1)
Run a query to Download Data