diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-11-02 09:01:06 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-11-03 00:59:17 +0800 |
commit | 4fda2a2d049843db7f87b930321c11c910e40ea3 (patch) | |
tree | b0a6d9b2046fe485aff438fb07a39371e893c48b /packages/asset-buyer/src/utils | |
parent | e7e9c2a2ebf32ed96e859c9c50a5c9614e372bc7 (diff) | |
download | dexon-sol-tools-4fda2a2d049843db7f87b930321c11c910e40ea3.tar dexon-sol-tools-4fda2a2d049843db7f87b930321c11c910e40ea3.tar.gz dexon-sol-tools-4fda2a2d049843db7f87b930321c11c910e40ea3.tar.bz2 dexon-sol-tools-4fda2a2d049843db7f87b930321c11c910e40ea3.tar.lz dexon-sol-tools-4fda2a2d049843db7f87b930321c11c910e40ea3.tar.xz dexon-sol-tools-4fda2a2d049843db7f87b930321c11c910e40ea3.tar.zst dexon-sol-tools-4fda2a2d049843db7f87b930321c11c910e40ea3.zip |
fix(asset-buyer): fix default values being overriden and incorrect fee rounding
Diffstat (limited to 'packages/asset-buyer/src/utils')
-rw-r--r-- | packages/asset-buyer/src/utils/buy_quote_calculator.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/asset-buyer/src/utils/buy_quote_calculator.ts b/packages/asset-buyer/src/utils/buy_quote_calculator.ts index f94ab3fa4..6a67ed1ed 100644 --- a/packages/asset-buyer/src/utils/buy_quote_calculator.ts +++ b/packages/asset-buyer/src/utils/buy_quote_calculator.ts @@ -119,7 +119,7 @@ function calculateQuoteInfo( ethAmountToBuyZrx = findEthAmountNeededToBuyZrx(feeOrdersAndFillableAmounts, zrxAmountToBuyAsset); } /// find the eth amount needed to buy the affiliate fee - const ethAmountToBuyAffiliateFee = ethAmountToBuyAsset.mul(feePercentage); + const ethAmountToBuyAffiliateFee = ethAmountToBuyAsset.mul(feePercentage).ceil(); const totalEthAmountWithoutAffiliateFee = ethAmountToBuyAsset.plus(ethAmountToBuyZrx); const ethAmountTotal = totalEthAmountWithoutAffiliateFee.plus(ethAmountToBuyAffiliateFee); // divide into the assetBuyAmount in order to find rate of makerAsset / WETH |