banbannardTornado Cash Sanctions 4
    Updated 2022-08-10
    with base as (select address,
    address_name,
    count(1)
    from flipside_prod_db.crosschain.address_labels
    where project_name ilike 'tornado cash'
    and blockchain = 'ethereum'
    group by 1,2),

    base2 as (select block_timestamp,
    tx_hash,
    origin_from_address,
    ifnull(amount_usd, 0) as amount_usd,
    symbol
    from base a
    left join ethereum.core.ez_token_transfers b
    on a.address = b.to_address
    where datediff('day', block_timestamp, current_date()) <= {{timeframe_days}}),

    base3 as (select block_timestamp,
    tx_hash,
    origin_from_address,
    ifnull(amount_usd, 0) as amount_usd,
    'ETH'
    from base a
    left join ethereum.core.ez_eth_transfers b
    on a.address = b.eth_to_address
    where datediff('day', block_timestamp, current_date()) <= {{timeframe_days}}),

    base4 as (select * from base2
    union
    select * from base3),

    base5 as (select origin_from_address,
    count(distinct(tx_hash)) as count_tx,
    case
    when count_tx < 5 then 'Hibernate - Less than 5 Transactions'
    Run a query to Download Data