hessWeekly Sales Volume
    Updated 2024-06-18
    with pallet as ( select block_timestamp::date as date,
    tx_id,
    seller_address as seller,
    buyer_address as buyer,
    amount as price,
    amount_usd as price_usd,
    nft_address as collection_address ,
    project_name,
    token_id
    from sei.nft.ez_nft_sales
    where tx_succeeded = 'TRUE'
    and platform_name ilike '%pallet%')

    select trunc(date,'week') as weekly,
    sum(price_usd) as volume_usd,
    sum(price) as volume_sei,
    avg(price) as avg_price_sei,
    avg(price_usd) as avg_price_usd,
    median(price) as median_sei,
    median(price_usd) as median_usd,
    avg(volume_usd) over (order by weekly rows between 1 preceding and 0 following) as "Avg 7 Day moving Volume (USD)",
    avg(volume_usd) over (order by weekly rows between 2 preceding and 0 following) as "Avg 14 Day moving Volume (USD)",
    avg(volume_usd) over (order by weekly rows between 4 preceding and 0 following) as "Avg 30 Day moving Volume (USD)"
    from pallet
    group by 1

    QueryRunArchived: QueryRun has been archived