granadohoPatterns behind the Most Common Sources of Arbitrage
    Updated 2022-03-24
    with clean_data1 as (
    select
    date(block_timestamp) as date,
    count(distinct tx_id) AS total_swap_with_gain
    from solana.swaps
    where block_timestamp::date >= '2022-02-01'
    and swap_program = 'jupiter aggregator v2'
    and succeeded = 'True'
    and (swap_from_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' or swap_from_mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')
    and (swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' or swap_to_mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')
    and swap_from_amount >=100 and swap_to_amount >=100
    and ((swap_to_amount-swap_from_amount)/swap_from_amount)*100 >= 1
    group by 1
    order by 1
    ), clean_data2 as (
    select
    date(block_timestamp) as date,
    count(tx_id) as total_count
    from solana.swaps
    where block_timestamp::date >= '2022-02-01'
    and swap_program = 'jupiter aggregator v2'
    and succeeded = 'True'
    and (swap_from_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' or swap_from_mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')
    and (swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' or swap_to_mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')
    and swap_from_amount >=100 and swap_to_amount >=100
    group by 1
    order by 1
    ), average_arb as (
    select
    date(block_timestamp) as date,
    ((avg(swap_to_amount)-avg(swap_from_amount))/avg(swap_from_amount))*100 AS arb_percent
    from solana.swaps
    where block_timestamp::date >= '2022-02-01'
    and swap_program = 'jupiter aggregator v2'
    and succeeded = 'True'
    and (swap_from_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' or swap_from_mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB')
    Run a query to Download Data