mhmTop 500 highest sale by price
Updated 2022-08-02Copy 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 nft_sales as (
select block_timestamp::date as date, tx_hash, EVENT_INPUTS:to as buyer, CONTRACT_ADDRESS as token_address, EVENT_INPUTS:tokenId as token_id
from polygon.core.fact_event_logs
where ORIGIN_TO_ADDRESS = '0xf715beb51ec8f63317d66f491e37e7bb048fcc2d'
and ORIGIN_FUNCTION_SIGNATURE = '0xbbbfa60c'
and EVENT_NAME = 'Transfer'
and EVENT_INPUTS:from IS NOT NULL
and EVENT_INPUTS:to IS NOT NULL
and EVENT_INPUTS:tokenId IS NOT NULL
), transfer_single as (
select block_timestamp::date as date, tx_hash, EVENT_INPUTS:"_to" as buyer, CONTRACT_ADDRESS as token_address, EVENT_INPUTS:"_id" as token_id
from polygon.core.fact_event_logs
where ORIGIN_TO_ADDRESS = '0xf715beb51ec8f63317d66f491e37e7bb048fcc2d'
and ORIGIN_FUNCTION_SIGNATURE = '0xbbbfa60c'
and EVENT_NAME = 'TransferSingle'
and EVENT_INPUTS:"_from" IS NOT NULL
and EVENT_INPUTS:"_to" IS NOT NULL
and EVENT_INPUTS:"_id" IS NOT NULL
), transfer_batch as (
select block_timestamp::date as date, tx_hash, EVENT_INPUTS:"_to" as buyer, CONTRACT_ADDRESS as token_address, EVENT_INPUTS:"_ids"[0] as token_id
from polygon.core.fact_event_logs
where ORIGIN_TO_ADDRESS = '0xf715beb51ec8f63317d66f491e37e7bb048fcc2d'
and ORIGIN_FUNCTION_SIGNATURE = '0xbbbfa60c'
and EVENT_NAME = 'TransferBatch'
and EVENT_INPUTS:"_from" IS NOT NULL
and EVENT_INPUTS:"_to" IS NOT NULL
and EVENT_INPUTS:"_ids" IS NOT NULL
), all_nft_transfers as (
select * from nft_sales
union all
select * from transfer_single
union all
select * from transfer_batch
), eth_prices as (
select HOUR::date as date, avg(price) as price_eth
from flipside_prod_db.ethereum.token_prices_hourly
Run a query to Download Data