Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable v2 routing on all deployed L2 #465

Merged
merged 19 commits into from
Jan 26, 2024
Merged

feat: enable v2 routing on all deployed L2 #465

merged 19 commits into from
Jan 26, 2024

Conversation

just-toby
Copy link
Collaborator

@just-toby just-toby commented Jan 3, 2024

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

enables v2 routes on all deployed L2

  • What is the current behavior? (You can also link to an open issue here)

currenty SOR assumes v2 isn't deployed on all L2

  • What is the new behavior (if this is a feature change)?

support v2 routes on all deployed L2

  • Other information:

@just-toby just-toby requested a review from jsy1218 January 3, 2024 21:40
@just-toby just-toby requested a review from a team as a code owner January 3, 2024 21:40
@just-toby just-toby changed the title wip feat: enable v2 routing on optimism Jan 3, 2024
@jsy1218
Copy link
Member

jsy1218 commented Jan 4, 2024

Looks like the merge conflict needs to be resolved before Github CI runs the tests.

Copy link
Contributor

@cgkol cgkol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we run some tests to make sure this works on optmism before we push it?

@jsy1218
Copy link
Member

jsy1218 commented Jan 11, 2024

Shall we run some tests to make sure this works on optmism before we push it?

I think we want to conduct some manual testing (and maybe add into integ-test as well):

  1. getting the new UR deployed address https://uniswapteam.slack.com/archives/C05MF1J6GR5/p1704913678240789
  2. deploy V2 tokens on optimism ourselves (preferably FOT)
  3. create FOT/WETH pool
  4. add liquidity into FOT/WETH pool
  5. run router to make sure it can route through

We are blocked on 1 right now.

@jsy1218
Copy link
Member

jsy1218 commented Jan 11, 2024

Also I just noticed that somehow for v2 pool-provider, SOR doesn't use FACTORY_ADDRESS from v2-sdk, but rather computes the pool address directly https://github.com/Uniswap/smart-order-router/blob/main/src/providers/v2/pool-provider.ts#L261. This was probably fine previously, because UR was not deployed for v2 pools. But now with UR with different factory addresses across chains, we might need to change the v2 pool-provider logic.

Copy link
Contributor

@mikeki mikeki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, assuming it works

@just-toby just-toby marked this pull request as draft January 12, 2024 22:54
@just-toby just-toby marked this pull request as ready for review January 12, 2024 22:54
@jsy1218
Copy link
Member

jsy1218 commented Jan 16, 2024

I noticed v2-sdk FACTORY_ADDRESS_MAP is missing CELO. This explains why the CELO integ-tests are consistently failing. We will need to bump v2-sdk to include re-deployed CELO address.

@jsy1218 jsy1218 changed the title feat: enable v2 routing on optimism feat: enable v2 routing on arbitrum Jan 17, 2024
@jsy1218 jsy1218 self-assigned this Jan 26, 2024
@jsy1218 jsy1218 changed the title feat: enable v2 routing on arbitrum feat: enable v2 routing on all deployed L2 Jan 26, 2024
@jsy1218
Copy link
Member

jsy1218 commented Jan 26, 2024

Shall we run some tests to make sure this works on optmism before we push it?

Sadly we aren't able to test on any deployed L2, including Optimism. The reason is because no has added liquidity on V2 deployed L2 yet. For example, the latest UniswapV2Router02 deployed Optimism shows no one ever invoked addLiquidity/addLiquidityETH of the write contract.

I think we want to merge this first, meanwhile getting to how to add liquidity to test routing.

@jsy1218 jsy1218 merged commit 57f6aae into main Jan 26, 2024
22 of 23 checks passed
@jsy1218 jsy1218 deleted the feat/optimism-v2 branch January 26, 2024 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants