princefarzamWhat percentage of all swaps (with a size of at least $100) where a wallet starts the transaction with USDC or USDT and ends the transaction with either USDC or USDT have resulted in at least a 1% gain?
    Updated 2022-03-23
    WITH GainOnePercent AS (
    SELECT
    COUNT(DISTINCT tx_id) AS gain_one_percent_swaps
    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),
    AllSwaps AS(
    select
    COUNT(DISTINCT tx_id) AS all_swaps
    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
    )
    SELECT
    'Arbitrage',
    G.gain_one_percent_swaps,
    A.all_swaps
    FROM GainOnePercent G, AllSwaps A