Afonso_Diaztop projects copy
    Updated 2024-12-29
    with

    pricet as (
    select
    hour::date as dt,
    avg(price) as token_price_usd
    from
    aptos.price.ez_prices_hourly
    where
    symbol = 'APT'
    group by 1
    ),

    sales as (
    select
    tx_hash,
    block_timestamp,
    seller_address,
    buyer_address,
    project_name,
    nft_address,
    nvl(total_price_usd, total_price * token_price_usd) as price_usd,
    nvl(platform_fee_usd, platform_fee * token_price_usd) as platform_fee_usd
    from
    aptos.nft.ez_nft_sales
    left join pricet on block_timestamp::date = dt
    where platform_name = 'Wapal'
    )

    select
    project_name,
    count(distinct tx_hash) as sales,
    count(distinct buyer_address) as buyers,
    count(distinct seller_address) as sellers,
    sum(price_usd) as volume_usd,
    max(price_usd) as max_price_usd,
    QueryRunArchived: QueryRun has been archived