MostafaBalance of Top 5 TOKE Holder of January 2022 in Current Date
    Updated 2022-06-21
    with jan as (
    SELECT
    DISTINCT USER_ADDRESS as top_holder,
    SYMBOL,
    avg(BALANCE) as TOKE_AMOUNT
    FROM flipside_prod_db.ethereum.erc20_balances
    where contract_address = lower('0x2e9d63788249371f1DFC918a52f8d799F4a38C94')
    and BALANCE_DATE >= '2022-01-01' and BALANCE_DATE <= '2022-01-31'
    and SYMBOL='TOKE'
    group by 1,2
    order by TOKE_AMOUNT DESC
    limit 5)
    SELECT
    USER_ADDRESS as top_holder,
    SYMBOL,
    avg(BALANCE) as TOKE_AMOUNT
    FROM flipside_prod_db.ethereum.erc20_balances
    where contract_address = lower('0x2e9d63788249371f1DFC918a52f8d799F4a38C94')
    and USER_ADDRESS in (select top_holder from jan )
    and BALANCE_DATE >= DATEADD(day, -1, CURRENT_TIMESTAMP())
    and SYMBOL='TOKE'
    group by 1,2
    order by TOKE_AMOUNT DESC
    Run a query to Download Data