diff options
Diffstat (limited to 'packages/0x.js/src')
-rw-r--r-- | packages/0x.js/src/utils/order_state_utils.ts | 6 |
1 files changed, 6 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 69e749952..d1b2feb43 100644 --- a/packages/0x.js/src/utils/order_state_utils.ts +++ b/packages/0x.js/src/utils/order_state_utils.ts @@ -110,7 +110,13 @@ export class OrderStateUtils { if (makerFee.isZero()) { return BigNumber.min(makerTransferrable, remainingMakerAmount); } + if (makerFeeTransferrable.greaterThanOrEqualTo(makerFee) && + makerTransferrable.greaterThanOrEqualTo(remainingMakerAmount) && + makerTokenAddress !== zrxTokenAddress) { + return BigNumber.min(makerTransferrable, remainingMakerAmount); + } const orderToFeeRatio = totalMakerAmount.dividedToIntegerBy(makerFee); + console.log('order to fee ratio: ', orderToFeeRatio.toString()); let fillableTimesInMakerToken = makerTransferrable.dividedToIntegerBy(orderToFeeRatio); const fillableTimesInFeeToken = BigNumber.min(makerFeeTransferrable, remainingMakerFee); if (makerTokenAddress === zrxTokenAddress) { |