pratyaksh2013Tornado cash - Last month
    Updated 2022-08-10
    with addresses_data as (select *
    from flipside_prod_db.crosschain.address_labels
    where project_name = 'tornado cash'),

    --addresses as (select address from address_data),

    eth_1 as (
    select tx_hash,to_address, amount*b.price as amount_usd, date_trunc('hour', block_timestamp) as time_,
    date_trunc('day', block_timestamp) as day_
    from ethereum.core.ez_token_transfers a
    left join ethereum.core.fact_hourly_token_prices b
    on date_trunc('hour', block_timestamp) = b.hour
    where b.symbol = a.symbol
    and to_address in (select address from addresses_data)
    ),

    eth_2 as (select tx_hash,to_address, amount_usd/b.price as amount, day_
    from eth_1
    left join ethereum.core.fact_hourly_token_prices b
    on time_ = HOUR
    and symbol = 'WETH'),
    ava_1 as (
    select tx_hash,origin_to_address, amount_usd, date_trunc('hour', block_timestamp) as time_,
    date_trunc('day', block_timestamp) as day_
    from avalanche.core.ez_avax_transfers
    where origin_to_address in (select address from addresses_data)
    ),

    ava_2 as (select tx_hash,origin_to_address, amount_usd/b.price as amount, day_
    from ava_1
    left join ethereum.core.fact_hourly_token_prices b
    on time_ = HOUR
    and symbol = 'WETH'),
    arb_1 as (
    Run a query to Download Data