rustygeeFXSPriceArb
    Updated 2023-01-31

    -- SELECT *
    -- FROM arbitrum.core.fact_event_logs
    -- WHERE CONTRACT_ADDRESS = lower('0x90FF2b6b6a2eb3C68D883bc276F6736b1262fa50')
    -- LIMIT 100

    -- with latestSwapsETH as (
    -- SELECT *
    -- FROM arbitrum.core.fact_event_logs
    -- WHERE CONTRACT_ADDRESS = lower('0x90FF2b6b6a2eb3C68D883bc276F6736b1262fa50')
    -- --and ORIGIN_FUNCTION_SIGNATURE = '0x431a4ad3'
    -- and EVENT_NAME = 'Swap'
    -- and DATE(BLOCK_TIMESTAMP) = '2023-01-23'
    -- ),

    with latestSwaps as (
    SELECT *, 'Arbitrum' as label
    FROM arbitrum.core.fact_event_logs
    WHERE CONTRACT_ADDRESS = lower('0x90FF2b6b6a2eb3C68D883bc276F6736b1262fa50')
    and EVENT_NAME = 'Swap'
    and DATE(BLOCK_TIMESTAMP) = '2023-01-30'
    UNION ALL
    SELECT *, 'Ethereum' as label
    FROM ethereum.core.fact_event_logs
    WHERE CONTRACT_ADDRESS = lower('0x03b59bd1c8b9f6c265ba0c3421923b93f15036fa')
    and EVENT_NAME = 'Swap'
    and DATE(BLOCK_TIMESTAMP) = '2023-01-30'
    ),

    InandOut as (
    SELECT
    BLOCK_TIMESTAMP as time, label,
    CAST(EVENT_INPUTS:amount0In AS INTEGER) amt0_in,
    CAST(EVENT_INPUTS:amount1In AS INTEGER) amt1_in,
    CAST(EVENT_INPUTS:amount0Out AS INTEGER) amt0_out,
    CAST(EVENT_INPUTS:amount1Out AS INTEGER) amt1_out
    Run a query to Download Data