CryptoIcicleLil-Nouns-2.Secondary Sales Activity - Traits
    Updated 2022-06-17
    -- Payout 100 USDC
    -- Grand Prize 300 USDC
    -- Level Intermediate

    -- Q2. How many Lil Nouns have been sold on a secondary exchange within 24 hours of being minted?
    -- Are there any common traits among these Lil Nouns? Which Lil Noun’s have the biggest difference (positive or negative)
    -- between their mint price and secondary sale price? Visualize and analyze your findings.

    -- Hint: This query looks at Nouns traits. You will need to modify it for Lil Nouns!
    with mint_dates as (
    select
    tokenid,
    mint_price_usd as mint_price,
    block_timestamp as mint_date
    from ethereum.core.ez_nft_mints
    where block_number > 12000000 and nft_address = '0x4b10701bfd7bfedc47d50562b76b436fbb5bdb3b'
    ),
    sale_dates as (
    select
    tokenid,
    price_usd as sale_price,
    block_timestamp as sale_date,
    rank() over (partition by tokenid order by block_timestamp asc ) as rank -- take only the very first sale
    from ethereum.core.ez_nft_sales
    where block_number > 12000000 and nft_address = '0x4b10701bfd7bfedc47d50562b76b436fbb5bdb3b'
    qualify rank = 1
    ),
    nfts as (
    select distinct tokenid from (
    select
    m.tokenid,
    mint_date,
    sale_date,
    datediff('hour', mint_date, sale_date) as n_hours,
    sale_price-mint_price as profit
    from mint_dates m left join sale_dates s on s.tokenid = m.tokenid
    Run a query to Download Data