greyswanNFT-SWAPPERS_share
    Updated 2023-02-27
    with
    unique_NFT_users as (
    select distinct
    date_trunc('month', block_timestamp) as NFT_month,
    seller as seller_purchaser
    from
    solana.core.fact_nft_sales
    where
    block_timestamp > CURRENT_DATE - 365
    and block_timestamp <= CURRENT_DATE - 1
    UNION
    select distinct
    date_trunc('month', block_timestamp) as NFT_month,
    purchaser
    from
    solana.core.fact_nft_sales
    where
    block_timestamp > CURRENT_DATE - 365
    and block_timestamp <= CURRENT_DATE - 1
    ),
    swaps_by_NFTs as (
    select
    tx_id,
    swapper,
    date_trunc('month', block_timestamp) as swap_month,
    swap_from_mint,
    swap_to_mint,
    swap_program
    from
    unique_NFT_users
    left join solana.core.fact_swaps on seller_purchaser = swapper
    and NFT_month = date_trunc('month', block_timestamp)
    where
    succeeded = 'true'
    and block_timestamp > CURRENT_DATE - 365
    and block_timestamp <= CURRENT_DATE - 1
    Run a query to Download Data