LuqmanUntitled Query
Updated 2022-08-31Copy Reference Fork
999
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 profit as (
with spending as (
with bid_tx as (
select
tx_hash,
block_timestamp,
event_inputs:to as buyer
from ethereum.core.fact_event_logs
where 1 = 1
and contract_name = 'CryptoPunksMarket'
and origin_function_signature = '0x23165b75'
and buyer is not null
)
,hourly_price as (
select
hour,
price as eth_price
from ethereum.core.fact_hourly_token_prices
where symbol = 'WETH'
)
,acceptBid as (
select
buyer,
h.hour,
tokenflow_eth.hextoint(substr(input_data,11,64)) as punkIndex,
tokenflow_eth.hextoint(substr(input_data,11+64,64))/pow(10,18) as price,
eth_price*price as price_usd
from ethereum.core.fact_transactions f
join hourly_price h on h.hour = date_trunc('hour', f.block_timestamp)
join bid_tx t on f.tx_hash = t.tx_hash
)
,offered as (
select
buyer_address as buyer,
tokenid as punkIndex,
price,
Run a query to Download Data