bachiopttoeth2
    Updated 2022-09-15
    with bridge_addresses as (
    select
    block_timestamp,
    tx_hash,
    origin_from_address
    from ethereum.core.fact_event_logs
    where origin_to_address = lower('0x99c9fc46f92e8a1c0dec1b1747d010903e884be1')--lower('0x25ace71c97B33Cc4729CF772ae268934F7ab5fA1')
    )
    , optimism_addresses as (
    select
    block_timestamp,
    tx_hash,
    origin_from_address,
    origin_to_address,
    event_name
    from optimism.core.fact_event_logs
    )
    , action_dtls as (
    select
    b.block_timestamp,
    b.tx_hash,
    b.event_name,
    a.origin_from_address,
    b.origin_to_address
    from bridge_addresses a join optimism_addresses b on a.origin_from_address = b.origin_from_address
    where b.block_timestamp > a.block_timestamp
    )
    , transfer_dtls as (
    select
    date(block_timestamp) as date,
    tx_hash,
    event_name,
    count(DISTINCT tx_hash) as no_of_txns
    from action_dtls
    where event_name is not NULL
    and event_name = 'Transfer'
    Run a query to Download Data