primo_dataQuixotic NFT Dashboard V3
    Updated 2022-08-01
    --Q7. Create a secondary market dashboard for NFT sales on Quixotic, the largest NFT marketplace on Optimism!

    --Include any data you think is relevant in our Optimism tables and tell us the most interesting trends you can find with the secondary NFT market.

    with nft_sales as (
    select
    date(block_timestamp) dt
    ,tx_hash
    ,contract_address nft_address
    ,event_inputs:from seller_address
    ,event_inputs:to buyer_address
    from optimism.core.fact_event_logs
    where origin_to_address in ('0x3f9da045b0f77d707ea4061110339c4ea8ecfa70','0x20975da6eb930d592b9d78f451a9156db5e4c77b','0x065e8a87b8f11aed6facf9447abe5e8c5d7502b6') --quixotic contracts
    and event_name = 'Transfer'
    and event_inputs:to = origin_from_address
    and nft_address != '0x4200000000000000000000000000000000000006'
    ),
    price as (
    select
    tx_hash
    ,eth_value
    from optimism.core.fact_transactions
    ),
    eth_price as (
    select date(hour) dt, avg(price) avg_price
    from flipside_prod_db.ethereum.token_prices_hourly
    where hour >= date('2022-06-15')
    and symbol = 'WETH'
    group by 1
    )
    select
    n.dt
    ,'x' || n.tx_hash tx_hash -- adding x to beginning so tableau data connector reads column as a string
    ,'x' || n.nft_address nft_address
    ,'x' || n.seller_address seller_address
    ,'x' || n.buyer_address buyer_address
    Run a query to Download Data