par_rnUSDT: banned addresses Balance state
    Updated 2022-12-02
    with Ban As (select BLOCK_TIMESTAMP,EVENT_INPUTS:_user AS "banned address" from ethereum.core.fact_event_logs
    where EVENT_NAME='AddedBlackList' and CONTRACT_ADDRESS='0xdac17f958d2ee523a2206206994597c13d831ec7'
    and EVENT_INPUTS:_user not in (select EVENT_INPUTS:_user from ethereum.core.fact_event_logs
    where EVENT_NAME='RemovedBlackList' and CONTRACT_ADDRESS='0xdac17f958d2ee523a2206206994597c13d831ec7')),
    tb AS (select USER_ADDRESS,LAST_ACTIVITY_BLOCK_TIMESTAMP,CURRENT_BAL,SYMBOL,USD_VALUE_NOW
    from ethereum.core.ez_current_balances where USER_ADDRESS in (select "banned address" from ban) and SYMBOL is not NULL and USD_VALUE_NOW is not NULL),
    tb2 AS (select
    uSER_ADDRESS AS "banned address",
    sum(case when SYMBOL='USDT' then CURRENT_BAL else 0 end) AS "USDT balance"
    from tb
    group by 1)
    select
    case when "USDT balance">0 then 'balance > 0'
    else 'balance = 0' end AS "balance state",
    count("balance state") AS "addresses number"
    from tb2 group by 1
    Run a query to Download Data