LTirrell2022-03-18_solana_jup-arb_wallets
    Updated 2022-03-25
    with stable_swaps as (
    select
    block_timestamp,
    tx_id,
    swapper,
    swap_to_amount,
    swap_from_amount,
    (swap_to_amount / swap_from_amount) as arbitrage,
    (swap_to_amount - swap_from_amount) as gain,
    case
    when swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then 'USDC'
    when swap_to_mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' then 'USDT'
    end as swap_to_currency,
    case
    when swap_from_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then 'USDC'
    when swap_from_mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' then 'USDT'
    end as swap_from_currency,
    case
    when arbitrage >= 1.01 then 1
    else 0
    end as profitable
    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
    Run a query to Download Data