@0x/asset-swapper: Address review comments.

This commit is contained in:
Lawrence Forman
2020-03-11 12:19:00 -04:00
parent 87999f402f
commit 1a9063a55b
2 changed files with 5 additions and 6 deletions

View File

@@ -28,8 +28,8 @@ export const DEFAULT_GET_MARKET_ORDERS_OPTS: GetMarketOrdersOpts = {
runLimit: 2 ** 15,
excludedSources: [],
bridgeSlippage: 0.005,
maxFallbackSlippage: 0.1,
numSamples: 20,
maxFallbackSlippage: 0.05,
numSamples: 13,
sampleDistributionBase: 1.05,
feeSchedule: {},
gasSchedule: {},

View File

@@ -87,9 +87,9 @@ function nativeOrdersToPath(
rate,
adjustedRate,
adjustedOutput,
index: path.length,
flags: 0,
parent: path.length !== 0 ? path[path.length - 1] : undefined,
index: 0, // TBD
parent: undefined, // TBD
source: ERC20BridgeSource.Native,
fillData: { order },
});
@@ -131,8 +131,7 @@ function dexQuotesToPaths(
: ZERO_AMOUNT;
const adjustedOutput = side === MarketOperation.Sell ? output.minus(penalty) : output.plus(penalty);
const rate = side === MarketOperation.Sell ? output.div(input) : input.div(output);
const adjustedRate =
side === MarketOperation.Sell ? output.minus(penalty).div(input) : input.div(output.plus(penalty));
const adjustedRate = side === MarketOperation.Sell ? adjustedOutput.div(input) : input.div(adjustedOutput);
path.push({
input,