Skip to content

Commit

Permalink
fix prettier onchain quoter
Browse files Browse the repository at this point in the history
  • Loading branch information
jsy1218 committed May 10, 2024
1 parent dff7d16 commit 44b1d69
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions src/providers/on-chain-quote-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BaseProvider } from '@ethersproject/providers';
import {
encodeMixedRouteToPath,
MixedRouteSDK,
Protocol
Protocol,
} from '@uniswap/router-sdk';
import { ChainId } from '@uniswap/sdk-core';
import { encodeRouteToPath } from '@uniswap/v3-sdk';
Expand All @@ -12,20 +12,18 @@ import _ from 'lodash';
import stats from 'stats-lite';

import { MixedRoute, V2Route, V3Route } from '../routers/router';
import {
IMixedRouteQuoterV1__factory
} from '../types/other/factories/IMixedRouteQuoterV1__factory';
import { IMixedRouteQuoterV1__factory } from '../types/other/factories/IMixedRouteQuoterV1__factory';
import { IQuoterV2__factory } from '../types/v3/factories/IQuoterV2__factory';
import { ID_TO_NETWORK_NAME, metric, MetricLoggerUnit } from '../util';
import {
MIXED_ROUTE_QUOTER_V1_ADDRESSES,
NEW_QUOTER_V2_ADDRESSES
NEW_QUOTER_V2_ADDRESSES,
} from '../util/addresses';
import { CurrencyAmount } from '../util/amounts';
import { log } from '../util/log';
import {
DEFAULT_BLOCK_NUMBER_CONFIGS,
DEFAULT_SUCCESS_RATE_FAILURE_OVERRIDES
DEFAULT_SUCCESS_RATE_FAILURE_OVERRIDES,
} from '../util/onchainQuoteProviderConfigs';
import { routeToString } from '../util/routes';

Expand Down Expand Up @@ -291,14 +289,15 @@ export class OnChainQuoteProvider implements IOnChainQuoteProvider {
minTimeout: 25,
maxTimeout: 250,
},
protected batchParams: (optimisticCachedRoutes: boolean) => BatchParams =
(_) => {
return {
multicallChunk: 150,
gasLimitPerCall: 1_000_000,
quoteMinSuccessRate: 0.2,
};
},
protected batchParams: (optimisticCachedRoutes: boolean) => BatchParams = (
_
) => {
return {
multicallChunk: 150,
gasLimitPerCall: 1_000_000,
quoteMinSuccessRate: 0.2,
};
},
protected gasErrorFailureOverride: FailureOverrides = {
gasLimitOverride: 1_500_000,
multicallChunk: 100,
Expand Down Expand Up @@ -389,8 +388,12 @@ export class OnChainQuoteProvider implements IOnChainQuoteProvider {
/// Validate that there are no incorrect routes / function combinations
this.validateRoutes(routes, functionName, useMixedRouteQuoter);

let multicallChunk = this.batchParams(optimisticCachedRoutes).multicallChunk;
let gasLimitOverride = this.batchParams(optimisticCachedRoutes).gasLimitPerCall;
let multicallChunk = this.batchParams(
optimisticCachedRoutes
).multicallChunk;
let gasLimitOverride = this.batchParams(
optimisticCachedRoutes
).gasLimitPerCall;
const { baseBlockOffset, rollback } = this.blockNumberConfig;

// Apply the base block offset if provided
Expand Down

0 comments on commit 44b1d69

Please sign in to comment.