Flipside Community5B - polygon most popular dexes among super_users
    Updated 2025-02-04
    -- forked from mar1na-catscatscode / 5B - polygon most popular dexes among acquired users @ https://flipsidecrypto.xyz/mar1na-catscatscode/q/ArIqiX_rG5u5/5b---polygon-most-popular-dexes-among-acquired-users

    with super_users as (
    select distinct from_address as user
    from polygon.core.fact_transactions
    where
    -- block_timestamp::date >='2023-01-01' and
    -- block_timestamp::date < '2024-01-01' and
    nonce=99
    )

    select
    case
    when platform = 'uniswap-v2' or platform = 'uniswap-v3' then 'uniswap'
    when platform = 'pancakeswap-v2' or platform = 'pancakeswap-v3' then 'pancakeswap'
    when platform = 'kyberswap-v1' or platform = 'kyberswap-v2' then 'kyberswap'
    when platform = 'dodo-v1' or platform = 'dodo-v2' then 'dodo'
    when platform = 'quickswap-v2' or platform = 'quickswap-v3' then 'quickswap'
    else platform
    end as dex,
    count(distinct origin_from_address) as users,
    count(distinct tx_hash) as transactions
    from polygon.defi.ez_dex_swaps
    where origin_from_address in (select user from super_users)
    and block_timestamp::date >='2023-01-01'
    and block_timestamp::date < '2024-01-01'
    group by 1
    order by 2 desc, 3 desc
    limit 5



    Last run: 3 months ago
    DEX
    USERS
    TRANSACTIONS
    1
    uniswap46391121420141
    2
    quickswap43207917545338
    3
    sushiswap2639813595965
    4
    balancer1066581445849
    5
    dodo100083977669
    5
    139B
    331s