Ali3NNFTs Leaderboard
    Updated 2024-04-16
    with timetable as (
    select case when '{{Time_Frame}}' = 'Last 7 Days' then 7
    when '{{Time_Frame}}' = 'Last 14 Days' then 14
    when '{{Time_Frame}}' = 'Last 30 Days' then 30
    when '{{Time_Frame}}' = 'Last 60 Days' then 60
    when '{{Time_Frame}}' = 'Last 90 Days' then 90
    when '{{Time_Frame}}' = 'Last 180 Days' then 180
    when '{{Time_Frame}}' = 'Last 365 Days' then 365
    when '{{Time_Frame}}' = 'All Time' then 3000
    else 2000 end as timeframe)

    select token_id as "NFT Token #ID",
    count (distinct tx_id) as "Sales",
    count (distinct buyer_address) as "Buyers",
    count (Distinct seller_address) as "Sellers",
    sum (amount) as "Sales Volume [SEI]",
    sum (amount_usd) as "Sales Volume [USD]",
    avg (amount) as "Average Price [SEI]",
    avg (amount_usd) as "Average Price [USD]",
    min (amount) as "Floor Price [SEI] (LEFT)",
    min (amount_usd) as "Floor Price [USD]",
    max (amount) as "Price Ceiling [SEI] (RIGHT)",
    max (amount_usd) as "Price Ceiling [USD]"
    from sei.nft.ez_nft_sales join timetable
    where tx_succeeded = 'TRUE'
    and project_name ilike '%{{NFT_Collection}}%'
    and block_timestamp >= current_date - timeframe
    group by 1
    order by 2 desc



    QueryRunArchived: QueryRun has been archived