rajsNoun Traits Top 50 Sales
    Updated 2022-06-12
    with traits as
    (
    select
    tx_hash,
    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 = '0x9c8ff314c9bc7f6e59a9d9225fb22946427edc03'
    and topics[0]::string = '0x1106ee9d020bfbb5ee34cf5535a5fbf024a011bd130078088cbf124ab3092478'
    )
    ,

    secondary_sales as
    (
    SELECT
    -- *
    token_id,
    avg(price) as price
    FROM
    (
    SELECT
    tokenid::integer as token_id,
    price,
    currency_symbol,
    price_usd,
    tx_hash,
    block_timestamp
    from flipside_prod_db.ethereum_core.ez_nft_sales
    where nft_address = lower('0x9C8fF314C9Bc7F6e59A9d9225Fb22946427eDC03')
    order by 1 DESC
    )
    Run a query to Download Data