alitaslimiDOMI Swaps Daily
    Updated 2023-12-18
    with
    -------------------- Swaps --------------------
    swaps as (
    select
    block_timestamp,
    tx_hash,
    origin_from_address as swapper,
    case platform
    when 'balancer' then 'Balancer'
    when 'curve' then 'Curve'
    when 'trader-joe-v1' then 'Trader Joe'
    when 'trader-joe-v2' then 'Trader Joe'
    when 'uniswap-v3' then 'Uniswap'
    when 'woofi' then 'WOOFi'
    else platform
    end as dex,
    pool_name,
    token_in as from_token,
    token_out as to_token,
    symbol_in as from_symbol,
    symbol_out as to_symbol,
    case
    when amount_in_usd - amount_out_usd > 100 then amount_out_usd
    when amount_in_usd - amount_out_usd < -100 then amount_in_usd
    else (amount_in_usd + amount_out_usd) / 2
    end as amount_usd,
    iff(amount_in_usd - amount_out_usd between -10 and 10, (amount_out_usd - amount_in_usd) / amount_out_usd * 100, 0) as slippage
    from
    avalanche.defi.ez_dex_swaps
    ),
    -------------------- Tokens --------------------
    tokens as (
    select
    block_timestamp,
    tx_hash,
    from_symbol as symbol,
    Run a query to Download Data