Updated 2024-09-27
    with t as (
    select
    tx_hash,
    block_timestamp,
    seller_address,
    buyer_address,
    nft_address,
    price,
    price_usd,
    tx_fee_usd,
    platform_fee_usd
    from
    polygon.nft.ez_nft_sales
    where
    block_timestamp::date between '{{ start_date }}' and '{{ end_date }}'
    and price_usd < 1e6
    and platform_name = 'opensea'
    )

    select
    count(distinct tx_hash) as transactions,
    count(distinct seller_address) as sellers,
    count(distinct buyer_address) as buyers,
    count(distinct nft_address) as collections,
    sum(price_usd) as volume_usd,
    avg(price_usd) as avg_price_usd,
    sum(platform_fee_usd) as total_platform_fee_usd,
    avg(platform_fee_usd) as average_platform_fee_usd,
    sum(tx_fee_usd) as total_tx_fee_usd,
    avg(tx_fee_usd) as average_tx_fee_usd,
    transactions / count(distinct block_timestamp::date) as daily_average_transactions,
    sellers / count(distinct block_timestamp::date) as daily_average_sellers,
    buyers / count(distinct block_timestamp::date) as daily_average_buyers,
    transactions / buyers as txns_per_buyer
    from t
    QueryRunArchived: QueryRun has been archived