SocioCryptometrics
Updated 2022-09-28Copy 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 tx_hash as ( select tx_hash
from optimism.core.fact_event_logs
where CONTRACT_ADDRESS = '0x998ef16ea4111094eb5ee72fc2c6f4e6e8647666')
,
weth_sales as ( select tx_hash
from optimism.core.fact_event_logs
where contract_address = '0x4200000000000000000000000000000000000006')
,
data_ as ( select date(block_timestamp) as date, tx_hash, EVENT_INPUTS:from as seller, EVENT_INPUTS:to as buyer, contract_address as collection,EVENT_INPUTS[0]:tokenid as token
from optimism.core.fact_event_logs
where event_name = 'Transfer' and tx_hash in ( select tx_hash from tx_hash)
)
,
eth_sale as (select date, a.tx_hash , 'ETH' as symbol , seller, buyer, collection , eth_value as amount
from data_ a join optimism.core.fact_transactions b on a.tx_hash = b.tx_hash
where eth_value != 0)
,
nft_z as ( select date(BLOCK_TIMESTAMP) as date, tx_hash , CURRENCY_SYMBOL as symbol, seller_address as seller, buyer_address as buyer,
nft_address as collection , price as amount
from optimism.core.ez_nft_sales
where tx_hash not in ( select tx_hash from tx_hash) and PLATFORM_NAME = 'quixotic' and event_type = 'sale')
,
nft as ( select *
from nft_z)
,
op_sale as ( select date(block_timestamp) as date, tx_hash , 'OP' as symbol , EVENT_INPUTS:from as seller, EVENT_INPUTS:to as buyer,
CONTRACT_ADDRESS as collection
FROM optimism.core.fact_event_logs
where event_name = 'Transfer' and CONTRACT_ADDRESS != '0x4200000000000000000000000000000000000042' and contract_address != '0x4200000000000000000000000000000000000006'
and tx_hash not in ( select tx_hash from eth_sale) and tx_hash in (select tx_hash from tx_hash))
,
op_data as ( select date, a.tx_hash , symbol , seller, buyer, collection , raw_amount/pow(10,18) as amount
from optimism.core.fact_token_transfers a join op_sale b on a.tx_hash = b.tx_hash)
,
weth as ( select tx_hash
from optimism.core.fact_event_logs
Run a query to Download Data