MostlyData_Osmosis MEV data copy
    Updated 2023-04-13
    -- forked from Osmosis MEV data @ https://flipsidecrypto.xyz/edit/queries/64177bc5-eb3a-46e9-b4aa-fc08ff69d80b

    with arbitrages as(
    select
    block_id,
    block_timestamp,
    tx_id,
    trader,
    from_currency as token,
    pool_ids,
    (to_amount - from_amount) * pow(10,-from_decimal) as profit

    from osmosis.core.fact_swaps
    where block_timestamp > '2023-01-01'
    --and block_timestamp < '2022-01-01'
    and tx_succeeded
    and from_currency = to_currency
    and (
    from_currency = 'uosmo'
    or from_currency = 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858'
    or from_currency = 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2'
    )
    and to_amount > from_amount
    and pool_ids[2] is not null
    ),

    price_infos as(
    select
    price,
    symbol,
    recorded_at

    from osmosis.core.dim_prices
    where recorded_at > '2023-01-01'
    ),
    Run a query to Download Data