RamaharBridge (Across)
    Updated 2022-06-22
    with T1 as (select
    tx_hash,
    substr(INPUT_DATA,3,8) as methodID,
    regexp_substr_all(SUBSTR(INPUT_DATA, 11, len(INPUT_DATA)), '.{64}') AS segmented_data,
    ethereum.public.udf_hex_to_int(segmented_data[0]) as receipient,
    ethereum.public.udf_hex_to_int(segmented_data[1]) as origintokenaddress,
    ethereum.public.udf_hex_to_int(segmented_data[2]) as tokenamount,
    ethereum.public.udf_hex_to_int(segmented_data[3]) as destchainID
    from ethereum.core.fact_transactions
    where to_address = lower('0x4D9079Bb4165aeb4084c526a32695dCfd2F77381') ),

    T2 as (select
    t.block_timestamp,
    t.tx_hash,
    t.from_address,
    t.to_address,
    t.contract_address,
    t.symbol,
    t.amount,
    t.amount_usd,
    destchainID
    from ethereum.core.ez_token_transfers t
    inner join T1 on T1.tx_hash = t.tx_hash)

    select
    DATE(block_timestamp) AS dayz,
    CASE
    WHEN destchainID = '42161' then 'Arbitrium One'
    WHEN destchainID = '512' then 'Double-A Chain Mainnet'
    WHEN destchainID = '10' then 'Optimism'
    WHEN destchainID = '137' then 'Polygon Mainnet'
    WHEN destchainID = '288' then 'Boba Network'
    WHEN destchainID = '1024' then 'CLV Parachain'
    else 'Other chain'
    end as chains,
    symbol,
    Run a query to Download Data