rajsGlasses
    Updated 2022-06-20
    with winners as
    (
    SELECT
    tx_json:receipt:logs[0]:decoded:inputs:nounId::integer as nounid,
    max(eth_value) as winner_bid_price
    -- *
    from flipside_prod_db.ethereum_core.fact_transactions
    where to_address = '0x55e0f7a3bb39a28bd7bcc458e04b3cf00ad3219e'
    and status = 'SUCCESS'
    group by 1
    )
    ,

    mints as
    (
    SELECT
    nounid,
    eth_value as mint_price,
    -- tr.*,
    tx_hash,
    block_timestamp
    from flipside_prod_db.ethereum_core.fact_transactions t
    right join winners w
    on tx_json:receipt:logs[0]:decoded:inputs:nounId::integer = nounid
    and eth_value = winner_bid_price
    -- left join traits tr
    -- on t.tx_hash = tr.tx_hash
    where to_address = '0x55e0f7a3bb39a28bd7bcc458e04b3cf00ad3219e'
    and status = 'SUCCESS'
    and block_timestamp >= '2022-05-01'
    )
    ,

    secondary_sales AS
    (
    SELECT
    Run a query to Download Data