hesamFlow of Optimism Bridge Query
    Updated 2022-11-07
    with Optimism_bridges as (
    select
    CASE
    When origin_to_address = lower('0x25ace71c97b33cc4729cf772ae268934f7ab5fa1') Then 'Optimism → Ethereum'
    When origin_to_address = lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1') Then 'Ethereum → Optimism'
    End as Flow,
    origin_from_address,
    block_timestamp,
    amount_usd,
    tx_hash
    from
    ethereum.core.ez_eth_transfers
    where
    origin_to_address in (lower('0x25ace71c97b33cc4729cf772ae268934f7ab5fa1'),lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1'))
    and block_timestamp >= '2022-07-01'
    and block_timestamp < '2022-08-01'
    UNION ALL
    select
    CASE
    When origin_to_address = lower('0x25ace71c97b33cc4729cf772ae268934f7ab5fa1') Then 'Optimism → Ethereum'
    When origin_to_address = lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1') Then 'Ethereum → Optimism'
    End as Flow,
    origin_from_address,
    block_timestamp,
    amount_usd,
    tx_hash
    from
    ethereum.core.ez_token_transfers
    where
    origin_to_address in (lower('0x25ace71c97b33cc4729cf772ae268934f7ab5fa1'),lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1'))
    and block_timestamp >= '2022-07-01'
    and block_timestamp < '2022-08-01'
    )
    select
    Flow,
    sum (amount_usd) as "Volume ($USD)",