Abolfazl_771025total overal
    Updated 2023-03-15
    with sol_price as (
    select
    date(block_timestamp) as date,
    avg(swap_to_amount) / avg(swap_from_amount) as solprice
    from solana.fact_swaps
    where swap_from_mint = 'So11111111111111111111111111111111111111112'
    and swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
    and swap_to_amount > 0
    and swap_from_amount > 0
    group by 1
    order by 1 asc
    )
    select
    'Magic eden' as marketplace,
    count(DISTINCT purchaser) as buyer_count,
    count (a.tx_id) as sales_count,
    sum(sales_amount * solprice) as volume
    from solana.core.fact_nft_sales a join sol_price b on date(a.block_timestamp) = b.date
    where MARKETPLACE in ('magic eden v1' , 'magic eden v2')
    group by 1
    union
    select
    marketplace,
    count(DISTINCT purchaser) as buyer_count,
    count (a.tx_id) as sales_count,
    sum(sales_amount * solprice) as volume
    from solana.core.fact_nft_sales a join sol_price b on date(a.block_timestamp) = b.date
    where marketplace not in ('magic eden v1' , 'magic eden v2')
    group by 1
    Run a query to Download Data