tkvresearchNFTs I %
    Updated 2023-12-12

    with

    AA as(

    select block_timestamp, event_type, platform_name, price_usd as volume from ethereum.nft.ez_nft_sales union all
    select block_timestamp, event_type, platform_name, price_usd as volume from arbitrum.nft.ez_nft_sales union all
    select block_timestamp, event_type, platform_name, price_usd as volume from optimism.nft.ez_nft_sales union all
    select block_timestamp, event_type, platform_name, price_usd as volume from base.nft.ez_nft_sales union all
    select block_timestamp, event_type, platform_name, price_usd as volume from avalanche.nft.ez_nft_sales union all
    select block_timestamp, event_type, platform_name, price_usd as volume from bsc.nft.ez_nft_sales union all
    select block_timestamp, event_type, platform_name, price_usd as volume from polygon.nft.ez_nft_sales
    ),


    A as( select case when platform_name in ('blur','opensea') then platform_name else 'other' end as protocol,
    sum(volume) as volume
    from AA
    where date(block_timestamp) BETWEEN '2022-12-18' and '2023-12-12'
    group by 1),

    B as( select case when platform_name in ('blur','opensea') then platform_name else 'other' end as protocol,
    sum(volume) as volume
    from AA
    where date(block_timestamp) BETWEEN '2021-12-18' and '2022-12-18'
    group by 1),


    C as(
    select a.protocol,
    a.volume as volume_2023, a.volume / sum(a.volume) over() as rate_2023,
    b.volume as volume_2022, b.volume / sum(b.volume) over() as rate_2022
    from A as a
    join B as b on a.protocol = b.protocol)


    Run a query to Download Data