RayyykSolana vs Flow Sports NFT 9
    Updated 2022-12-09
    with price as (select date_trunc ('day', recorded_hour) as date,
    avg(close) as sol_price
    from solana.core.fact_token_prices_hourly
    where symbol ilike 'SOL'
    and id = 'solana'
    group by 1),

    solana as (select purchaser as wallet,
    sum(sales_amount * sol_price) as volume_usd,
    row_number () over (order by volume_usd desc) as count
    from solana.core.fact_nft_sales a
    join solana.core.dim_labels b on a.mint = b.address
    join price c on date_trunc ('day', block_timestamp) = date
    where address_name ilike 'Blockasset Legends%'
    and block_timestamp >= '2021-11-08'
    group by 1),

    flow_1 as (select buyer,
    sum(price) as usd_volume
    from flow.core.ez_nft_sales
    where tx_succeeded = 'TRUE'
    and nft_collection = 'A.329feb3ab062d289.RaceDay_NFT'
    and not currency = 'A.1654653399040a61.FlowToken'
    and block_timestamp >= '2021-11-08'
    group by 1),

    flow_2 as (select buyer,
    sum(price)*avg(price_usd) as flow_usd_volume
    from flow.core.ez_nft_sales a
    join flow.core.fact_prices c on a.block_timestamp::date = c.timestamp::date
    where tx_succeeded = 'TRUE'
    and nft_collection = 'A.329feb3ab062d289.RaceDay_NFT'
    and currency = 'A.1654653399040a61.FlowToken'
    and token_contract = 'A.1654653399040a61.FlowToken'
    and block_timestamp >= '2021-11-08'
    group by 1),
    Run a query to Download Data