aboutsummaryrefslogtreecommitdiffstats
path: root/packages/asset-buyer/src/utils
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-09-15 19:56:20 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-09-15 20:14:55 +0800
commit190bf2599c1327fffd03d8a9d50bc7568190cf33 (patch)
tree587e65fdeda7067bf3f2980c309990a60804aae8 /packages/asset-buyer/src/utils
parentf1a22e9bd7943bc9cb8d8308daca0c60af6e0039 (diff)
downloaddexon-sol-tools-190bf2599c1327fffd03d8a9d50bc7568190cf33.tar
dexon-sol-tools-190bf2599c1327fffd03d8a9d50bc7568190cf33.tar.gz
dexon-sol-tools-190bf2599c1327fffd03d8a9d50bc7568190cf33.tar.bz2
dexon-sol-tools-190bf2599c1327fffd03d8a9d50bc7568190cf33.tar.lz
dexon-sol-tools-190bf2599c1327fffd03d8a9d50bc7568190cf33.tar.xz
dexon-sol-tools-190bf2599c1327fffd03d8a9d50bc7568190cf33.tar.zst
dexon-sol-tools-190bf2599c1327fffd03d8a9d50bc7568190cf33.zip
Implement StandardRelayerAPIOrderFetcher
Diffstat (limited to 'packages/asset-buyer/src/utils')
-rw-r--r--packages/asset-buyer/src/utils/order_fetcher_response_processor.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/asset-buyer/src/utils/order_fetcher_response_processor.ts b/packages/asset-buyer/src/utils/order_fetcher_response_processor.ts
index 04c5355eb..f1116a80f 100644
--- a/packages/asset-buyer/src/utils/order_fetcher_response_processor.ts
+++ b/packages/asset-buyer/src/utils/order_fetcher_response_processor.ts
@@ -165,6 +165,10 @@ function unbundleOrdersWithAmounts(
const { remainingFillableMakerAssetAmount, ...order } = orderWithAmount;
// if we are still missing a remainingFillableMakerAssetAmount, assume the order is completely fillable
const newRemainingAmount = remainingFillableMakerAssetAmount || order.makerAssetAmount;
+ // if remaining amount is less than or equal to zero, do not add it
+ if (newRemainingAmount.lte(constants.ZERO_AMOUNT)) {
+ return acc;
+ }
const newAcc = {
orders: _.concat(orders, order),
remainingFillableMakerAssetAmounts: _.concat(remainingFillableMakerAssetAmounts, newRemainingAmount),