aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/util/buy_quote_updater.ts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve@0xproject.com>2019-01-10 08:29:11 +0800
committerGitHub <noreply@github.com>2019-01-10 08:29:11 +0800
commit6487fae1131eb6e9215c918f23bac317157f368b (patch)
treebc02d4b3b0b556b2e911f4ba2c60f4035fdd717e /packages/instant/src/util/buy_quote_updater.ts
parent87c287a5e26e89ee25dd43793415d00d4ddfd5fa (diff)
parentfb3605026ef63ef6897010a52bf3f4c116cdf271 (diff)
downloaddexon-sol-tools-6487fae1131eb6e9215c918f23bac317157f368b.tar
dexon-sol-tools-6487fae1131eb6e9215c918f23bac317157f368b.tar.gz
dexon-sol-tools-6487fae1131eb6e9215c918f23bac317157f368b.tar.bz2
dexon-sol-tools-6487fae1131eb6e9215c918f23bac317157f368b.tar.lz
dexon-sol-tools-6487fae1131eb6e9215c918f23bac317157f368b.tar.xz
dexon-sol-tools-6487fae1131eb6e9215c918f23bac317157f368b.tar.zst
dexon-sol-tools-6487fae1131eb6e9215c918f23bac317157f368b.zip
Merge pull request #1437 from 0xProject/feature/instant/tell-amount-available
[instant] Tell user how much of an asset is available
Diffstat (limited to 'packages/instant/src/util/buy_quote_updater.ts')
-rw-r--r--packages/instant/src/util/buy_quote_updater.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/instant/src/util/buy_quote_updater.ts b/packages/instant/src/util/buy_quote_updater.ts
index 6191c92e3..37974e71c 100644
--- a/packages/instant/src/util/buy_quote_updater.ts
+++ b/packages/instant/src/util/buy_quote_updater.ts
@@ -5,6 +5,7 @@ import * as _ from 'lodash';
import { Dispatch } from 'redux';
import { oc } from 'ts-optchain';
+import { SLIPPAGE_PERCENTAGE } from '../constants';
import { Action, actions } from '../redux/actions';
import { AffiliateInfo, ERC20Asset, QuoteFetchOrigin } from '../types';
import { analytics } from '../util/analytics';
@@ -33,8 +34,12 @@ export const buyQuoteUpdater = {
}
const feePercentage = oc(options.affiliateInfo).feePercentage();
let newBuyQuote: BuyQuote | undefined;
+ const slippagePercentage = SLIPPAGE_PERCENTAGE;
try {
- newBuyQuote = await assetBuyer.getBuyQuoteAsync(asset.assetData, baseUnitValue, { feePercentage });
+ newBuyQuote = await assetBuyer.getBuyQuoteAsync(asset.assetData, baseUnitValue, {
+ feePercentage,
+ slippagePercentage,
+ });
} catch (error) {
const errorMessage = assetUtils.assetBuyerErrorMessage(asset, error);