diff --git a/packages/app/models/stack-order/stack-order.ts b/packages/app/models/stack-order/stack-order.ts index e90350ac..42b57261 100644 --- a/packages/app/models/stack-order/stack-order.ts +++ b/packages/app/models/stack-order/stack-order.ts @@ -64,13 +64,16 @@ export const totalStacked = (order: StackOrder) => }, 0) ?? 0; export const stackHasRemainingFunds = (stackOrder: StackOrder) => - totalFundsUsed(stackOrder) > stacklyFee(stackOrder) && + totalFundsUsed(stackOrder) >= stacklyFee(stackOrder) && stackRemainingFunds(stackOrder) > stacklyFee(stackOrder); export const stackRemainingFunds = (stackOrder: StackOrder) => { - if (totalFundsUsed(stackOrder) === 0 && totalStackOrdersDone(stackOrder) > 0) + if ( + stackOrder.cowOrders.length && + totalFundsUsed(stackOrder) === 0 && + totalStackOrdersDone(stackOrder) > 0 + ) return 0; - return ( convertedAmount(stackOrder.amount, stackOrder.sellToken.decimals) - totalFundsUsed(stackOrder)