purifyeeters misc stats
    Updated 2024-11-12
    with yeeters as (
    select
    value:ADDRESS as address,
    value:VALUE as networth
    from (
    select
    live.udf_api('https://flipsidecrypto.xyz/api/v1/queries/6a084f89-ea42-420d-bdd8-89341c36589c/data/latest') as resp
    ), lateral flatten (input => resp:data)
    )

    select (select avg(networth) from yeeters where networth>0) as avg_networth,
    (select median(networth) from yeeters where networth>0) as median_networth,
    COUNT_IF(networth>=100) as yeeters_over_100,
    COUNT_IF(networth>=1000) as yeeters_over_1000,
    COUNT_IF(networth>=10000) as yeeters_over_10000,
    count(distinct address) as unique_yeeters
    from yeeters
    QueryRunArchived: QueryRun has been archived