keshanUntitled Query
    Updated 2022-06-22

    SELECT
    tokenflow_eth.hextoint(substr(input_data, 11, 64)) as chain_id,
    --tokenflow_eth.hextoint(substr(input_data, 1, 20)),
    tx_json,
    tx_json:receipt:logs[2]:decoded:inputs:chainId
    from ethereum.core.fact_transactions
    where chain_id in (137, 1, 42161, 100, 10)
    and to_address in (
    '0xb8901acb165ed027e32754e0ffe830802919727f',
    '0x3666f603cc164936c1b87e207f36beba4ac5f18a',
    '0x3e4a3a4796d16c0cd582c382691998f7c06420b6',
    '0x22b1cbb8d98a01a3b71d034bb899775a76eb1cc2',
    '0x3d4cc8a61c7528fd86c55cfe061a78dcba48edd1',
    '0xb98454270065a31d71bf635f6f7ee6a518dfb849'
    )
    --WHERE tx_Hash = '0xc56cee64b1aea258ca2d54b19f40034fbbdade9bbf0359e45a3b73a644c68af5'
    /*
    select
    replace(tx_json:chain_id, '0x'), tx_json:chain_id, *,
    regexp_substr_all(SUBSTR(INPUT_DATA, 3, len(INPUT_DATA)), '.{64}') AS segmented_data,
    ethereum.public.udf_hex_to_int(segmented_data[0]) as amount,
    ethereum.public.udf_hex_to_int(segmented_data[1]) as t1,
    ethereum.public.udf_hex_to_int(segmented_data[2]) as amount2,
    ethereum.public.udf_hex_to_int(segmented_data[3]) as amount3
    from ethereum.core.fact_transactions
    --where to_address = lower('0x4D9079Bb4165aeb4084c526a32695dCfd2F77381') -- Across protocol
    where to_address = lower('0x46ae9BaB8CEA96610807a275EBD36f8e916b5C61')
    limit 100


    select a.block_timestamp, a.from_address
    , a.raw_amount / pow(10, b.decimals) amount
    , amount * d.price amount_usd
    , case
    when a.origin_to_address = '0xb8901acb165ed027e32754e0ffe830802919727f' then 'ETH'
    Run a query to Download Data