diff --git a/src/vendors/ethers/utils/gas-limit.ts b/src/vendors/ethers/utils/gas-limit.ts index b351894..8282849 100644 --- a/src/vendors/ethers/utils/gas-limit.ts +++ b/src/vendors/ethers/utils/gas-limit.ts @@ -1,10 +1,10 @@ import { ethers } from 'ethers'; /** - * This value has been calculated as the difference between estimated gas with caching on a single block - * and actual gas without caching on multiple blocks. + * This value has been determined after testing all `order - fill` pairings and recording the difference + * between `ethers`' `estimateGas` and the tx's `gasUsed`. */ -const GAS_LIMIT_DELTA = ethers.BigNumber.from('15000'); +const GAS_LIMIT_DELTA = ethers.BigNumber.from('26000'); /** * Calculates a higher gas limit to prevent out-of-gas errors in certain situations. diff --git a/test/vendors/ethers/utils/gas-limit.spec.ts b/test/vendors/ethers/utils/gas-limit.spec.ts index 2df97b8..8391fb6 100644 --- a/test/vendors/ethers/utils/gas-limit.spec.ts +++ b/test/vendors/ethers/utils/gas-limit.spec.ts @@ -11,6 +11,6 @@ describe('vendors/ethers/utils/gas-limit', () => { assert.strictEqual(limit._isBigNumber, true, 'should create a BigNumber instance'); assert.strictEqual(limit.gt(estimated), true, 'the limit should be greater than the estimate'); - assert.strictEqual(limit.toNumber(), estimated.toNumber() + 15000, 'the limit should be 15k greater than the estimate'); + assert.strictEqual(limit.toNumber(), estimated.toNumber() + 26000, 'the limit should be 26k greater than the estimate'); }); });