diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-10 18:51:13 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-10 18:56:15 +0800 |
commit | cee29542451d3bf8c99bd08963a2108768072195 (patch) | |
tree | f3d657be53459ce3851fcf9632bd94f32ee80184 /packages/instant/src/util/buy_quote_updater.ts | |
parent | a8d9263062e586b90ee4c303d3d3aca72e428edc (diff) | |
parent | 686f27a96f0cd749f6315d7edd2bb56cf1819245 (diff) | |
download | dexon-sol-tools-cee29542451d3bf8c99bd08963a2108768072195.tar.gz dexon-sol-tools-cee29542451d3bf8c99bd08963a2108768072195.tar.zst dexon-sol-tools-cee29542451d3bf8c99bd08963a2108768072195.zip |
Merge development
Diffstat (limited to 'packages/instant/src/util/buy_quote_updater.ts')
-rw-r--r-- | packages/instant/src/util/buy_quote_updater.ts | 7 |
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); |