0xbrun0winr holders dev
    Updated 2023-04-02
    /*
    Can do better here probably using union all and sum amount with sign grouping by adress
    Also filter out contracts holders maybe
    */

    with
    inflows as (
    select
    to_address as user_address,
    sum(raw_amount / 1e18) as amount_in
    from
    arbitrum.core.fact_token_transfers
    where
    contract_address = lower('0xD77B108d4f6cefaa0Cae9506A934e825BEccA46E')
    group by
    user_address
    ),
    outflows as (
    select
    from_address as user_address,
    sum(raw_amount / 1e18) as amount_out
    from
    arbitrum.core.fact_token_transfers
    where
    contract_address = lower('0xD77B108d4f6cefaa0Cae9506A934e825BEccA46E')
    group by
    user_address
    )
    select
    inf.user_address, amount_in - amount_out as amount,
    outf.user_address
    from
    inflows inf full join outflows outf on inf.user_address = outf.user_address
    order by amount desc
    Run a query to Download Data