ArioFlow Holders - 1
    Updated 2024-05-10
    with inflow as (
    select
    RECIPIENT as user_address,
    sum(AMOUNT::float) as inflows
    from flow.core.ez_token_transfers
    where TOKEN_CONTRACT = 'A.1654653399040a61.FlowToken'
    and AMOUNT::float > 0
    and tx_succeeded = 'TRUE'
    group by 1
    ),
    outflow as (
    select
    SENDER as User_address,
    sum(AMOUNT::float) as Outflows
    from flow.core.ez_token_transfers
    where 1=1
    and TOKEN_CONTRACT = 'A.1654653399040a61.FlowToken'
    and amount::float > 0
    and tx_succeeded = 'TRUE'
    group by 1
    ),
    joint as (
    select
    User_address,
    sum(inflows-Outflows) as Flow_Balance
    from inflow join outflow using(User_address)
    where User_address != 'null'
    group by 1
    having Flow_Balance > 0.1
    order by 2 desc
    --limit 1000
    ),
    all_wallets as (
    SELECT
    count(distinct user_address) as "# All Wallets"
    from (select User_address from Inflow
    QueryRunArchived: QueryRun has been archived