Moe2 HadeSwap
    Updated 2023-08-30
    with prices as (
    select
    hour::date as date,
    avg(price) as price from ethereum.core.fact_hourly_token_prices
    where token_address ilike '0xD31a59c85aE9D8edEFeC411D448f90841571b89c'
    group by 1)

    ,base as (
    select a.*,
    ADDRESS_NAME as collection,
    sales_amount*price as sale_volume_usd
    from solana.core.fact_nft_sales a
    join prices b on a.block_timestamp::date = b.date
    join solana.core.dim_labels l on a.mint = l.address
    where succeeded = 'TRUE'
    and sales_amount > 0
    and marketplace = 'hadeswap')
    select

    count(distinct PURCHASER) as PURCHASERs ,
    count(distinct SELLER) as SELLERs ,
    count(distinct TX_ID) as TX_IDs ,
    sum(sale_volume_usd) as sale_usd ,

    sale_usd/SELLERs as usd_per_seller,
    sale_usd/PURCHASERs as usd_per_PURCHASER,
    sale_usd/TX_IDs as usd_per_tx,

    avg(sale_volume_usd) as avg_sale_volume_usd,
    median(sale_volume_usd) as median_sale_volume_usd

    from base
    Run a query to Download Data