RayyykPolygon Slippage by Swap Category (USD)
    Updated 24 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 polygon.defi.ez_dex_swaps
    where contract_address = '0x93ef615f1ddd27d0e141ad7192623a5c45e8f200'
    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 24 hours agoAuto-refreshes every 24 hours
    SWAP_CATEGORY
    SLIPPAGE_USD
    SLIPPAGE_PERCENT
    1
    1) <$1k-0.5554009727-0.03289380845
    2
    2) $1k - $10k-75.752218045-4.046711262
    3
    3) $10k - $50k-1312.24-12.83559106
    3
    128B
    30s