Mikey_SOL - nft
    Updated 2023-04-13
    with prices as ( -- Wsol prices on ethereum. solana price table doesn't cover nowadays.
    select
    PRICE as hourly_prices,
    "HOUR"
    from ethereum.core.fact_hourly_token_prices
    where "HOUR"::DATE between '2022-11-01' and '2022-11-14'
    and TOKEN_ADDRESS ILIKE '0xD31a59c85aE9D8edEFeC411D448f90841571b89c'
    ),
    daily_prices as (
    select
    avg(hourly_prices) as daily_prices,
    date_trunc('day', "HOUR") as "date"
    from prices
    group by 2
    ),
    SOL_data as (
    select
    tx_id as tx_hash,
    seller,
    purchaser as buyer,
    mint as nft_contract,
    sales_amount as NFT_price,
    block_timestamp
    from solana.core.fact_nft_sales
    ),
    sales as (
    select
    block_timestamp,
    nft_contract,
    (NFT_price * hourly_prices) as USD_price
    from SOL_data
    join prices
    on "HOUR" = date_trunc('hour', block_timestamp)
    ),
    average_nft_prices as (
    select
    Run a query to Download Data