Updated 2024-10-29
    with

    main as (
    select
    tx_hash,
    block_timestamp,
    buyer_address,
    seller_address,
    price,
    price_usd,
    nft_address,
    token_id,
    platform_fee_usd
    from near.nft.ez_nft_sales
    where
    platform_name = 'Paras'
    and
    block_timestamp::date between '{{ start_date }}' and '{{ end_date }}'
    )

    select
    count(distinct tx_hash) as transactions,
    count(distinct buyer_address) as buyers,
    count(distinct seller_address) as sellers,
    count(distinct nft_address) as total_collections,
    count(distinct token_id) as total_tokens,
    sum(price) as total_volume_near,
    avg(price) as average_volume_near,
    median(price) as median_volume_near,
    sum(price_usd) as total_volume_usd,
    avg(price_usd) as average_volume_usd,
    median(price_usd) as median_volume_usd,
    max(price) as maximum_price,
    max(price_usd) as maximum_price_usd,
    sum(platform_fee_usd) as total_platform_fee_usd,
    avg(platform_fee_usd) as average_platform_fee_usd
    QueryRunArchived: QueryRun has been archived