Afonso_DiazMarket Share
    Updated 2025-01-26
    with

    main as (
    select
    tx_id,
    block_timestamp,
    trader as user,
    nvl(amount_in_usd, amount_out_usd) as amount_usd,
    token_in_symbol as symbol_in,
    token_out_symbol as symbol_out,
    platform
    from
    flow.defi.ez_dex_swaps
    where
    amount_usd <= 1e6
    )

    select
    iff(platform ilike 'increment%', 'Increment', 'Other') as market_share,
    count(distinct tx_id) as transactions,
    count(distinct user) as users,
    sum(amount_usd) as total_volume_usd,
    avg(amount_usd) as average_amount_usd
    from
    main
    group by 1
    QueryRunArchived: QueryRun has been archived