fix: feeType=positive_slippage logic [TKR-81] (#209)

* fix: Fix feeType=positive_slippage logic to not force the EP route

* fix: yarn prettier
This commit is contained in:
Romain Butteaud
2021-04-26 11:26:57 -07:00
committed by GitHub
parent 6d877d5242
commit 2b120d0669
2 changed files with 11 additions and 5 deletions

View File

@@ -1,4 +1,13 @@
[
{
"version": "6.6.1",
"changes": [
{
"note": "Fixing Positive Slippage logic to not force the EP route",
"pr": 209
}
]
},
{
"version": "6.6.0",
"changes": [

View File

@@ -1,6 +1,6 @@
import { FillQuoteTransformerData, FillQuoteTransformerOrderType } from '@0x/protocol-utils';
import { AffiliateFeeType, ExchangeProxyContractOpts, MarketBuySwapQuote, MarketOperation, SwapQuote } from '../types';
import { ExchangeProxyContractOpts, MarketBuySwapQuote, MarketOperation, SwapQuote } from '../types';
import {
createBridgeDataForBridgeOrder,
getErc20BridgeSourceToBridgeSource,
@@ -70,6 +70,7 @@ export function isMultiplexMultiHopFillCompatible(quote: SwapQuote, opts: Exchan
/**
* Returns true iff a quote can be filled via a VIP feature.
*/
export function isDirectSwapCompatible(
quote: SwapQuote,
opts: ExchangeProxyContractOpts,
@@ -163,10 +164,6 @@ export function requiresTransformERC20(opts: ExchangeProxyContractOpts): boolean
if (!opts.affiliateFee.buyTokenFeeAmount.eq(0) || !opts.affiliateFee.sellTokenFeeAmount.eq(0)) {
return true;
}
// Has a positive slippage fee.
if (opts.affiliateFee.feeType === AffiliateFeeType.PositiveSlippageFee) {
return true;
}
// VIP does not support selling the entire balance
if (opts.shouldSellEntireBalance) {
return true;