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:
parent
4c3fbe83ac
commit
95345f18bc
@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"version": "6.4.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Use SOURCE_FLAGS.rfqOrder in comparisonPrice",
|
||||
"pr": 177
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "6.3.0",
|
||||
"changes": [
|
||||
|
@ -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');
|
||||
|
@ -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);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user