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:
@@ -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": [
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user