FlippppppaDistinct Hourly Volume copy
    -- forked from freemartian / Distinct Hourly Volume @ https://flipsidecrypto.xyz/freemartian/q/2023-06-02-11-08-am-Ro0Woy

    -- )
    with total as (
    select
    date_trunc('hour', block_timestamp) as time,
    sum(amount) as Stolen_Fund,
    sum(amount * token_price) as Stolen_Fund_USD,
    Symbol as Token,
    case
    when block_timestamp BETWEEN '2023-05-30 04:50:00' and '2023-06-01 05:00:00' then 'Pika Protocol'
    when block_timestamp >= '2023-06-01 05:00:00' then 'Orbiter finance'
    end as Protocol,
    'Optimism' as Network
    from optimism.core.ez_token_transfers
    where to_address in (
    '0x2162b6caa174b90416090bd4a87e7d08f7027c48',
    '0x9fa7bb759641fcd37fe4ae41f725e0f653f2c726',
    '0x29b32f1320e2e78fa66a92e5114a125e68e75e88')
    and block_timestamp > '2023-05-30 04:50:00'
    group by symbol, Network, time, protocol

    UNION

    select
    date_trunc('hour', block_timestamp) as time,
    sum(amount) as Stolen_Fund,
    sum(amount * token_price) as Stolen_Fund_USD,
    Symbol as Token,
    case
    when block_timestamp BETWEEN '2023-05-30 04:50:00' and '2023-06-01 05:00:00' then 'Pika Protocol'
    when block_timestamp >= '2023-06-01 05:00:00' then 'Orbiter finance'
    end as Protocol,
    'Arbitrum' as Network
    from arbitrum.core.ez_token_transfers
    Run a query to Download Data