Skip to content

Uniswap v4 support #337

Closed
Closed

Description

@ErikBjare

Uniswap v4 was recently announced: https://blog.uniswap.org/uniswap-v4

My commitment

I'm not sure how much time I'll have to work on it myself, but I am at minimum open to helping out with reviewing PRs etc.

Plan

Not sure if we should go for a full rewrite this time and rip out the v1/v2/v3 support (to clean up the codebase), perhaps ship it as a separate package uniswap-python-v4.

For now, we will work in the dev/v4 branch and make a new class to instantiate for v4. This seems like a good solution.

Work so far can be seen here: #340

Funding

I assume we will be able to acquire funding for this, given the Uniswap Grants Program (UGP) was satisfied with our work in the past. (as was Adam)

Misc

Might want to include example for hooks, here's one for example that sets trading hours in a silly way: https://twitter.com/eth_call/status/1675860109342253059

@shanefontaine @liquid-8 @KeremP

Activity

  1. liquid-8 commented on Jun 16, 2023

    @liquid-8
    Member

    I've just read whitepaper, so it's kinda challenging to determine further development. From what I understand, they intend to drop old pools in favor of singleton contract. Most probably, liquidity providers will tend to migrate there as uni team declares pretty much attractive features for this contract. Hence, uni v2 and v3 pools will follow v1. I think we should wait for testnet deployment. At that moment it will be much easier to understand what way we should consider.

    Regarding participation, I'd like to but I literally reside in Ukraine, so it's kinda hard to predict.

  2. ErikBjare commented on Jun 16, 2023

    @ErikBjare
    MemberAuthor

    @liquid-8 Oh shit, didn't realize. If I can help in anyway, don't hesitate to ask.

    I'm also eager for a testnet deployment, just wanted to send out notice well in advance :)

  3. ErikBjare commented on Jun 17, 2023

    @ErikBjare
    MemberAuthor
  4. liquid-8 commented on Jun 17, 2023

    @liquid-8
    Member

    That's fine. It is possible now to make some drafts, at least. Also, I share your idea to ship that as a separate package. I doubt that we have to pay attention to the older versions from now on. However, there are plenty of v2/v3 clones; therefore, there is no need to purge previous versions' support from the codebase.

  5. deleted a comment from liquid-8 on Jul 3, 2023
  6. KeremP commented on Jul 3, 2023

    @KeremP
    Contributor

    I agree a separate package is a good approach here - can leave the older versions untouched as Im sure most would try to migrate to v4 (given the optionality hooks could provide). Haven't dived into the whitepaper yet but definitely intrigued. Ill probably set aside some time and take a look this week.

  7. liquid-8 commented on Sep 13, 2023

    @liquid-8
    Member
  8. snarflakes commented on Feb 7, 2025

    @snarflakes

    As an alternative to incorporating all the changes into the existing build, I recently built a Python-based script that makes it easy to execute SWAP_EXACT_IN swaps using Uniswap v4 Universal Router on L2.

    • Provides an easy-to-use example of how to integrate Uniswap v4 Universal Router decoding in real swaps.
    • Reduces the complexity of constructing transactions manually.
    • Works currently with v3 pools on all L2 networks (including Base) (soon v4 pools once enough token pairs are available on all chains)

    Here’s the repo: https://github.com/snarflakes/uniswap-python-swapper

    I’d love to know if you think this could be helpful for your users? Or build off of it?

    Thanks for building such a great tool, i've used it extensively—looking forward to your thoughts!

    Best,
    Snar

  9. linked a pull request that will close this issueV4 support #418on Jan 5, 2026
  10. ErikBjare commented on Jul 28, 2026

    @ErikBjare
    MemberAuthor

    Support for Uniswap V4 was merged today in #418, will release v0.8.0 with it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions