maybeyonassol_orca_top_pair_overall
    Updated 2022-03-08
    with swaps as (
    select
    block_timestamp,
    tx_id,
    swapper,
    swap_from_mint,
    swap_from_amount,
    swap_to_mint,
    swap_to_amount,
    case swap_from_mint
    when 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then swap_to_mint
    when 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' then swap_to_mint
    when '9vMJfxuKxXBoEa7rM12mYLMwTacLMLDJqHozw96WQL8i' then swap_to_mint
    else swap_from_mint end as token,
    case swap_from_mint
    when 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then swap_to_amount
    when 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' then swap_to_amount
    when '9vMJfxuKxXBoEa7rM12mYLMwTacLMLDJqHozw96WQL8i' then swap_to_amount
    else swap_from_amount end as token_vol,
    case swap_from_mint
    when 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then swap_from_amount
    when 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' then swap_from_amount
    when '9vMJfxuKxXBoEa7rM12mYLMwTacLMLDJqHozw96WQL8i' then swap_from_amount
    else swap_to_amount end as token_usd_vol,
    case swap_from_mint
    when 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' then swap_from_amount/swap_to_amount
    when 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB' then swap_from_amount/swap_to_amount
    when '9vMJfxuKxXBoEa7rM12mYLMwTacLMLDJqHozw96WQL8i' then swap_from_amount/swap_to_amount
    else swap_to_amount/swap_from_amount end as price
    from solana.swaps
    where swap_program = 'orca'
    and (
    swap_to_mint in (
    'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', -- USDC
    'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB', -- USDT
    '9vMJfxuKxXBoEa7rM12mYLMwTacLMLDJqHozw96WQL8i' -- UST
    Run a query to Download Data