aboutsummaryrefslogtreecommitdiffstats
path: root/packages/0x.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/0x.js')
-rw-r--r--packages/0x.js/src/utils/order_state_utils.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/0x.js/src/utils/order_state_utils.ts b/packages/0x.js/src/utils/order_state_utils.ts
index f82601cae..cc4933d39 100644
--- a/packages/0x.js/src/utils/order_state_utils.ts
+++ b/packages/0x.js/src/utils/order_state_utils.ts
@@ -78,6 +78,9 @@ export class OrderStateUtils {
.dividedToIntegerBy(totalTakerTokenAmount);
const fillableMakerTokenAmount = BigNumber.min([makerProxyAllowance, makerBalance]);
const remainingFillableMakerTokenAmount = BigNumber.min(fillableMakerTokenAmount, remainingMakerTokenAmount);
+ const remainingFillableTakerTokenAmount = remainingFillableMakerTokenAmount
+ .times(totalTakerTokenAmount)
+ .dividedToIntegerBy(totalMakerTokenAmount);
// TODO: Handle edge case where maker token is ZRX with fee
const orderRelevantState = {
makerBalance,
@@ -87,6 +90,7 @@ export class OrderStateUtils {
filledTakerTokenAmount,
canceledTakerTokenAmount,
remainingFillableMakerTokenAmount,
+ remainingFillableTakerTokenAmount,
};
return orderRelevantState;
}