Skip to content

Commit

Permalink
fix base multicall multichunk for gas (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsy1218 authored Aug 12, 2023
1 parent 878e0dd commit fbc0435
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/routers/alpha-router/alpha-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,38 @@ export class AlphaRouter
switch (chainId) {
case ChainId.OPTIMISM:
case ChainId.OPTIMISM_GOERLI:
this.onChainQuoteProvider = new OnChainQuoteProvider(
chainId,
provider,
this.multicall2Provider,
{
retries: 2,
minTimeout: 100,
maxTimeout: 1000,
},
{
multicallChunk: 110,
gasLimitPerCall: 1_200_000,
quoteMinSuccessRate: 0.1,
},
{
gasLimitOverride: 3_000_000,
multicallChunk: 45,
},
{
gasLimitOverride: 3_000_000,
multicallChunk: 45,
},
{
baseBlockOffset: -10,
rollback: {
enabled: true,
attemptsBeforeRollback: 1,
rollbackBlockOffset: -10,
},
}
);
break;
case ChainId.BASE:
case ChainId.BASE_GOERLI:
this.onChainQuoteProvider = new OnChainQuoteProvider(
Expand All @@ -400,7 +432,7 @@ export class AlphaRouter
maxTimeout: 1000,
},
{
multicallChunk: 110,
multicallChunk: 80,
gasLimitPerCall: 1_200_000,
quoteMinSuccessRate: 0.1,
},
Expand Down

0 comments on commit fbc0435

Please sign in to comment.