fix: exchange proxy overhead scaled by gas price (#2723)
This commit is contained in:
@@ -141,6 +141,10 @@
|
|||||||
{
|
{
|
||||||
"note": "Added `Shell`",
|
"note": "Added `Shell`",
|
||||||
"pr": 2722
|
"pr": 2722
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Fix exchange proxy overhead gas being scaled by gas price",
|
||||||
|
"pr": 2723
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@@ -25,10 +25,9 @@ import {
|
|||||||
GetMarketOrdersOpts,
|
GetMarketOrdersOpts,
|
||||||
OptimizedMarketOrder,
|
OptimizedMarketOrder,
|
||||||
} from './market_operation_utils/types';
|
} from './market_operation_utils/types';
|
||||||
import { getTokenFromAssetData, isSupportedAssetDataInOrders } from './utils';
|
|
||||||
|
|
||||||
import { QuoteReport } from './quote_report_generator';
|
import { QuoteReport } from './quote_report_generator';
|
||||||
import { QuoteFillResult, simulateBestCaseFill, simulateWorstCaseFill } from './quote_simulation';
|
import { QuoteFillResult, simulateBestCaseFill, simulateWorstCaseFill } from './quote_simulation';
|
||||||
|
import { getTokenFromAssetData, isSupportedAssetDataInOrders } from './utils';
|
||||||
|
|
||||||
// TODO(dave4506) How do we want to reintroduce InsufficientAssetLiquidityError?
|
// TODO(dave4506) How do we want to reintroduce InsufficientAssetLiquidityError?
|
||||||
export class SwapQuoteCalculator {
|
export class SwapQuoteCalculator {
|
||||||
@@ -195,7 +194,8 @@ export class SwapQuoteCalculator {
|
|||||||
opts.gasSchedule,
|
opts.gasSchedule,
|
||||||
quoteReport,
|
quoteReport,
|
||||||
);
|
);
|
||||||
const exchangeProxyOverhead = _opts.exchangeProxyOverhead(sourceFlags).toNumber();
|
// Use the raw gas, not scaled by gas price
|
||||||
|
const exchangeProxyOverhead = opts.exchangeProxyOverhead(sourceFlags).toNumber();
|
||||||
swapQuote.bestCaseQuoteInfo.gas += exchangeProxyOverhead;
|
swapQuote.bestCaseQuoteInfo.gas += exchangeProxyOverhead;
|
||||||
swapQuote.worstCaseQuoteInfo.gas += exchangeProxyOverhead;
|
swapQuote.worstCaseQuoteInfo.gas += exchangeProxyOverhead;
|
||||||
return swapQuote;
|
return swapQuote;
|
||||||
|
Reference in New Issue
Block a user