KaskoazulSwap Arbitrages - succes rate
    Updated 2022-04-01
    WITH ALLSWAPS AS (
    select swapper,
    block_timestamp as fecha_1,
    tx_group_id as swap_1,
    swap_from_asset_id as from_id_1,
    swap_from_amount as from_amount_1,
    swap_to_asset_id as to_id_1,
    swap_to_amount as to_amount_1,
    swap_program as dex_1
    from algorand.swaps
    where block_timestamp::date >= '2022-01-01'
    order by 1, 2
    ),

    ADDNEXTSWAP AS (
    select swapper,
    fecha_1,
    swap_1,
    from_id_1,
    from_amount_1,
    to_id_1,
    to_amount_1,
    dex_1,
    lead(fecha_1) over (partition by swapper order by fecha_1) as fecha_2,
    lead(swap_1) over (partition by swapper order by fecha_1) as swap_2,
    lead(from_id_1) over (partition by swapper order by fecha_1) as from_id_2,
    lead(from_amount_1) over (partition by swapper order by fecha_1) as from_amount_2,
    lead(to_id_1) over (partition by swapper order by fecha_1) as to_id_2,
    lead(to_amount_1) over (partition by swapper order by fecha_1) as to_amount_2,
    lead(dex_1) over (partition by swapper order by fecha_1) as dex_2
    from ALLSWAPS
    order by 1, 2
    ),

    ARBITRAGE AS (
    select swapper,
    Run a query to Download Data