use the RfqOrder source flag for comparison price EP overhead (#177)

* use the RfqOrder source flag for comparison price EP overhead

* updated changelog

* changelog -> 6.4
This commit is contained in:
Alex Kroeger 2021-03-17 16:37:56 -07:00 committed by GitHub
parent 4c3fbe83ac
commit 95345f18bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 5 deletions

View File

@ -1,4 +1,13 @@
[
{
"version": "6.4.0",
"changes": [
{
"note": "Use SOURCE_FLAGS.rfqOrder in comparisonPrice",
"pr": 177
}
]
},
{
"version": "6.3.0",
"changes": [

View File

@ -50,7 +50,7 @@ export function getComparisonPrices(
const fillFeeInEth = new BigNumber(
(feeSchedule[ERC20BridgeSource.Native] as FeeEstimate)({ type: FillQuoteTransformerOrderType.Rfq }),
);
const exchangeProxyOverheadInEth = new BigNumber(exchangeProxyOverhead(SOURCE_FLAGS.Native));
const exchangeProxyOverheadInEth = new BigNumber(exchangeProxyOverhead(SOURCE_FLAGS.RfqOrder));
feeInEth = fillFeeInEth.plus(exchangeProxyOverheadInEth);
} catch {
logUtils.warn('Native order fee schedule requires fill data');

View File

@ -40,8 +40,8 @@ const feeSchedule = {
};
const exchangeProxyOverhead = (sourceFlags: number) => {
if ([SOURCE_FLAGS.Native].includes(sourceFlags)) {
return new BigNumber(150e3).times(GAS_PRICE);
if ([SOURCE_FLAGS.RfqOrder].includes(sourceFlags)) {
return new BigNumber(20e3).times(GAS_PRICE);
} else {
return new BigNumber(200e3).times(GAS_PRICE);
}
@ -107,7 +107,7 @@ describe('getComparisonPrices', async () => {
);
// expected outcome
const EXPECTED_PRICE = new BigNumber('500.925');
const EXPECTED_PRICE = new BigNumber('500.6');
expect(comparisonPrices.wholeOrder).to.deep.eq(EXPECTED_PRICE);
});
@ -129,7 +129,7 @@ describe('getComparisonPrices', async () => {
);
// expected outcome
const EXPECTED_PRICE = new BigNumber('0.0020037069');
const EXPECTED_PRICE = new BigNumber('0.0020024029');
expect(comparisonPrices.wholeOrder).to.deep.eq(EXPECTED_PRICE);
});