RayyykEthereum Slippage by Swap Category (USD)
    Updated 11 hours ago
    with table_1 as (select min(block_timestamp::date) as date,
    tx_hash,
    sum(amount_in_usd) as from_amount,
    sum(amount_out_usd) as to_amount,
    case when '{{start_date}}' = '' then '01/01/2023'
    else '{{start_date}}'
    end as start_date,
    case when '{{end_date}}' = '' then current_date - 1
    else '{{end_date}}'
    end as end_date
    from ethereum.defi.ez_dex_swaps
    where contract_address = '0x470e8de2ebaef52014a47cb5e6af86884947f08c'
    and block_timestamp >= start_date and block_timestamp <= end_date
    group by 2),

    table_2 as (select date,
    tx_hash,
    from_amount,
    to_amount,
    to_amount - from_amount as slippage
    from table_1
    where (from_amount > 0 or to_amount > 0)),

    final as (select date::date as day,
    tx_hash,
    case
    when from_amount is null then to_amount
    else from_amount
    end as swap_size,
    case
    when swap_size < 1000 then '1) <$1k'
    when swap_size >= 1000 and swap_size < 10000 then '2) $1k - $10k'
    when swap_size >= 10000 and swap_size < 50000 then '3) $10k - $50k'
    when swap_size >= 50000 and swap_size < 100000 then '4) $50k - $100k'
    else '5) >$100K'
    end as swap_category,
    Last run: about 11 hours agoAuto-refreshes every 24 hours
    SWAP_CATEGORY
    SLIPPAGE_USD
    SLIPPAGE_PERCENT
    1
    1) <$1k2.1297228760.5497896762
    2
    2) $1k - $10k-38.532337033-0.4836889883
    3
    3) $10k - $50k-262.702459239-1.748731762
    4
    4) $50k - $100k-2218.42787234-3.222826193
    5
    5) >$100K-12766.6624-7.452169377
    5
    218B
    22s