KaskoazulArbitrage buena
    Updated 2022-03-27

    WITH FIRST_TX AS (
    SELECT
    firstswap.swapper,
    firstswap.block_timestamp as fecha_1,
    firstswap.tx_group_id as tx_1,
    firstswap.swap_from_asset_id,
    firstswap.swap_from_amount,
    firstswap.swap_to_asset_id,
    firstswap.swap_to_amount,
    firstswap.swap_program,
    (
    SELECT
    MIN(secondswap.block_timestamp)
    FROM algorand.swaps AS secondswap
    WHERE secondswap.block_timestamp > firstswap.block_timestamp
    AND firstswap.swapper = secondswap.swapper
    AND firstswap.swap_to_asset_id = secondswap.swap_from_asset_id
    AND firstswap.swap_to_amount = secondswap.swap_from_amount
    AND secondswap.swap_to_asset_id IN (31566704, 312769)
    ) AS NextDate
    FROM algorand.swaps as firstswap
    WHERE firstswap.swap_from_asset_id IN (31566704, 312769)
    AND fecha_1 >= '2022-01-01'
    LIMIT 10
    )

    SECOND_TX as (

    )
    select swapper,




    Run a query to Download Data