hessTop 50 NFTs by TVL
    Updated 2025-01-26
    with base as (select block_timestamp,
    tx_id,
    EVENT_DATA:"initiator" as user,
    event_data:"nftID"::string as nft,
    event_data:"amount" as amt,
    event_data:"contractTVL"::float as tvl
    from flow.core.fact_events
    where tx_succeeded = 'TRUE'
    and event_contract = 'A.a45ead1cf1ca9eda.FlowRewards'
    and event_type = 'Locked')
    ,
    base2 as (select nft,
    count(DISTINCT tx_id) as transactions,
    count(DISTINCT user) as users,
    sum(amt) as "Locked Flow",
    max(tvl) as "TVL Flow",
    avg(amt) as avg,
    median(amt) as median,
    max(amt) as max
    from base
    group by 1)

    select nft,
    transactions,
    "Locked Flow",
    ("Locked Flow"/"TVL Flow")*100 as "Share from Total",
    avg as "Avg Amount",
    max as "Max Amount",
    median as "Median Amount"
    from base2
    order by 3 desc
    limit 50



    QueryRunArchived: QueryRun has been archived