Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Feat/sync#6

Open
arch1995 wants to merge 104 commits intomainfrom
feat/sync
Open

Feat/sync#6
arch1995 wants to merge 104 commits intomainfrom
feat/sync

Conversation

@arch1995
Copy link

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

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

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

  • Other information:

jsy1218 and others added 30 commits October 15, 2024 07:45
…unichain sepolia SwapV2Router02 (Uniswap#748)

* 4.6.2

* bump sdk-core to 5.8.3

* also bump ur-sdk for v4 sepolia re-deploy comments

* remove TODO
…1) expanding mixed quoter v1 to L2s 2) support migrate mixed quoter v1 to mixed quoter v2 across chains (Uniswap#746)

* chore: bump sor to 4.7.0 - feat: SOR level implementation to support 1) expanding mixed quoter v1 to L2s 2) support migrate mixed quoter v1 to mixed quoter v2 across chains

* 4.7.0

* also fix alpha-router integ-tests

* make other gas params protocol dependent as well

* fix alpha router compiling error
…en, and custom fee tier and tick spacings (Uniswap#751)

* fix: v4 subgraph provider add ETH base token, and custom fee tier and tick spacings

* merge conflict

* 4.7.1

* add sepolia v4 1 eth -> usdc quote test

* remove fee parsing in v4

* also fix unichain sepolia exact out quote test setup
…nd routeToString (Uniswap#750)

* fix: add v4 related split routes metrics

* 4.7.2

* also fix routeToString

* also fix routeToString

* also fix routeToString
…Uniswap#752)

- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
Release Uniswap/sdks#175
Uniswap/sdks#171
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
Release Uniswap/sdks#178

this is for re-deployed v2 router on sepolia
…swap#747)

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

- **What is the current behavior?** (You can also link to an open issue here)
if the cached routes is invalid, meaning it cant get any swap route at all, it does not get cache invalidated.

- **What is the new behavior (if this is a feature change)?**
we will invalidate the cached routes by checking to see if the swap route from cache is invalid

- **Other information**:
we have to roll out with percentage. because there's a chance there are many invalid cached routes in prod.

This is somewhat critical to fix prior to V4, because there's a chance that routing caches invalid v4-pool routes. Previously this wasn't much of a concern,. since V3 launched in 2021, and cached routes was rolled out in 2023, so the v2 and v3 pool TVLs won't change that much, although concentrated liquidities can change based on the market pricing.

I expect with v4, there will be more dynamics from 0 TVL to some TVLs, hence cached routes have more chance of caching invalid v4-pool routes.
* fix: await set cached routes

* 4.7.6
* chore: more metrics for routes/quotes fetched

* simplify
…n case of tenderly downtime (Uniswap#759)

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

- **What is the current behavior?** (You can also link to an open issue here)
Right now when tenderly has system downtime, we do not differentiate from when tenderly simulation returns a failed simulated transaction, in case of the Simulation Status, as FAILED.

- **What is the new behavior (if this is a feature change)?**
In case of tenderly downtime, we return SystemDown simulation status from SOR.

- **Other information**:
It will get populated in routing to return a new simulation status as "SYSTEM_DOWN"
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
Release https://github.com/Uniswap/smart-order-router/pull/759/files
Uniswap#762)

* feat: migrate base tenderly to new endpoint

* add base into alpha router integ tedst

* 4.8.0

* bump hardhat
…Uniswap#764)

* fix: Do not force add AMPL pools for V3 in candidate pools

* only mainnet

* update test
…#768)

* fix(subgraph): include VIRTUAL tokens in V2 subgraph

* add chainId base check

* space

* only allow VIRTUAL/GAME for now
…iswap#770)

* fix(subgraph): include top 20 VIRTUAL/* pools in V2 Base subgraph

* add test suite

* update comment
…sCostInTermsOfQuoteToken (Uniswap#776)

* fix: Use syntheticGasCostInTermsOfQuoteToken only if within 30% of gasCostInTermsOfQuoteToken

* asFraction

* multiply percent

* increase gas test deviation percent
…en only if within 30% of gasCostInTermsOfQuoteToken (Uniswap#777)
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
Bug fix

- **What is the current behavior?** (You can also link to an open issue here)
Tenderly node block can fall behind RPC node block, hence node simulation failed with "not found".

- **What is the new behavior (if this is a feature change)?**
We pass in latest for tenderly node simulation.

- **Other information**:
…niswap#780)

* feat: tenderly sim status SlippageTooLow

* add unit test

* feedback

* 4.8.7
* chore: add gas estimation quality metric

* fix

* metric in gas units

* extra metric

* fix test
…rom API to node (Uniswap#782)

* feat: migrate all other L2s tenderly sim from API to node

* 4.9.0

* add tenderly allowed L2s
* fix: arb tenderly node endpoint

* 4.9.1
jsy1218 and others added 30 commits March 5, 2025 14:17
…#839)

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

- **What is the current behavior?** (You can also link to an open issue here)
Sdks deps was incorrect

- **What is the new behavior (if this is a feature change)?**
Bump all the sdks with correct deps

- **Other information**:
there was a major version bump in router-sdk Uniswap/sdks#223 , that messed up sdks deps.
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
bug fix

- **What is the current behavior?** (You can also link to an open issue here)
its erroring out on this [line](https://github.com/Uniswap/smart-order-router/blob/4d376c4acf2af50a9e79e51c49cdac5051f951ad/src/util/routes.ts#L111). type should be v2 [Pair](https://github.com/Uniswap/sdks/blob/main/sdks/v2-sdk/src/entities/pair.ts#L40). 

- **What is the new behavior (if this is a feature change)?**
Bump sdks that reverted the esm/cjs build separation across sdks

- **Other information**:
…#843)

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

- **What is the current behavior?** (You can also link to an open issue here)
we dont know how often cached routes change

- **What is the new behavior (if this is a feature change)?**
we log metrics to know how often cached routes change

- **Other information**:
we also log the chainId, as well as pair. we dont have the trading amount yet, because theres way too many fanouts.

Tested in routing-api, I can see:
- query string param cachedRoutesRouteIds
![Screenshot 2025-03-10 at 5.11.17 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/BB54fKe6Y10GvrrdKXQN/729b653a-19f1-4d46-9e82-56c509ebffb9.png)

- cachedRoutesNotChanged metrics
![Screenshot 2025-03-10 at 5.12.34 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/BB54fKe6Y10GvrrdKXQN/0f1e88b3-dbd5-4fc8-95aa-fed2d736b5e0.png)
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
Bug fix

- **What is the current behavior?** (You can also link to an open issue here)
We use wrong mixed quoter ABI on most chains, except for L1

- **What is the new behavior (if this is a feature change)?**
We need to use mixed quoter V2 ABI on most chains, because we never deployed mixed quoter V1 on most chains.

- **Other information**:
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
Bug fix

- **What is the current behavior?** (You can also link to an open issue here)
in beta pipeline, seeing

> [QuoteFetchError] Attempt 3. Unknown error from provider: types/values length mismatch (count={"types":3,"values":2}, value={"types":[{"name":"path","type":"bytes","indexed":null,"components":null,"arrayLength":null,"arrayChildren":null,"baseType":"bytes","_isParamType":true},{"name":"param","type":"tuple","indexed":null,"components":[{"name":"nonEncodableData","type":"tuple[]","indexed":null,"components":[{"name":"hookData","type":"bytes","indexed":null,"components":null,"arrayLength":null,"arrayChildren":null,"baseType":"bytes","_isParamType":true}],

this is because the mixed route doesn;t have v4 pool, but since it's on Base and OP, we still need to encode with V2 function ABIs

- **What is the new behavior (if this is a feature change)?**
encode with V2 function ABIs

- **Other information**:
…Uniswap#846)

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

- **What is the current behavior?** (You can also link to an open issue here)
we got incorrect protocol version encoding, when the mixed route does not have the v4 pool, meanwhile we hit against mixed quoter v2

- **What is the new behavior (if this is a feature change)?**
in case the mixed route does not have the v4 pool, we hit against mixed quoter v1

- **Other information**:
we need to ask protocol team to deploy mixed quoter v1 across rest of L2s (It's only on base).

Tested changing mixed quoter v1 on base address works https://app.warp.dev/block/YGaQIFDTXwWR9zsIZVENzZ
…ses (Uniswap#847)

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

- **What is the current behavior?** (You can also link to an open issue here)
We need to update other L2s mixed quoter v1 address to the newly deployed mixed quoter v1.

- **What is the new behavior (if this is a feature change)?**
We need to update other L2s mixed quoter v1 address to the newly deployed mixed quoter v1.

- **Other information**:
…4 pool filtered out (Uniswap#848)

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

- **What is the current behavior?** (You can also link to an open issue here)
we return the mixed route that contains the v4 pool, where UR v1.2 was requested with protocols v2,v3

- **What is the new behavior (if this is a feature change)?**
we need to make sure we filter out mixed route w/ v4 pool.

- **Other information**:
… in wiping cached routes (Uniswap#850)

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

- **What is the current behavior?** (You can also link to an open issue here)
We do not wipe out cached routes in online lambda path.

- **What is the new behavior (if this is a feature change)?**
We should wipe out cached routes in online lambda path.

- **Other information**:
i think its ok to have a perf hit in this case

because 1) theres not many mixed quote as best quote 2) for mixed route that contains v4 pool is even less 3) quote request with UR v1.2 header is even less

works on my local https://app.warp.dev/block/hiG5dT6jliXF7mOrzzwU0P
…ingProvider for enableMixedRouteWithUR1_2Percent (Uniswap#853)
… enableMixedRouteWithUR1_2 (Uniswap#854)

* chore: bump sor to 4.20.12 - fix: enableMixedRouteWithUR1_2Percent to enableMixedRouteWithUR1_2

* 4.20.12
…niswap#855)

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

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

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

- **Other information**:
* update arbitrum sepolia weth9 & wrapped native

* use non null assertion operator for imported WETH9

* up version to 4.20.11

Co-authored-by: Nikita Polyakov <[email protected]>
…tes (Uniswap#858)

* feat: SOR to support hook routing toggles for v4 routes and mixed routes

* chore: bump sor to 4.21.0 - feat: SOR to support hook routing toggles for v4 routes and mixed routes

* fix the mixed route hooks toggle logic

* add unit test

* 4.21.0

* fix all
…niswap#859)

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

- **What is the current behavior?** (You can also link to an open issue here)
when upstream passes in HOOKS_ONLY or NO_HOOKS, subgraph candidate pools loading cannot honor that. That's a problem in case hookful pools have very small TVLs, in case of HOOKS_ONLY. It's also a problem when only hookful pools have large TVLs for a particular trade pair in case of NO_HOOKS.

- **What is the new behavior (if this is a feature change)?**
We want candidate pools loading to respect HOOKS_ONLY or NO_HOOKS.

- **Other information**:
…iswap#861)

* chore: bump sor to 4.21.2 - fix: bypass cache when HOOK_INCLUSIVE

* 4.21.2

* only HOOKS_INCLUSIVE should enter cache

* fix swapRouter URv1.2 caching bypass

* add unit test

* add more comments
* feat: skip cachedRoutes for large swaps

* v4.21.2

* large swap usd threshold from alpharoutingconfig

* chore: bump sor to 4.21.2 - fix: bypass cache when HOOK_INCLUSIVE

* 4.21.2

* only HOOKS_INCLUSIVE should enter cache

* fix swapRouter URv1.2 caching bypass

* add unit test

* add more comments

* 4.21.3

* add if (inputAmountIsLargeSwap) {
      return false;
    }

* fix tests after merge

---------

Co-authored-by: jsy1218 <[email protected]>
* Revert "feat: skip cachedRoutes for large swaps (Uniswap#860)"

This reverts commit 3be41b6.

* v4.21.4
* chore: add more pool metrics on v2 getPools

* more latency metrics
* Revert "chore: add more pool metrics on v2 getPools (Uniswap#866)"

This reverts commit b1f7785.

* version update
* fix: base v3 subgraph filtering update

* logic update

* remove liquidity filter
* fix: base v3 subgraph filtering update v2

* version bump
…ambda (Uniswap#863)

* chore: bump sor to 4.21.4 - fix: tenderly simulation during caching lambda

* do not cache routes when tenderly sim unknown error

* addressing comments

* remove unnecessary comments

* update tests

* extract methods and add unit tests

* make sure simulationStatus is not null

* 4.21.12

---------

Co-authored-by: Yucan Liu <[email protected]>
…niswap#877)

* fix: bypass v3 pool FOT check for  token
siyujiang/route-495-bypass-v3-pool-fot-check-for-elmo-token

* 4.21.13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants