headitmanagerOptimism to Ethereum : Total
    Updated 2022-09-11
    with eth_to_optimisim_ETH as
    (select count(*) as cnt,sum(AMOUNT) am,sum(AMOUNT_USD) as usd_am,BLOCK_TIMESTAMP::date from ethereum.core.ez_eth_transfers
    where ORIGIN_TO_ADDRESS='0x99c9fc46f92e8a1c0dec1b1747d010903e884be1'
    group by 4)
    , eth_to_optimisim_USDT as (
    select count(*) as cnt,sum(AMOUNT) am,sum(AMOUNT_USD) as usd_am,BLOCK_TIMESTAMP::date from ethereum.core.ez_token_transfers
    where ORIGIN_TO_ADDRESS='0x99c9fc46f92e8a1c0dec1b1747d010903e884be1' and SYMBOL='USDT'
    group by 4)
    ,optimisim_to_eth_ETH as
    (select count(*) as cnt,sum(AMOUNT) am,sum(AMOUNT_USD) as usd_am,BLOCK_TIMESTAMP::date from optimism.core.ez_eth_transfers
    where ORIGIN_TO_ADDRESS='0x4200000000000000000000000000000000000006'
    group by 4)
    , optimisim_to_eth_USDT as (
    select count(*) as cnt,sum(RAW_AMOUNT/1e6) as usdt_am,BLOCK_TIMESTAMP::date from optimism.core.fact_token_transfers
    where
    FROM_ADDRESS='0x0000000000000000000000000000000000000000'
    and CONTRACT_ADDRESS in ('0x94b008aa00579c1307b0ef2c499ad98a8ce58e58','0x2057c8ecb70afd7bee667d76b4cd373a325b1a20') and RAW_AMOUNT>0
    group by 3)

    select sum(cnt),sum(am),sum(usd_am) from optimisim_to_eth_ETH

    Run a query to Download Data