Sbhn_NPoptimism 13
Updated 2022-10-27
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 opensea_data as(
select date_trunc('day', block_timestamp) as date, tx_hash, buyer_address as buyer, seller_address as seller, NFT_Address, price_usd
from ethereum.core.ez_nft_sales
where 1=1
and platform_name = 'opensea'
and block_timestamp >= '2022-01-01'
and event_type = 'sale'
),
eth_price as(
select date_trunc('day', hour) as date, avg(price) as eth_price
from
ethereum.core.fact_hourly_token_prices
where 1=1
and symbol = 'WETH'
group by date
),
quix_data as(
select date_trunc('day', block_timestamp) as date, tx_hash, origin_from_address as buyer,
event_inputs:from as seller, contract_address as nft_address
from optimism.core.fact_event_logs
where origin_to_address in ('0x3f9da045b0f77d707ea4061110339c4ea8ecfa70', -- from Jul-02-2022 till now
'0x20975da6eb930d592b9d78f451a9156db5e4c77b', -- Feb-10-2022 to Jul-06-2022
'0x065e8a87b8f11aed6facf9447abe5e8c5d7502b6', -- from May-25-2022 to Jul-11-2022
'0x998ef16ea4111094eb5ee72fc2c6f4e6e8647666') -- from july 29 till now
and event_name = 'Transfer'
and event_inputs:to = origin_from_address
and event_removed = false
and block_timestamp >= '2022-01-01'
),
quix_data_final as(
select a.*, b.eth_value*c.eth_price as price_usd
from quix_data a
inner join optimism.core.fact_transactions b on a.tx_hash = b.tx_hash
inner join eth_price c on a.date = c.date
),
Run a query to Download Data