nsa2000eth air6
    Updated 2022-12-01
    --this code is thankfully burrowed from HBD1994: https://app.flipsidecrypto.com/dashboard/2Utd2G and alik110: https://app.flipsidecrypto.com/velocity/queries/baa9a3f3-3559-4c6e-9864-292903409d05
    with MainAcrossTable as (
    select
    block_timestamp,
    tx_hash,
    regexp_substr_all(SUBSTR(DATA, 3, len(DATA)), '.{64}') as Segmented_Data,
    ethereum.public.udf_hex_to_int(Segmented_Data[0]) / pow(10,18) as amount,
    ethereum.public.udf_hex_to_int(Segmented_Data[1]) as originChainId,
    ethereum.public.udf_hex_to_int(Segmented_Data[2]) as destinationChainId,
    origin_from_address,
    origin_to_address,
    contract_address,
    event_inputs
    from ethereum.core.fact_event_logs
    where origin_to_address = lower('0x4D9079Bb4165aeb4084c526a32695dCfd2F77381')
    and contract_address = lower('0x4D9079Bb4165aeb4084c526a32695dCfd2F77381')
    and origin_from_address not in ('0x428ab2ba90eba0a4be7af34c9ac451ab061ac010','0xf7bac63fc7ceacf0589f25454ecf5c2ce904997c')
    and tx_status = 'SUCCESS'),

    AcrossTransferTable as (
    select
    block_timestamp,
    tx_hash,
    symbol,
    amount,
    amount_usd
    from ethereum.core.ez_token_transfers
    where tx_hash in (select distinct(tx_hash) from MainAcrossTable)

    union ALL

    select
    block_timestamp,
    tx_hash,
    'ETH' as symbol,
    amount,
    Run a query to Download Data