elsinaVolume of tx received by Tornado Cash addresses
    Updated 2022-08-10
    with eth_price as (
    select hour::date as date, avg(price) as price
    from ethereum.core.fact_hourly_token_prices
    where date >= current_date - 365 and symbol = 'WETH'
    group by 1
    ),
    vol as (
    select
    address,
    address_name,
    case
    when block_timestamp::date >= current_date - 30 then 'Last Month'
    when block_timestamp::date >= current_date - 90 then 'Last Quarter'
    when block_timestamp::date >= current_date - 365 then 'Last Year' end as time,
    sum(amount * price) as volume_in_usd
    from
    ethereum.core.ez_eth_transfers join
    flipside_prod_db.crosschain.address_labels on
    eth_to_address = address join
    eth_price on
    block_timestamp::date = date
    where
    block_timestamp::date >= current_date - 365 and
    project_name = 'tornado cash' and
    label_subtype = 'general_contract' and
    blockchain = 'ethereum'
    group by 1, 2, 3

    union all

    select
    address,
    address_name,
    case
    when block_timestamp::date >= current_date - 30 then 'Last Month'
    when block_timestamp::date >= current_date - 90 then 'Last Quarter'
    Run a query to Download Data