cypherLil Nouns Secondary Sales Activity - largest negative price difference
    Updated 2022-06-21
    with mints as (select
    block_number as mint_block,
    block_timestamp as mint_time,
    dateadd('hour', 24, block_timestamp) as day_later,
    tx_hash as mint_hash,
    contract_address,
    tokenflow_eth.hextoint(topics[1])::integer as token_id,
    tokenflow_eth.hextoint(substr(data,3,64)) as background,
    tokenflow_eth.hextoint(substr(data,67,64)) as body,
    tokenflow_eth.hextoint(substr(data,131,64)) as accessory,
    tokenflow_eth.hextoint(substr(data,195,64)) as head,
    tokenflow_eth.hextoint(substr(data,259,64)) as glasses
    from ethereum.core.fact_event_logs
    where block_number > 12000000
    and contract_address = lower('0x4b10701Bfd7BFEdc47d50562b76b436fbB5BdB3B' )
    and topics[0]::string = '0x1106ee9d020bfbb5ee34cf5535a5fbf024a011bd130078088cbf124ab3092478'
    order by token_id desc),

    mint_prices as (
    select
    m.*,
    lead(t.amount, 1, 0) over (order by token_id) as mint_price,
    lead(t.amount_usd, 1, 0) over (order by token_id) as mint_price_usd
    from mints m, ethereum.core.ez_eth_transfers t
    where m.mint_block = t.block_number and m.mint_hash = t.tx_hash
    order by token_id desc
    ),

    nouns_sold as (select
    block_timestamp as sell_time,
    try_cast(tokenid as integer) as token_id,
    price as sell_price,
    price_usd as sell_price_usd
    from ethereum.core.ez_nft_sales
    where nft_address = lower('0x4b10701bfd7bfedc47d50562b76b436fbb5bdb3b')),

    Run a query to Download Data