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

Improving gas estimates for l2s #53

Merged
merged 14 commits into from
Feb 1, 2022
Merged
Prev Previous commit
Next Next commit
remove comments
  • Loading branch information
snreynolds committed Jan 26, 2022
commit 2f6af8b369c50bd0164830211a525fac0a316f7d
8 changes: 4 additions & 4 deletions cli/commands/quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { flags } from '@oclif/command';
import { Protocol } from '@uniswap/router-sdk';
import { Currency, Percent, TradeType } from '@uniswap/sdk-core';
import dotenv from 'dotenv';
import { ethers } from 'ethers';
import { BigNumber, ethers } from 'ethers';
import _ from 'lodash';
import {
ID_TO_CHAIN_ID,
Expand Down Expand Up @@ -201,9 +201,9 @@ export class Quote extends BaseCommand {
blockNumber,
estimatedGasUsed,
gasPriceWei,
initTicksCrossed!,
l1GasUse!,
l1GasCost!
initTicksCrossed ?? BigNumber.from(0),
l1GasUse ?? BigNumber.from(0),
l1GasCost ?? BigNumber.from(0)!
);
}
}
2 changes: 1 addition & 1 deletion src/providers/v3/gas-data-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GasPriceOracle, GasPriceOracle__factory } from '../../types/other';
import { ChainId, OVM_GASPRICE_ADDRESS } from '../../util';

/**
* Provider or getting Optimism gas constants.
* Provider for getting Optimism gas constants.
*
* @export
* @interface IGasDataProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ export class V3HeuristicGasModelFactory extends IV3GasModelFactory {
};
}

// NOTE end of buildGasModel()

private estimateGas(
routeWithValidQuote: V3RouteWithValidQuote,
gasPriceWei: BigNumber,
Expand Down