barbodtoke3
    Updated 2022-06-22
    with table1 as (
    select distinct user_address,
    max(balance) as maxbalance
    from flipside_prod_db.ethereum.erc20_balances
    where contract_address = '0x2e9d63788249371f1dfc918a52f8d799f4a38c94' -- $TOKE
    and balance_date between '2022-01-01' and '2022-01-31' and label is null
    group by 1
    order by 2 desc
    limit 20)

    select distinct t1.user_address,
    t2.maxbalance,
    t1.balance as todaybalance,
    todaybalance - t2.maxbalance as Diff
    from flipside_prod_db.ethereum.erc20_balances t1
    join table1 t2 on t1.user_address = t2.user_address
    where contract_address = '0x2e9d63788249371f1dfc918a52f8d799f4a38c94' -- $TOKE
    and t1.balance_date = (select max(balance_date) from flipside_prod_db.ethereum.erc20_balances)
    and label is null
    order by 3 desc
    Run a query to Download Data