Skip to content

Commit

Permalink
Revert "chore: bump sor to 4.17.10 - fix: add base mixed quoter v2 (#…
Browse files Browse the repository at this point in the history
…1002)" (#1004)

This reverts commit 43d06ee.
  • Loading branch information
jsy1218 authored Feb 7, 2025
1 parent 9a25466 commit f569197
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 75 deletions.
2 changes: 1 addition & 1 deletion lib/handlers/injector-sor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ export abstract class InjectorSOR<Router, QueryParams> extends Injector<
ChainId.MAINNET,
]

const mixedSupported = [ChainId.MAINNET, ChainId.SEPOLIA, ChainId.GOERLI, ChainId.BASE, ChainId.UNICHAIN]
const mixedSupported = [ChainId.MAINNET, ChainId.SEPOLIA, ChainId.GOERLI, ChainId.UNICHAIN]

const cachedRoutesCacheInvalidationFixRolloutPercentage = NEW_CACHED_ROUTES_ROLLOUT_PERCENT[chainId]

Expand Down
8 changes: 0 additions & 8 deletions lib/handlers/quote/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
sortsBefore,
SwapOptions,
SwapRoute,
V4_ETH_WETH_FAKE_POOL,
} from '@uniswap/smart-order-router'
import { Pool as V3Pool } from '@uniswap/v3-sdk'
import { Pool as V4Pool } from '@uniswap/v4-sdk'
Expand Down Expand Up @@ -544,13 +543,6 @@ export class QuoteHandler extends APIGLambdaHandler<
}

if (nextPool instanceof V4Pool) {
// We want to filter the fake v4 pool here,
// because in SOR, we intentionally retain the fake pool, when it returns the valid routes
// https://github.com/Uniswap/smart-order-router/pull/819/files#diff-0eeab2733d13572382be381aa273dddcb38e797adf48c864105fbab2dcf011ffR489
if (nextPool.tickSpacing === V4_ETH_WETH_FAKE_POOL[chainId].tickSpacing) {
continue
}

curRoute.push({
type: 'v4-pool',
address: v4PoolProvider.getPoolId(
Expand Down
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@
"@types/stats-lite": "^2.2.0",
"@uniswap/default-token-list": "^11.13.0",
"@uniswap/permit2-sdk": "^1.3.0",
"@uniswap/router-sdk": "^1.22.1",
"@uniswap/router-sdk": "^1.21.0",
"@uniswap/sdk-core": "^7.5.0",
"@uniswap/smart-order-router": "4.17.11",
"@uniswap/smart-order-router": "4.17.12",
"@uniswap/token-lists": "^1.0.0-beta.33",
"@uniswap/universal-router-sdk": "^4.17.0",
"@uniswap/universal-router-sdk": "^4.14.0",
"@uniswap/v2-sdk": "^4.13.0",
"@uniswap/v3-periphery": "^1.4.4",
"@uniswap/v3-sdk": "^3.24.0",
Expand Down
48 changes: 0 additions & 48 deletions test/mocha/e2e/quote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
parseAmount,
SWAP_ROUTER_02_ADDRESSES,
USDB_BLAST,
USDC_BASE,
USDC_BNB,
USDC_MAINNET,
USDC_NATIVE_ARBITRUM,
Expand Down Expand Up @@ -3418,53 +3417,6 @@ describe('quote', function () {
fail(JSON.stringify(err.response.data))
}
})

it(`USDC -> mockA only through mixed`, async () => {
if (chain !== ChainId.BASE) {
// Only Base has mockA
return
}

if (type !== 'exactIn') {
// mixed route only supports exact in
return
}

const tokenOut = new Token(ChainId.BASE, '0x878784f7ebf6e57d17c81d82ddf53f117a5e2988', 18, 'MOCKA')
const amount = type === 'exactIn' ? '0.00000000000001' : '0.000001'

const quoteReq: QuoteQueryParams = {
tokenInAddress: USDC_BASE.address,
tokenInChainId: chain,
tokenOutAddress: tokenOut.address,
tokenOutChainId: chain,
amount: await getAmountFromToken(type, WNATIVE_ON(chain), tokenOut, amount),
type,
enableUniversalRouter: true,
forceMixedRoutes: true,
protocols: 'mixed',
}

const headers = {
'x-universal-router-version': '2.0',
}

const queryParams = qs.stringify(quoteReq)

try {
const response: AxiosResponse<QuoteResponse> = await axios.get<QuoteResponse>(`${API}?${queryParams}`, {
headers: headers,
})
const { status, data } = response

expect(status).to.equal(200, JSON.stringify(response.data))
expect(data.route.filter((pools) => pools.filter((pool) => pool.type === 'v3-pool'))).to.not.be.undefined
expect(data.route.filter((pools) => pools.filter((pool) => pool.type === 'v4-pool'))).to.not.be.undefined
} catch (err: any) {
fail(JSON.stringify(err.response.data))
}
})

it(`has quoteGasAdjusted values`, async () => {
if (chain === ChainId.SEPOLIA && !erc1.equals(V4_SEPOLIA_TEST_A)) {
// Sepolia doesn't have sufficient liquidity on DAI pools yet
Expand Down

0 comments on commit f569197

Please sign in to comment.