keean82eventual-jade
    Updated 2024-08-25
    WITH all_prices AS (
    SELECT
    swapper,
    block_timestamp,
    tx_id,
    swap_to_mint,
    swap_from_mint,
    swap_from_amount/swap_to_amount as token_buy_price
    FROM
    solana.defi.fact_swaps
    WHERE
    date_trunc('month', block_timestamp) = '2024-08-01 00:00:00'
    AND swap_from_mint = 'So11111111111111111111111111111111111111112'
    AND succeeded = TRUE
    AND swap_to_amount > 1

    ORDER BY
    token_buy_price
    )
    SELECT
    swap_to_mint,
    MAX(token_buy_price) as max_price
    FROM
    all_prices
    WHERE
    date_trunc('month', block_timestamp) = '2024-08-01 00:00:00'
    GROUP BY
    swap_to_mint
    QueryRunArchived: QueryRun has been archived